Downsampling with Imresize (Satellite Imagery)
12 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Cemre
el 13 de Jun. de 2023
Comentada: Vinayak Agrawal
el 15 de Jun. de 2023
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 comentarios
Respuesta aceptada
Vinayak Agrawal
el 13 de Jun. de 2023
Editada: Vinayak Agrawal
el 15 de Jun. de 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 comentarios
Más respuestas (0)
Ver también
Categorías
Más información sobre Multirate Signal Processing en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!