`opencv.android.JavaCameraView` 和 `opencv.android.NativeCameraView` 有什么区别 [英] What is the difference between `opencv.android.JavaCameraView` and `opencv.android.NativeCameraView`

查看:30
本文介绍了`opencv.android.JavaCameraView` 和 `opencv.android.NativeCameraView` 有什么区别的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

正如主题中所述:opencv.android.JavaCameraViewopencv.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?

推荐答案

来自 OpenCV 文档:

org.opencv.android.JavaCameraView 类在 OpenCV 库中实现.它继承自 CameraBridgeViewBase,扩展了 SurfaceView 并使用标准的 Android 相机 API.或者,您可以使用 org.opencv.android.NativeCameraView 类,该类实现相同的接口,但使用 VideoCapture 类作为相机访问后端.opencv:show_fps="true"opencv:camera_id="any" 选项启用 FPS 消息并允许使用设备上的任何相机.应用程序首先尝试使用后置摄像头.

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.

CvCameraViewListener 接口的实现允许您在从相机抓取帧之后和在屏幕上渲染之前添加处理步骤.最重要的功能是onCameraFrame.它是回调函数,在从相机检索帧时调用.回调输入是 CvCameraViewFrame 类的对象,代表来自相机的帧.

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.

这篇关于`opencv.android.JavaCameraView` 和 `opencv.android.NativeCameraView` 有什么区别的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