I am trying to get the coordinates of the leftEye and rightEye and draw a line from leftEye to rightEye but the coordinates returned are null. I am using Nexus 4 to test the application. Nexus 4 doesn't support this feature?? I can draw a rectangle around the detected face without any problem. For reference, I have attached my codes for detection of the eye coordinates.
try{
float x1 = detectedFaces[i].leftEye.x;
float y1 = detectedFaces[i].leftEye.y;
float x2 = detectedFaces[i].rightEye.y;
float y2 = detectedFaces[i].rightEye.y;
//Converting from driver coordinate to view coordinate
float Xx1 = (x1+1000) * vWidth/2000;
float Yy1 = (y1+1000) * vHeight/2000;
float Xx2 = (x2+1000) * vWidth/2000;
float Yy2 = (y2+1000) * vHeight/2000;
canvas.drawLine(Xx1, Yy1, Xx2, Yy2, drawingPaint);
}
catch(Exception e){
Log.e(TAG, "Error: " +e.getMessage());
}
Logcat
11-15 16:37:52.895: E/Take_Picture(1304): Error: null
11-15 16:37:53.115: E/Take_Picture(1304): Error: null
11-15 16:37:53.286: E/Take_Picture(1304): Error: null