Reputation: 811
I am trying to do image processing on images that i get from camera frames with Vuforia QCAR. And for that i want to use OpenCV.
I want to send the pixels as byte arrays to openCv from Vuforia. But i dont know how to do it. I know how to reach java methods from native part or vice versa, but i couldnt find a starting point about how to call a native function from another library.
One more question, can i just invoke the OpenCV methods in native(c++) part of Vuforia? So that i dont have to just send the bytes to another class?
I am a bit confused
Thanks
Upvotes: 2
Views: 1748
Reputation: 349
Yes, you can work with OpenCV strictly in native code along with Vuforia. It's not totally clear if what you're trying to do is in real-time or not, however, it'll be more efficient if you do the computer vision stuff in C/C++.
Here's an example of how you could create an OpenCV Mat using a QCAR::Image.
Mat grayImage = Mat(QCARImage->getHeight(), QCARImage->getWidth(), CV_8UC1, (unsigned char *)QCARImage->getPixels());
Once you instantiate the Mat with a pointer to the QCAR image data, you can go about doing image processing and computer vision as you normally would with OpenCV.
Upvotes: 2