brandonmpetty / Doxa

A Local Adaptive Thresholding framework for image binarization written in C++, with JS and Python bindings. Implementing: Otsu, Bernsen, Niblack, Sauvola, Wolf, Gatos, NICK, Su, T.R. Singh, WAN, ISauvola, Bataineh, Chan and Shafait.
https://brandonmpetty.github.io/Doxa/WebAssembly
Creative Commons Zero v1.0 Universal
167 stars 37 forks source link

Refactor - Replace Integral Images with cutting edge algorithm #12

Closed brandonmpetty closed 3 years ago

brandonmpetty commented 3 years ago

Integral Image optimization has been replaced by the Chan algorithm, a cutting edge algorithm that is up to 3x faster while using only a fraction of the memory... and allows for processing large image files! The default grayscale algorithm has also changed from Qt to Mean. Python bindings have been added along with a new set of demos for Python / PIL, C++ Qt and OpenCV, and JS with NodeJS and Web. Updating the same memory has was proven safe in UpdateToBinary(...), so no temporary image is being used anymore. A BinarizationFactory class was added to help simplify using the library and for exposing new language bindings.

brandonmpetty commented 3 years ago

A few other changes: We changed from using Sample Variance to Population Variance when calculating Variance. ISauvola has been abstracted so that it is very easy to make "Improved" versions of any algorithm in the list.