What is the difference in these two methods of finding coordinates of image?
5 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
mee mee
le 18 Jan 2016
Réponse apportée : mee mee
le 19 Jan 2016
I am trying to find coordinates of a line in my binary image. I used two methods.
1) X=imread('line.png'); [I,J] = find(X ==0); this methods give me multiple coordinates of the whole image.
2) A=imread('line.png'); image(A) [x,y]=ginput(); this methods give me the coordinates of the points on the line that I click by mouse.
Using method 2, I click multiple points (between start and end point of the line) and I get coordinates of those points. But when I compared the results getting from method 2 and method 1, they are different. I know that the cooridinate points may be different depending on my clicking. But I think the start and end coordinate (i.e. start and end of the line) should be the same?
Can anyone help me what the difference between these two methods? Are they finding different coordinate system?
Thanks.
0 commentaires
Réponse acceptée
David Young
le 18 Jan 2016
The results of find are [row, column]. The results of ginput are [column, row].
That is, find uses the matrix convention for coordinate ordering, but ginput uses the image and graphics convention.
Does this explain the difference you observe?
0 commentaires
Plus de réponses (2)
Voir également
Catégories
En savoir plus sur Data Exploration dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!