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

조회 수: 2 (최근 30일)
dayeon
dayeon 2024년 7월 24일
답변: Angelo Yeo 2024년 7월 24일
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
dayeon
dayeon 2024년 7월 24일
thank you for your amazing code! thank a lot! :))
Umar
Umar 2024년 7월 24일
Hi dayeon,
You're welcome, if the Answer resolved your question, please Accept-click it.

댓글을 달려면 로그인하십시오.

채택된 답변

Matt J
Matt J 2024년 7월 24일
편집: Matt J 2024년 7월 24일
Use imresize. It scales relative to the center.

추가 답변 (1개)

Angelo Yeo
Angelo Yeo 2024년 7월 24일
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)

카테고리

Help CenterFile Exchange에서 3-D Volumetric Image Processing에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by