Analyzing your prompt, please hold on...
An error occurred while retrieving the results. Please refresh the page and try again.
When working with white (or light) text on a black (or other dark) background, recognition accuracy may suffer. It can be greatly improved by reversing the colors of the image so that light areas appear dark and dark areas appear light. In addition, other colors are also swapped: red becomes cyan, green becomes magenta, blue becomes yellow, and so on.
Aspose.OCR provides the automated preprocessing filter that inverts colors in the image before proceeding to recognition.
To automatically invert colors in an image before recognition, run the image through OCR_IMG_PREPROCESS_INVERT
preprocessing filter.
std::string image_path = "source.png";
custom_preprocessing_filters filters_;
filters_.filter_1 = OCR_IMG_PREPROCESS_INVERT;
asposeocr_preprocess_page_and_save(image_path.c_str(), "result.png", filters_);
Automatic color inversion 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.