Using Sum Segmentation in Matlab you can turn this:
Into this:
Which is my first step in creating a best fit grid for the dot array. Normally I'd just impose a grid over the dots but the dots positions are somewhat random as they are placed by hand. The fact they are placed by hand means I need to create a "Best Fit Grid" to properly segment the image.
So does OpenCV have a "Sum Segmentation" fuction or if not is there another way I can go about this?