How to access zoomed image on axes GUI
5 ビュー (過去 30 日間)
古いコメントを表示
I was working on some application in matlab guide. I'm using toolbar in my GUI with inbuilt zoom in and zoom out features that it provides. So what I have done is that I have loaded an image on an axis. And now after zooming it, I want the access the zoomed image, not the entire image. I have tried getimage(), but what it does is that it gives me the entire image loaded on the axis. Someone please help me out.
0 件のコメント
採用された回答
Image Analyst
2014 年 7 月 27 日
In the other post I told you to use getframe() and gave you code. Here is the demo again.
close all;
im=imread('cameraman.tif');
subplot(1,2,1);
imshow(im);
subplot(1,2,2);
imshow(im);
size(im)
zoom(8);
zoomedImage = getframe(); % Get zoomed portion that is visible.
size(zoomedImage.cdata)
figure; % Bring up separate figure.
imshow(zoomedImage.cdata);
Do you see how in the second figure it is only the zoomed, visible portion of the image from figure 1 that was captured and is being displayed?
Your post is ambiguous. On the one hand you say you want to capture only the zoomed portion, yet on the other hand you say you want "the entire image loaded on the axis" which would include the entire image even the parts that were zoomed out of the display window and not visible. Of course you already have the entire image - you sent it into the axes with imshow(), though what's displayed may be different if you added text, lines, or other annotation. Please clarify exactly what you want because it's not clear to me.
7 件のコメント
Image Analyst
2014 年 7 月 28 日
That's not how you do ROI processing. You don't just zoom and expect to process the visible area. You need to crop it out with imcrop, or use imrect() or rbbox() or some other way to indicate what the ROI is.
その他の回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Migrate GUIDE Apps についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!