My initial plan is to detect the colors and make a contour around it using the detected colors. But I’m a bit confused how to proceed or how it can be done.
break the task down into subtasks. state them clearly. research each. if a subtask is still too complex, break it down further.
perhaps the first task should be to review the tutorials on https://docs.opencv.org/ so you know the tools (primitives and operations) of image processing.
I went down the same path, even to the point of using red and green squares. The only difference is I had a single red square in the upper right and a green one in the lower left.
My advice is not to do this at all, unless you will always have the exact same lighting, the exact same shade of white for a background, and never have any other objects/backgrounds visible. Basically the color approach works with a fixed image in a file, but not if you are using a camera. Because you will go crazy trying to distinguish “red” or “green” under varying circumstances.
Saw it, but, it’s utilizing Aruco. I can’t use Aruco now because it’s sensitive. A little part of it being blocked means it can’t be detected anymore. But thanks, though.