Filter löschen
Filter löschen

word segmentation using horizontal projection

5 Ansichten (letzte 30 Tage)
lotus whit
lotus whit am 3 Aug. 2016
Bearbeitet: lotus whit am 3 Aug. 2016
i followed word segmentation algorithm, according on histogram as steps: 1-construct the vertical histogram for the image. 2-count white pixel in each column. 3- use histogram to find the columns containing number of white pixel . i tried in this code , but i don't have any idea about how count white pixel in each histogram column, could you please help me.
x=imread('doc4.jpg');
xg=rgb2gray(x);
xbw=im2bw(xg);
imshow(xbw);
numWhitePixels = sum(xbw(:));
numBlackPixels = numel(xbw) - numWhitePixels;
sum(xbw,1);
sum(xbw,2);
px=sum(xbw,1); py=sum(xbw,2);
figure(1),plot(px); figure(2),plot(py);
imhist(px);
imhist(py);

Antworten (0)

Community Treasure Hunt

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

Start Hunting!

Translated by