how to get horizontal projection of histogram of an binary image ?and based on that how to segment of each line in the image? please suggest me
2 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
ayushi
am 18 Mai 2016
Kommentiert: ayushi
am 21 Mai 2016
<<
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/164600/image.png)
>>
<<
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/164607/image.jpeg)
>> this is my ZjSqKcW.jpg and on the bases of this image i want the horizontal projection of histogram like g.png and after the histogram i want the segmentation of each line.how to do please suggest
0 Kommentare
Akzeptierte Antwort
Alessandro Masullo
am 20 Mai 2016
Given your image im, you can binarize it with im2bw:
bw = 1-im2bw(image);
The horizontal histogram (I guess) is the sum of the object in the horizontal direction, which is
h = sum(bw,2)
You can then plot it with:
figure
plot(sum(bw,2),1:size(bw,1))
Which gives you the image attached.
The segmentation could be performed with findpeaks.
5 Kommentare
Image Analyst
am 21 Mai 2016
Threshold it and then use regionprops(labeledImage, 'PixelIdxList') to find where each line starts and stops (what row indexes), or what rows have text in them.
Weitere Antworten (0)
Siehe auch
Produkte
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!