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
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:
reading in the image and trump using openCV.imread, as spicy.misc is depreciated.
using argparse for command line interaction when calling main()
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
tobayesian_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:
main()
README has been updated to reflect changes.