word segmentation using horizontal projection
2 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
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);
0 Commenti
Risposte (0)
Vedere anche
Categorie
Scopri di più su Histograms in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!