得seq的重心

keypoint get_gravity_center(CvSeq* seq)//中心位置,与像素的值无关
{
	double m00, m10, m01;
	CvMoments moment;
	cvMoments(seq, &moment, 1);
	
	m00 = cvGetSpatialMoment( &moment, 0, 0 );
	m10 = cvGetSpatialMoment( &moment, 1, 0 );
	m01 = cvGetSpatialMoment( &moment, 0, 1 );
	keypoint center;
	center.x = (int) (m10/m00);
	center.y = (int) (m01/m00);
	return center;
} 

你可能感兴趣的:(得seq的重心)