How to recognize scale marker text in the image?

2 ビュー (過去 30 日間)
AMAR P
AMAR P 2018 年 10 月 3 日
コメント済み: AMAR P 2018 年 10 月 10 日
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 件のコメント
AMAR P
AMAR P 2018 年 10 月 4 日
@jonas Yes, I have tried that but could not get a excellent results. rather Zero results.. Have you tried it?
Image Analyst
Image Analyst 2018 年 10 月 4 日
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.

サインインしてコメントする。

採用された回答

AMAR P
AMAR P 2018 年 10 月 10 日
% file: AutoMarkerScale
% Author: AMAR P
% Version: V1_0
%Objective: Localize the Marker Scale on a Image, Perform OCR and Return
%the Value.
%==========================================================================
%==========================================================================
% Read Image
[MainImg, MainImgMap] = imread(OriginalImg);
%Convert to Binary
BinImg = im2bw(MainImg, graythresh(MainImg));
BinImg = imcomplement(BinImg);
[yMax, xMax] = size(BinImg);
%ROI here is Region of Interest select using imrect()
BotRImg = imcrop(BinImg,ROI);
[ROIy_max,ROIx_max] = size(BotRImg);
% To Remove any Noise
BotRImg = imclearborder(BotRImg);
% Run OCR on Image
ocrResult = ocr(BotRImg,'CharacterSet','0123456789numc',...
'TextLayout','Line',...
'Language','English');
MarkerValue = ocrResult.Text;
fprintf('Marker Value is = %s', MarkerValue);
  1 件のコメント
AMAR P
AMAR P 2018 年 10 月 10 日
Thanks Everyone for your valuable inputs.

サインインしてコメントする。

その他の回答 (1 件)

Image Analyst
Image Analyst 2018 年 10 月 3 日
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 件のコメント
Image Analyst
Image Analyst 2018 年 10 月 9 日
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
AMAR P 2018 年 10 月 10 日
Sure.. I will finalize couple things and will post the result.

サインインしてコメントする。

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by