MATLAB Answers

Text recognition in videos: two almost identical frames, different results

2 views (last 30 days)
pietro
pietro on 5 Aug 2019
Edited: pietro on 5 Aug 2019
I have all,
I have collected a series of video with a dashcam installed on a tractor. The dashcam reports the speed of the tractor in the video and I need to extract the speed from the video. To this goal, I have extracted the frames and I have used the OCR function on each frame to recognize the text. In order to improve the accuracy of the text recognition I have:
  • restricted the character set to numbers and the letters "KM" of the unit
  • restricted the analysis to a region of interest
The approach works in some cases but it does not work also in two almost identical frames. In the following links, you can see two identical frames, in this frame the text is not recognized, while in this is recognized.The region of interest is the yellow rectangle. How could I improve the accuracy of the method?
Below, you will find my code
Thank you,
Best regards,
Pietro
clear all
v = VideoReader('C:\Users\serbr\Desktop\GRMN8722.MP4');
i=0;
TargetBoundingBox=[804 678 100 38];
NotFound=[];
while hasFrame(v)
i=i+1;
video{i} = readFrame(v);
Speed{i} = ocr(video{i},TargetBoundingBox,'CharacterSet','0123456789KM');
if isempty(Speed{i}.Words)==0
Iocr{i} = insertObjectAnnotation(video{i}, 'rectangle', ...
Speed{i}.WordBoundingBoxes, ...
Speed{i}.WordConfidences);
end
end

  2 Comments

Walter Roberson
Walter Roberson on 5 Aug 2019
The advertising on the page is much larger than your images. I suggest that you use the tools to post the images here.
pietro
pietro on 5 Aug 2019
I have used a different tool to share the file. Now no advertising since I have used Onedrive

Sign in to comment.

Answers (0)

Sign in to answer this question.

Tags

Products


Release

R2019a