Open Edgar-ZP opened 1 year ago
Hi! Glad you've been enjoying Viseron :)
Nothing has changed in 2.X whn it comes to masking, so it should still be working. The mask should be configured using coordinates of the cameras resolution.
If you check the live view and add ?draw_motion_mask=1
at the end, does it look the way you expect?
The full URL looks like this: http://<server ip>:<port>/<camera identifier>/mjpeg-stream?draw_motion_mask=1
When I restart Viseron with the same config, but only the other mask (the one with the # in front of in my config snippet) of camera_33_driveway
. I get indeed the mask the way I want on http://x.x.x.x:8888/camera_33_driveway/mjpeg-stream?draw_motion_mask=1
.
For the docs it would be nice if you could add a comment that the mask is about the original (ffmpeg component / camera) resolution.
I have tried some other config and even other locations of the motion mask, but it seems to me the mask is never applied. But it is all on try and error. Do you have some idea I could do to debug this and generate more log data ?
Hmm, if you check http://x.x.x.x:8888/camera_33_driveway/mjpeg-stream?draw_motion_mask=1&draw_motion=1
do the squiggly lines (representing motion) intersect with the mask?
In my tests the mask is applied correctly
Yes I see the outlines of the motion within the mask. It's like the mask isn't applied at all, but the mask is drawn perfect on the video. I also tried a simple box and different places, but without any luck so I am out-of-ideas to debug.
And because with every change I have to go outside and run around it costs a lot of time...
Will run some tests and get report back if i can manage to reproduce or not, thanks for your patience
Yes I see the outlines of the motion within the mask.
I think you have to negate your mask. Motion is only triggered outside the mask, not inside it.
That is correct, motion is masked within the region that you defined.
I have not had the time to run tests yet. Sorry about that
Yesterday night I was playing around, again, with the config and it seems I have one Motion Mask working (camera 31). It is not the camera i wanted to, but it is progress. But i needed to "shrink" the motion mask far within the picture.
The second camera (32) still does not work with the motion mask.
mog2:
motion_detector:
cameras:
camera_31_frontdoor:
trigger_recorder: false
recorder_keepalive: true
#max_recorder_keepalive
fps: 4
area: 0.007
width: 800
height: 600
mask:
- coordinates:
- x: 10
y: 10
- x: 10
y: 660
- x: 1048
y: 660
- x: 1048
y: 466
- x: 1350
y: 238
- x: 1590
y: 130
- x: 1590
y: 10
threshold: 20
history: 500
detect_shadows: false
learning_rate: 0.01
camera_33_driveway:
trigger_recorder: false
recorder_keepalive: true
#max_recorder_keepalive
fps: 4
area: 0.007
width: 854
height: 480
mask:
- coordinates:
- x: 2550
y: 10
- x: 2550
y: 550
- x: 2240
y: 502
- x: 1935
y: 165
- x: 1260
y: 70
- x: 1260
y: 10
threshold: 20
history: 500
detect_shadows: false
learning_rate: 0.01
Hmmm and it is broken again... Could it be the mog2 motion-mask crashes or something without logs ? It is of course strange the motion detection keeps working. :exploding_head:
That should not be possible no, the mask is applied to the image in the same thread, so if the masking would crash it would stop detecting motion as well.
I've had limited time the last few weeks so i have not been able to dig further just yet. Im thinking about adding a new view to the frontend which would allow you to see what Viseron "sees", maybe that could give some clues.
Could you navigate to /<CAMERA_IDENTIFIER>/mjpeg-stream?draw_motion_mask=1&draw_motion=1
and show me what it looks like when you say it stops working?
I've been testing and from what i can observe it is working. There might be an issue with the area being misscalculated if the motion contour entirely surrounds the mask, gonna do some extra testing on that
I cropped the picture of privacy reasons, i do not like it so public. But you can see the problem, the headlights of traffic on the road triggers motion.
There is a little room between the mask and the border of the picture, this was because I thought this would fix the problem. But as you can see it didn´t...
Interesting, thanks for providing the images. Will copy your config and run some tests
I cant for the life of me reproduce this. I am thinking it could be because i am referencing a global frame instead of copying it.
I just pushed that change to dev
, will take a few minutes for it to finish the build.
Can you try that and see if it helps?
Hey. I seem to be having the exact issue with an object mask. The mask is drawn properly, but not applied. I've got a stupid tree in the area that waves like a person. Anything I can do to help?
darknet:
object_detector:
cameras:
camera_1: # Attach detector to the configured camera_1 above
fps: 1
scan_on_motion_only: false # Scan for objects even when there is no motion
labels:
- label: person
confidence: 0.90
trigger_recorder: true
height_min: 0.08
mask:
- coordinates:
- x: 5
y: 0
- x: 1274
y: 3
- x: 12
y: 709
I just upgraded to version v2.3.1
but this problem still exists.
While the motion mask is perfect drawn on the mjpeg-stream, motions inside the mask are still recognized and trigger a motion.
Will need to take a deeper look. I did some tests a few weeks back but i could not reproduce. Will need to investigate deeper.
Working hard on #619 atm so it might take some time, i have not forgotten about it tho!
:+1: When you have an idea of build i can test, just let me know. And thanks for sharing this nice project !
Hi Hi,
first of all: thanks for this great project !
This weekend I updated my setup (finally) to the latest 2.x version. And while the config is completely different, it reads very nice.
Only the big problem I face is that I can´t get the motion-mask to work anymore. And with a big road just on the edge of my camera I get a lot of triggers :-(
I tried all kinds of different configs:
I there a bug in the latest version (v2.2.0) or do I miss a config setting ?
Kind regards !
This is my complete config: