I want to use OpenCV's FaceRecognition
in java through javacv wrapper library.
I don't know how to pass images and labels to com.googlecode.javacv.cpp.opencv_contrib.FaceRecognizer.train(CvArr, CvArr)
I can use cvLoadImage(String)
or cvLoadImageM(String)
to obtain single images, but how do I make an CvArr
of them?
After some reading I found out that CvArr
is an opaque type. You just initialize with any data - it is just a C pointer after all.
So:
CvMat[] images = new CvMat[n];
images[0] = cvLoadImageM(...);
...
CvArr arr = new CvArr(new CvMatArray(images));
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With