Downsampling with Imresize (Satellite Imagery)

12 views (last 30 days)
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.

Accepted Answer

Vinayak Agrawal
Vinayak Agrawal on 13 Jun 2023
Edited: Vinayak Agrawal on 15 Jun 2023
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 Comments
Cemre
Cemre on 13 Jun 2023
Edited: Cemre on 13 Jun 2023
Thanks for your answer. Best regards.

Sign in to comment.

More Answers (0)

Community Treasure Hunt

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

Start Hunting!