필터 지우기
필터 지우기

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?

조회 수: 15 (최근 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');

채택된 답변

Walter Roberson
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
VENKATESAN
VENKATESAN 2012년 12월 4일
Thank you very much for your details about image resizing. Actually, the resolution of our image depends on field of view (FOV). Resolution = FOV/No. of pixels. FOV defines the distance of the total number of pixels in an image in millimeter, so that we can able to calculate the size of the object that we are imaging. Since we are changing the dimension of the image from (1280x512) to (2048x2048), whether the change in number of pixels will affect FOV.
Image Analyst
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개)

카테고리

Help CenterFile Exchange에서 Geometric Transformation and Image Registration에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by