Superimposing Labels on an image

Forum for questions and support relating to 1.33.x development only.
Locked
ashima
Posts: 7
Joined: Thu Jan 23, 2020 6:21 am

Superimposing Labels on an image

Post by ashima »

Hello Everyone,

I am new to Zoneminder. This is my first installation. I would like to setup cameras overviewing a parking lot for ~1000 cars. I would like to label each parking slot with a number.

Is it possible to do so in zoneminder. Here is a google link to show what exactly I would like to achieve.

https://www.google.com/search?q=parking ... 137FRIwdrM

Any Pointers.

Regards,
Ashima
ashima
Posts: 7
Joined: Thu Jan 23, 2020 6:21 am

Re: Superimposing Labels on an image

Post by ashima »

I am not sure if I have made my situation clear or not.

I have cameras facing parking slots. Each of the parking slot is marked with white line. What I want is something of image processing. A green box should be drawn around each pair of white lines and a number is assigned to this box. So when a car comes and park in this slot I can identify it by the number. I guess I have made myself clear.

Can anyone please help. Is it really possible in zoneminder.
User avatar
snake
Posts: 337
Joined: Sat May 21, 2016 2:20 am

Re: Superimposing Labels on an image

Post by snake »

1000 vehicles is a lot. Let's forget that, and assume you have something like 20 boxes per camera. You can setup 20 zones, and then act upon that, so I'm going to guess that this 'is' possible.

Alternatively, you will want to investigate zmeventnotification server, and also ozone.network
ashima
Posts: 7
Joined: Thu Jan 23, 2020 6:21 am

Re: Superimposing Labels on an image

Post by ashima »

Thanks @snake for your tip. I'll try to draw zones for each parking slot.

Since I am a first timer wih zones, I'll really appreciate if you could answer have few more queries :

1) Is there any limitation to no of zones that can be marked per camera ?
2) Instead of colored filled box to show zone, can I have transparent box with just outline to show zone. ( I guess I have made my point clear)

Thank you
ashima
Posts: 7
Joined: Thu Jan 23, 2020 6:21 am

Re: Superimposing Labels on an image

Post by ashima »

I guess there is a some kind of confusion. I want to make these boxes visible during live streaming. Like how we can have time stamp on the live feed, I want boxes drawn on the feed. I guess defining zones is to monitor activity in that area. Right now I am not much worried about the activity. All I want is to draw boxes with id on the live feed (basically a box on each parking slot with id).

Any help ?
Regards,
Ashima
User avatar
snake
Posts: 337
Joined: Sat May 21, 2016 2:20 am

Re: Superimposing Labels on an image

Post by snake »

It sounds like what you are trying to do is a video overlay. You want to overlay boxes on the video feeds.

Not typical behavior of ZM, but ZM provides the video streams via Apache, so you should be able to grab those video feeds, add the overlay, and serve the resulting stream. I'm not sure exactly how you would do it, but a search of ffmpeg overlay -filesystem (there are some false results for fuse related items) comes up with relevant material. I don't know if you'd want to consider other options as well. ZM should work, but there might be more efficient ways. If you don't need to record the streams + overlay, then maybe the above is enough. With some effort, there is surely a way to tie into the video before it is output to apache, if you hack ZM. (Look at the code for how the timestamp is managed, possibly)

See:
https://www.linuxquestions.org/question ... ay-787081/
https://stackoverflow.com/questions/525 ... ing-ffmpeg

Video streams are accessible via something like an HTML page with:

Code: Select all

<img width="412px" height="268px" src="http://IPOFZMSERVER/zm/cgi-bin/nph-zms?mode=jpeg&monitor=1&scale=100"&user="watchinguser"&pass="somepassword" >
User avatar
iconnor
Posts: 2862
Joined: Fri Oct 29, 2010 1:43 am
Location: Toronto
Contact:

Re: Superimposing Labels on an image

Post by iconnor »

Yeah we don't really have this ability at this time. We can add it.... what's your budget? :)

Text is easy, just use the timestamp label. Boxes are harder.

I can't help but think if I was doing it, I would use spray paint. Of course this might get covered by a car right?

I guess I'm just not sure what the point of the box is.
User avatar
asker
Posts: 1553
Joined: Sun Mar 01, 2015 12:12 pm

Re: Superimposing Labels on an image

Post by asker »

ashima wrote: Fri Jan 24, 2020 5:29 am I guess there is a some kind of confusion. I want to make these boxes visible during live streaming. Like how we can have time stamp on the live feed, I want boxes drawn on the feed. I guess defining zones is to monitor activity in that area. Right now I am not much worried about the activity. All I want is to draw boxes with id on the live feed (basically a box on each parking slot with id).

Any help ?
Regards,
Ashima
Write a simple montage view yourself in html using the nph-zms URL of ZM and then overlay it with SVG boxes and text. Won't take you more than a few hours or max a day, even if you have no idea of what SVG and HTML is (Google for tutorials)
I no longer work on zmNinja, zmeventnotification, pyzm or mlapi. I may respond on occasion based on my available time/interest.

Please read before posting:
How to set up logging properly
How to troubleshoot and report - ES
How to troubleshoot and report - zmNinja
ES docs
zmNinja docs
ashima
Posts: 7
Joined: Thu Jan 23, 2020 6:21 am

Re: Superimposing Labels on an image

Post by ashima »

Thanks for the feedback.


The nph-zms view just give a snapshot image at that moment. Can I have live streaming url. I would like to have live stream with boxes overlay.

Also I have observed when I live stream the video using browser(i.e logging in to zoneminder console using laptop), my cpu usage in laptop goes up by 80%. However live streaming using Zmninja app on laptop increase it by just 10%. Why is it so ? Similarly the cpu usage on the server also increases.
User avatar
snake
Posts: 337
Joined: Sat May 21, 2016 2:20 am

Re: Superimposing Labels on an image

Post by snake »

ashima wrote: Mon Jan 27, 2020 4:33 pm The nph-zms view just give a snapshot image at that moment. Can I have live streaming url. I would like to have live stream with boxes overlay.
See wiki.zoneminder.com/Example_Camera_View_HTML

This should stream, I think mjpeg to your browser.
Locked