1 | initial version |
Instead of Otsu's method you could use an adaptive binarization approach via cv::adaptiveThreshold . However note that your image has undergone three processes: first different brightness, probably not that challenging if you use adaptive-binarization. Second the image has undergone salt and pepper noise --> median-filter. And third it has been blurred, probably by a gaussian --> you need to deblur it ( use unsharp-technique, a code snippet can be found in the openCV-Doku: http://docs.opencv.org/modules/core/doc/basic_structures.html?highlight=unsharp#matrix-expressions . These processes you need to adress in reversed order. Good luck!