Downsampling with Imresize (Satellite Imagery)
조회 수: 12 (최근 30일)
이전 댓글 표시
Hi,
I am downsampling my satellite images (.png format) with Imresize bicubic function. I would like to decrease the resolution of my images from 2m to 10m. What should I write to scale? Scale of 2 is 0.50. Should I write 0.20 since my scale factor is 5?
Thanks in advance.
댓글 수: 0
채택된 답변
Vinayak Agrawal
2023년 6월 13일
편집: Vinayak Agrawal
2023년 6월 15일
Hi cemre,
Yes, to downsample your satellite images from 2m to 10m resolution using the `imresize` function in MATLAB, you should set the scale factor to 0.20. This is because the scale factor represents the ratio of the output image size to the input image size, where a scale factor of 0.5 results in an output image that is half the size of the input image.
In your case, you want to reduce the resolution by a factor of 5 (from 2m to 10m), so the scale factor should be 0.2 (1/5). This means that the output image will be 20% the size of the input image, or 5 times smaller in both dimensions.
Here is an example MATLAB code to downsample an image from 2m to 10m resolution using `imresize`:
% Load the original image
origImage = imread('original-image.png');
% Set the desired scale factor to achieve 10m resolution
scaleFactor = 0.2;
% Resize the image using bicubic interpolation
downsampledImage = imresize(origImage, scaleFactor, 'bicubic');
% Save the downsampled image to a new file
imwrite(downsampledImage, 'downsampled-image.png');
This code will load the original image, set the scale factor to 0.2, downsample the image using bicubic interpolation, and save the downsampled image to a new file named "downsampled-image.png".
Hope it helps!
Please accept the answer in the case it is correct so that it can help others as well
댓글 수: 4
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Multirate Signal Processing에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!