Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

New to MATLAB?

recognizing numbers from a table in an image

Asked by Akshay

Akshay (view profile)

on 12 Dec 2012 this is my image..its a railway ticket.. i need to recognize the pnr no. on the top left corner of the table using image processing and ocr.. how to do this?? i am a beginer please help

1 Comment


Akshay (view profile)

on 15 Dec 2012



Akshay (view profile)


No products are associated with this question.

1 Answer

Answer by Image Analyst

Image Analyst (view profile)

on 15 Dec 2012

If the yellow box is always in a fixed position, you can simply crop it out using known, fixed coordinates. If it moves around you can find the yellow box by using one of my color segmentation methods in my File Exchange. Basically find yellow by something like

yellowPixels = redChannel > 128 | greenChannel > 128 | blueChannel < 128;

then call imfill. Then use regionprops to find the largest yellow blob and use ismember or wbareaopen to extract only the biggest blob. Then multiply that mask by the image. Then you need to do OCR on the image which goes beyond the help we offer here.


Image Analyst

Image Analyst (view profile)

Contact us