Problems getting event server running with OpenCV

Discussion topics related to mobile applications and ZoneMinder Event Server (including machine learning)
Post Reply
MoparMap
Posts: 4
Joined: Fri Jan 13, 2023 3:59 pm

Problems getting event server running with OpenCV

Post by MoparMap »

So I just recently stumbled on the Zoneminder event server and liked the idea of having more detailed notifications for motion alerts compared to what I had seen before using the filters native to the base ZM install. I took the plunge and managed to get the event server running, but I'm having issues with getting it to do object detection or any kind of notifications. At the moment I have things set up pretty basic with mostly default settings, though I did turn off face detection and alpr in the object detection ini file. However, when I try to run a test event through the start event script I'm getting an error on the ZM console that I have pretty much no idea about. It seems to have something to do with the OpenCV code, but beyond that it's pretty much alien language to me. I installed the base OpenCV from repositories as I do not have a modern enough graphics card to have a use for GPU accelerated stuff at this time. The error I'm getting is seen on the attached screenshot below. Anyone have any idea what's going on? I tried doing my best Googling, but I was coming up with nothing. I tried looking through the code some myself as well, but there is way too much going on for me to grasp the nature of the problem.
Attachments
ZMEventError.jpg
ZMEventError.jpg (67 KiB) Viewed 934 times
MoparMap
Posts: 4
Joined: Fri Jan 13, 2023 3:59 pm

Re: Problems getting event server running with OpenCV

Post by MoparMap »

Anyone? Just tried running it manually again through the debugger to see if there was any more info, but looks to be the same general error. Maybe there is some more detail here, but looks to have a problem with the same function:
ZMEventError.jpg
ZMEventError.jpg (280.43 KiB) Viewed 838 times
Is this actually an error or is this the expected functionality when it doesn't recognize any objects in a frame? I just walked in front of the camera and stood there briefly, so I would think it would have a fairly easy time recognizing me as a person, but truthfully I don't fully understand what the OpenCV function call actually does as it's not particularly intuitive. I see the final line indicate that no objects were detected, but I wasn't sure if that was just a fallback statement because the function call failed or if the failure is actually the code not seeing anything. I would have expected it to do something more "graceful" like return a zero compared to an error if nothing was found, but again, this is pretty much black magic to me at this point.
Magic919
Posts: 1381
Joined: Wed Sep 18, 2013 6:56 am

Re: Problems getting event server running with OpenCV

Post by Magic919 »

It's broken.

I'd suggest trying a lower version of CV if you can. Mine runs on 4.6.0 and doesn't throw that error.

They seem to have made improvements in DNN module, which is what Yolo is calling here.

I can't say I really understand a lot of this.

Sadly it's dead on here for ZM and much worse for ZMES. Baudneo is working on a new version, but it's still not ready for us.
-
MoparMap
Posts: 4
Joined: Fri Jan 13, 2023 3:59 pm

Re: Problems getting event server running with OpenCV

Post by MoparMap »

Okay, thanks for the reply! At least gives me some idea of where to even begin. I managed to cobble together a pseudo-solution currently that relies on the cameras' built in smart detection (Reolink RLC-822A cameras), but it's a pain to manage the way I have my camera network set up. At the moment when the cameras trigger their detection they just upload a picture to my server via FTP and I have a notification script running that watches the folder and sends me a Pushover notification with the picture as an attachment. It works, but to change settings I have to VNC to my server to access the VLAN the cameras area on and individually log in to each camera to change the detection settings. On the one hand it's nice because it offloads the work from the server and the cameras have some neat functionality like time based sensitivities, but on the other hand it's annoying that everything isn't in the same place and if I'm doing something like mowing the lawn I am going to get constant notifications that I can't easily temporarily disable. Running it through ZM would make it a lot simpler to quickly change a monitor from detect to monitor and back when I'm done, all from my phone.
MoparMap
Posts: 4
Joined: Fri Jan 13, 2023 3:59 pm

Re: Problems getting event server running with OpenCV

Post by MoparMap »

So just downgraded my OpenCV to 4.6.0.66 and it works. Thanks again! I'll have to play with all the other configs and get things tuned, but looks like this just became a viable option again.
Magic919
Posts: 1381
Joined: Wed Sep 18, 2013 6:56 am

Re: Problems getting event server running with OpenCV

Post by Magic919 »

That’s great news. It’s a pretty neat tool to add to ZM.
-
Post Reply