Exacly as stated in the subject: What is the difference between opencv.android.JavaCameraView
and opencv.android.NativeCameraView
. What are advanta
From the OpenCV documentation:
The org.opencv.android.JavaCameraView
class is implemented inside OpenCV library. It is inherited from CameraBridgeViewBase
, that extends SurfaceView
and uses standard Android camera API. Alternatively you can use org.opencv.android.NativeCameraView
class, that implements the same interface, but uses VideoCapture
class as camera access back-end. opencv:show_fps="true"
and opencv:camera_id="any"
options enable FPS message and allow to use any camera on device. Application tries to use back camera first.
Implementation of CvCameraViewListener
interface allows you to add processing steps after frame grabbing from camera and before its rendering on screen. The most important function is onCameraFrame
. It is callback function and it is called on retrieving frame from camera. The callback input is object of CvCameraViewFrame
class that represents frame from camera.
I just took this answer from here (Which is a bit old answer) and added what I experienced:
native camera:
(+1) higher framerate
(+1) capture RGBA, no need to convert from android yuv format.
I hope this can be helpful !