Skip to content
Advertisement

How to find contours in a region of interest in image using opencv and Python?

JavaScript

I belive that for C++ the solution looks like this:

findContours(Mask(cv::Rect(x,y,width,height)), contours, hierarchy, RETR_TREE, CHAIN_APPROX_SIMPLE, Point(0,0) );

How can I change this line to get the results I want?

this is the area I’m interested in frame[a:a + height, b:left_x + 300] Thanks in advance!

Advertisement

Answer

your code looks strange to me, here a snippet with a line

JavaScript

so for the input "144,81:626,232"; you get the output:

JavaScript

because that is the way qt print rectangle objects-> topLeftPoint wxh

Advertisement