OpenCV for Unity 2.6.3
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.
Loading...
Searching...
No Matches
OpenCVForUnity.UnityUtils.Helper.VideoCaptureCameraInput2MatHelper Class Reference

VideoCaptureCameraInput 2 mat helper. v 1.0.2 Depends on OpenCVForUnity version 2.6.1 (WebCamTexture2MatHelper v 1.0.1) or later. (Use the WebCamDevice.isFrontFacing and WebCamTexture.videoRotationAngle properties to flip the camera input image in VideoCaptue to the correct orientation.) More...

Inheritance diagram for OpenCVForUnity.UnityUtils.Helper.VideoCaptureCameraInput2MatHelper:
OpenCVForUnity.UnityUtils.Helper.WebCamTexture2MatHelper OpenCVForUnity.UnityUtils.Helper.ICameraSource2MatHelper OpenCVForUnity.UnityUtils.Helper.ISource2MatHelper

Public Member Functions

virtual VideoCapture GetVideoCapture ()
 Return the VideoCapture instanse.
 
- Public Member Functions inherited from OpenCVForUnity.UnityUtils.Helper.WebCamTexture2MatHelper
virtual void Initialize (bool autoPlay=true)
 Initialize this instance.
 
virtual void Initialize (int requestedWidth, int requestedHeight, bool autoPlay=true)
 Initialize this instance.
 
virtual void Initialize (bool requestedIsFrontFacing, float requestedFPS=30f, bool rotate90Degree=false, bool autoPlay=true)
 Initialize this instance.
 
virtual void Initialize (string deviceName, int requestedWidth, int requestedHeight, bool requestedIsFrontFacing=false, float requestedFPS=30f, bool rotate90Degree=false, bool autoPlay=true)
 Initialize this instance.
 
virtual bool IsInitialized ()
 Indicate whether this instance has been initialized.
 
virtual void Play ()
 Start the active camera.
 
virtual void Pause ()
 Pause the active camera.
 
virtual void Stop ()
 Stop the active camera.
 
virtual bool IsPlaying ()
 Indicate whether the active camera is currently playing.
 
virtual bool IsPaused ()
 Indicate whether the camera is paused.
 
virtual bool IsFrontFacing ()
 Indicate whether the active camera device is currently front facng.
 
virtual string GetDeviceName ()
 Return the active camera device name.
 
virtual int GetWidth ()
 Return the active camera width.
 
virtual int GetHeight ()
 Return the active camera height.
 
virtual float GetFPS ()
 Return the active camera framerate.
 
virtual WebCamTexture GetWebCamTexture ()
 Return the active WebcamTexture.
 
virtual WebCamDevice GetWebCamDevice ()
 Return the active WebcamDevice.
 
virtual Matrix4x4 GetCameraToWorldMatrix ()
 Return the camera to world matrix.
 
virtual Matrix4x4 GetProjectionMatrix ()
 Return the projection matrix matrix.
 
virtual Source2MatHelperColorFormat GetBaseColorFormat ()
 Return the video base color format.
 
virtual bool DidUpdateThisFrame ()
 Indicate whether the video buffer of the frame has been updated.
 
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.
 
virtual Color32[] GetBufferColors ()
 Get the buffer colors.
 
virtual void Dispose ()
 Releases all resource used by the WebCamTexture2MatHelper object.
 
- Public Member Functions inherited from OpenCVForUnity.UnityUtils.Helper.ICameraSource2MatHelper
- Public Member Functions inherited from OpenCVForUnity.UnityUtils.Helper.ISource2MatHelper

Additional Inherited Members

- Protected Member Functions inherited from OpenCVForUnity.UnityUtils.Helper.WebCamTexture2MatHelper
virtual void OnValidate ()
 
virtual void Update ()
 
virtual IEnumerator OnApplicationFocus (bool hasFocus)
 
virtual void OnDestroy ()
 Raises the destroy event.
 
virtual IEnumerator _Initialize ()
 Initialize this instance by coroutine.
 
virtual IEnumerator hasUserAuthorizedCameraPermission ()
 Check camera permission state by coroutine.
 
virtual void FlipMat (Mat mat, bool flipVertical, bool flipHorizontal)
 Flip the mat.
 
