word segmentation using horizontal projection
2 ビュー (過去 30 日間)
古いコメントを表示
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 件のコメント
回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Histograms についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!