how to mark the highest white pixel through bottom to the top? using grayscale image.
이전 댓글 표시


%point location
row=find(sum(img8,2)==0,1,'last')+1;
col=find(img8(row,:)~=0);
row=row(ones(size(col)));
Points=[row(:) col(:)];
imshow(img8);
hold on
plot(Points(:,2),Points(:,1)','rp','MarkerSize',12)
a=text(Points(1,2),Points(1,1),['This is (col,row)(',num2str(Points(1,2)),',',num2str(Points(1,1)),')']);
set(a, 'FontName', 'Arial' ,'FontWeight', 'bold', 'FontSize', 12,'Color', 'blue');
hold off
댓글 수: 2
Image Analyst
2015년 11월 1일
What do you mean by highest? The lowest row value? Or the brightest gray level?
nurul najmah
2015년 11월 1일
편집: nurul najmah
2015년 11월 1일
채택된 답변
추가 답변 (1개)
X = imread('grayscaleImage.png');
[R,C] = find(all(X==255,3));
[Y,Z] = unique(C,'first');
imshow(X);
hold on
plot(C(Z),R(Z),'-rx')
produces this:

댓글 수: 3
nurul najmah
2015년 11월 2일
Stephen23
2015년 11월 3일
My pleasure. You can also vote for answers that work well.
Chad Greene
2015년 11월 3일
I voted for your answer Stephen!
카테고리
도움말 센터 및 File Exchange에서 Image Preview and Device Configuration에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
