Question: ![enter image description here](https://i.stack.imgur.com/YMqNQ.png)We need to count the number of people in a crowd and we have used the `opencv_traincascade` but it detects many things. 

What could be the other approach we can use?

Answer: 
I was looking for something like that. I have found this project HeadCounter ( <https://github.com/yquemener/HeadCounter> ) and some papers:
"Counting in Extremely Dense Crowd Images" ( <http://crcv.ucf.edu/projects/crowdCounting/index.php> ) and "Crowd Size Estimation" ( <http://course1.winona.edu/cmalone/promotion/UndergraduateResearch/Cariveau%20Report.pdf> )
There are several ways of doing this. I have done a similar project years ago with the help of Aforge.net.

I'll suggest you to use some existing image library like emgu-cv or aforge for this task.

I think <http://www.codeproject.com/Articles/239849/Multiple-face-detection-and-recognition-in-real-ti> article may help you in achieving this functionality with sample project.