*What I do:*

1.I Write the face detection in opencv c++ and call from android using 
wrapper.

2.I used android native camera and pass image(Mat) to the detection 
method(detection method is shown below)

3.Its working in android 4.0 to android 5.1 but while running in android 
6.0, the application crashes

4.I added LOGD inside the c++ source code to find exactly where the crash 
happen.

5.Crashing happening at always at the end of the detection method in 
Android 6.0

6.Sample Code

CascadeClassifier cascade;

Rect detection(Mat& image){
   LOGD("face1");
    vector<Rect> val;
    Mat im(image.size(),CV_8UC1);
    if(image.channels()==3)
    {
        cvtColor(image,im,COLOR_BGR2GRAY);
    }
    else
    {
        image.copyTo(im);
    }
     LOGD("face2");
    cascade.detectMultiScale(im, val, 
1.1,2,CASCADE_FIND_BIGGEST_OBJECT,Size(image.cols/3,image.rows/3));
     LOGD("face3");
    if(val.size()==0)
     {
    return Rect(0,0,0,0);
     }
     LOGD("face4");
    return val[0];}

7.Calling method in c++ 

Rect ROI=detection(image);
LOGD("val1: %d",ROI.x);
LOGD("val2: %d",ROI.y);
LOGD("val3: %d",ROI.width);
LOGD("val4: %d",ROI.height);

8.Android logcat message

When not giving face to camera it show in logcat like this

09-21 18:25:52.612 20436 20615 D qualitycheck: quality109-21 18:25:52.612 20436 
20615 D qualitycheck: quality309-21 18:25:52.612 20436 20615 D qualitycheck: 
quality409-21 18:25:52.612 20436 20615 D qualitycheck: face109-21 18:25:52.622 
20436 20615 D qualitycheck: face209-21 18:25:52.642 20436 20615 D qualitycheck: 
face309-21 18:25:52.642 20436 20615 D qualitycheck: quality2709-21 18:25:52.642 
20436 20615 D qualitycheck: res: 009-21 18:25:52.642 20436 20615 D 
qualitycheck: res1: 009-21 18:25:52.642 20436 20615 D qualitycheck: res2: 
009-21 18:25:52.642 20436 20615 D qualitycheck: res3: 009-21 18:25:52.642 20436 
20615 D qualitycheck: quality2809-21 18:25:52.642 20436 20615 D qualitycheck: 
quality1809-21 18:25:52.642 20436 20615 I QualityCheck : 1000

When giving face to camera it show in logcat like this

09-21 18:25:57.662 20436 20615 D qualitycheck: quality109-21 18:25:57.662 20436 
20615 D qualitycheck: quality309-21 18:25:57.662 20436 20615 D qualitycheck: 
quality409-21 18:25:57.662 20436 20615 D qualitycheck: face109-21 18:25:57.662 
20436 20615 D qualitycheck: face209-21 18:25:57.702 20436 20615 D qualitycheck: 
face309-21 18:25:57.702 20436 20615 D qualitycheck: face4

then application crashes

9.The log "face4" is shown ,but its not returning in detection method 
,while running in android 6.0.

please help me to solve this issue.

Detailed log - 
https://s3.amazonaws.com/uploads.hipchat.com/140263/1400779/kS4OjMvPGa5d1zy/logcat.txt

-- 
You received this message because you are subscribed to the Google Groups 
"Android Discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to android-discuss+unsubscr...@googlegroups.com.
To post to this group, send email to android-discuss@googlegroups.com.
Visit this group at https://groups.google.com/group/android-discuss.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/android-discuss/86301a49-3c90-4c6a-986f-4a0bb491fcf4%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to