reduction image using spline interpolation

1 visualización (últimos 30 días)
Omar Yonis
Omar Yonis el 18 de Jul. de 2020
Comentada: Image Analyst el 19 de Jul. de 2020
Hello
I want to Reduction of the image size to 50% of the original size using spline interpolation what the best code to do this

Respuestas (1)

Image Analyst
Image Analyst el 18 de Jul. de 2020
smallImage = imresize(rgbImage, 0.5);
  4 comentarios
Omar Yonis
Omar Yonis el 19 de Jul. de 2020
Editada: Omar Yonis el 19 de Jul. de 2020
i tried this code and it works only when i convert rgb to gray but i want to reduction rgb image using interp2 only what ishould to do?
rgbImage=imread('rgb.jpg');
grayImage=rgb2gray(rgbImage);
imshow(grayImage);
[rows, columns] = size(grayImage);
[X,Y] = meshgrid(1:columns,1:rows);
xi = linspace(1,columns,170);
yi = linspace(1,rows,209);
[Xi,Yi] = meshgrid(xi,yi) ;
resizedImage = uint8(interp2(X,Y,double(grayImage),Xi,Yi,'spline'));
figure
imshow(resizedImage);
Image Analyst
Image Analyst el 19 de Jul. de 2020
Use imsplit() to extract the separate color channels
[r, g, b] = imsplit(rgbImage);
Then recombine them with cat():
resizedRGBImage = cat(3, resizedR, resizedG, resizedB);
You never answered my question about why you want to do it this more complicated way rather than using the built-in imresize(). So, why? It doesn't make sense to me.

Iniciar sesión para comentar.

Categorías

Más información sobre Geometric Transformation and Image Registration en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by