Borrar filtros
Borrar filtros

how can i rescale image? standard is at the center part

31 visualizaciones (últimos 30 días)
dayeon
dayeon el 24 de Jul. de 2024 a las 10:56
Respondida: Angelo Yeo el 24 de Jul. de 2024 a las 23:47
hello, i want to rescale image using the center standard, not at the corner of the imge
I attatched the example image, the red square is the reference image, and the blue one is the rescaled image (here, the center part is marked as 'X', and not only this enlarging case, i want to apply this algorithm for reduction case)
i want to use affine transform or any other method using interpolation, and i want to input the ratio of rescale and output of the rescaled image
I repreciate to all of your answers thanks a lot :))
  3 comentarios
dayeon
dayeon el 24 de Jul. de 2024 a las 12:39
thank you for your amazing code! thank a lot! :))
Umar
Umar el 24 de Jul. de 2024 a las 14:47
Hi dayeon,
You're welcome, if the Answer resolved your question, please Accept-click it.

Iniciar sesión para comentar.

Respuestas (2)

Matt J
Matt J el 24 de Jul. de 2024 a las 15:05
Editada: Matt J el 24 de Jul. de 2024 a las 15:05
Use imresize. It scales relative to the center.

Angelo Yeo
Angelo Yeo el 24 de Jul. de 2024 a las 23:47
It looks like you want to apply affine transfomation to image and warp them. You can use imwarp to apply geometric transformations and interpolate them.
I = imread('cameraman.tif');
imshow(I)
A = [1 0.5 0;
0 1 0;
0 0 1];
tform = affinetform2d(A);
J = imwarp(I,tform);
imshow(J)

Categorías

Más información sobre Read, Write, and Modify Image 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!

Translated by