Saving whole of zoomed images?
6 views (last 30 days)
Show older comments
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
0 Comments
Answers (2)
Image Analyst
on 3 Dec 2012
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."
0 Comments
See Also
Categories
Find more on Convert Image Type in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!