MarcoForte / bayesian-matting

Python implementation of Bayesian Matting from Yung-Yu Chuang, Brian Curless, David H. Salesin, and Richard Szeliski. A Bayesian Approach to Digital Matting. In Proceedings of IEEE Computer Vision and Pattern Recognition (CVPR 2001), Vol. II, 264-271, December 2001
95 stars 33 forks source link

dead loop in bayesian_matting.py #5

Open shartoo opened 5 years ago

shartoo commented 5 years ago

For some image the code will result in dead loop,causelen(f_weights) < minN or len(b_weights) < minN in code bayesian_matting.py.

htkang369 commented 5 years ago

I met the same issue, you could add n += 1 in the condition before "continue".

shartoo commented 5 years ago

thank you for your advice!

lxh98 commented 3 years ago

thank you for your advice!

Hello! Have you solved this problem? I added n+= 1 before "continue", but then the value of output alpha turn to "nan"

lxh98 commented 3 years ago

I met the same issue, you could add n += 1 in the condition before "continue".

Hello! Have you solved this problem? I added n+= 1 before "continue", but then the value of output alpha turn to "nan"

arpitkaushal commented 3 years ago

I met the same issue, you could add n += 1 in the condition before "continue".

Doing this reduces the accuracy of the alpha map considerably.

lxh98 commented 3 years ago

I met the same issue, you could add n += 1 in the condition before "continue".

Doing this reduces the accuracy of the alpha map considerably.

Hello, have you solved this problem?

arpitkaushal commented 3 years ago

I met the same issue, you could add n += 1 in the condition before "continue".

Doing this reduces the accuracy of the alpha map considerably.

Hello, have you solved this problem?

Not yet, but should do it by the end of today. It's part of my course work.

ADG4050 commented 1 year ago

Is the dead loop issue solved, as adding a n=+1 before continue degrades the alpha matte quality.