필터 지우기
필터 지우기

Info

이 질문은 마감되었습니다. 편집하거나 답변을 올리려면 질문을 다시 여십시오.

issue with imshow ploting

조회 수: 1 (최근 30일)
Jerome
Jerome 2013년 3월 4일
마감: MATLAB Answer Bot 2021년 8월 20일
I am trying to plot/show an image with the certain parameters, but it doesn't show. Only the contour. Does anyone know how I can resolve my image to be shown the the parameters and contour? Thanks in advance
imshow(image,'Border','tight','InitialMagnification',100)
colormap(gray)
hold on
contour(phi,[0 0],'r')

답변 (2개)

Brian B
Brian B 2013년 3월 4일
It is probably a scaling issue. What are the sizes of image and phi?
  댓글 수: 9
Brian B
Brian B 2013년 3월 4일
편집: Brian B 2013년 3월 4일
By default, imshow expects values between 0 and 1. You can normalize your matrix, or you can explicitly tell it what range to map to the coloraxis (using 'DisplayRange' or the bracket notation above, but with the min and max values as in [-7 255]), or you can tell it to map the whole range by passing in the empty brackets as I did above.
Jerome
Jerome 2013년 3월 4일
Thanks a lot!

Image Analyst
Image Analyst 2013년 3월 4일
It's not clear if you meant
min(image(:)) = 7
or
min(image(:)) = -7
But either way you can do
imshow(yourImage, []);
It's also a bad idea to call your image "image" because it would blow away the built in image() function. I hope you didn't do that.
  댓글 수: 1
Brian B
Brian B 2013년 3월 4일
True! I read it so quickly I didn't even notice the missing "=".
On the same note, as a control engineer I am always appalled when examples in the MATLAB documentation assign the output of a function testing some true or false condition to a variable named tf! Where are your transfer functions, now?

이 질문은 마감되었습니다.

태그

Community Treasure Hunt

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

Start Hunting!

Translated by