I am using the Azure Vision API, but it is not able to read text from certain images which appear to be very clear. Can you please guide on what preprocessing to give good results.

Raj Bonigala 0 Reputation points
2025-09-01T07:02:54.22+00:00

I am using the Azure Vision API, but it is not able to read text from certain images which appear to be very clear. Can you please guide on what preprocessing to give good results.02_reading_03_advanced_grayscale

02_reading_00_original_crop

Computer Vision
Computer Vision
An Azure artificial intelligence service that analyzes content in images and video.
{count} votes

1 answer

Sort by: Most helpful
  1. SRILAKSHMI C 8,295 Reputation points Microsoft External Staff Moderator
    2025-09-02T10:28:33.0733333+00:00

    Hello Raj Bonigala,

    I understand that you're having trouble with the Azure Vision API's ability to read text from certain images. Even if an image looks visually clear, OCR performance can be affected by factors such as resolution, contrast, skew, font style, or background noise. Preprocessing your images before sending them to the API can greatly improve results.

    Here are some recommended strategies:

    Ensure the images are of high resolution. The minimum height of the text should be about 12 pixels (roughly 8-point font at 150 DPI). Images should be at least 50x50 pixels and less than 10,000x10,000 pixels.

    Enhance brightness and contrast so the text stands out clearly from the background. Poor lighting or faint text can reduce recognition accuracy.

    Convert the image to grayscale to reduce distractions from colors and highlight text features.

    Convert the image to black and white so characters are more distinct from the background.

    Apply denoising or smoothing techniques to remove shadows, speckles, or other artifacts that might interfere with OCR.

    Focus only on the text region by removing irrelevant areas around the text.

    Correct skewed or rotated text so that text lines are horizontally aligned. Ensure the images meet the supported file format and dimension requirements (JPEG, PNG, BMP, etc.).

    In your case, since you mentioned experimenting with grayscale (02_reading_03_advanced_grayscale) and cropping (02_reading_00_original_crop), combining these steps such as cropping the text region and then applying grayscale with proper contrast adjustment often provides the best OCR results.

    please refer these documents,

    I Hope this helps. Do let me know if you have any further queries.

    Thank you!

    0 comments No comments

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.