Region of interest

help, I want to take out a region of interest, which in this case is a green zone, but with the drawContours of opencv it hurts me in outline


That is the image, and this is the result I am getting.
roi2

Hi Brian,
Just use Image > Color > Split Channels, then discard the green channel.
Bob

1 Like

but what I want is what is inside the green rectangle

O.K. then, just use the “magic wand” tool. It’s on the tool bar. Just adjust it by right clicking and entering the value which covers the area you want to keep.
Bob

hmmm is opencv python, it’s by code hehe

Isolate the image first then use OpenCV,
Bob

but I want to automate that, but when I make the rectangle it takes the top part that is the one I don’t want

I don’t understand what you desire in the image. Could you indicate it some way?
Bob

I want to isolate the rectangle in green to be able to analyze what is inside it
e
something like that would be

Hi,
Well then you need to split channel to recover the green part as suggested above and then you can use fitRectangle to correct the contour to the actual rectangle

2 Likes

Yes, LThomas tells the best way.
Bob

1 Like