finding coordinates of specific pixel using pixel value ?
26 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Dani
le 27 Août 2015
Commenté : Walter Roberson
le 15 Sep 2017
how to get (x,y)coordinates of an image in matlab using pixel value..for example if pixel value is 250 then find the x,y coordinates of all pixel having value 250
0 commentaires
Réponse acceptée
Image Analyst
le 5 Sep 2015
You will find countless papers on recognizing certain features on faces by looking here: http://www.visionbib.com/bibliography/contentspeople.html#Face%20Recognition,%20Detection,%20Tracking,%20Gesture%20Recognition,%20Fingerprints,%20Biometrics
0 commentaires
Plus de réponses (1)
Bjorn Gustavsson
le 28 Août 2015
Try:
help find
Then you should see that
[i1,i2] = find(I==250);
Or if your image is in some double precision format when you cant rely on finding exact equality of pixel values:
[i1,i2] = find(round(scalefactorofyourchoise*(I-250)==0);
HTH
9 commentaires
Renuka
le 15 Sep 2017
Modifié(e) : Walter Roberson
le 15 Sep 2017
After doing the above:
[i1,i2] = find(I==250);
How do I get each of the (i1, i2) pair?
I need to set some value for each coordinate obtained from the above finding...
Please reply ASAP.
Walter Roberson
le 15 Sep 2017
The K'th pair is I(i1(K), i2(K))
If you need to get all of them at once then easiest is
idx = find(I==250);
I(idx)
using only one index instead of a pair.
If you need the pair of indices for some reason then
[i1,i2] = find(I==250);
I( sub2ind(size(I), i1, i2) )
Voir également
Produits
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!