Counting people in a moving crowd from a video

Hello, I would like to count the number of people from a video.
The cameraman films the crowd from above, and is walking through it, therefore the scene is moving, and the crowd too in the opposite direction.
The quality is similar to this image (Berlin 1989 crowd) : https://static01.nyt.com/images/2019/11/02/world/xxberlin-wall-archive-28/xxberlin-wall-archive-28-mobileMasterAt3x.jpg
I thought that I could separate the video into multiple images and count the number of people to have an estimation of it, but a proper video counter would be amazing too. I have seen some examples using python for a static scene, I wonder if there is a Matlab solution for a moving scene. I checked the computer vision toolbox, but it seems very dense with dozens of image classification techniques and I don't have any experience with computer vision, and a medium Matlab experience, so if someone could point me to the right direction, I would be thankful.

4 Comments

I think you're already pointed in the right direction. The Computer Vision Toolbox had extensive tracking capabilities. It's just a matter of you going through the examples and trying to adapt them to your videos.
I was just programming a similar task in the past 48 hours tracking objects related to optic flow. Find the right function you're looking for, work through an example, and then apply it to what you need to do. In a couple of hours the ball will be rolling!
Thanks both, I will try my best. Do you have particular methods to recommend ?
I don't but I would start by looking for examples. I'm sure this has been done before.

Sign in to comment.

Answers (1)

Hi,
This could be a good demo for you to start. This example shows how to perform automatic detection and tracking of people in a video from a moving camera. Use this MATLAB command to open the example.
openExample('vision/PedestrianTrackingFromMovingCameraExample')

Categories

Find more on Image Processing and Computer Vision in Help Center and File Exchange

Asked:

on 1 Aug 2021

Edited:

on 4 Aug 2021

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!