Search All of the Math Forum:
Views expressed in these public forums are not endorsed by
Drexel University or The Math Forum.
|
|
|
|
Error in getframe() ?
Posted:
Sep 19, 1996 11:38 AM
|
|
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
|
|
|
|