virtual void CancelInitCoroutine ()
 Cancel Init Coroutine.
 
virtual void ReleaseResources ()
 To release the resources.
 
- Protected Attributes inherited from OpenCVForUnity.UnityUtils.Helper.WebCamTexture2MatHelper
string _requestedDeviceName = null
 Set the name of the camera device to use. (or device index number)
 
int _requestedWidth = 640
 Set the width of camera.
 
int _requestedHeight = 480
 Set the height of camera.
 
bool _requestedIsFrontFacing = false
 Set whether to use the front facing camera.
 
float _requestedFPS = 30f
 Set the frame rate of camera.
 
bool _rotate90Degree = false
 Set whether to rotate camera frame 90 degrees. (clockwise)
 
bool _flipVertical = false
 Set whether to flip vertically.
 
bool _flipHorizontal = false
 Set whether to flip horizontal.
 
Source2MatHelperColorFormat _outputColorFormat = Source2MatHelperColorFormat.RGBA
 Select the output color format.
 
int _timeoutFrameCount = 1500
 The number of frames before the initialization process times out.
 
UnityEvent _onInitialized
 UnityEvent that is triggered when this instance is initialized.
 
UnityEvent _onDisposed
 UnityEvent that is triggered when this instance is disposed.
 
Source2MatHelperErrorUnityEvent _onErrorOccurred
 UnityEvent that is triggered when this instance is error Occurred.
 
WebCamTexture webCamTexture
 The active WebcamTexture.
 
WebCamDevice webCamDevice
 The active WebcamDevice.
 
Mat frameMat
 The frame mat.
 
Mat baseMat
 The base mat.
 
Mat rotatedFrameMat
 The rotated frame mat.
 
Color32[] colors
 The buffer colors.
 
Source2MatHelperColorFormat baseColorFormat = Source2MatHelperColorFormat.RGBA
 The base color format.
 
bool isInitWaiting = false
 Indicates whether this instance is waiting for initialization to complete.
 
bool hasInitDone = false
 Indicates whether this instance has been initialized.
 
IEnumerator initCoroutine
 The initialization coroutine.
 
ScreenOrientation screenOrientation
 The orientation of the screen.
 
int screenWidth
 The width of the screen.
 
int screenHeight
 The height of the screen.
 
bool autoPlayAfterInitialize
 If set to true play after completion of initialization.
 
bool isScreenSizeChangeWaiting = false
 
- Properties inherited from OpenCVForUnity.UnityUtils.Helper.WebCamTexture2MatHelper
virtual string requestedDeviceName [get, set]
 
virtual int requestedWidth [get, set]
 
virtual int requestedHeight [get, set]
 
virtual bool requestedIsFrontFacing [get, set]
 
virtual float requestedFPS [get, set]
 
virtual bool rotate90Degree [get, set]
 
virtual bool flipVertical [get, set]
 
virtual bool flipHorizontal [get, set]
 
virtual Source2MatHelperColorFormat outputColorFormat [get, set]
 
virtual int timeoutFrameCount [get, set]
 
UnityEvent onInitialized [get, set]
 
UnityEvent onDisposed [get, set]
 
Source2MatHelperErrorUnityEvent onErrorOccurred [get, set]
 
- Properties inherited from OpenCVForUnity.UnityUtils.Helper.ICameraSource2MatHelper
- Properties inherited from OpenCVForUnity.UnityUtils.Helper.ISource2MatHelper

Detailed Description

VideoCaptureCameraInput 2 mat helper. v 1.0.2 Depends on OpenCVForUnity version 2.6.1 (WebCamTexture2MatHelper v 1.0.1) or later. (Use the WebCamDevice.isFrontFacing and WebCamTexture.videoRotationAngle properties to flip the camera input image in VideoCaptue to the correct orientation.)

Member Function Documentation

◆ GetVideoCapture()

virtual VideoCapture OpenCVForUnity.UnityUtils.Helper.VideoCaptureCameraInput2MatHelper.GetVideoCapture ( )
virtual

Return the VideoCapture instanse.

Returns
The VideoCapture instanse.

The documentation for this class was generated from the following file: