Class HistogramEqualizationFilter
A filter to apply histogram equalization to an image.
Inheritance
Implements
Namespace: IronBarCode
Assembly: IronBarCode.dll
Syntax
public class HistogramEqualizationFilter : Object, IImageFilter
Reach for HistogramEqualizationFilter when a barcode is washed out or under-exposed and the bars barely stand apart from the background. Histogram equalization redistributes an image's brightness levels so the tones spread across the full range, pulling a low-contrast capture into one where dark bars and light spaces separate cleanly. A code shot in poor lighting, behind glare, or from a faded printout often carries enough detail to decode once the contrast is stretched, and this filter performs that stretch automatically with no tuning required.
The filter implements IImageFilter and is added to the ImageFilterCollection on BarcodeReaderOptions.ImageFilters, where filters run in collection order before the read. A developer constructs it, adds it to the collection, and passes the options to BarcodeReader.Read. It exposes only the parameterless constructor and has no configurable properties, so the equalization is applied uniformly across the image; place it early in the collection so later filters operate on the contrast-corrected result.
using IronBarCode;
var options = new BarcodeReaderOptions
{
ImageFilters = new ImageFilterCollection { new HistogramEqualizationFilter() }
};
var results = BarcodeReader.Read("washed-out.png", options);The image correction how-to demonstrates the correction filters on a sample barcode, and the imperfect barcode example reads a degraded image through a filter pipeline.
Constructors
HistogramEqualizationFilter()
Initializes a new instance of the HistogramEqualizationFilter class.
Declaration
public HistogramEqualizationFilter()