I need help in drawing bounding rectangle on threshold Codebook algorithm

asked 2019-04-15 15:22:41 -0500

Like in question I don't know where put code to draw rectangle on original video based on threshold image

This is my code https://pastebin.com/fYj66aYq

here is the output of the code and this red rectangle is what i want to achive image description

Thx in advance

edit retag flag offensive close merge delete

Comments

You could try contour finding (https://docs.opencv.org/4.0.0/dc/dcf/...) but not sure how that particular blob is different from the others. If you can distinguish it then you can use the boundingRect function to get the rectangle surrounding the contour and draw it with rectangle function.

Chris gravatar imageChris ( 2019-04-16 10:22:49 -0500 )edit

Ok thank u I will try your suggestion

cinekprzyprzy gravatar imagecinekprzyprzy ( 2019-04-16 10:51:54 -0500 )edit