Ask Your Question

chinadragon0515's profile - activity

2016-10-08 18:17:04 -0600 received badge  Nice Answer (source)
2016-06-24 01:45:43 -0600 received badge  Student (source)
2016-05-18 04:06:26 -0600 received badge  Teacher (source)
2015-09-01 02:46:00 -0600 received badge  Enthusiast
2015-08-27 19:20:49 -0600 commented question How to construct the parameters required by FaceRecognizer in Java

Any one has any tips or suggestions? And anyone know is there a plan to make default java interface contains FaceRecognizer in opencv 3.0?thanks.

2015-08-25 07:55:59 -0600 received badge  Necromancer (source)
2015-08-25 07:50:31 -0600 answered a question Not able to build OpenCV3-RC1 with 'Debug' build type

I met the same issue with opencv3.0.0 to be built with mingw, and I have workaround this, the way I worked around is,

edit file %OPENCV_HOME%\sources\modules\videoio\src\cap_dshow.cpp Add

#define STRSAFE_NO_DEPRECATE

At least, it works for me and pass the error.

2015-08-25 07:48:49 -0600 commented question How to construct the parameters required by FaceRecognizer in Java

Here are the code

FaceRecognizer lbphFaceRecognizer = new LBPHFaceRecognizer(); 
lbphFaceRecognizer.train(images, labels);   
int[] predictedLabel = {-1}; double[] confidence ={0.88}; 
lbphFaceRecognizer.predict(testImage, predictedLabel, confidence);
2015-08-25 00:33:17 -0600 received badge  Editor (source)
2015-08-24 01:58:44 -0600 asked a question How to construct the parameters required by FaceRecognizer in Java

I build a JNI to create LBPHFaceRecognizer, and I can get dll created as expected, but I met issue when call it during train,

Here are the code I construct the parameters for train and the exception I got,

    List<Mat> images = new ArrayList<Mat>(imageFiles.length);
    Mat labels = new Mat(imageFiles.length, 1,  CvType.CV_32SC1);
    int counter = 0;
    for (File image : imageFiles) {
        Mat img = Highgui.imread(image.getAbsolutePath());
        int label = Integer.parseInt(image.getName().split("\\-")[0]);
        images.add(counter,img);
        labels.put(counter, 1, label);
        counter++;
    }

OpenCV Error: Bad argument (The images are expected as InputArray::STD_VECTOR_MAT (a std::vector<mat>) or _InputArray::STD_VECTOR_VECTOR (a std::vector< vector<...> >).) in train, file D:\Project\javacv\opencv\opencv\sources\modules\contrib\src\facerec.cpp, line 913

Exception in thread "main" java.lang.Exception: unknown exception

at org.opencv.contrib.FaceRecognizer.predict_0(Native Method)
at org.opencv.contrib.FaceRecognizer.predict(FaceRecognizer.java:173)
at OpenCV2411FaceRecognizer.main(OpenCV2411FaceRecognizer.java:149)

Can anyone help me on this?

And when I tried to load a trained result, I just get exception with no meaningful message, any tips on how to fix this? The exception is

Exception in thread "main" java.lang.Exception: unknown exception

at org.opencv.contrib.FaceRecognizer.load_0(Native Method)
at org.opencv.contrib.FaceRecognizer.load(FaceRecognizer.java:104)
at OpenCV2411FaceRecognizer.main(OpenCV2411FaceRecognizer.java:131)
2015-08-23 03:06:43 -0600 asked a question How to implement FaceRecognizer with opencv java interface (both 2.4.11 and 3.0.0 version)

I meet some issues with face recognizer in opencv 3.0 java interface, I am using opencv java interface (not javacv), I have implemented face detection, I want to add face recognizer and looking for some interface like FaceRecognizer and method like createFisherFaceRecognizer, seems there is nojava package in opencv java interface ready for this now, do we have a plan to add this? How can I implement FaceRecoginizer java interface in opencv 3.0? How I implement createFisherFaceRecognizer in opencv 3.0? Do we have some guide or tutorial for this?

I also check opencv 2.4.11 java interface , I find it has class named FaceRecognizer, but I did not find method like createFisherFaceRecognizer, how can I created a FisherFaceRecognizer in 2.4.11? Do we have some guide or tutorial for this?

thanks in advance.