How to find the center of one palm in the picture
In the below picture, there is on palm, how to find the center point of this palm using OpenCV? It will be very appreciated if anyone can tell me the method.
I want to find the center point of the palm center region, see the below image, I want to find the center of the red circle
when use connectedComponentsWithStats(), I get the centroid point, see the below image, the centroid point(the blue point) is not which I want
If you want to do it yourself, you could iterate over the image, all the while finding the average location of the white pixels. Or... see LBerger's answer.
Try finding the maximum inscribed circle or have a look at the distance transform.
You can erode the object a few times to get rid of the fingers. Then get the centroid using the connectedComponentsWithStats or the Hu moments.
If it's hard to erode, you may use region growth with left-up-right three directions, starting from the white pixel which has the largest y-value, as a result, you'll get the palm and a finger, shaping like a lollipop. Finally, count the horizontal length for each row to eliminate the finger.