Analyzing your prompt, please hold on...
An error occurred while retrieving the results. Please refresh the page and try again.
Some images, such as store receipts, have very thin characters that may be damaged by automatic contrast corrections or binarization.
Aspose.OCR for Python via .NET provides a special processing 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.
To increase the thickness of characters in an image, run the image through dilate
processing filter.
# Instantiate Aspose.OCR API
api = AsposeOcr()
# Initialize image processing
filters = PreprocessingFilter()
filters.add(PreprocessingFilter.dilate())
# Add image to the recognition batch and apply processing filter
input = OcrInput(InputType.SINGLE_IMAGE, filters)
input.add("source.png")
# Save processed image to the "result" folder
ImageProcessing.save(input, "result")
# Recognize the image
result = api.recognize(input)
# Print recognition result
print(result[0].recognition_text)
Dilation is recommended for the following images:
Analyzing your prompt, please hold on...
An error occurred while retrieving the results. Please refresh the page and try again.