Ask Your Question

Revision history [back]

Several steps
- convert the image to grayscale
- threshold this mono image using some application specific threshold value
- find contours in the threshold image with findContours
https://docs.opencv.org/2.4/modules/imgproc/doc/structural_analysis_and_shape_descriptors.html#findcontours
- to get the center, either get the contour bounding box and use its center or loop through all the pixels in the contour and compute their average x, y value