Variable thresholding implementation

asked 2013-01-16 11:31:42 -0600

unxnut gravatar image

Sometime back, I had implemented the variable thresholding algorithm for image segmentation as described in the book by Gonzalez and Woods. I had done it on a pixel buffer that was an array of unsigned char. I tried to do the same thing in OpenCV, looking for an equivalent function and the closest I came to is adaptiveThreshold. However, my results are different between the two algorithms. As I investigated further, I noticed that adaptiveThreshold works just with the mean value of pixels in a neighborhood while variable thresholding algorithm uses both mean and standard deviation of pixels in the neighborhood.

So, my question is if someone is aware of a variable threshold implementation in OpenCV or is there an easy way to do it, using the library functions instead of from first principles.

edit retag flag offensive close merge delete