I am experimenting with local (adaptive) grey threshold for the binarization of B&W photographs of yellowed manuscripts:

Raw image

I got adaptive thresholding working in both scikit-image and cv2. In both cases (grey < threshold_niblack() in scikit-image and cv.adaptiveThreshold() in cv2 -- all Python) the result I get is successfully binarized, with the background pretty much uniform -- and completely full of noise:

Binarized image

What kind of step do I now need to separate the text from this background noise?

  • 2
    $\begingroup$ looks like you should be able to extract features by area. So remove any continious area smaller than x pixels $\endgroup$ – joojaa Nov 8 at 17:10
  • 1
    $\begingroup$ +1 to joojaa's comment, but you really shouldn't have got here in the first place -- any adaptive thresholding method should provide a bias parameter that will help you avoid amplifying low-amplitude noise in nearly uniform regions. $\endgroup$ – Rahul Nov 8 at 19:13
  • $\begingroup$ @Rahul I see, thank you. Adjusting the "Constant subtracted from the mean" does help. $\endgroup$ – Aaron Brick Nov 9 at 6:18
  • $\begingroup$ @joojaa Thank you! I found out how to find, filter, and draw contours. This is promising. $\endgroup$ – Aaron Brick Nov 9 at 6:19

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.