How do I place images at specific coordinates?
8 views (last 30 days)
Show older comments
MathWorks Support Team
on 25 Jul 2018
Answered: MathWorks Support Team
on 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.
Accepted Answer
MathWorks Support Team
on 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 Comments
More Answers (0)
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!