find the coordinates of an image

how to get the xy coordinates of palm from the image

3 Comments

If you expect to get an answer you will have to be more specific. The picture on the right looks like a MATLAB binary image and all of the "true" pixels represent the palm. Do you want to find the "centroid?" The bottom-left-most pixel of the palm? The bottom-right-most pixel of the palm? The top-left-most? See what I mean?
A good first thing to do would be to specify the problem exactly.
thank you, consider only the right image, i want to get the x-y coordinates of entire structure of palm alone, i know that if we have the coordinates we can get the image, but i have image and i want to know the coordinates is it possible?
Mohammed Qusay
Mohammed Qusay on 7 Mar 2017
Edited: Mohammed Qusay on 7 Mar 2017
@John ... i want to the The bottom-left-most pixel of the palm, The bottom-right-most pixel of the palm,The top-left-most and the top-right-most of the binary image how to get it ?

Sign in to comment.

 Accepted Answer

Ramesh - if the right-hand image is a binary image of 0's and 1's, then can't you get the rows and columns (y and x coordinates respectively) using the following
[rows,cols] = find(binaryImg==1);
where binaryImg is your binary image and 1 corresponds to the white pixels?

5 Comments

THANK YOU GEOFF, i need to model the palm, so with the binary values i can reconstruct the image using matlab, but is it possible to model using binary 1's and 0's.
if i get the coordinate values i will export it to some files and use it for modelling.
The rows and cols variables will give you the coordinates of the palm (and fingers). You can then use those coordinates to extract the palm data from the original image.
thank you Geoff, will try and let u know.
If, by chance, you want just the outline of the palm, you can use
boundaries = bwboundaries(binaryImage);
Or (not as efficiently)
[rows, columns] = find(bwperim(binaryImage));
Geoff's code can skip the unnecessary step of comparing every pixel in the entire image to 1 by simply just doing:
[rows,cols] = find(binaryImg);
@image analyst
thank you will inform you after trying it

Sign in to comment.

More Answers (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!