Ask Your Question

Revision history [back]

In line findContours I had to change img_mask to ~img_mask, to invert colors, since black is the target color for boundingRect,

im2, contours, hierarchy = cv2.findContours(~img_mask, cv2.RETR_TREE, cv2.CHAIN_APPROX_SIMPLE)

Thanks for the help mcclintic_!!

click to hide/show revision 2
No.2 Revision

updated 2018-08-10 05:36:29 -0600

berak gravatar image

In line findContours I had to change img_mask to ~img_mask, ~img_mask, to invert colors, since black is the target color for boundingRect,

im2, contours, hierarchy = cv2.findContours(~img_mask, cv2.RETR_TREE, cv2.CHAIN_APPROX_SIMPLE)

cv2.CHAIN_APPROX_SIMPLE)

Thanks for the help mcclintic_!!

click to hide/show revision 3
No.3 Revision

updated 2018-08-10 05:37:11 -0600

berak gravatar image

In line findContours I had to change img_mask to ~img_mask, to invert colors, since black is the target color for boundingRect,

im2, contours, hierarchy =  cv2.findContours(~img_mask, cv2.RETR_TREE, cv2.CHAIN_APPROX_SIMPLE)

Thanks for the help mcclintic_!!

In line findContours I had to change img_mask to ~img_mask, to invert colors, since black white is the target color for boundingRect,

im2, contours, hierarchy = 
     cv2.findContours(~img_mask, cv2.RETR_TREE, cv2.CHAIN_APPROX_SIMPLE)

image description

Thanks for the help mcclintic_!!