Fish eyes for people counting in tough lighting.

Mark_M

Known around here
Jul 2, 2019
1,067
1,515
Land down down under
Pondering some thoughts...

I am waiting to try people counting for a large light show I do. This is where it gets tricky.
Peak times have 50 people at once.

Higher resolution is needed for fisheyes but that takes away from low light capability (and my budget).
Add to that, the camera will have view of the light show flashing/strobing then absolute darkness on the other side.
I don't care if the image is horrible. I'm just wanting the camera to do it's people counting.
Hidden behind a spoiler so Google doesn't index this.
1661663646667.png
Issue I have is to figure out mounting.
I can make a pole (#1) but that is going to look awful attached to the fence in an open space.
Option #2 is the best for the camera but this would take some paper work to get sorted.



I'm looking for a fisheye camera. Something I could mount facing directly down and use for people counting.

Along with the high res 12MP units, I see this one.
5MP seems perfect, I don't think I need 12MP worth of video just to count people.
I saw this mini dome with a wide angle lens... apparently has people counting, but does it work as well as the bigger units?
1661662523440.png1661662512329.png

I was thinking that one of these units would be best suited to outside.
1661662480532.png
Andy sells this sort of one at 5MP:
1661662469277.png


Any Ideas?
I do not want to spend too much money on this camera because it will only be used for 40 days each year.
 
Are you trying to count the crowd as a crowd, because that sound impossible.

Most counting systems I've seen have just employed regular cameras at entrances / exits and counted the number of people in / out / aggregate number for the number currently.
 
  • Like
Reactions: Mark_M and mat200
Are you trying to count the crowd as a crowd, because that sound impossible.

Most counting systems I've seen have just employed regular cameras at entrances / exits and counted the number of people in / out / aggregate number for the number currently.
I would have to count it as a crowd.
I see this video of a Dahua fisheye showing 'people in area' counting.
1661669075068.png

Biggest issue I can already see is that not everyone is being identified and that looks to be 20ft away.
1661669167439.png
 
  • Like
Reactions: mat200
AI is relatively new to the security camera field. I note those people are moving around in a rather controlled fashion. Not sure if you will be happy with results of a an actual rave/party type situation due to the close proximity of everyone to each other and the constant movement. You already pointed out a limitation in a controlled environment.
But I am curious as to the success you will find as it is an intriguing adventure to embark on.

But the edge cases are what get my attention. If you take a shot at 9pm and have those people counted, then take a shot at 10pm and repeat, how can you know what individuals were in the 9pm shot? That would lead to double counting I would think.

Or maybe this is just a single shot when you think the crowd is at its peak? Then what about the ones that came and left before and after that specific shot? Seems like you would lose head count on that concern.

Is there no way to have cameras aimed at the entrance/exits of the venue? But of course when counting ‘persons’ rather than specific people I think the double counting would still be a challenge. I say that as I would guess that some people are going to enter/exit throughout the evening.

For the fisheye to work it must be ‘over’ the crowd. Do you have access to wire the ceiling at each event? This AI people counting capability should work on any camera. So you could just get a regular wide angle and mount it on your stage rather than the ceiling. It would have to be as high as possible obviously.
If you can get a fisheye mounted over the crowd and you are going for a single shot when the crowd seems at its most dense, can’t you just have the camera take the shot, then you manually count later? Do you need this headcount dynamically in the moment so you can announce this curious information to the crowd?

You know I go to our local food shopping store and for years now they have had cameras counting people in the checkout lanes. There is a large 45 inch tv on the ceiling that shows how many lanes are open and how many should be open based on how may ‘persons’ are waiting in line. Management just looks at the screen (aimed at all the people in line) and dynamically calls up additional cashiers based on the recommendation of that people counting software. Seems to work ok. Sometimes they don’t call a cashier up fast enough so the wait times can still be annoying.
 
Not sure if you will be happy with results of a an actual rave/party type situation due to the close proximity of everyone to each other and the constant movement. You already pointed out a limitation in a controlled environment.
But I am curious as to the success you will find as it is an intriguing adventure to embark on.

Is there no way to have cameras aimed at the entrance/exits of the venue? But of course when counting ‘persons’ rather than specific people I think the double counting would still be a challenge. I say that as I would guess that some people are going to enter/exit throughout the evening.
This is outdoors and there is 'two exits' (the road) which I think would be a pain to count entering/exiting.
People park within the boundary then walk out of their vehicles.
I hid the map image behind a spoiler earlier (so Google doesn't index it).

Or maybe this is just a single shot when you think the crowd is at its peak? Then what about the ones that came and left before and after that specific shot? Seems like you would lose head count on that concern.
Ideally it wouldn't be peak times and a snapshot. I might as well just do that manually.

Last year I just went through all the footage at the end of each night to count everyone. Juggling between all the cameras outside takes time and I had to be very careful not to double count!
Biggest issue is that people would hide behind a car then come in frame again. There is where I would hope that a fisheye looking down from above would help somewhat.

For the fisheye to work it must be ‘over’ the crowd. Do you have access to wire the ceiling at each event? This AI people counting capability should work on any camera. So you could just get a regular wide angle and mount it on your stage rather than the ceiling. It would have to be as high as possible obviously.
If you can get a fisheye mounted over the crowd and you are going for a single shot when the crowd seems at its most dense, can’t you just have the camera take the shot, then you manually count later? Do you need this headcount dynamically in the moment so you can announce this curious information to the crowd?
I am thinking that a 120 FOV and mounted 25ft up might be enough to count all the area directly in front of the display.
Certainly some people counting in the main area would help speed up manual counting time.



I'll be a little more descriptive with the circumstances...
Click the spoiler to open photo/video.
Hidden behind a spoiler so Google doesn't index this.

Panoramic images from my phone:

My property is the house directly across the road.
To the right, by the sliver/gold car, is a fence I could mount a pole to. This would be the easiest from my setup but would look damn ugly.
Option #2 is to ask Council to mount onto the street pole. It would be a challenge to get the paper work but I think this would be the best results.


I was really wanting to get a 180deg bullet now that Andy has got them. Neighbour is happy to let me setup a pole and mount it to their fence post.
But my plans were foiled because vehicles will park in front of the display and paper work to close off parking would lead to paying traffic management fees (there goes the price of a Hubble multi-sensor PTZ each year).


Christmas is in Summer down here, so it gets dark at about 9:10pm.
The light show runs from 8:00pm (when it is still light) until 11:00pm.
The lights are flashing to music and change brightness/color.

This is a time-lapse video from 2021 captured on an Axis M3106-LVE mkII. Horrible night quality by todays standards.
This camera is 120deg FOV.

Hopefully that image and video gives a better clue as to what I conditions are.
 
Last edited:
  • Like
Reactions: Old Timer
I may be mistaken, but I think that the AI counting subroutine counts whatever it sees at the moment. Also, it counts ‘persons’ not ’individuals’ so at the end of the night I am not sure how any total it might end up with would have any use

If I understand your requirement, you want to count individuals, not people. I mean, that is what you were doing manually at the end of the evening. That complicates things greatly. I have a thought that might help ease obtaining a total count at the end of the evening, but would still require manual reviewing jpgs at the end of the night. So may not be a very good solution.

I have played around with facial recognition via DeepStack. When you turn that feature on it scans the camera stream for known faces. For every face it does not recognize it zooms in on the face it sees in the video stream, takes a pic of just the face, and then stores that image as a jpg in a special folder.
So in your case it seems that people show up in a relatively slow but steady stream. Some approach the building, others stay on the sidewalk. Few stay for long periods. These attributes work well with this idea. So the idea is to have maybe 3 cameras at about 8 to 10 high up on the building that are tight enough FOV to cover from one end of your property to the other where people tend to aggregate. They can all be installed right next to each other on a pole, but must be facing the road. It simply cannot be a single 2.8mm as DeepStack must be able to have the faces not be little dots in the image. This approach is of course because you are not counting ‘persons’ you are counting individuals so the faces must be identifiable. Finally, each camera should not overlap on what they see once set up or you will get to many dupes to be useful. So like 3 6mm cams If mounted on the house. The closer the cams to the people, the wider FOV could be possible, they just can’t overlap on their view. The cams need not be anything special as DeepStack would be doing the work.

In this fashion you will have jpgs of everyone that attends. It will be easy enough to eliminate dupes at the end of the evening as they can be sorted by time (all three cams dump to the same folder).
You will have to play around with settings like how often Deepstack scans the crowd for faces. You would know best and as the posted video is sped up, it is a difficult call. I would think something like every 2 minutes let DeepStack scan the (3) stream(s). The more often you let it scan the more likely you will get dupes. Don’t scan often enough, you could miss people. Maybe every 3 or 5 minutes instead?

Stretch goal if you are technical: Take the first jpg placed into the unknown folder and scan it programmatically into DeepStack. This makes that person a ‘known’ person. Then, if DeepStack takes a pic of that same person a bit later they will (actually thats a maybe as this facial recognition stuff is not like Hollywood, especially when the environment cannot be controlled as is your case) not be placed in the ‘unknown’ folder. Keep repeating this process (with a script) for every new pic taken. This would automatically eliminate the dupes in the unknown folder (best case anyway).

You also said “Biggest issue is that people would hide behind a car then come in frame again”
As long as they show themselves to the cameras for about 2 minutes they would have their image taken and stored off. You would only miss people that show up and walk away faster than 2 minutes (or whatever scan frequency you choose)

Any way, you did say “any ideas?” so tossing one out. In general I don’t think that AI - at the non-commercial level with no real control over how people enter or exit or how they attend - is ready for such activities out of the box.

I think overall your goals to automate individual counting at such an event are challenging for sure. I hope you find a solution and report back here with your success!
 
  • Like
Reactions: Mark_M
If I understand your requirement, you want to count individuals, not people. I mean, that is what you were doing manually at the end of the evening. That complicates things greatly. I have a thought that might help ease obtaining a total count at the end of the evening, but would still require manual reviewing jpgs at the end of the night. So may not be a very good solution.
I'm aware nothing automatic will be 100% accurate.
My thoughts is that people counting function would consider them the same person unless they went out of shot (as long as that green box stays around them for).

Full-on multiple cameras and trying to captures faces sounds like a dream, but I think that would be far too much of a stretch.
The price tag of that would be better to hire someone to count for a few hours.


I am kind-of tempted to still try ahead for a fisheye or at least some camera that can see a very wide overview.
So my manual counting efforts are a little easier than switching between cameras.
 
I would have to count it as a crowd.
I see this video of a Dahua fisheye showing 'people in area' counting.

I've never used one of these systems but I'm going to say as per your pictures, such a system is impossible, at least at the moment. 50 people is a lot of targets.

As I said above, most venues I've seen have a single camera on every entry / exit point and this is mounted around 7-8ft and pointing directly at the entrance and tightly focused so it capures just the door and the people. The camera then recognises the people and counts them in or out according to the direction of travel whilst keeping an aggregate score. I can't see this being too hard to set up unless you have no exits or entrances and just free movement. With such low numbers though, it shouldn't be too difficult to set up some kind of barrier system and funnel people though an entrance / exit. In fact it could be easier because unlike a pub / nighlcub where theses systems are often in use, in a display environment you can have dedicated entrances and exits thus eliminating 2 way traffic making the counting process easier.

As for cost, that's down to you. You may be right, it may be cheaper to employ someone to count on the door although if these are repeat events, don't forget to see the aggregate cost over time.
 
  • Like
Reactions: Mark_M
My thoughts is that people counting function would consider them the same person unless they went out of shot (as long as that green box stays around them for).
Even if true, the double counting will be a very pronounced concern and with a fisheye it will be difficult to determine who was double counted at the end of the evening. I say that as the shots from a single 360 camera will provide images of people that will be difficult to see who is where and where did they move to - they are just so small. Not impossible, just really small images of the specific person in question. Seems no different than what you were doing with a regular camera and manual counting.

Also, if true, it will only give totals for what it sees at that moment. You will have hundreds of moments throughout the evening. Tallying that up will require scripting of some sort I would imagine (or again, reviewing the footage and manually counting). I don’t think what you are chasing has any ‘out of the box’ solution anywhere

So my manual counting efforts are a little easier than switching between cameras.
If you are referring to my multiple camera idea there is no switching from one to the other. They all operate at the same time, automatically place the results into a common folder and then at the end of the evening you count jpg’s. Since all the jpgs can be sorted by time it will be only a modest effort to delete the dupes then count the remaining - actually windows will count them for you as you can always get the total of a folder in windows.

Expensive? Three random knockoff cameras versus one fancy AI laden camera, could be a draw.
But no matter what you do, if you pull this off, you will be a pioneer for sure.
I just hope you report back with your success