OpenCV - Computing a best fit grid
So I have an image which looks similar to this:
And what I need to do if create a best fit grid. The circles in this image are circular but they can be oval, oblong or any random shape you can think of and while they will be in the same relative location they could be shifted around by several pixels or the dots could "run" like when using paint.
I believe I need the grid so I can get the inner 75% of these dots and average the color contained in that 75%.
I've looked at Calib3d.findCirclesGridDefault but I believe that just creates a grid based on the center points of found circles. There isn't much documentation on the java side so please correct me if I'm wrong.
Calib3d.findCirclesGridDefault: http://docs.opencv.org/java/org/openc...
Is there an OpenCV Method to do this or is there any prefered method of generating a best fit grid?
May be you can use threshold and connectedComponentsWithStats. Hence you will have gravity center of indiviudual shape.