MATLAB: Finding the centroid of a polygon that has been superimposed using the insertshape function onto an image

face detection and trackingobject detection and tracking

I have detected a face in an image frame and am tracking the same, I have also depicted it using a polygon. Now how do I find the centroid of that polygon as I track the face?

Best Answer

You have the polygon vertices (you supplied them when using insertShape), so just average them to find the centroid.
Related Question