MATLAB: Is there a way to get the centroid of a pixel in an image

centroidcomputer visionimage processingImage Processing Toolbox

I have a set of pixels from an image that I'd like to find out the centroid for, without user input. Is there such a way to do this?

Best Answer

See my Image Processing Tutorial http://www.mathworks.com/matlabcentral/fileexchange/?term=authorid%3A31862 It goes through all that. It finds centroid of regions and gray level weighted centroids of regions, and a bunch of other stuff too. It has been very instructive for thousands of people.