0

I have a large array MxNxP size where M and N are the breadth and length of each image and P is the number os images. Now, this represents satellite image with 0.1 degree resolution. Is it possible to resample these images to 0.25 or 0.5-degree resolution in Matlab?

I checked resample function but I need to change the pixel size, not sampling rate. At the end, I still want P number of images.

Thanks for your help.

P.S. I do not have to resize.

Windy Day
  • 173
  • 1
  • 15

1 Answers1

0

You can skip few rows and columns and take the output into a matrix?

A = rand(100,100) ;
A_reduced = A(1:2:10,1:2:10) ;

YOu can use interp2, if you want exact resolution as mentioned.

I = imread('peppers.png') ;
[nx,ny,t] = size(I) ;

x = 1:ny ;
y = 1:nx ;
[X,Y] = meshgrid(x,y) ;
%%
dx = 2 ; dy = 2 ;
[Xi,Yi] = meshgrid(1:dx:ny,1:dy:nx) ;

Zi = zeros(size(Xi,1),size(Xi,2),t) ;
for i = 1:t
    Zi(:,:,i) = interp2(X,Y,double(I(:,:,i)),Xi,Yi) ;
end
Zi = uint8(Zi) ;
Siva Srinivas Kolukula
  • 1,251
  • 1
  • 7
  • 14