How do I place images at specific coordinates?
8 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
MathWorks Support Team
le 25 Juil 2018
Réponse apportée : MathWorks Support Team
le 25 Juil 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.
Réponse acceptée
MathWorks Support Team
le 25 Juil 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 commentaires
Plus de réponses (0)
Voir également
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!