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
94 stars 33 forks source link

Error handling for infinite loop #6

Closed brandon-hastings closed 7 months ago

brandon-hastings commented 7 months ago

Main component is detection of an infinite loop and adding a retry method for the infinite loop encountered by some users in #5. Added integer parameter minN_reduction to bayesian_matte() that allows the user to decrease minN by 1 and retry for that many times when an infinite loop is detected. If this still fails, a runtime error is raised and the program terminates, suggesting to adjust input parameters.

Other changes include:

README has been updated to reflect changes.

MarcoForte commented 7 months ago

Thank you @brandon-hastings for your contributions