org.opencv.android
Class NativeCameraView
java.lang.Object
SurfaceView
org.opencv.android.CameraBridgeViewBase
org.opencv.android.NativeCameraView
public class NativeCameraView
- extends CameraBridgeViewBase
This class is an implementation of a bridge between SurfaceView and native OpenCV camera.
Due to the big amount of work done, by the base class this child is only responsible
for creating camera, destroying camera and delivering frames while camera is enabled
Method Summary |
protected boolean |
connectCamera(int width,
int height)
This method is invoked shall perform concrete operation to initialize the camera. |
protected void |
disconnectCamera()
Disconnects and release the particular camera object being connected to this surface view. |
Methods inherited from class org.opencv.android.CameraBridgeViewBase |
AllocateCache, calculateCameraFrameSize, deliverAndDrawFrame, disableFpsMeter, disableView, enableFpsMeter, enableView, SetCaptureFormat, setCvCameraViewListener, setMaxFrameSize, surfaceChanged, surfaceCreated, surfaceDestroyed |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
mCamera
protected VideoCapture mCamera
TAG
public static final java.lang.String TAG
- See Also:
- Constant Field Values
NativeCameraView
public NativeCameraView(Context context,
AttributeSet attrs)
NativeCameraView
public NativeCameraView(Context context,
int cameraId)
connectCamera
protected boolean connectCamera(int width,
int height)
- Description copied from class:
CameraBridgeViewBase
- This method is invoked shall perform concrete operation to initialize the camera.
CONTRACT: as a result of this method variables mFrameWidth and mFrameHeight MUST be
initialized with the size of the Camera frames that will be delivered to external processor.
- Specified by:
connectCamera
in class CameraBridgeViewBase
- Parameters:
width
- - the width of this SurfaceViewheight
- - the height of this SurfaceView
disconnectCamera
protected void disconnectCamera()
- Description copied from class:
CameraBridgeViewBase
- Disconnects and release the particular camera object being connected to this surface view.
Called when syncObject lock is held
- Specified by:
disconnectCamera
in class CameraBridgeViewBase