How can I transform points (pixel points) of the same different size images ?

조회 수: 2 (최근 30일)
I have attached an figure, here we see two images A and B, but they are different size. I have the points of a rectangle (e.g., for image B). How can I transform the points
from B to A?

채택된 답변

Image Analyst
Image Analyst 2018년 1월 20일
Just multiply the row index of the points by the ratio of the row sizes, and the column index by the ratio of the column sizes.
[rowsa, columnsa, numColorsa] = size(imageA);
[rowsb, columnsb, numColorsa] = size(imageB);
% Transform point 1
row1b = round(row1a * rowsb / rowsa);
col1b = round(col1a * columnsb / columnsb);
Same for any other points, like the other 3 vertex points.
  댓글 수: 2
K M Ibrahim Khalilullah
K M Ibrahim Khalilullah 2018년 1월 21일
Thank you very much. A little problem. May It would be >> columnsb / columnsa);

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Import, Export, and Conversion에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by