Search All of the Math Forum:
Views expressed in these public forums are not endorsed by
NCTM or The Math Forum.



Re: Centroid of an image file
Posted:
May 29, 2013 9:10 PM


"Sunayana C" wrote in message <ko2tgv$o75$1@newscl01ah.mathworks.com>... > Hello every one... > > I need to find the centroid of an image file...However I don't have the image tool box and hence converted my images in .bmp format to .mat format using octave....Now I need to find the centroid of this .mat file how should I do it ?? ==================================================== See my image segmentation tutorial. http://www.mathworks.com/matlabcentral/fileexchange/?term=authorid%3A31862
Basically you can set up a binary image the same size as your image and then call regionprops:
binaryImage = true(size(grayImage)); measurements = regionprops(binaryImage, grayImage, 'WeightedCentroid'); centroids = [measurements.WeightedCentroid];



