필터 지우기
필터 지우기

how to plot gray-level value versus image height

조회 수: 2 (최근 30일)
Elysi Cochin
Elysi Cochin 2013년 1월 16일
i have uploaded an image in the link
in that fig(b) says to plot gray-level value versus image height.... how to plot gray-level value versus image height as shown in that figure(b) and how to get those values R1 and R2 from that... please do reply sir.... i need to get the region between R1 and R2 and draw lines in R1 and R2 as in figure(c) and display that much portion in another figure..... please do reply....

채택된 답변

Thorsten
Thorsten 2013년 1월 16일
Iorg = imread('./../../Downloads/r1r2.png');
I = rgb2gray(Iorg(58:242, 60:198, :));
s = sum(I');
[notused R1] = max(s);
minthreshold = 30;
R2 = min(find(s < minthreshold));
subplot(2, 3, [1:3]), imshow(Iorg)
subplot(2,3,4), imshow(I)
subplot(2,3,5),
% plot vertical histogram
N = numel(s);
for i=1:N, line([0 s(i)], N-[i i]+1), end
axis tight
set(gca, 'PlotBoxAspectRatio', [1 size(I,1)/size(I, 2) 1])
xlabel('Gray-level value')
ylabel('Image height')
subplot(2,3,6)
imshow(I)
line(xlim, [R1 R1], 'Color', 'y')
line(xlim, [R2 R2], 'Color', 'y')
  댓글 수: 3
Walter Roberson
Walter Roberson 2013년 1월 17일
Please show size(R1) and size(R2) and size(s)
Elysi Cochin
Elysi Cochin 2013년 1월 17일
why sir.....

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by