OpenCV for Unity
2.6.2
Enox Software / Please refer to OpenCV official document ( http://docs.opencv.org/4.10.0/index.html ) for the details of the argument of the method.
|
WebCamTexture 2 mat helper. v 1.0.0 More...
Public Member Functions | |
virtual void | Initialize (bool autoPlay=true) |
Initialize this instance. More... | |
virtual void | Initialize (int requestedWidth, int requestedHeight, bool autoPlay=true) |
Initialize this instance. More... | |
virtual void | Initialize (bool requestedIsFrontFacing, float requestedFPS=30f, bool rotate90Degree=false, bool autoPlay=true) |
Initialize this instance. More... | |
virtual void | Initialize (string deviceName, int requestedWidth, int requestedHeight, bool requestedIsFrontFacing=false, float requestedFPS=30f, bool rotate90Degree=false, bool autoPlay=true) |
Initialize this instance. More... | |
virtual bool | IsInitialized () |
Indicate whether this instance has been initialized. More... | |
virtual void | Play () |
Start the active camera. More... | |
virtual void | Pause () |
Pause the active camera. More... | |
virtual void | Stop () |
Stop the active camera. More... | |
virtual bool | IsPlaying () |
Indicate whether the active camera is currently playing. More... | |
virtual bool | IsPaused () |
Indicate whether the camera is paused. More... | |
virtual bool | IsFrontFacing () |
Indicate whether the active camera device is currently front facng. More... | |
virtual string | GetDeviceName () |
Return the active camera device name. More... | |
virtual int | GetWidth () |
Return the active camera width. More... | |
virtual int | GetHeight () |
Return the active camera height. More... | |
virtual float | GetFPS () |
Return the active camera framerate. More... | |
virtual WebCamTexture | GetWebCamTexture () |
Return the active WebcamTexture. More... | |
virtual WebCamDevice | GetWebCamDevice () |
Return the active WebcamDevice. More... | |
virtual Matrix4x4 | GetCameraToWorldMatrix () |
Return the camera to world matrix. More... | |
virtual Matrix4x4 | GetProjectionMatrix () |
Return the projection matrix matrix. More... | |
virtual Source2MatHelperColorFormat | GetBaseColorFormat () |
Return the video base color format. More... | |
virtual bool | DidUpdateThisFrame () |
Indicate whether the video buffer of the frame has been updated. More... | |
virtual Mat | GetMat () |
Get the mat of the current frame. The Mat object's type is 'CV_8UC4' or 'CV_8UC3' or 'CV_8UC1' (ColorFormat is determined by the outputColorFormat setting). Please do not dispose of the returned mat as it will be reused. More... | |
virtual Color32 [] | GetBufferColors () |
Get the buffer colors. More... | |
virtual void | Dispose () |
Releases all resource used by the WebCamTextureToMatHelper object. More... | |
Protected Member Functions | |
virtual void | OnValidate () |
virtual void | Update () |
virtual IEnumerator | OnApplicationFocus (bool hasFocus) |
virtual void | OnDestroy () |
Raises the destroy event. More... | |
virtual IEnumerator | _Initialize () |
Initialize this instance by coroutine. More... | |
virtual IEnumerator | hasUserAuthorizedCameraPermission () |
Check camera permission state by coroutine. More... | |
virtual void | FlipMat (Mat mat, bool flipVertical, bool flipHorizontal) |
Flip the mat. More... | |
virtual void | CancelInitCoroutine () |
Cancel Init Coroutine. More... | |
virtual void | ReleaseResources () |
To release the resources. More... | |
Protected Attributes | |
string | _requestedDeviceName = null |
Set the name of the camera device to use. (or device index number) More... | |
int | _requestedWidth = 640 |
Set the width of camera. More... | |
int | _requestedHeight = 480 |
Set the height of camera. More... | |
bool | _requestedIsFrontFacing = false |
Set whether to use the front facing camera. More... | |
float | _requestedFPS = 30f |
Set the frame rate of camera. More... | |
bool | _rotate90Degree = false |
Set whether to rotate camera frame 90 degrees. (clockwise) More... | |
bool | _flipVertical = false |
Set whether to flip vertically. More... | |
bool | _flipHorizontal = false |
Set whether to flip horizontal. More... | |
Source2MatHelperColorFormat | _outputColorFormat = Source2MatHelperColorFormat.RGBA |
Select the output color format. More... | |
int | _timeoutFrameCount = 1500 |
The number of frames before the initialization process times out. More... | |
UnityEvent | _onInitialized |
UnityEvent that is triggered when this instance is initialized. More... | |
UnityEvent | _onDisposed |
UnityEvent that is triggered when this instance is disposed. More... | |
Source2MatHelperErrorUnityEvent | _onErrorOccurred |
UnityEvent that is triggered when this instance is error Occurred. More... | |
WebCamTexture | webCamTexture |
The active WebcamTexture. More... | |
WebCamDevice | webCamDevice |
The active WebcamDevice. More... | |
Mat | frameMat |
The frame mat. More... | |
Mat | baseMat |
The base mat. More... | |
Mat | rotatedFrameMat |
The rotated frame mat More... | |
Color32 [] | colors |
The buffer colors. More... | |
Source2MatHelperColorFormat | baseColorFormat = Source2MatHelperColorFormat.RGBA |
The base color format. More... | |
bool | isInitWaiting = false |
Indicates whether this instance is waiting for initialization to complete. More... | |
bool | hasInitDone = false |
Indicates whether this instance has been initialized. More... | |
IEnumerator | initCoroutine |
The initialization coroutine. More... | |
ScreenOrientation | screenOrientation |
The orientation of the screen. More... | |
int | screenWidth |
The width of the screen. More... | |
int | screenHeight |
The height of the screen. More... | |
bool | autoPlayAfterInitialize |
If set to true play after completion of initialization. More... | |
bool | isScreenSizeChangeWaiting = false |
WebCamTexture 2 mat helper. v 1.0.0
By setting outputColorFormat to RGBA, processing that does not include extra color conversion is performed.
|
protectedvirtual |
Initialize this instance by coroutine.
|
protectedvirtual |
Cancel Init Coroutine.
|
virtual |
Indicate whether the video buffer of the frame has been updated.
true
, if the video buffer has been updated false
otherwise.Implements OpenCVForUnity.UnityUtils.Helper.ISource2MatHelper.
|
virtual |
Releases all resource used by the WebCamTextureToMatHelper object.
Call Dispose when you are finished using the WebCamTextureToMatHelper. The Dispose method leaves the WebCamTextureToMatHelper in an unusable state. After calling Dispose, you must release all references to the WebCamTextureToMatHelper so the garbage collector can reclaim the memory that the WebCamTextureToMatHelper was occupying.
Implements OpenCVForUnity.UnityUtils.Helper.ISource2MatHelper.
|
protectedvirtual |
Flip the mat.
mat | Mat. |
|
virtual |
Return the video base color format.
Implements OpenCVForUnity.UnityUtils.Helper.ISource2MatHelper.
|
virtual |
Get the buffer colors.
|
virtual |
Return the camera to world matrix.
Implements OpenCVForUnity.UnityUtils.Helper.ICameraSource2MatHelper.
|
virtual |
Return the active camera device name.
Implements OpenCVForUnity.UnityUtils.Helper.ISource2MatHelper.
|
virtual |
Return the active camera framerate.
Implements OpenCVForUnity.UnityUtils.Helper.ICameraSource2MatHelper.
|
virtual |
Return the active camera height.
Implements OpenCVForUnity.UnityUtils.Helper.ISource2MatHelper.
|
virtual |
Get the mat of the current frame. The Mat object's type is 'CV_8UC4' or 'CV_8UC3' or 'CV_8UC1' (ColorFormat is determined by the outputColorFormat setting). Please do not dispose of the returned mat as it will be reused.
Implements OpenCVForUnity.UnityUtils.Helper.ISource2MatHelper.
|
virtual |
Return the projection matrix matrix.
Implements OpenCVForUnity.UnityUtils.Helper.ICameraSource2MatHelper.
|
virtual |
Return the active WebcamDevice.
|
virtual |
Return the active WebcamTexture.
|
virtual |
Return the active camera width.
Implements OpenCVForUnity.UnityUtils.Helper.ISource2MatHelper.
|
protectedvirtual |
Check camera permission state by coroutine.
|
virtual |
Initialize this instance.
autoPlay | If set to true play after completion of initialization. |
Implements OpenCVForUnity.UnityUtils.Helper.ISource2MatHelper.
|
virtual |
Initialize this instance.
requestedWidth | Requested width. |
requestedHeight | Requested height. |
autoPlay | If set to true play after completion of initialization. |
|
virtual |
Initialize this instance.
requestedIsFrontFacing | If set to true requested to using the front camera. |
requestedFPS | Requested FPS. |
rotate90Degree | If set to true requested to rotate camera frame 90 degrees. (clockwise) |
autoPlay | If set to true play after completion of initialization. |
|
virtual |
Initialize this instance.
deviceName | Device name. |
requestedWidth | Requested width. |
requestedHeight | Requested height. |
requestedIsFrontFacing | If set to true requested to using the front camera. |
requestedFPS | Requested FPS. |
rotate90Degree | If set to true requested to rotate camera frame 90 degrees. (clockwise) |
autoPlay | If set to true play after completion of initialization. |
|
virtual |
Indicate whether the active camera device is currently front facng.
true
, if the active camera device is front facng, false
otherwise.Implements OpenCVForUnity.UnityUtils.Helper.ICameraSource2MatHelper.
|
virtual |
Indicate whether this instance has been initialized.
true
, if this instance has been initialized, false
otherwise.Implements OpenCVForUnity.UnityUtils.Helper.ISource2MatHelper.
|
virtual |
Indicate whether the camera is paused.
true
, if the active camera is paused, false
otherwise.Implements OpenCVForUnity.UnityUtils.Helper.ISource2MatHelper.
|
virtual |
Indicate whether the active camera is currently playing.
true
, if the active camera is playing, false
otherwise.Implements OpenCVForUnity.UnityUtils.Helper.ISource2MatHelper.
|
protectedvirtual |
|
protectedvirtual |
Raises the destroy event.
|
protectedvirtual |
|
virtual |
Pause the active camera.
Implements OpenCVForUnity.UnityUtils.Helper.ISource2MatHelper.
|
virtual |
Start the active camera.
Implements OpenCVForUnity.UnityUtils.Helper.ISource2MatHelper.
|
protectedvirtual |
To release the resources.
|
virtual |
Stop the active camera.
Implements OpenCVForUnity.UnityUtils.Helper.ISource2MatHelper.
|
protectedvirtual |
|
protected |
Set whether to flip horizontal.
|
protected |
Set whether to flip vertically.
|
protected |
UnityEvent that is triggered when this instance is disposed.
|
protected |
UnityEvent that is triggered when this instance is error Occurred.
|
protected |
UnityEvent that is triggered when this instance is initialized.
|
protected |
Select the output color format.
|
protected |
Set the name of the camera device to use. (or device index number)
|
protected |
Set the frame rate of camera.
|
protected |
Set the height of camera.
|
protected |
Set whether to use the front facing camera.
|
protected |
Set the width of camera.
|
protected |
Set whether to rotate camera frame 90 degrees. (clockwise)
|
protected |
The number of frames before the initialization process times out.
|
protected |
If set to true play after completion of initialization.
|
protected |
The base color format.
|
protected |
The base mat.
|
protected |
The buffer colors.
|
protected |
The frame mat.
|
protected |
Indicates whether this instance has been initialized.
|
protected |
The initialization coroutine.
|
protected |
Indicates whether this instance is waiting for initialization to complete.
|
protected |
|
protected |
The rotated frame mat
|
protected |
The height of the screen.
|
protected |
The orientation of the screen.
|
protected |
The width of the screen.
|
protected |
The active WebcamDevice.
|
protected |
The active WebcamTexture.
|
getset |
|
getset |
|
getset |
|
getset |
|
getset |
|
getset |
|
getset |
|
getset |
|
getset |
|
getset |
|
getset |
|
getset |
|
getset |