Open GoogleCodeExporter opened 8 years ago
After some hassle I was able to make FactDetect-Android work on my Samsung
Galaxy S, now I face the same problem that was reported here. No matter what I
take picture of it just doesn't detect any faces and shows a red cross over the
entire picture. It looks like DetectHaarParam.push just doesn't work. I'm going
to try the method itself on a standalone picture and report back.
Original comment by mogore...@gmail.com
on 3 Jan 2011 at 4:02
[deleted comment]
It seems to me that the code is actually broken :( I've tried the standalone
code below and it does not detect faces even on the example image provided with
FaceDetect-Android. It looked so good though ...
Actual Result: 0 (zero)
Expected Result: 1 face from lena.png file
public static void main(String[] args) {
System.out.println("hello world");
try {
FileInputStream in = new FileInputStream("D:\\svn\\JJIL\\FaceDetect-Android\\res\\raw\\hcsb_ser");
InputStream is = in;
ObjectInputStream ios = new ObjectInputStream(is);
Object o = ios.readObject();
DetectHaarParam.setCascade((HaarClassifierCascade) o);
ios.close();
is.close();
} catch (Exception ex) {
ex.printStackTrace();
System.err.print("Exception: " + ex.toString()); //$NON-NLS-1$ //$NON-NLS-2$
}
Image img = Toolkit.getDefaultToolkit().createImage("D:\\svn\\JJIL\\FaceDetect-Android\\res\\raw\\lena.png");
boolean b = Toolkit.getDefaultToolkit().prepareImage(img, -1, -1, null);
int nFaces = 0;
DetectHaarParam mDhp = new DetectHaarParam();
RgbImage mRgbCurrent = RgbImageJ2se.toRgbImage(img);
mDhp.push(mRgbCurrent);
for (Enumeration<jjil.core.Rect> e = mDhp.getResult(); e.hasMoreElements();) {
++nFaces;
};
mRgbCurrent = null;
System.out.println(nFaces);
}
Original comment by mogore...@gmail.com
on 3 Jan 2011 at 6:24
Hi,
try check this:
http://www.richardnichols.net/2011/01/java-facial-recognition-haar-cascade-with-
jjil-guide/
I tested it and it works well.
Bye.
Denis
Original comment by denpe...@gmail.com
on 26 May 2011 at 9:57
Original issue reported on code.google.com by
cmusic...@gmail.com
on 18 May 2009 at 2:28