I've been working on this project for a while and am still struggling to get my automatic detection algorithms to work every time.
Given a set of images like this I need to extract the coloured region inside of the border of each square.
It seemed relatively simple at first but I can't get my code to work on every image.
The problem is the images may have been taken under different lighting conditions or slightly rotated, etc, so some times some of the squares are missed.
I currently apply a Gaussian blur to the grey-scale image, then use otzu threshold to biniarize the image for contour detection. The contours are then sorted by size, shape ,and centroid to get the positions of the regions of interest which is used to extract the colour information.
The problem is sometimes contour detection fails to get the outline for each square. I can play with the parameters of the blur and threshold step to get it to work, but I would like it to automatically determine optimal parameters to get a 10x10 grid of "perfect" square contours.
Is there a machine learning or computer vision method to automatically determine the proper parameters for this type of image processing?
[link][1 comment]