In OpenCV the following function is used to calculate moment;
CvMoments *moment = (CvMoments*)malloc(sizeof(CvMoments)); cvMoments(img, moment, 1);
To get the exact location of the object or the centroid can be obtained by dividing the moment value with the area.The area can be obtained by applying the following function;
cvGetCentralMoment()
No comments:
Post a Comment