Face Detection with JJIL Library and ColdFusion (Experiment)

I was trying to do face detection with Faint Java library and noticed quite disappointingly it only works on 32bit platforms. Looking elsewhere found JJIL Java library build to do face detection on mobile applications and also quite nice blog post by Richard Nichols on the subject. It was a good start. I suggest you to read that post first since I build a new copy of JJILCore.jar with Richard’s updated codes.

Just like OpenCV, JJIL also use haar cascade file to detect objects from images and the face detection is as good as the haar values. OpenCV haar and JILL use two different haar file formats. Not to worry, there is Haar2J2me utility that allows you to convert OpenCV haar files into smaller JJIL format. But so far I did not found any satisfactory haar cascade file that can do proper face detection with JJIL.

Let’s work on following image:


Here is the ColdFusion code. After I add JJILCore.jar and JJIL-J2SE.jar into my ColdFusion lib folder.   

Here is the result:

You notice two things right away. Frist Doctor’s face is detected two times. That is not because he is having two hearts, but JILL tend to detect same face multiple times in different sizes. It is bit easy to correct with bit of ColdFusion:

Secondly it did not detect Amy Pond’s face and that is not very nice. Now I have to find a better set of haar files that can detect faces in different angles or I have to find different solution altogether. 

Download (JILL-CFM-Example.zip)