Hacker News new | ask | show | jobs
by daedbe 1357 days ago
A common alternative solution in this case would be to use an adaptive thresholding technique such as Otsu’s method.
2 comments

Otsu's method finds a single threshold value in an adaptive way. This can't solve a scanned document thresholding problem.

btw: The iOS Notes app has quite a capable document scanning tool. It's cleverly hidden though.

I'm pretty happy with the scanning feature of Evernote, and I think there are some other nice apps in the Android app store, but my goal is to have a solution that is not captive (either to a specific vendor or to a SaaS solution).
Thanks, I was not aware of Otsu's method.

From the Wikipedia article, "Otsu's method performs badly in case of heavy noise, small objects size, inhomogeneous lighting and larger intra-class than inter-class variance." (Emphasis mine.)

Right now my solution is at the stage of local thresholds with a configurable block size.

Thanks to your pointer, I know now that my next steps will be to review the Niblack or the Bernsen algorithms. (Or just integrate ImageJ.)