Please help me in segmenting the Hindi text into number of lines and words and characters

조회 수: 1 (최근 30일)
Hi,
I have attached a Hindi text . How can I divide into number of lines,words and characters using
regionprops function in MATLAB.
I have written the code like this, where is the error
clc;
clear all;
a=imread('D:/sahoo/sample.jpg');
%figure,imshow(a)
b=rgb2gray(a);
%Igray1=medfilt2(b);
Ibw = im2bw(b,graythresh(b));
[m n] = size(Ibw);
Ibw2=~Ibw;
Iedge = edge(uint8(Ibw));
imshow(Iedge)
se = strel('square',2);
Iedge2 = imdilate(Iedge, se);
imshow(Iedge2);
%Image Filling
Ifill= imfill(Iedge2,'holes');
imshow(Ifill)
Ilabel = bwlabel(Ifill);
%disp(num);
Ibox = regionprops(Ilabel,'BoundingBox');
Ibox(1)
%Ibox = [Iprops.BoundingBox];
%Ibox = reshape(Ibox,[4 15]);
imshow(Ibw2)
hold on;
for cnt = 1:53
rectangle('position',Ibox(:,cnt),'edgecolor','r');
end

답변 (1개)

Image Analyst
Image Analyst 2014년 1월 6일
We help with MATLAB programming, not OCR algorithm development. Go here: http://iris.usc.edu/Vision-Notes/bibliography/contentschar.html#OCR,%20Document%20Analysis%20and%20Character%20Recognition%20Systems and pick a published algorithm that might be better than yours. If you really want to continue using yours you'll have to upload your picture so we can try your code.

카테고리

Help CenterFile Exchange에서 Convert Image Type에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by