How can I resize a rectangular image of size 1280x512 to a square image of size (2048x2048)? I have used the following code. Is it correct or is there any other better methods to perform resizing?
17 ビュー (過去 30 日間)
古いコメントを表示
% First read the image I of size (1280x512) using imread, then used imresize to change the size of I to (2048x2048) and used imwrite to save the image
I=imread('I.tif');
J=imresize(I,[2048 2048],'bicubic');
imwrite(J,'J.tif','tiff');
0 件のコメント
採用された回答
Walter Roberson
2012 年 12 月 4 日
It depends on your purpose. If the purpose is the human visual system, then you might possibly get more-appreciated output using imresize() with 'lanczos3'. See http://en.wikipedia.org/wiki/Lanczos_resampling#Limitations
4 件のコメント
Image Analyst
2012 年 12 月 4 日
Gee, Hollywood & Burbank do it all the time. In movies and TV, you just zoom into your crummy surveillance video by a factor of 50 or 100 and now you can read license plates and newspapers and see peoples' faces in super high resolution. But my favorite scene was in the movie "No way out" http://www.youtube.com/watch?v=m4SBMyd0yEQ where they had a Polaroid negative of Kevin Costner and the CIA or FBI was spending days trying to process this thing, which was getting more and more focused pass after pass. Of course all they had to do was to negate the image, but anyway... Kevin Costner wanted to delay this process so he got his friend in charge of the group to delay it and he went by the image analysts and told them "The eigenvalue is off. We're pulling away from our reference information. Program a Fourier transform." Friends wondered why I laugh out loud at that scene.
When you change the size of your image, of course it does not change the field of view. Increasing the resolution in pixels will not increase the real-world spatial resolution in mm either. However decreasing the size of your image will reduce the size of objects you can resolve in your image (because you're throwing away information).
その他の回答 (0 件)
参考
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!