Determine the largest length along the width of the part
이전 댓글 표시
I have a binary image
what I want to do is
1. Calculate the sum of black pixels along each and every individual row
2. Then compare the individual sums to get the largest value(which would be my answer).
or in other words
Determine the largest length along the width of the part.
I have another question
>>>>I want to count the number of black pixels in each individual row and then compare that result to get 'which row has highest number of black pixels'.
댓글 수: 1
Image Analyst
2013년 5월 5일
편집: Image Analyst
2013년 5월 5일
Your final question was answered by the second comment I gave to my original answer. I give you both the count, AND the row at which that highest count happens at. Isn't that what you want?
채택된 답변
추가 답변 (1개)
Youssef Khmou
2013년 5월 5일
hi you can try as the following :
I=imread('circuit.tif'); % esample
B=im2bw(I);
S=sum(B);
figure, plot(S),
[y,x]=max(S)
% X= 252 in this case so the row 252 is the largest
카테고리
도움말 센터 및 File Exchange에서 Video Formats and Interfaces에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!