필터 지우기
필터 지우기

Error occurred when I switched from MATLAB's generic OCR to my self trained OCR.

조회 수: 3 (최근 30일)
location= 'filepath\*.jpg';
ds = imageDatastore(location);
fid = fopen('noPlate.txt', 'wt');
while hasdata(ds)
img = read(ds) ; % read image from datastore
gray = rgb2gray(img);
gray = medfilt2(gray, [3 3]);
ocrResults = evaluateOCRTraining(gray);
recognizedText = ocrResults.results;
% This portion of code writes the number plate
fprintf(fid,'%s\n', recognizedText); % to the text file, if executed a notepad file with the
fprintf(fid,'%s\n', '\n');
end
fclose(fid);
winopen('noPlate.txt')
% evaluateOCRTraining function:
function [ocrI, results] = evaluateOCRTraining(I, roi)
trainedLanguage = 'file_path';
layout = 'Block';
if nargin == 2
results = ocr(I, roi, ...
'Language', trainedLanguage, ...
'TextLayout', layout);
else
results = ocr(I, ...
'Language', trainedLanguage, ...
'TextLayout', layout);
end

답변 (0개)

카테고리

Help CenterFile Exchange에서 Computer Vision Toolbox에 대해 자세히 알아보기

제품


릴리스

R2018a

Community Treasure Hunt

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

Start Hunting!

Translated by