How can I transform points (pixel points) of the same different size images ?
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
K M Ibrahim Khalilullah
am 20 Jan. 2018
Kommentiert: Image Analyst
am 21 Jan. 2018
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
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/169218/image.png)
from B to A?
0 Kommentare
Akzeptierte Antwort
Image Analyst
am 20 Jan. 2018
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 Kommentare
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Import, Export, and Conversion finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!