I'm trying to use opencv kmeans function at the binary image but I don't know how to setup the its parameters.
My final goal is to find the to two centers of blob.
vector<Point2f> centers;
Mat points;
findNonZero(binary_image, points);
points.convertTo(points, CV_32F);
kmeans(points, overlapped, Mat(), TermCriteria( TermCriteria::EPS+TermCriteria::COUNT, 10, 1.0), 3,
KMEANS_PP_CENTERS, centers );
First parameter requires Specific Format. So I tried to fix it but it has an error
Actually, I don't know how to use the Kmeans function at binary image specifically.
Can you help me how to use it?
It was simple problem. I changed third parameters.
Thank you!