I am trying to segment an area of interest out of an image for some process I am automating. My idea was to tape off the area with black tape and use lighting to influence the segmentation. This is all going to according to plan, except when some object is in front of the taped off area.
The above image is the one I am trying to edit. Normally if there was no tube I can do it, and use the colored squares to measure the area in cm/mm/m. Right now I can't, because my code only detects the blue square.
A super easy solution would be to tape off the part of the tube with black tape and just run the normal code. But I'd like to do this programmatically.
I have tried using this source: Find and draw the largest contour in opencv on a specific color (Python)
And some others. But I just can't figure it out.
What is the best approach?