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.
|
VideoCapture 2 mat helper. v 1.0.1. More...
Public Member Functions | |
virtual void | Initialize (bool autoPlay=true) |
Initialize this instance. | |
virtual void | Initialize (string requestedVideoFilePath, bool autoPlay=true) |
Initialize this instance. | |
virtual bool | IsInitialized () |
Indicate whether this instance has been initialized. | |
virtual void | Play () |
Start the video. | |
virtual void | Pause () |
Pause the video. | |
virtual void | Stop () |
Stop the video. | |
virtual bool | IsPlaying () |
Indicate whether the video is currently playing. | |
virtual bool | IsPaused () |
Indicate whether the video is paused. | |
virtual string | GetDeviceName () |
Return the active video device name. | |
virtual int | GetWidth () |
Return the video width. | |
virtual int | GetHeight () |
Return the video height. | |
virtual float | GetFPS () |
Return the video framerate. | |
virtual float | GetFramePosRatio () |
Return the relative position of the video file: 0=start of the film, 1=end of the film. | |
virtual void | SetFramePosRatio (float ratio) |
Set the relative position of the video file: 0=start of the film, 1=end of the film. | |
virtual int | GetFrameIndex () |
Return the video frame index. | |
virtual void | SetFrameIndex (int index) |
Set the video frame index. | |
virtual int | GetFrameCount () |
Return the number of frames in the current video content. | |
virtual Source2MatHelperColorFormat | GetBaseColorFormat () |
Return the video base color format. | |
virtual VideoCapture | GetVideoCapture () |
Return the VideoCapture instance. | |
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). | |
virtual void | Dispose () |
Releases all resource used by the VideoCapture2MatHelper object. | |
Public Member Functions inherited from OpenCVForUnity.UnityUtils.Helper.IVideoSource2MatHelper | |
Public Member Functions inherited from OpenCVForUnity.UnityUtils.Helper.ISource2MatHelper |
Protected Member Functions | |
virtual void | OnValidate () |
virtual void | LateUpdate () |
virtual void | ReadFrame () |
virtual void | OnDestroy () |
Raises the destroy event. | |
virtual IEnumerator | _Initialize () |
Initialize this instance by coroutine. | |
virtual void | StartWaitFrameTimeThread () |
virtual void | StopWaitFrameTimeThread () |
virtual void | WaitFrameTimeThreadWorker () |
virtual void | CancelInitCoroutine () |
Cancel Init Coroutine. | |
virtual void | ReleaseResources () |
To release the resources. | |
Protected Attributes | |
string | _requestedVideoFilePath = string.Empty |
Set the video file path, relative to the starting point of the "StreamingAssets" folder, or absolute path. | |
int | _apiPreference = Videoio.CAP_ANY |
Set the apiPreference. VideoCapture API backends identifier. (Advanced Option) See ReadMe.pdf for setup instructions for using CAP_FFMPEG on Windows platforms. | |
Source2MatHelperColorFormat | _outputColorFormat = Source2MatHelperColorFormat.BGR |
Select the output color format. | |
int | _timeoutFrameCount = 1500 |
The number of frames before the initialization process times out. | |
bool | _loop = true |
Indicate whether to play this video in a loop. | |
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. | |
System.Object | videoCaptureLockObject = new System.Object() |
VideoCapture | _videoCapture |
System.Object | sync = new System.Object() |
bool | _isReading = false |
bool | _isPlaying = false |
bool | _didUpdateThisFrame = false |
bool | _didUpdateImageBufferInCurrentFrame = false |
Mat | frameMat |
The frame mat. | |
Mat | baseMat |
The base mat. | |
System.Object | imageBufferMatLockObject = new System.Object() |
The image buffer mat. | |
Mat | _imageBufferMat |
Source2MatHelperColorFormat | baseColorFormat = Source2MatHelperColorFormat.BGR |
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. | |
IEnumerator | getFilePathCoroutine |
The get file path coroutine. | |
bool | _isThreadRunning = false |
bool | _shouldStopThread = false |
bool | autoPlayAfterInitialize |
If set to true play after completion of initialization. | |
Properties | |
virtual string | requestedVideoFilePath [get, set] |
virtual int | apiPreference [get, set] |
virtual Source2MatHelperColorFormat | outputColorFormat [get, set] |
virtual int | timeoutFrameCount [get, set] |
virtual bool | loop [get, set] |
UnityEvent | onInitialized [get, set] |
UnityEvent | onDisposed [get, set] |
Source2MatHelperErrorUnityEvent | onErrorOccurred [get, set] |
VideoCapture | videoCapture [get, set] |
virtual bool | isReading [get, set] |
virtual bool | isPlaying [get, set] |
virtual bool | didUpdateThisFrame [get, set] |
virtual bool | didUpdateImageBufferInCurrentFrame [get, set] |
Mat | imageBufferMat [get, set] |
virtual bool | isThreadRunning [get, set] |
virtual bool | shouldStopThread [get, set] |
Properties inherited from OpenCVForUnity.UnityUtils.Helper.IVideoSource2MatHelper | |
Properties inherited from OpenCVForUnity.UnityUtils.Helper.ISource2MatHelper |
VideoCapture 2 mat helper. v 1.0.1.
By setting outputColorFormat to BGR, 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 VideoCapture2MatHelper object.
Call Dispose when you are finished using the VideoCapture2MatHelper. The Dispose method leaves the VideoCapture2MatHelper in an unusable state. After calling Dispose, you must release all references to the VideoCapture2MatHelper so the garbage collector can reclaim the memory that the VideoCapture2MatHelper was occupying.
Implements OpenCVForUnity.UnityUtils.Helper.ISource2MatHelper.
|
virtual |
Return the video base color format.
Implements OpenCVForUnity.UnityUtils.Helper.ISource2MatHelper.
|
virtual |
Return the active video device name.
Implements OpenCVForUnity.UnityUtils.Helper.ISource2MatHelper.
|
virtual |
Return the video framerate.
Implements OpenCVForUnity.UnityUtils.Helper.IVideoSource2MatHelper.
|
virtual |
Return the number of frames in the current video content.
Implements OpenCVForUnity.UnityUtils.Helper.IVideoSource2MatHelper.
|
virtual |
Return the video frame index.
Implements OpenCVForUnity.UnityUtils.Helper.IVideoSource2MatHelper.
|
virtual |
Return the relative position of the video file: 0=start of the film, 1=end of the film.
Implements OpenCVForUnity.UnityUtils.Helper.IVideoSource2MatHelper.
|
virtual |
Return the video 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).
Implements OpenCVForUnity.UnityUtils.Helper.ISource2MatHelper.
|
virtual |
Return the VideoCapture instance.
|
virtual |
Return the video width.
Implements OpenCVForUnity.UnityUtils.Helper.ISource2MatHelper.
|
virtual |
Initialize this instance.
autoPlay | If set to true play after completion of initialization. |
Implements OpenCVForUnity.UnityUtils.Helper.ISource2MatHelper.
|
virtual |
Initialize this instance.
requestedVideoFilePath | Requested video file path. |
autoPlay | If set to true play after completion of initialization. |
|
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 video is paused.
true
, if the video is paused, false
otherwise.Implements OpenCVForUnity.UnityUtils.Helper.ISource2MatHelper.
|
virtual |
Indicate whether the video is currently playing.
true
, if the video is playing, false
otherwise.Implements OpenCVForUnity.UnityUtils.Helper.ISource2MatHelper.
|
protectedvirtual |
|
protectedvirtual |
Raises the destroy event.
|
protectedvirtual |
|
virtual |
Pause the video.
Implements OpenCVForUnity.UnityUtils.Helper.ISource2MatHelper.
|
virtual |
Start the video.
Implements OpenCVForUnity.UnityUtils.Helper.ISource2MatHelper.
|
protectedvirtual |
|
protectedvirtual |
To release the resources.
|
virtual |
Set the video frame index.
index | The video frame index. |
Implements OpenCVForUnity.UnityUtils.Helper.IVideoSource2MatHelper.
|
virtual |
Set the relative position of the video file: 0=start of the film, 1=end of the film.
ratio | The relative position of the video file: 0=start of the film, 1=end of the film. |
Implements OpenCVForUnity.UnityUtils.Helper.IVideoSource2MatHelper.
|
protectedvirtual |
|
virtual |
Stop the video.
Implements OpenCVForUnity.UnityUtils.Helper.ISource2MatHelper.
|
protectedvirtual |
|
protectedvirtual |
|
protected |
Set the apiPreference. VideoCapture API backends identifier. (Advanced Option) See ReadMe.pdf for setup instructions for using CAP_FFMPEG on Windows platforms.
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
Indicate whether to play this video in a loop.
|
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 video file path, relative to the starting point of the "StreamingAssets" folder, or absolute path.
|
protected |
|
protected |
The number of frames before the initialization process times out.
|
protected |
|
protected |
If set to true play after completion of initialization.
|
protected |
The base color format.
|
protected |
The base mat.
|
protected |
The frame mat.
|
protected |
The get file path coroutine.
|
protected |
Indicates whether this instance has been initialized.
|
protected |
The image buffer mat.
|
protected |
The initialization coroutine.
|
protected |
Indicates whether this instance is waiting for initialization to complete.
|
protected |
|
protected |
|
getset |
|
getsetprotected |
|
getsetprotected |
|
getsetprotected |
|
getsetprotected |
|
getsetprotected |
|
getsetprotected |
|
getset |
|
getset |
|
getset |
|
getset |
|
getset |
|
getset |
|
getsetprotected |
|
getset |
|
getsetprotected |