Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Application error while recognizing an image #6

Closed
jheimes-silveira opened this issue Apr 23, 2017 · 9 comments
Closed

Application error while recognizing an image #6

jheimes-silveira opened this issue Apr 23, 2017 · 9 comments

Comments

@jheimes-silveira
Copy link

jheimes-silveira commented Apr 23, 2017

When recognizing an image the application is stopped working...
The log that appears to me is:

04-23 19:25:55.964 19295-20628/com.lauszus.facerecognitionapp I/FaceRecognitionAppActivity/Native: Using Eigenfaces
04-23 19:25:55.964 19295-20628/com.lauszus.facerecognitionapp I/FaceRecognitionAppActivity/Native: Reconstructing Faces
04-23 19:25:55.974 19295-20628/com.lauszus.facerecognitionapp A/libc: /home/jheimes/eigen-eigen-67e894c6cd8f/Eigen/src/Core/CwiseBinaryOp.h:110: Eigen::CwiseBinaryOp<Eigen::internal::scalar_difference_op<float, float>, const Eigen::CwiseUnaryOp<Eigen::internal::scalar_cast_op<int, float>, const Eigen::Matrix<int, -1, -1, 0, -1, -1> >, const Eigen::Replicate<Eigen::Matrix<float, -1, 1, 0, -1, 1>, 1, -1> >::CwiseBinaryOp(const Lhs &, const Rhs &, const BinaryOp &) [BinaryOp = Eigen::internal::scalar_difference_op<float, float>, LhsType = const Eigen::CwiseUnaryOp<Eigen::internal::scalar_cast_op<int, float>, const Eigen::Matrix<int, -1, -1, 0, -1, -1> >, RhsType = const Eigen::Replicate<Eigen::Matrix<float, -1, 1, 0, -1, 1>, 1, -1>]: assertion "aLhs.rows() == aRhs.rows() && aLhs.cols() == aRhs.cols()" failed
04-23 19:25:55.974 19295-20628/com.lauszus.facerecognitionapp A/libc: Fatal signal 6 (SIGABRT), code -6 in tid 20628 (AsyncTask #2)
04-23 19:25:56.684 19295-19295/com.lauszus.facerecognitionapp W/art: Verification of void android.support.v4.widget.NestedScrollView$AccessibilityDelegate.onInitializeAccessibilityEvent(android.view.View, android.view.accessibility.AccessibilityEvent) took 658.990ms
@Lauszus
Copy link
Owner

Lauszus commented Apr 24, 2017

Does this happen with the app downloaded from the Google Play store as well: https://play.google.com/store/apps/details?id=com.lauszus.facerecognitionapp?

@jheimes-silveira
Copy link
Author

A version that is in the store is approved, but I downloaded the source and reproduced, this is giving me this error.

@Lauszus
Copy link
Owner

Lauszus commented May 2, 2017

@jheimes-silveira you need to give me some more information, so I can reproduce it. When does this happen? Please try to describe it in more detail, so I can fix it.

@jheimes-silveira
Copy link
Author

Good morning, I changed a version of eigen, it worked better, which version are you using?

@Lauszus
Copy link
Owner

Lauszus commented May 2, 2017

I have been using Eigen 3.1.0 and 3.3.3.

@Lauszus
Copy link
Owner

Lauszus commented May 23, 2017

Closing this issue due to lack of response. Feel free to reopen if it is still an issue.

@Lauszus Lauszus closed this as completed May 23, 2017
@Aashima-Gupta
Copy link

Hi..
i am facing an error in face recognition.
The app is not recognizing any face. Can you mention all possibilities for this going wrong?

Why always the value of mindist is returned as -1 ?

@Aashima-Gupta
Copy link

Aashima-Gupta commented Sep 24, 2018

Code:

float minDist = bundle.getFloat(NativeMethods.MeasureDistTask.MIN_DIST_FLOAT);
Log.i(TAG,"min Dist"+ minDist);
try {
   if (minDist != -1) {
       int minIndex = bundle.getInt(NativeMethods.MeasureDistTask.MIN_DIST_INDEX_INT);
       float faceDist = bundle.getFloat(NativeMethods.MeasureDistTask.DIST_FACE_FLOAT);
       if (imagesLabels.size() > minIndex) { // Just to be sure
           Log.i(TAG, "dist[" + minIndex + "]: " + minDist + ", face dist: " + faceDist + ", label: " + imagesLabels.get(minIndex));

           String minDistString = String.format(Locale.US, "%.4f", minDist);
           String faceDistString = String.format(Locale.US, "%.4f", faceDist);

           if (faceDist < faceThreshold && minDist < distanceThreshold) // 1. Near face space and near a face class
               showToast("Face detected: " + imagesLabels.get(minIndex) + ". Distance: " + minDistString, Toast.LENGTH_LONG);
           else if (faceDist < faceThreshold) // 2. Near face space but not near a known face class
               showToast("Unknown face. Face distance: " + faceDistString + ". Closest Distance: " + minDistString, Toast.LENGTH_LONG);
           else if (minDist < distanceThreshold) // 3. Distant from face space and near a face class
               showToast("False recognition. Face distance: " + faceDistString + ". Closest Distance: " + minDistString, Toast.LENGTH_LONG);
           else // 4. Distant from face space and not near a known face class.
               showToast("Image is not a face. Face distance: " + faceDistString + ". Closest Distance: " + minDistString, Toast.LENGTH_LONG);
       }
   } else {
       Log.w(TAG, "Array is null");
       if (useEigenfaces || uniqueLabels == null || uniqueLabels.length > 1)
           // uniqueLabels.length is null
           showToast("Keep training...", Toast.LENGTH_SHORT);
       else
           showToast("Fisherfaces needs two different faces", Toast.LENGTH_SHORT);
   }
} catch (Exception e) {
   e.printStackTrace();
   e.getMessage();
}

Since mindist is always -1 , it always shows array is null
So what exactly mindist variable should contain to recognize faces correctly??

@Lauszus
Copy link
Owner

Lauszus commented Sep 24, 2018

If it returns -1, then it means that there there were no Eigenvectors:

if (pFacebase->V.any()) { // Make sure that the eigenvector has been calculated

Is there printed any exceptions here:

or here:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants