getframe() resizing capture issue

조회 수: 2 (최근 30일)
rgk134
rgk134 2012년 5월 10일
So I am trying to use getframe() to capture a plot of an image and then use that image later as a filter. I have found that if I run this on images over a certain dimension, even though the image is still able to display 100% in the figure window, the getframe() command captures a smaller display than is shown (as given by the cdata matrix). Any help?
close all
figure(1),imshow(im2bw(image_v2,1),'InitialMagnification',100), truesize, hold on, scatter(x,y,30,'ws','MarkerFaceColor',[1 1 1]);
imagemask = getframe();
rgb = imagemask.cdata(:,:,1);
figure(2),imshow(rgb);
dimensions = size(rgb);
rgb(dimensions(1),:)=[];
rgb(:,dimensions(2))=[];
dimensions = size(rgb);
for i = 1:dimensions(1)
for j = 1:dimensions(2)
if rgb(i,j)==255
rgb(i,j)=1;
elseif rgb(i,j)==1
rgb(i,j)=0;
end
end
end
figure(4), imshow(rgb)
image_filtered = image_v2.*rgb;
figure(3),imshow(image_filtered);
  댓글 수: 1
Walter Roberson
Walter Roberson 2012년 5월 11일
Could you be more specific about the size limits you are encountering? Also which OS are you using, which MATLAB version, and what monitor size are you using? What does
get(0,'ScreenSize')
show? Also, do you happen to be using multiple monitors?

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

답변 (0개)

카테고리

Help CenterFile Exchange에서 Convert Image Type에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by