mplayer -vf haardetect=...
This patch brings OpenCV's Haar like features detection to MPlayer. The very nice object recognition algorithm implemented in OpenCV makes it possible, even on a single computer, to perform things such as crude face recognition on an full scale DVD source in real time. It returns when and where objects are recognized (timestamp, position and size) on both the command line and in a log file.
It’s interesting to the OpenCV crowd because it basically extends the possible sources to most of what mplayer can decode without the need for preliminary conversion and storage.
It’s interesting to the MPlayer crowd because it brings facultative, very easy to use face recognition to what their player can already do if they have OpenCV installed.
Install OpenCV.
Apply the aforementioned patch to a recent mplayer tree.
Compile and install, as usual.
Go read Mplayer manual (man mplayer — search for haardetect under -vf). It basically nothing more than calling:
mplayer -vf haardetect=...
Fast enough to detect frontal faces in real time on a single 2 GHz Xeon node from an unscaled 720x480 NTSC DVD source. Used in conjunction with -sstep 1, It detects faces on a 2 hours long movie in a little less than 45 seconds on the same hardware.
It’s already working well. What could be done would be:
optimizing the MPlayer to OpenCV image transfert, which is straighforward, but not as fast as it could be.
adding a preview option so that recognized objects might be visualized on the run.
profiling it more, and testing it more extensively regarding thread-safety; used this way, OpenCV is supposed to be reentrant, but I am not absolutely sure it is.