How to interface tesseract and matlab?
8 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
I downloaded a file that contains the tesseract mex on a zip file. The zip file contains the folders as seen on the attached picture. I located the tesseract mex folder on the MATLAB file and run it using the code: But i am getting errors.
%%reading Image %%
clc %%clearing the command window
clear all %%clear all the variable in the workspace
close all %%close all the figures
rawImage=imread('scan0011.tif');
figure,imshow(rawImage);
title('Raw Image');
if size(rawImage,3)==3
grayImage=rgb2gray(rawImage);
else
grayImage=rawImage;
end
figure,imshow(grayImage);
title('Gray Image');
binaryImage=im2bw(grayImage,graythresh(grayImage));
figure,imshow(grayImage);
title('Binary Image');
%%before image preprocessing %%
ocrBefore=tesseract(grayImage','eng',6);
bwOp=~bwareaopen(~binaryImage,20);%%removing noises %%
figure,imshow(bwOp)
title('Noise Removed Image');
preprocessedImage=uint8(255*bwOp);
ocrAfter=tesseract(preprocessedImage','eng',6);
1 comentario
Respuestas (0)
Ver también
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!