How do I place images at specific coordinates?
8 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
MathWorks Support Team
am 25 Jul. 2018
Beantwortet: MathWorks Support Team
am 25 Jul. 2018
I have multiple image files each 1024x1024 as well as a matrix of (x,y) coordinates for the top left corner of each image. How do I place each image at its given location?
The image file names are stored as a cell of strings in the same order as the coordinates.
Akzeptierte Antwort
MathWorks Support Team
am 25 Jul. 2018
This can be done by using the "imshow" function and specifying the 'XData' and 'YData' positions for the image. For more information on these parameters, please see the following link:
Attached is a function which takes in the size of the square image, "pix", an nx1 cell array of all the n image file names in strings, "filenames", and an nx2 matrix of the (x,y) coordinates of the top left corner of each of the n images in order of the "filenames" cell, "coords". It then displays all the images in their desired locations.
0 Kommentare
Weitere Antworten (0)
Siehe auch
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!