필터 지우기
필터 지우기

Recover image from current figure without saving it

조회 수: 2 (최근 30일)
Mario Trevino
Mario Trevino 2013년 5월 3일
Suppose I have:
figure
imshow(matrix)
hold on
scatter(x2,y2,size2,color2, 'filled')
axis square
axis off
colormap(c)
saveas(gcf,'image2.jpg','jpg')
A=imread('image2.jpg');
imshow(A);
QUESTION: how do I recover composite image A without having to save image2.jpg on the first place? there should be a shortcut!! Any help?

채택된 답변

Image Analyst
Image Analyst 2013년 5월 3일
Why do you want it? It wouldn't be just your image, it would be that plus border padding, tick marks (if axis was "on"), title, etc. Of what use is this to your program if it were to be a variable (an image variable)?
That said, you can use getframe().
  댓글 수: 2
Mario Trevino
Mario Trevino 2013년 5월 3일
works fine, but with getrame im not getting a matrix2 the same size as the original one....
Image Analyst
Image Analyst 2013년 5월 3일
It won't be the size of the image of course, since you're grabbing extra stuff, and it also depends on how you sized the figure on the screen. What's your image size, what's your saved figure size, and what size are you expecting?
Have you tried export_fig()? See http://www.mathworks.com/matlabcentral/fileexchange/ for the most popular download.

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Images에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by