How to recognize colors from the color chart? I am developing a vision application that is using the color chart below and camera to extract color of each patch in the chart. In order to do that, I have to first detect the chart area in an image and match the area with existing template which contains locations of patches.

My question: I need to detect the color patch area by recognizing four corners of the chart. You can see the corners that the small inset rectangles indicate in the image below. I know one way to go about it is to let user to select those corners by clicking it. But is there any way to automatically detect four corners from the image.
You can house hough lines to detect the color area


First detect all lines
Lines with longest length would be the outer most ones
Pick the top horizontal line and do template match for the squares.
Once you find the squares, traverse downwards toll you reach the other set of squares.
Mark all points where the squares were found
You now have an enclosing area for the color chart.