kgunjikar
kgunjikar

Reputation: 475

Count objects in video

I'm trying to setup a software that will count the number of objects in a video. Video is being captured by webcams. The counting need not be real-time. Is there a software, preferably open source, that can do this?

I thought maybe Zoneminder with motion detection can help? I'm not sure that will work accurately.

Any other suggestions or pointers?

Upvotes: 1

Views: 3589

Answers (1)

Wagner Patriota
Wagner Patriota

Reputation: 5674

This kind of problem is not simple. Many times people here ask about image recognition as if there's something magical or a magic library that does it! But unfortunately there's not such tool.

So, where to start? The most popular framework for this is OpenCV. This is a good start-point!

Let's check your case:

You need to count objects. The speed of the counting itself is not your problem (since you are not in very very high frame-rate or resolution, you can do it in real time today). This is not the big deal.

The big deal here is that there's no magic, neither single nor best technique for the recognition itself. Example:

  • Detect a set of blue balls in a yellow floor is kind of easy! Detect colorized balls in a colorized floor is completely different and much harder!
  • If you wanna detect still objects, it's gonna be harder than detect moving objects.

You gotta study a little bit of the basics in order to choose the best technique. Somo common techniques are Lucas–Kanade method (for tracking moving objects) and Haar (popular method for detecting still objects and also faces). You can find some build-in samples of these with OpenCV.

The simple motion detection itself is very easy: you can compare the difference between frames (just a simple subtraction). If the amount of difference is big enough, then it means something is changing in the scene. But this doesn't seem to have anything to do with what you are looking for, once count objects is what you want.

Upvotes: 2

Related Questions