Calculate mean for vector of points

Viewed 16744

I have a vector of a 2-dimensional points in OpenCV

std::vector<cv::Point2f> points;

I would like to calculate the mean values for x and y coordinates in points. Something like:

cv::Point2f mean_point; //will contain mean values for x and y coordinates
mean_point = some_function(points); 

This would be simple in Matlab. But I'm not sure if I can utilize some high level OpenCV functions to accomplish the same. Any suggestions?

4 Answers
Related