MATLAB: Find the barycenter of luminance in an image

barycentercenter of gravityimage processingImage Processing Toolboxluminosity;

I need to find the weighted center of luminosity of barycenter in an image. (the weighted L center in Lab a b)

Best Answer

  • Since R2008a (or maybe b) regionprops has had a "WeightedCentroid" property that you can ask for. So pass in the L channel and ask for that if you want the centroid weighted by the L value.
    If you want it weighted by the distance, that's the inertia or moment. See I don't think there's anything built in for that but you can ask for the PixelList which is the location of every pixel in the blob and you can easily calculate it yourself.