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.

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

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.

hmmm is opencv python, it’s by code hehe

Isolate the image first then use OpenCV,

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?

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

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


Yes, LThomas tells the best way.

1 Like