How do I place images at specific coordinates?
9 次查看(过去 30 天)
显示 更早的评论
MathWorks Support Team
2018-7-25
回答: MathWorks Support Team
2018-7-25
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.
采纳的回答
MathWorks Support Team
2018-7-25
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 个评论
更多回答(0 个)
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!