#include "opencv2/highgui/highgui.hpp"
#include "opencv2/imgproc/imgproc.hpp"
#include <iostream>
#include <stdio.h>
#include <stdlib.h>
using namespace cv;
using namespace std;
int main(int argc, char** argv)
{
Mat src, gray,thr;
src = imread(argv[1], 1 );
cvtColor( src, gray, COLOR_BGR2GRAY );
threshold( gray, thr, 100,255,THRESH_BINARY );
Moments m = moments(thr,true);
Point p(m.m10/m.m00, m.m01/m.m00);
cout<< Mat(p)<< endl;
circle(src, p, 5, Scalar(128,0,0), -1);
imshow("Image with center",src);
waitKey(0);
}