How to recognize scale marker text in the image?
Show older comments
Hello All, I wish to identify scale marker text in the image. And would like your suggestions and ideas for Algorithm. In Image given below its 100uM and thats what I would like to recognize.

5 Comments
ANKUR KUMAR
on 3 Oct 2018
Have you written that text or is it written before.
AMAR P
on 4 Oct 2018
AMAR P
on 4 Oct 2018
Image Analyst
on 4 Oct 2018
Well, did you try my code below? If not, why not? If it's not what you want, then explain better exactly what "identify" means to you.
Accepted Answer
More Answers (1)
Image Analyst
on 3 Oct 2018
It's a constant and uniform gray level, so just detect that. For example if it's gray level is 175, do
scaleMask = grayImage == 175;
scaleMask = bwareafilt(scaleMask, 1); % Take largest blob.
scaleMask = imfill(scaleMask, 'holes'); % Fill holes to get rectangular block.
Not sure what you want to do after that.
8 Comments
AMAR P
on 5 Oct 2018
Image Analyst
on 5 Oct 2018
To batch process fiels, see the two code samples in the FAQ: http://matlab.wikia.com/wiki/FAQ#How_can_I_process_a_sequence_of_files.3F
Again, I have no idea what detect or identify means to you. Do you mean read the number inside the uniform area and then get a spatial calibration factor from that? Do you mean just find pixels that are in the bounding box of the scale bar background? I have no idea.
AMAR P
on 8 Oct 2018
AMAR P
on 8 Oct 2018
Image Analyst
on 8 Oct 2018
OK, use imclearborder() to get rid of the white surround. Then call bwareafilt() to get rid of the underline.
Then to do OCR you need the Computer Vision System Toolbox. Do you have that?
AMAR P
on 9 Oct 2018
Image Analyst
on 9 Oct 2018
Glad it's working for you. Do you want to post the final code so that people won't post here for years to come "Can you please upload your code?" as they always do.
AMAR P
on 10 Oct 2018
Categories
Find more on Convert Image Type in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!