Otary now includes 17 image binarization methods (alexandrepoupeau.com)

🤖 AI Summary
Otary’s Image Transformer now bundles 17 image binarization methods (5 basic + 12 advanced), exposing them through an Image-level API and a transformer.binarizer BinarizerImage class. Binarization converts pixels to strict black/white (0/1 or 0/255) and is a common preprocessing step for OCR, document restoration, remote sensing and other vision pipelines. The update centralizes both global (threshold_simple, threshold_otsu) and a wide range of local thresholding algorithms—e.g., adaptive (mean/gaussian), Otsu variants, Sauvola/ISauvola, Bernsen, Bradley, Gatos, Feng, FAIR, and Adotsu—so practitioners can pick trade-offs between speed, robustness to uneven illumination and handling of stains or document artifacts. Key technical notes: binary() and binaryrev() return NDArray masks (0/1) with defaults favoring Sauvola for quality (but slower) while adaptive/Otsu sit on the performance/quality sweet spot. Each method exposes tuned parameters for local window sizes and post-processing: adaptive(block_size, constant), adotsu(grid_size, k_sigma, n_steps), Bernsen(window_size, contrast_limit, threshold_global), FAIR with multi-stage clustering/postprocessing controls, and method-specific options for upsampling or contrast thresholds. Source code is available under otary/image/components/transformer/components/binarizer, making it easy to reproduce, tune and integrate into downstream ML pipelines that require precise, configurable binarization.
Loading comments...
loading comments...