Using Matlab's image processing toolbox I can find weighted centroids using the regionprops
function. This is because the function can return either a WeightedCentroid
or a list of pixels indices per labeled part of the image, by PixelList
, and then the weighted centroid is easily calculated. However, jacket's support in regionprops only returns an unweighted centroid (or the centroid of the binary "island" that was obtained using bwlabel
earlier). This means that the info regarding pixel positions was somehow used in order to find these centroids.
How can I access jacket's regionprops info regarding the list of pixels it uses to calculate the unweighted centroid so I could use it to calculate a weighted centroid?
(One important reason to do this is because the function find
cannot be used in a gfor
loop, otherwise one can find
the different output values of bwlabel
...)