I'm new to OpenCV and I want to detect the actions in a video by using openCV. Let say the video is a cricket match, then I want to detect who is the batmat and who is the bowler by using their motions. Can anyone guide me how can I do this with examples or some related videos. All your comments are highly appreciated.
-
are you looking for 'action recognition' or similar ? quite an active research topic. do not expect to find easy readymades. – berak Dec 09 '14 at 17:31
-
yes I want to identify actions. I'm not expecting any readymades. I want to know the ways that I can implement this project with the people have experiences in related fields. – Anushka Ekanayake Dec 10 '14 at 07:18
2 Answers
With my limited understanding on image processing, I feel the approach ( especially haar classifiers ) in the accepted answer might not be the best option you have.
Read up on following
- Optical flow based processing - That will help you identify motion.
- Background subtraction - Ground color is usually green and player clothes also have color.
- Contours - They let you identify shapes.
- Hough Line transform - There will be lines in your video stream.
- Edge detection
I assume one of intentions of doing this project is to learn image processing and just not to get the result. Training a haar xml for identifying a batsman/bowler with +ve/-ve image samples is more like repetitive job than a real learning process. More over, you will need to spend lots of time collecting samples, and then retraining xmls on failure etc. Also, haar classifiers are for object detection are not for motion detection as mentioned in question.
Aishack website has some references projects with image processing ideas. Wait for more responses to this question from experts.

- 10,859
- 4
- 50
- 82
-
"With my limited understanding on image processing, I feel the approach ( especially haar classifiers ) in the accepted answer might not be the best option you have." -- You have limited experience, yet you are down voting my post. That is the reason. – MiiinimalLogic Dec 10 '14 at 14:33
-
@MiiinimalLogic That is not true. I didn't downvote first. I gave an answer telling what I felt was the truth and helpful to OP. Also, by I meant by "limited experience" - if compared to experts and not to novices. – kiranpradeep Dec 10 '14 at 15:30
-
@MiiinimalLogic I accept it is poor behaviour in SO on my part respond to your downvote of my answer by my downvote of your answer. My answers have been downvoted earlier - but they where with reasons in comments. This time, I felt it was for no reason and I was angry and naive. Sorry if I was offensive and won't repeat. – kiranpradeep Dec 10 '14 at 15:37
Look into object recognition and Haar classifiers, specifically train_cascade methods of theOpenCV library. You'll need a LOT of still samples of each player type and their typical moves, then train a classifier and then analyze video frames to pick them out. You have a long, but awesome road ahead of you.

- 820
- 6
- 11
-
thanks a lot for your valuable guidance. Yah, it's important for my final year project. :) – Anushka Ekanayake Dec 09 '14 at 04:40
-
No problem. Please contact me on my site www.mjp.audio, I would like to work on this with you. – MiiinimalLogic Dec 09 '14 at 15:18
-
@MiiinimalLogic Downvotes are to be provided with reason as comment which was not given. My reasoning for avoiding haar was given in the answer. If you have watched the game of cricket, you will see that, the OP ( student ) is going to spend/waste lots of time collecting samples of players from video and training and retraining and will end up with almost nothing - other than leaning haar training. Also this needs to be done in a video stream. Haar is too slow for that. Secondly, in a cricket video stream multiple cameras and their angles makes haar impossible. – kiranpradeep Dec 10 '14 at 05:20
-
@MiiinimalLogic Even forgetting the learning part and thinking only in *SO's answer only and no additional noise* perspective, Haar will not help the OP for a cricket live video stream. – kiranpradeep Dec 10 '14 at 05:21