Analyzing your prompt, please hold on...
An error occurred while retrieving the results. Please refresh the page and try again.
Low contrast and blurring are the most typical distortions when text is photographed with a smartphone camera, especially in low light conditions. They make it difficult for the OCR algorithms to operate successfully, significantly reducing the recognition accuracy.
Aspose.OCR can automatically increase the contrast of images before proceeding to recognition.
To automatically increase the image contrast before recognition, run the image through contrast_correction_filter
processing filter.
# Instantiate Aspose.OCR API
api = AsposeOcr()
# Initialize image processing
filters = PreprocessingFilter()
filters.add(PreprocessingFilter.contrast_correction_filter())
# 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)
Automatic contrast adjustment 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.