OpenCV for Unity 3.0.0
Enox Software / Please refer to OpenCV official document ( http://docs.opencv.org/4.12.0/index.html ) for the details of the argument of the method.
|
Represents an augmented reality (AR) object that integrates with the ARCamera. This class manages solving Perspective-n-Point (PnP) problems, handling AR matrix transformations, and detecting whether the object is within the AR camera's viewport. More...
Public Types | |
enum | Calib3dSolvePnPFlagsMode { SOLVEPNP_ITERATIVE = Calib3d.SOLVEPNP_ITERATIVE , SOLVEPNP_EPNP = Calib3d.SOLVEPNP_EPNP , SOLVEPNP_P3P = Calib3d.SOLVEPNP_P3P , SOLVEPNP_AP3P = Calib3d.SOLVEPNP_AP3P , SOLVEPNP_DLS = Calib3d.SOLVEPNP_DLS , SOLVEPNP_UPNP = Calib3d.SOLVEPNP_UPNP , SOLVEPNP_IPPE = Calib3d.SOLVEPNP_IPPE , SOLVEPNP_IPPE_SQUARE = Calib3d.SOLVEPNP_IPPE_SQUARE , SOLVEPNP_SQPNP = Calib3d.SOLVEPNP_SQPNP , SOLVEPNP_ITERATIVE_THEN_EPNP } |
Enum to set flags for solvePnP. More... | |
Public Member Functions | |
virtual void | CalculateARMatrix (ARHelper arHelper) |
Calculate ARMatrix from set parameters. | |
virtual void | Dispose () |
Disposes resources. This method is called when OnDestroy() is called. | |
virtual Matrix4x4 | GetARMatrix () |
Get ARMatrix. | |
virtual Mat | GetRvec () |
Get rvec. | |
virtual Mat | GetTvec () |
Get tvec. | |
virtual void | Initialize () |
Initializes resources and sets the initial values. This method is called when Awake() is called. | |
virtual bool | IsARGameObjectInARCameraViewport () |
Is the ARGameObject in the ARCameraViewport? This flag is updated when CalculateARMatrix() is called. | |
virtual void | ResetImagePointsAndObjectPoints () |
Reset the imagePoints and objectPoints. | |
virtual void | UpdateTransform (ARHelper arHelper) |
Update the Transform of UpdateTarget using ARMatrix. | |
Protected Member Functions | |
virtual void | Awake () |
Awake is called when the script instance is being loaded. | |
virtual bool | IsARGameObjectInARCameraViewport (Mat tvec, Matrix4x4 projectionMatrix) |
Determines whether an AR game object is within the AR camera's viewport. | |
virtual void | OnDestroy () |
Called when the MonoBehaviour will be destroyed. This method is used to release resources and perform cleanup operations. | |
virtual void | OnValidate () |
Called when the script is loaded or a value is changed in the Inspector. | |
Protected Attributes | |
bool | _applyXaxisInversionToARMatrix = false |
bool | _applyYaxisInversionToARMatrix = false |
bool | _applyZaxisInversionToARMatrix = false |
int | _arCameraEventCount = 0 |
The number of frames to wait for the ARCamera event to fire. | |
Matrix4x4 | _arMatrix |
The transformation matrix for AR. | |
bool | _changedARMatrix = false |
The flag that indicates whether the ARMatrix has changed. | |
bool | _changedSolvePnpPoints = false |
The flag that indicates whether the SolvePnP points have changed. | |
int | _delayFrameOnEnterARCameraViewportEvent = 0 |
int | _delayFrameOnExitARCameraViewportEvent = 0 |
Vector2[] | _imagePoints = null |
Matrix4x4 | _invertXMatrix = Matrix4x4.TRS(Vector3.zero, Quaternion.identity, new Vector3(-1, 1, 1)) |
The matrix that inverts the X axis. | |
Matrix4x4 | _invertYMatrix = Matrix4x4.TRS(Vector3.zero, Quaternion.identity, new Vector3(1, -1, 1)) |
The matrix that inverts the Y axis. | |
Matrix4x4 | _invertZMatrix = Matrix4x4.TRS(Vector3.zero, Quaternion.identity, new Vector3(1, 1, -1)) |
The matrix that inverts the Z axis. | |
bool | _isARGameObjectInARCameraViewport = false |
Is the ARGameObject in the ARCameraViewport? This flag is updated when CalculateARMatrix() is called. | |
bool | _leftHandedCoordinates = false |
Vector2 | _ndcXRange = new Vector2(-1.0f, 1.0f) |
Vector2 | _ndcYRange = new Vector2(-1.0f, 1.0f) |
Vector2 | _ndcZRange = new Vector2(0.0f, 1.0f) |
Vector3[] | _objectPoints = null |
PoseData | _oldPoseData |
The old pose data. | |
UnityEvent< ARHelper, ARCamera, ARGameObject > | _onEnterARCameraViewport |
UnityEvent< ARHelper, ARCamera, ARGameObject > | _onExitARCameraViewport |
float | _positionLowPassParam = 4f |
float | _rotationLowPassParam = 2f |
Mat | _rvec |
The rvec Mat for Calib3d.solvePnP(). | |
Calib3dSolvePnPFlagsMode | _solvePnPFlagsMode = Calib3dSolvePnPFlagsMode.SOLVEPNP_ITERATIVE_THEN_EPNP |
float | _solvePnPRefineLMMovementThreshold = 100 |
Matrix4x4 | _transformMatrix |
The transformation matrix from poseData. | |
Mat | _tvec |
The tvec Mat for Calib3d.solvePnP(). | |
bool | _useLowPassFilter = false |
bool | _useSolvePnPRefineLM = false |
Properties | |
virtual bool | ApplyXaxisInversionToARMatrix [get, set] |
Apply X-axis inversion to ARMatrix. | |
virtual bool | ApplyYaxisInversionToARMatrix [get, set] |
Apply Y-axis inversion to ARMatrix. | |
virtual bool | ApplyZaxisInversionToARMatrix [get, set] |
Apply Z-axis inversion to ARMatrix. | |
virtual int | DelayFrameOnEnterARCameraViewportEvent [get, set] |
Invoke UnityEvent onEnterARCameraViewport only when the ARGameObject is in the ARCamera viewport for the specified number of consecutive frames. Prevents frequent notifications due to noise. | |
virtual int | DelayFrameOnExitARCameraViewportEvent [get, set] |
Invoke UnityEvent onEnterARCameraViewport only when the ARGameObject is outside the ARCamera viewport for the specified number of consecutive frames. Prevents frequent notifications due to noise. | |
virtual Vector2[] | ImagePoints [get, set] |
Specify the imagePoints argument to the Calib3d.solvePnP() method. | |
virtual bool | LeftHandedCoordinates [get, set] |
Enable this flag if the object point is a left-hand coordinate system (Unity). | |
virtual Vector2 | NdcXRange [get, set] |
Defines the valid range for the X coordinate in NDC space. Used in IsARGameObjectInARCameraViewport method for viewport visibility checks. | |
virtual Vector2 | NdcYRange [get, set] |
Defines the valid range for the Y coordinate in NDC space. Used in IsARGameObjectInARCameraViewport method for viewport visibility checks. | |
virtual Vector2 | NdcZRange [get, set] |
Defines the valid range for the Z coordinate in NDC space. Used in IsARGameObjectInARCameraViewport method for viewport visibility checks. | |
virtual Vector3[] | ObjectPoints [get, set] |
Specify the objectPoints argument to the Calib3d.solvePnP() method. | |
virtual UnityEvent< ARHelper, ARCamera, ARGameObject > | OnEnterARCameraViewport [get, set] |
UnityEvent notified when the ARGameObject enters the viewport of the ARCamera. | |
virtual UnityEvent< ARHelper, ARCamera, ARGameObject > | OnExitARCameraViewport [get, set] |
UnityEvent notified when the ARGameObject exits the viewport of the ARCamera. | |
virtual float | PositionLowPassParam [get, set] |
Position parameter of LowPassFilter (Value in meters) | |
virtual float | RotationLowPassParam [get, set] |
Rotation parameter of LowPassFilter (Value in degrees) | |
virtual Calib3dSolvePnPFlagsMode | SolvePnPFlagsMode [get, set] |
Specify the flags argument to the Calib3d.solvePnP() method. | |
virtual float | SolvePnPRefineLMMovementThreshold [get, set] |
If useSolvePnPRefineLM is true, the Calib3d.solvePnPRefineLM() method is called if the difference between the tvec of the current frame and that of the previous frame is greater than the specified threshold. | |
virtual bool | UseLowPassFilter [get, set] |
When enabled, LowPassFilter suppresses noise. | |
virtual bool | UseSolvePnPRefineLM [get, set] |
If this flag is set to true, the Calib3d.solvePnPRefineLM() method is called after the Calib3d.solvePnPnP() method to optimize the results. | |
Represents an augmented reality (AR) object that integrates with the ARCamera. This class manages solving Perspective-n-Point (PnP) problems, handling AR matrix transformations, and detecting whether the object is within the AR camera's viewport.
|
protectedvirtual |
Awake is called when the script instance is being loaded.
|
virtual |
Calculate ARMatrix from set parameters.
|
virtual |
Disposes resources. This method is called when OnDestroy() is called.
|
virtual |
Get ARMatrix.
|
virtual |
Get rvec.
|
virtual |
Get tvec.
|
virtual |
Initializes resources and sets the initial values. This method is called when Awake() is called.
|
virtual |
Is the ARGameObject in the ARCameraViewport? This flag is updated when CalculateARMatrix() is called.
|
protectedvirtual |
Determines whether an AR game object is within the AR camera's viewport.
tvec | The translation vector (tvec) representing the object's position in the camera coordinate system. |
projectionMatrix | The projection matrix to transform the position. |
|
protectedvirtual |
Called when the MonoBehaviour will be destroyed. This method is used to release resources and perform cleanup operations.
|
protectedvirtual |
Called when the script is loaded or a value is changed in the Inspector.
|
virtual |
Reset the imagePoints and objectPoints.
|
virtual |
Update the Transform of UpdateTarget using ARMatrix.
|
protected |
|
protected |
|
protected |
|
protected |
The number of frames to wait for the ARCamera event to fire.
|
protected |
The transformation matrix for AR.
|
protected |
The flag that indicates whether the ARMatrix has changed.
|
protected |
The flag that indicates whether the SolvePnP points have changed.
|
protected |
|
protected |
|
protected |
|
protected |
The matrix that inverts the X axis.
|
protected |
The matrix that inverts the Y axis.
|
protected |
The matrix that inverts the Z axis.
|
protected |
Is the ARGameObject in the ARCameraViewport? This flag is updated when CalculateARMatrix() is called.
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
The old pose data.
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
The rvec Mat for Calib3d.solvePnP().
|
protected |
|
protected |
|
protected |
The transformation matrix from poseData.
|
protected |
The tvec Mat for Calib3d.solvePnP().
|
protected |
|
protected |
|
getset |
Apply X-axis inversion to ARMatrix.
|
getset |
Apply Y-axis inversion to ARMatrix.
|
getset |
Apply Z-axis inversion to ARMatrix.
|
getset |
Invoke UnityEvent onEnterARCameraViewport only when the ARGameObject is in the ARCamera viewport for the specified number of consecutive frames. Prevents frequent notifications due to noise.
|
getset |
Invoke UnityEvent onEnterARCameraViewport only when the ARGameObject is outside the ARCamera viewport for the specified number of consecutive frames. Prevents frequent notifications due to noise.
|
getset |
Specify the imagePoints argument to the Calib3d.solvePnP() method.
|
getset |
Enable this flag if the object point is a left-hand coordinate system (Unity).
|
getset |
Defines the valid range for the X coordinate in NDC space. Used in IsARGameObjectInARCameraViewport method for viewport visibility checks.
|
getset |
Defines the valid range for the Y coordinate in NDC space. Used in IsARGameObjectInARCameraViewport method for viewport visibility checks.
|
getset |
Defines the valid range for the Z coordinate in NDC space. Used in IsARGameObjectInARCameraViewport method for viewport visibility checks.
|
getset |
Specify the objectPoints argument to the Calib3d.solvePnP() method.
|
getset |
UnityEvent notified when the ARGameObject enters the viewport of the ARCamera.
|
getset |
UnityEvent notified when the ARGameObject exits the viewport of the ARCamera.
|
getset |
Position parameter of LowPassFilter (Value in meters)
|
getset |
Rotation parameter of LowPassFilter (Value in degrees)
|
getset |
Specify the flags argument to the Calib3d.solvePnP() method.
|
getset |
If useSolvePnPRefineLM is true, the Calib3d.solvePnPRefineLM() method is called if the difference between the tvec of the current frame and that of the previous frame is greater than the specified threshold.
|
getset |
When enabled, LowPassFilter suppresses noise.
|
getset |
If this flag is set to true, the Calib3d.solvePnPRefineLM() method is called after the Calib3d.solvePnPnP() method to optimize the results.