J
J
JRBRO2022-04-04 12:02:01
Python
JRBRO, 2022-04-04 12:02:01

Motion detector in Python?

Hello. I found ready-made solutions that highlight traffic in green online 1*pUIdN6sKkTYJlR-RO2MhlQ.gif

. Now the question is. Is there any solution with the OpenCV library to:

Calculate the displacement of objects relative to the reference, that is, I will set the "norm" for it, and it will show the deviation?
Choose an area in which there may be a shift?
Teach her to notify about such movements?

The task for a static studio is to detect whether the host has moved the scenery, but to make it clear to the script that, for example, the table and the area with the host can be movable. All this is possible in photo mode, not necessarily in live video

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Vindicar, 2022-04-04
@JRBRO

Choose an area in which there may be a shift?

You form a mask of ignored areas, use this mask to fill in "unnecessary" pixels with one color, and then process it. There will definitely not be movement in filled pixels. =)
The task is to identify at a static studio whether the host has moved the scenery,

Those. it is necessary to detect the very fact of movement, and not to highlight the area where it occurred?
I would go through a small blur on the reference frame and on the current one, and then subtract it pixel by pixel. Run the rest through the threshold transformation, if there is a noticeable shift, then something is wrong.
But it will work only if the lighting does not change, and the shadow from the host does not fall into the analyzed area.
If the scenery is colored, then this can be partially leveled by working in the HSV color system using the Hue channel (hue), ignoring Saturation (saturation) and Value (brightness).

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question