detecting moving object in labeled area

asked 2019-11-10 02:46:39 -0500

JWLee gravatar image

Hi. I'm making a moving object detecting program using opencv & python and I have some questions.

I labeled coordinates by cv2.rectangle and I have a code that catches moving object.

I want to judge if the moving object intrudes labeled area more than 3 secs.

If the object is moving inside labeled area more than 3 secs, It makes text that says "Intruder".

Is there any function or code that can judge this kind of function? (time and judge whether intrudes or not)


edit retag flag offensive close merge delete


You need to know the FPS of the input video first. Then, you can count the number of frames in which the intruder is inside the rectangle region. Dividing that number by the video FPS will give you the intrussion time in seconds

urres_coding gravatar imageurres_coding ( 2019-11-12 01:54:32 -0500 )edit