android - Is opencv manager is compulsory to install? -
If we are trying to apply using If you are running full image processing using OpenCV NDK (which is quite possible) So OpenCV Manager is not required. Data from the preview of the camera can be moved to your function written in the original C / C ++, where you can convert it to BGR / BGRA. One outline of that would be the following: Code in Java Where width and height image / camera is the width and height of the preview I'm assuming that you can process the frame with the camera Are there. In that case you can pass data from the camera which comes in the form of a byte array. In the C / C ++ code, you can convert the camera data to BGR using the following snippet. Note that the default camera image format in most Android OS is NV21, but you can change it. Code C / C ++ You can now use matImg to do processing. In this case the integration of OpenCV manager can be avoided. All you need to do is ensure that the makefile has the correct link for opencv.mk. opencv , then the OdCV Manager Is Ndk mandatory to install? Is there any alternative to this so that nobody has to install OpenCiv Management because it looks strange if the customer has to install OpenCiv Management with our application.
Public resident zero jniPart (int width, integer height, byte [] data);
JNIEXPORT jstring JNICALL Java_com_example_AppName_ClassName_jniPart (JNIEnv * env, Jobsjekt j_this, jint width, jint height, jbyteArray yuvdata) {. . Jbyte * _yuv = env- & gt; GetByteArrayElements (yuv, 0); Mat nv21img (height + height / 2, width, CV_ 8 UC1, (unsigned char *) _UUV); Mat matIgg (height, width, CV_8UC3); CvtColor (nv21img, matImg, CV_YUV2BGR_NV21, 4); . }
Comments
Post a Comment