What is the difference between `opencv.android.JavaCameraView` and `opencv.android.NativeCameraView`

Exacly as stated in the subject: What is the difference between opencv.android.JavaCameraView and opencv.android.NativeCameraView. What are advantages one over the other, the main ones, which gives more options?

  • Use of Dialogs vs Activities
  • Get Touch Coordinates Relative To A View (ScreenToClient Equivalent?)
  • Change EditText hint color when using TextInputLayout
  • How to load a bitmap into an image-view with Picasso
  • How to tell screen resolution in “DP”?
  • Play notification default sound only (Android)
  • Related posts:

    Android AudioRecord example
    Displaying dates in localized format on Android
    Is there a list of what device has what abstracted dpi and screen size?
    How to make a dialog slide from bottom to middle of screen in android
    Android Navigation Bar covering viewpager content
    The difference between GCM and PARSE push messages
  • I need to download several images to directory so that content can be accessed offline
  • Android ContentProvider database query multiple tables
  • How to update Android ListView with dynamic data in real time?
  • Set a drawable as background programmatically
  • How to keep the OAuth consumer secret safe, and how to react when it's compromised?
  • Change Google Place Picker Appbar Text Color
  • 2 Solutions collect form web for “What is the difference between `opencv.android.JavaCameraView` and `opencv.android.NativeCameraView`”

    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.

    • “compiled only for armv7 architecture” not true anymore.
    • (-1) not work on all devices -> I confirm !! This is why I don’t use it !! see bug 2359.
    • (-1) not support autofocus, setting gain.. (answered in 2012)

    I hope this can be helpful !

    Android Babe is a Google Android Fan, All about Android Phones, Android Wear, Android Dev and Android Games Apps and so on.