Table of Contents

Method OtsuBinarize

Namespace
LMKit.Media.Image
Assembly
LM-Kit.NET.dll

OtsuBinarize()

Converts the image to a binary (bitonal) representation using global Otsu thresholding.

public ImageBuffer OtsuBinarize()

Returns

ImageBuffer

A new ImageBuffer in BINARY1 format where foreground pixels are 0 (black) and background pixels are 1 (white).

Remarks

Computes the optimal binarization threshold by maximizing inter-class variance (Otsu's method) over the full image histogram, then applies it to produce a clean two-level output: foreground pixels become 0 (black) and background pixels become 255 (white).

This is a fast, single-pass global threshold suitable for documents with uniform lighting. For documents with uneven illumination, shadows, or mixed backgrounds, prefer SmartBinarize() which applies adaptive, block-level thresholding.

Exceptions

ObjectDisposedException

Thrown if this instance has been disposed.

Share