org.opencv.android
Class JavaCameraView
java.lang.Object
SurfaceView
org.opencv.android.CameraBridgeViewBase
org.opencv.android.JavaCameraView
public class JavaCameraView
- extends CameraBridgeViewBase
This class is an implementation of the Bridge View between OpenCV and Java Camera.
This class relays on the functionality available in base class and only implements
required functions:
connectCamera - opens Java camera and sets the PreviewCallback to be delivered.
disconnectCamera - closes the camera and stops preview.
When frame is delivered via callback from Camera - it processed via OpenCV to be
converted to RGBA32 and then passed to the external callback for modifications if required.
Field Summary |
protected Camera |
mCamera
|
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. |
protected boolean |
initializeCamera(int width,
int height)
|
void |
onPreviewFrame(byte[] frame,
Camera arg1)
|
protected void |
releaseCamera()
|
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 Camera mCamera
JavaCameraView
public JavaCameraView(Context context,
AttributeSet attrs)
JavaCameraView
public JavaCameraView(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
initializeCamera
protected boolean initializeCamera(int width,
int height)
onPreviewFrame
public void onPreviewFrame(byte[] frame,
Camera arg1)
releaseCamera
protected void releaseCamera()