OpenCV for Unity 2.6.5
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.
|
A helper component for managing AR (Augmented Reality) functionalities. More...
Public Types | |
enum | UpdateTarget { ARGameObject , ARCamera } |
UpdateTarget Type. More... | |
Public Member Functions | |
virtual void | CalculateARMatrix () |
Calculate ARMatrix from set parameters. | |
virtual void | Dispose () |
Releases all resource used by the ARHelper. | |
virtual Matrix4x4 | GetARMatrix () |
Get ARMatrix. | |
Mat | GetCamMatrix () |
Get camMatrix. | |
virtual MatOfDouble | GetDistCoeffs () |
Get distCoeffs. | |
virtual Mat | GetRvec () |
Get rvec. | |
virtual Mat | GetTvec () |
Get tvec. | |
virtual void | Initialize () |
Initializes the ARHelper. | |
virtual void | Initialize (int screenWidth, int screenHeight, int imageWidth, int imageHeight, double[] camMatrixValues=null, double[] distCoeffsValues=null, Vector2[] imagePoints=null, Vector3[] objectPoints=null) |
Initializes the ARHelper. | |
virtual bool | IsInitialized () |
Indicates whether this instance has been initialized. | |
virtual void | ResetUpdateTargetTransform () |
Resets the Transform of updateTarget to its initial value at the time the Initialize() method is called. | |
virtual void | SetCamMatrix (Mat camMatrix) |
Set camMatrix. | |
virtual void | SetDistCoeffs (MatOfDouble distCoeffs) |
Set distCoeffs. | |
virtual void | UpdateTransform () |
Update the Transform of UpdateTarget using ARMatrix. | |
Public Attributes | |
Camera | arCamera |
Target AR Camera. | |
GameObject | arGameObject |
Target AR GameObject. | |
bool | calculateARMatrixInLateUpdate = true |
If true, the CalculateARMatrix() method is automatically called in the LateUpdate() method; if false, you must call it yourself. | |
Vector2[] | imagePoints |
Specify the imagePoints argument to the Calib3d.solvePnP() method. | |
Vector3[] | objectPoints |
Specify the objectPoints argument to the Calib3d.solvePnP() method. | |
float | positionLowPassParam = 4f |
Position parameter of LowPassFilter (Value in meters) | |
bool | rightHandedCoordinates = false |
Enable this flag if the object point is a right-hand coordinate system (OpenCV). | |
float | rotationLowPassParam = 2f |
Rotation parameter of LowPassFilter (Value in degrees) | |
UpdateTarget | updateTarget |
Update Target. | |
bool | updateTransformInLateUpdate = true |
If true, the UpdateTransform() method is automatically called in the LateUpdate() method; if false, you must call it yourself. | |
bool | useLowPassFilter = false |
When enabled, LowPassFilter suppresses noise. | |
Protected Member Functions | |
virtual void | OnDestroy () |
Raises the destroy event. | |
virtual void | OnValidate () |
Protected Attributes | |
double[] | _camMatrixValues = null |
double[] | _distCoeffsValues = null |
int | _imageHeight = 480 |
int | _imageWidth = 640 |
int | _screenHeight = 480 |
int | _screenWidth = 640 |
bool | hasInitDone = false |
Indicates whether this instance has been initialized. | |
Properties | |
virtual double[] | camMatrixValues [get, set] |
Specifies the initial value of camMatrix used for camera calibration. If the number of elements in this array is less than 9, it is automatically calculated from the Screen's Width and Height and the Image's Width and Height. | |
virtual double[] | distCoeffsValues [get, set] |
Specifies the initial value of distCoeffs used for camera calibration. If the number of elements in this array is less than 5, all elements are set to 0. | |
virtual int | imageHeight [get, set] |
Set the height of image. | |
virtual int | imageWidth [get, set] |
Set the width of image. | |
virtual int | screenHeight [get, set] |
Set the height of screen. | |
virtual int | screenWidth [get, set] |
Set the width of screen. | |
A helper component for managing AR (Augmented Reality) functionalities.
The ARHelper class simplifies AR-related calculations such as object pose estimation and Transform updates by specifying the objectPoints, imagePoints, camMatrix, and distCoeff for OpenCV's solvePnP() method. This class provides the following features:
Attach this component to a GameObject to enable AR functionality:
|
virtual |
Calculate ARMatrix from set parameters.
|
virtual |
Releases all resource used by the ARHelper.
|
virtual |
Get ARMatrix.
Mat OpenCVForUnity.UnityUtils.Helper.ARHelper.GetCamMatrix | ( | ) |
Get camMatrix.
|
virtual |
Get distCoeffs.
|
virtual |
Get rvec.
|
virtual |
Get tvec.
|
virtual |
Initializes the ARHelper.
|
virtual |
Initializes the ARHelper.
|
virtual |
Indicates whether this instance has been initialized.
true
, if this instance has been initialized, false
otherwise.
|
protectedvirtual |
Raises the destroy event.
|
protectedvirtual |
|
virtual |
Resets the Transform of updateTarget to its initial value at the time the Initialize() method is called.
|
virtual |
Set camMatrix.
camMatrix |
|
virtual |
Set distCoeffs.
distCoeffs |
|
virtual |
Update the Transform of UpdateTarget using ARMatrix.
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
Camera OpenCVForUnity.UnityUtils.Helper.ARHelper.arCamera |
Target AR Camera.
GameObject OpenCVForUnity.UnityUtils.Helper.ARHelper.arGameObject |
Target AR GameObject.
bool OpenCVForUnity.UnityUtils.Helper.ARHelper.calculateARMatrixInLateUpdate = true |
If true, the CalculateARMatrix() method is automatically called in the LateUpdate() method; if false, you must call it yourself.
|
protected |
Indicates whether this instance has been initialized.
Vector2 [] OpenCVForUnity.UnityUtils.Helper.ARHelper.imagePoints |
Specify the imagePoints argument to the Calib3d.solvePnP() method.
Vector3 [] OpenCVForUnity.UnityUtils.Helper.ARHelper.objectPoints |
Specify the objectPoints argument to the Calib3d.solvePnP() method.
float OpenCVForUnity.UnityUtils.Helper.ARHelper.positionLowPassParam = 4f |
Position parameter of LowPassFilter (Value in meters)
bool OpenCVForUnity.UnityUtils.Helper.ARHelper.rightHandedCoordinates = false |
Enable this flag if the object point is a right-hand coordinate system (OpenCV).
float OpenCVForUnity.UnityUtils.Helper.ARHelper.rotationLowPassParam = 2f |
Rotation parameter of LowPassFilter (Value in degrees)
UpdateTarget OpenCVForUnity.UnityUtils.Helper.ARHelper.updateTarget |
Update Target.
bool OpenCVForUnity.UnityUtils.Helper.ARHelper.updateTransformInLateUpdate = true |
If true, the UpdateTransform() method is automatically called in the LateUpdate() method; if false, you must call it yourself.
bool OpenCVForUnity.UnityUtils.Helper.ARHelper.useLowPassFilter = false |
When enabled, LowPassFilter suppresses noise.
|
getset |
Specifies the initial value of camMatrix used for camera calibration. If the number of elements in this array is less than 9, it is automatically calculated from the Screen's Width and Height and the Image's Width and Height.
|
getset |
Specifies the initial value of distCoeffs used for camera calibration. If the number of elements in this array is less than 5, all elements are set to 0.
|
getset |
Set the height of image.
|
getset |
Set the width of image.
|
getset |
Set the height of screen.
|
getset |
Set the width of screen.