I have recently started working on OpenCV4 Android. I was able to successfully run image mapulation samples. I wanted to secret RGB image as HSV as a test practice. I have opencvv on C ++ (windows) and know basic functions too.
Then cvtcolor fucntions take the following argument:
cvtcolor (mat src, mat dst, Imgproc COLOR_TRANSFORMATION_TYPE, number of channels);
I tried various methods to check out the output, but I was given only a preview of the camera which is a live camera view. Note: Other works such as Kenny still work (shows OUTPUT).
Also I suspect that JNI or NDK is necessary for this purpose, or did most of the applications that use the OpenCV library have written and compiled me in main link.
I'm a Starter for OpenCV4 Android. Apologies if I'm over-descriptive and all suggestions are welcome Thank you.
// METHOD 1 case imagemapulation activity. VIVI_MODE_HSV: rgba = inputFrame.rgba (); RGB Player = RGBA Crematorium (top, up + height, left, left + width); Imgproc.cvtColor (rgba, mIntermediateMat, Imgproc.COLOR_RGB2HSV_FULL); Imgproke. Cvtcolor (mIntermediateMat, rgbaInnerWindow, Imgproc.COLOR_HSV2RGB_FULL); RgbaInnerWindow.release (); break; // METHOD 2 case imagemapulation activity. VIVI_MODE_HSV: mat HSV = faucet; // rgba = inputFrame.rgba (); // rgbaInnerWindow = rgba.submat (top, up + height, left, left + width); Imgproke. CvtColor (RGBNrVindo, M-InterDiTAT, Improprop. COLOR_RGBA2RGB); Imgproc.cvtColor (mIntermediateMat, HSV, IMGROPCO COLOR_RGB2HSV_FULL); Imgproke. CvtColor (HSV, RGBNerWindo, IMGROPCO COLOR_HSV2RGB_FULL); RgbaInnerWindow.release (); break; // METHOD 3 Case ImageNalology Activity. VIVI_MODE_HSV: RGBINERWindo = RGBA Cymet (top, top + height, left, left + width); Imgproc.cvtColor (RGBNrVindo, RGBNerWindo, Improprop. COLOR_HSV2RGB_FULL); RgbaInnerWindow.release (); break;
If you want to display the HSV format image, see this code ( I do not know it has been tested, but it should work.)
Mat mRgba = inputFrame.rgba (); // MBBR is matte in BGR format, imgproke CTTER (RGBA, MBGR, IMGPRCColar_RGB2BGR, 3); // mHSV HSV format is compiled in Imgproc.cvtColor (mBgr, mHsv, imgproc.color_BGR2HSV, 3); // To display the image, we believe that the MHSV BGR is in IMPROP. CvtColor (MHSV, MRGB, IMGPRC, CLRRGR2, RGBA, 4); Apart from this I suspect that for this purpose it is necessary to use JNI i.e. NDK or most applications using the OpenCive library may have written me (written). In main_activity.java and compiled ?? No, you do not need to write native code for this, for OpenCV Java binding is enough for most applications. Even if you need to do it, it is very easy to do.
Comments
Post a Comment