Why my OCR isn't working on a very easy image

I have a binary image with 7 characters on.
It could not be easier for the ocr() function to detect, yet it still returns nothing.
An help would be appreciated
x = %My binary image
v = ocr(X).
But when I call v. It returns an empty vector for text?
Any advice/help would be greatly appreciated

답변 (1개)

yanqi liu
yanqi liu 2021년 11월 19일
sir,may be need some process,make it to white background and black text
clc;clear all;close all;
X = imread('https://ww2.mathworks.cn/matlabcentral/answers/uploaded_files/804884/skew.jpg');
bw = im2bw(X);
bw = imclearborder(bw);
bw = ~bw;
v = ocr(bw)
v =
ocrText with properties: Text: 'HK5| FHD↵↵' CharacterBoundingBoxes: [10×4 double] CharacterConfidences: [10×1 single] Words: {2×1 cell} WordBoundingBoxes: [2×4 double] WordConfidences: [2×1 single]
Iocr = insertObjectAnnotation(X, 'rectangle', ...
v.WordBoundingBoxes, ...
v.Words);
figure; imshow(Iocr);

카테고리

도움말 센터File Exchange에서 Convert Image Type에 대해 자세히 알아보기

질문:

2021년 11월 18일

답변:

2021년 11월 19일

Community Treasure Hunt

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

Start Hunting!

Translated by