Ask Your Question

rainNight's profile - activity

2014-04-26 03:06:28 -0600 commented question I'm developing a project about face recognition on android. I meet a problem after detect face region

thank you very much, I have sloved this problem. you help me a lot, thanks again

2014-04-26 01:54:39 -0600 commented question I'm developing a project about face recognition on android. I meet a problem after detect face region

yes, the facesArray[0] may be null, can I succeed atfer adding the code : if(facesArray[0]!=null) Mat faceImg = new Mat(mGray,facesArray[0]);

2014-04-25 08:20:22 -0600 asked a question Can I real-time recognize face

I want to know how to real-time recognize face.now, I have train a database, but when I detect face region, I don't know how to get the region. Does onCameraFrame() function support deal a frame.

2014-04-25 07:52:27 -0600 asked a question I'm developing a project about face recognition on android. I meet a problem after detect face region

I meet a problem in the onCameraFrame() function. After detect face in the function, I want to get the face region, and then create a new Mat to save the face area. but there are a problem.My code is:

mRgba = inputFrame.rgba();
    Imgproc.cvtColor(mRgba, mGray, Imgproc.COLOR_RGB2GRAY);
    int height = mGray.rows();
    if (Math.round(height * mRelativeFaceSize) > 0) {
        mAbsoluteFaceSize = Math.round(height * mRelativeFaceSize);
    }
    MatOfRect faces = new MatOfRect();
    if (mJavaDetector != null)
        mJavaDetector.detectMultiScale(mGray, faces, 1.1, 2, 2, // TODO: objdetect.CV_HAAR_SCALE_IMAGE
                new Size(mAbsoluteFaceSize, mAbsoluteFaceSize), new Size());
    Rect[] facesArray = faces.toArray();
    for (int i = 0; i < facesArray.length; i++)
        Core.rectangle(mRgba, facesArray[i].tl(), facesArray[i].br(), FACE_RECT_COLOR, 3);
    Mat faceImg = new Mat(mGray,facesArray[0]);

    return mRgba;

I want to get the face area, so I use the gray image to init the new Mat data. My error isimage description

while the program is right if I move the penultimate sentence

Mat faceImg = new Mat(mGray,facesArray[0]);

I want to know why is it. thanks

2014-04-24 19:49:23 -0600 asked a question why my JavaCameraView show a half photo

I miss a problem when I use the org.opencv.android.JavaCameraView. I just get half image as follow.image description.

I need not the black region,I want to have full screen for preview. I hope someone can help me. Thanks!

2014-04-21 21:16:55 -0600 commented question facerecognizer save() method

Yes, I don't ask for permision. thank you!

2014-04-21 08:28:42 -0600 answered a question how to appened the new faces into the xml file

I also make this project, but I don't know how to save() trained file, I try to directly save("train.xml"); but when I run this program, appear a error, it is image description

I want to know can the method create a new file? or I should open a file called train.xml, and then save it, I hope get your help,thanks!

2014-04-21 08:19:01 -0600 asked a question facerecognizer save() method

I miss a problem when I using the save() method in my face recognizer project. My code is:

    Ptr<FaceRecognizer> model = createEigenFaceRecognizer();
model->set("threshold",100.0);
model->train(images,labels);
model->save("/sdcard/Train_model.xml");

I can't open the file /sdcard/Train_model.xml in my project. I want to know whether the save method can create a new file. I hope that I can get your help,thanks My error isimage description

2014-04-21 03:34:14 -0600 commented question I am developing face recognize on android,why the predict method always return 0

thank you, when I add the model->set("threshold",0.0) method, the return is not 0,but -1, could you tell me how many values is suitable for setting the threshold. thanks again!

2014-04-21 03:23:10 -0600 received badge  Editor (source)
2014-04-21 03:17:52 -0600 commented question I am developing face recognize on android,why the predict method always return 0

the closest is meaning first push_back()? I really don't set the threshold, but I using threshold init the createFisherFaceRecognizer() method.

2014-04-21 02:32:15 -0600 asked a question I am developing face recognize on android,why the predict method always return 0

I was developing face recognize on android, but I missed a problem, when I use the predict method to predict persons, the return values is 0 everytime. The api sad that -1 states this face is unknown. Now,I want to know why is it. could you help me. thanks! My code

vector<Mat> images;
vector<jint> labels;
jint num_components = 10;
jdouble threshold = 10.0;
Mat& predictImg = *(Mat*)predictImgAddr;
//person1
images.push_back(imread("/sdcard/s1/1.bmp"));
labels.push_back(0);
images.push_back(imread("/sdcard/s1/2.bmp"));
labels.push_back(0);
images.push_back(imread("/sdcard/s1/3.bmp"));
labels.push_back(0);
images.push_back(imread("/sdcard/s1/4.bmp"));
labels.push_back(0);

//person2
images.push_back(imread("/sdcard/s2/1.bmp"));
labels.push_back(1);
images.push_back(imread("/sdcard/s2/2.bmp"));
labels.push_back(1);
images.push_back(imread("/sdcard/s2/3.bmp"));
labels.push_back(1);
images.push_back(imread("/sdcard/s2/4.bmp"));
labels.push_back(1);
Ptr<FaceRecognizer> model = createFisherFaceRecognizer(num_components, threshold);
model->train(images,labels);
jint predicted = model->predict(predictImg);
return predicted; `
2014-04-19 21:14:13 -0600 answered a question Update method in Face Recognizer

I am using opencv 2.4.8 for recognize face, but I can't find the method createLBPHFaceRecognizer(), could you help me ,thanks

2014-04-19 20:41:51 -0600 received badge  Supporter (source)
2014-04-19 20:28:57 -0600 answered a question Computing LBP Histogram in OpenCV

I'am also have this problem,I cant't find any methods of the createEigenFaceRecognizer(),createFisherFaceRecognizer(),createLBPHFaceRecognizer() , and I want to know the ways you slove the problem.