Saving whole of zoomed images?

5 次查看(过去 30 天)
Indrek Morell
Indrek Morell 2012-12-3
Greetings,
Got a nasty problem - I am loading using imread an image from file. Next the image is displayed with imshow command which places it into figure.
Problem is that images are larger than my screen (1920*1050). So to get to the original size which is necessary image is resized to original resolution. This leads to the problem that only some part of the image is visible in the axis (pan mode is enabled).
Now I will add some elements to image using function "text" and then I would like to write this image as whole to disk with original resolution but saveas, imwrite saves only PART of the image that is currently visible in the axis.
How would it be possible to save the image as WHOLE - that is not only the portion that is visible in axis area but also those regions that are currently not visible (can be viewed when panned)
Script below
clear; clc; close all;
Img=imread('D:\lla00010.png');
% loads image
Limits=size(Img);
% gets image size
Fig=figure;
A=imshow(Img,'Border','tight');
% plots image
Pos=get(Fig,'Position');
% gets figure size
zoom(max(xlim)/Pos(1,3));
% scales image to 100%
text(30,100,'\rightarrow','FontSize',12,'HorizontalAlignment','center','FontWeight','Bold','Color','r');
% plots red arrow

回答(2 个)

Walter Roberson
Walter Roberson 2012-12-3

Image Analyst
Image Analyst 2012-12-3
You can use the textinserter class if you have the Computer Vision toolbox. Then use imwrite to save the image to a disk file with the text burnt into the image.
"The text inserter System object draws text in an image. The output image can then be displayed or saved to a file. It can draw one or more arbitrary ASCII strings at multiple locations in an image."

类别

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