Change the resolution of an image created/opened with imshow
19 次查看(过去 30 天)
显示 更早的评论
Hello,
I'm making a random-black&white-dot background (random-dot stereogram). For that purpose I create a matrix composed by zeros and ones with the function I downloaded from a website (http://www.cns.atr.jp/~kmtn/imageMatlab/index.html). The function is called "randDot" and looks like:
function im = randDot(vhSize, dotSize, dotCol, backCol, density)
Then I establish the size of the image, dot color (black), background color (white) and density (0.5) and generate the image using IMSHOW as:
figure(1); imshow(im);
My problem comes when I want to visualize the image. When I choose a image size bigger than 1000x1000 (pixels?? Is it not defined in code) the function IMSHOW scales the entire image to fit in the window. How can I get an image as big as I want? Another option could be creating a picture with high resolution and scale it with another program, but, which is the resolution of the image generated by IMSHOW? Is it fixed or can I change it. Is there any better function to make it?
Thanks.
0 个评论
回答(1 个)
Sarah Wait Zaranek
2011-3-3
I think you can solve this by changing the 'InitialMagnification' property to change the magnification used to display the image.
You can get your default settings by:
iptgetpref('ImshowInitialMagnification')
There is more about this property in the documentation here: http://www.mathworks.com/help/toolbox/images/ref/imshow.html
Here is a small code example to show using the property:
>> I = imread('cameraman.tif');
>> imshow(I,'InitialMagnification',100) % 100 percent
>> imshow(I,'InitialMagnification',20) % 20 percent
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Image Processing Toolbox 的更多信息
产品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!