OpenCV for Unity
2.6.0
Enox Software / Please refer to OpenCV official document ( http://docs.opencv.org/4.9.0/index.html ) for the details of the argument of the method.
|
VideoCapture to mat helper. v 1.0.4 More...
Classes | |
class | ErrorUnityEvent |
Public Types | |
enum | ColorFormat : int { ColorFormat.GRAY = 0, ColorFormat.RGB, ColorFormat.BGR, ColorFormat.RGBA, ColorFormat.BGRA } |
enum | ErrorCode : int { ErrorCode.UNKNOWN = 0, ErrorCode.VIDEO_FILE_NOT_EXIST, ErrorCode.VIDEO_FILE_CANT_OPEN, ErrorCode.TIMEOUT } |
Public Member Functions | |
virtual void | Initialize () |
Initializes this instance. More... | |
virtual void | Initialize (string requestedVideoFilePath) |
Initializes this instance. More... | |
virtual bool | IsInitialized () |
Indicates whether this instance has been initialized. More... | |
virtual void | Play () |
Starts the video. More... | |
virtual void | Pause () |
Pauses the video. More... | |
virtual void | Stop () |
Stops the video. More... | |
virtual bool | IsPlaying () |
Indicates whether the video is currently playing. More... | |
virtual int | GetWidth () |
Returns the video width. More... | |
virtual int | GetHeight () |
Returns the video height. More... | |
virtual float | GetFPS () |
Returns the video framerate. More... | |
virtual float | GetPosRatio () |
Returns the relative position of the video file: 0=start of the film, 1=end of the film. More... | |
virtual void | SetPosRatio (float ratio) |
Sets the relative position of the video file: 0=start of the film, 1=end of the film. More... | |
virtual ColorFormat | GetBaseColorFormat () |
Returns the video base color format. More... | |
virtual VideoCapture | GetVideoCapture () |
Returns the VideoCapture instance. More... | |
virtual bool | DidUpdateThisFrame () |
Indicates whether the video buffer of the frame has been updated. More... | |
virtual Mat | GetMat () |
Gets 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). More... | |
virtual void | Dispose () |
Releases all resource used by the VideoCaptrueToMatHelper object. More... | |
Public Attributes | |
UnityEvent | onInitialized |
UnityEvent that is triggered when this instance is initialized. More... | |
UnityEvent | onDisposed |
UnityEvent that is triggered when this instance is disposed. More... | |
ErrorUnityEvent | onErrorOccurred |
UnityEvent that is triggered when this instance is error Occurred. More... | |
Protected Member Functions | |
virtual void | OnValidate () |
virtual void | LateUpdate () |
virtual void | ReadFrame () |
virtual void | OnDestroy () |
Raises the destroy event. More... | |
virtual IEnumerator | _Initialize () |
Initializes this instance by coroutine. More... | |
virtual void | StartWaitFrameTimeThread () |
virtual void | StopWaitFrameTimeThread () |
virtual void | WaitFrameTimeThreadWorker () |
virtual int | Channels (ColorFormat type) |
virtual int | ColorConversionCodes (ColorFormat srcType, ColorFormat dstType) |
virtual void | CancelInitCoroutine () |
Cancel Init Coroutine. More... | |
virtual void | ReleaseResources () |
To release the resources. More... | |
Protected Attributes | |
string | _requestedVideoFilePath = string.Empty |
Set the video file path. More... | |
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. More... | |
ColorFormat | _outputColorFormat = ColorFormat.BGR |
Select the output color format. More... | |
int | _timeoutFrameCount = 1500 |
The number of frames before the initialization process times out. More... | |
bool | _loop = true |
Indicates whether to play this video in a loop. More... | |
System.Object | videoCaptureLockObject = new System.Object() |
The VideoCapture. More... | |
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. More... | |
Mat | baseMat |
The base mat. More... | |
System.Object | imageBufferMatLockObject = new System.Object() |
The image buffer mat. More... | |
Mat | _imageBufferMat |
ColorFormat | baseColorFormat = ColorFormat.BGR |
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... | |
IEnumerator | getFilePathCoroutine |
The get file path coroutine. More... | |
bool | _isThreadRunning = false |
bool | _shouldStopThread = false |
Properties | |
virtual string | requestedVideoFilePath [get, set] |
virtual int | apiPreference [get, set] |
virtual ColorFormat | outputColorFormat [get, set] |
virtual int | timeoutFrameCount [get, set] |
virtual bool | loop [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] |
VideoCapture to mat helper. v 1.0.4
|
strong |
|
strong |
|
protectedvirtual |
Initializes this instance by coroutine.
|
protectedvirtual |
Cancel Init Coroutine.
|
protectedvirtual |
|
protectedvirtual |
|
virtual |
Indicates whether the video buffer of the frame has been updated.
true
, if the video buffer has been updated false
otherwise.
|
virtual |
Releases all resource used by the VideoCaptrueToMatHelper object.
Call Dispose when you are finished using the VideoCaptrueToMatHelper. The Dispose method leaves the VideoCaptrueToMatHelper in an unusable state. After calling Dispose, you must release all references to the VideoCaptrueToMatHelper so the garbage collector can reclaim the memory that the VideoCaptrueToMatHelper was occupying.
|
virtual |
Returns the video base color format.
|
virtual |
Returns the video framerate.
|
virtual |
Returns the video height.
|
virtual |
Gets 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 |
Returns the relative position of the video file: 0=start of the film, 1=end of the film.
|
virtual |
Returns the VideoCapture instance.
|
virtual |
Returns the video width.
|
virtual |
Initializes this instance.
|
virtual |
Initializes this instance.
requestedVideoFilePath | Requested video file path. |
|
virtual |
Indicates whether this instance has been initialized.
true
, if this instance has been initialized, false
otherwise.
|
virtual |
Indicates whether the video is currently playing.
true
, if the video is playing, false
otherwise.
|
protectedvirtual |
|
protectedvirtual |
Raises the destroy event.
|
protectedvirtual |
|
virtual |
Pauses the video.
|
virtual |
Starts the video.
|
protectedvirtual |
|
protectedvirtual |
To release the resources.
|
virtual |
Sets 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. |
|
protectedvirtual |
|
virtual |
Stops the video.
|
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 |
Indicates whether to play this video in a loop.
|
protected |
Select the output color format.
|
protected |
Set the video file path.
|
protected |
|
protected |
The number of frames before the initialization process times out.
|
protected |
|
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.
UnityEvent OpenCVForUnity.UnityUtils.Helper.VideoCaptureToMatHelper.onDisposed |
UnityEvent that is triggered when this instance is disposed.
ErrorUnityEvent OpenCVForUnity.UnityUtils.Helper.VideoCaptureToMatHelper.onErrorOccurred |
UnityEvent that is triggered when this instance is error Occurred.
UnityEvent OpenCVForUnity.UnityUtils.Helper.VideoCaptureToMatHelper.onInitialized |
UnityEvent that is triggered when this instance is initialized.
|
protected |
|
protected |
The VideoCapture.
|
getset |
|
getsetprotected |
|
getsetprotected |
|
getsetprotected |
|
getsetprotected |
|
getsetprotected |
|
getsetprotected |
|
getset |
|
getset |
|
getset |
|
getsetprotected |
|
getset |
|
getsetprotected |