Drexel dragonThe Math ForumDonate to the Math Forum



Search All of the Math Forum:

Views expressed in these public forums are not endorsed by Drexel University or The Math Forum.


Math Forum » Discussions » Software » comp.soft-sys.matlab

Topic: Error in getframe() ?
Replies: 0  

Advanced Search

Back to Topic List Back to Topic List  
Mark A. Lubinski

Posts: 18
Registered: 12/7/04
Error in getframe() ?
Posted: Sep 19, 1996 11:38 AM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

Lately I have noticed what I believe is an error in the function
getframe().
When an image is displayed in a figure of the same size with the axis
invisible,
I would expect [x,map]=getframe to return an array which is the same as
the
'Cdata' property of the image. However, getframe() does not return what
I expect.

Perhaps as example will better illustrate what I mean:
test=reshape(round(linspace(1,256,100*100)),100,100);
testmap=gray(256);
fh=figure('position',[100 100 100 100]);
axes('position',[0 0 1 1],'units','normal');
colormap(testmap);
ih=image(test);
set(gca,'visible','off');

[x,xmap]=getframe(gcf);
testc=get(ih,'Cdata');
testm=get(fh,'Colormap');
emap=testm-xmap;
e=testc-x;
sum(sum(abs(emap)))
sum(sum(abs(e)))
figure
colormap(gray);
imagesc(e);

The error is not even constant. If you display another image in a
different figure
before doing the test above, you will get a different error. For
example, try the
test above and then display the demo image gatlin:
load gatlin
figure
image(X)
colormap(map)
and then repeat the test above. I get a different answer.

Sure the error is small, but why is it there an error at all?
I am running Matlab 4.2c on a Sun.

-Mark Lubinski
lubinski@eecs.umich.edu





Point your RSS reader here for a feed of the latest messages in this topic.

[Privacy Policy] [Terms of Use]

© Drexel University 1994-2014. All Rights Reserved.
The Math Forum is a research and educational enterprise of the Drexel University School of Education.