I have a GUI program which shows 10 images using "axes(handles.axes1);" and "imshow(f);" function. But when I run it, the 10 images appear sequentially but not at the same time. There's a delay between each image showing. What's wrong within it?

 채택된 답변

Walter Roberson
Walter Roberson 2012년 3월 18일

2 개 추천

If you must use imshow(), then skip the axes() call and use
imshow(f, 'Parent', handles.axes1);
However, if you do not need imshow() specifically (e.g., you do not need the tools that it adds), then use
imagesc(f, 'Parent', handles.axes1);

댓글 수: 4

Yang
Yang 2012년 3월 18일
yes. your suggestion is quite good!! but one more question, the image shown by imagesc is by blue and red. My image is binary image 0 and 1. How can I convert blue and red to black and white?
Yang
Yang 2012년 3월 18일
and also, imagesc shows the axis. I can't let it not show by using axis off. how to solve it?
Yang
Yang 2012년 3월 18일
problem solved. thank you!
Image Analyst
Image Analyst 2012년 3월 18일
You likely had a grayscale image and for some strange reason imagesc, unlike imshow, applies some weird colormap. To undo that you also need to call colormap(gray(256)) right after you call imagesc.

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

추가 답변 (2개)

Image Analyst
Image Analyst 2012년 3월 16일

4 개 추천

Call "cla reset" before each call to imshow. Otherwise all the images "stack up" in the control and it will slow down each additional time imshow is called. cla reset clears out any prior images.

댓글 수: 6

Yang
Yang 2012년 3월 17일
I tried "cla reset" before each imshow but the result is still slow.
Image Analyst
Image Analyst 2012년 3월 17일
I'm still not sure what your question is. Is it that you want all 10 images to flash by sequentially and almost instantaneously (because you say it's too slow), OR is it that they appear sequentially instead of at the same time? If you want them all at the same time, use the montage() function in the Image Processing Toolbox to make a mosaic of all your images in one huge single image.
Gerald
Gerald 2014년 6월 20일
Thank you so much for your "cla reset" answer!! Images are now displayed much faster without truncation!! Thx!
Image Analyst
Image Analyst 2014년 6월 20일
You're welcome. Glad my suggestion was helpful to you. Can you go ahead and "Vote" for my answer then?
DEBANJAN DEBNATH
DEBANJAN DEBNATH 2022년 9월 20일
I want it to look like a vedio with high frame per second. Can u help?
Image Analyst
Image Analyst 2022년 9월 20일
@DEBANJAN DEBNATH - not enough information. You want what to "look like" a video? Please explain in your own, new discussion thread (not here).

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

Jan
Jan 2012년 3월 16일

0 개 추천

Nothing is wrong. Displaying an image needs some time.
You can use image and let drawnow trigger the screen update of the figure after all images have been inserted.
I assume posting the relevant part of the code and the size of the images might reveal other problems.

댓글 수: 2

Yang
Yang 2012년 3월 17일
yes but my image is binary image, how can I show it by using image
Jan
Jan 2012년 3월 18일
Please post a code which reproduces the problem. I do not see a problem for using IMAGE for a binary image. But perhaps I do not know exactly, what a binary image is...

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

카테고리

도움말 센터File Exchange에서 Convert Image Type에 대해 자세히 알아보기

태그

질문:

2012년 3월 16일

댓글:

2022년 9월 20일

Community Treasure Hunt

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

Start Hunting!

Translated by