Dilation
Contents
[
Hide
]
Some images, such as store receipts, have very thin characters that may be damaged by automatic contrast corrections or binarization.
Aspose.OCR provides a special preprocessing filter called dilation that can increase the thickness of characters in an image by adding pixels to the edges of high-contrast objects, such as letters.
Dilation automatically converts the image to black and white.
Dilation
To increase the thickness of characters in an image, run the image through OCR_IMG_PREPROCESS_DILATE
preprocessing filter.
std::string image_path = "source.png";
custom_preprocessing_filters filters_;
filters_.filter_1 = OCR_IMG_PREPROCESS_DILATE;
asposeocr_preprocess_page_and_save(image_path.c_str(), "result.png", filters_);
Usage scenarios
Dilation is recommended for the following images:
- Receipts.
- Printouts with very thin font.