I have recently written code for detecting path colors in a 2D grid and printing the corresponding path costs and it works fine for me. Here's my code; I am currently new to OpenCV and know only C++ (no python).
The image that I had for the project was:
Now I may get an image like this for the same task:
I need an algorithm to detect the square in the middle of the arena, rotate it to the angle by which it becomes like the image above, and then crop the rest of the image off.
I am currently at a fix about doing this.