How I can find out the center of any detected object?
Show older comments
I'm working on hand gesture recognition, and I try to make the classification based on hand position. I already write the code that detect the hand, but I need two things: 1- save the hand after detecting in separate variable, 2- I want to get the x,y,z coordinates or at least x,y coordinates of the center of the hand? I hope I can fide the answers. Thanks
Answers (1)
Image Analyst
on 28 Apr 2015
Use regionprops to get the centroid:
labeledImage = bwlabel(binaryImage);
measurements = regionprops(labeledImage, 'Centroid');
centroid = measurements.Centroid;
See my Image Segmentation Tutorial for a full demo: http://www.mathworks.com/matlabcentral/fileexchange/?term=authorid%3A31862
I don't know what "save the hand" means. What does it mean to you? I mean exactly , because there are multiple interpretations of that though you might not realize it.
Categories
Find more on Spectral Analysis in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!