Reading values in opencv_face.LBPHFaceRecognizer.getHistograms()

后端 未结 1 536
南旧
南旧 2021-01-28 00:52

I am trying to work with the open_cv library in android. I have never worked on it before, so this may be a very basic question.

I have an opencv_face.LBPHFaceReco

相关标签:
1条回答
  • 2021-01-28 01:15

    I was able to read the values by converting opencv_core.Mat to opencv_core.CvMat object. I don't know for what reason this object is marked deprecated but this worked fine for me:

                double[][] input = new double[(int)vector.size()][vector.get(0).size().width()];
                for (int i = 0; i < vector.size(); i++) {
                    opencv_core.Mat mat = vector.get(i);
                    (new opencv_core.CvMat(mat)).get(input[i]);
                }
    

    input variable here now had required values of all the histograms.

    0 讨论(0)
提交回复
热议问题