CV Camera
APIs for camera pose. More...
Enums
Name | |
---|---|
enum | MLCVCameraID { MLCVCameraID_ColorCamera = 0, MLCVCameraID_Ensure32Bits = 0x7FFFFFFF } Camera id enum. |
Functions
Name | |
---|---|
MLResult | MLCVCameraTrackingCreate(MLHandle * out_handle) Create CV Camera Tracker. |
MLResult | MLCVCameraGetFramePose(MLHandle camera_handle, MLHandle head_handle, MLCVCameraID id, MLTime camera_timestamp, MLTransform * out_transform) Get the camera pose in the world coordinate system. |
MLResult | MLCVCameraTrackingDestroy(MLHandle camera_handle) Destroy Tracker after usage. |
Detailed Description
APIs for camera pose.
Shared Object:
- perception.magicleap*
Enums Documentation
MLCVCameraID
Enumerator | Value | Description |
---|---|---|
MLCVCameraID_ColorCamera | 0 | Default camera id. |
MLCVCameraID_Ensure32Bits | 0x7FFFFFFF | Camera id. |
Camera id enum.
API Level:
- 5
Functions Documentation
MLCVCameraTrackingCreate
MLResult MLCVCameraTrackingCreate(
MLHandle * out_handle
)
Create CV Camera Tracker.
Parameters
MLHandle * | out_handle | Tracker handle. |
Returns
MLResult | MLResult_Ok | On success. |
MLResult | MLResult_PerceptionSystemNotStarted | Perception System has not been started. |
MLResult | MLResult_PermissionDenied | Necessary permission is missing. |
Required Permissions:
- android.permission.CAMERA (protection level: dangerous)
API Level:
- 5
MLCVCameraGetFramePose
MLResult MLCVCameraGetFramePose(
MLHandle camera_handle,
MLHandle head_handle,
MLCVCameraID id,
MLTime camera_timestamp,
MLTransform * out_transform
)
Get the camera pose in the world coordinate system.
Parameters
MLHandle | camera_handle | MLHandle previously created with MLCVCameraTrackingCreate. |
MLHandle | head_handle | MLHandle previously created with MLHeadTrackingCreate. |
MLCVCameraID | id | Camera id. |
MLTime | camera_timestamp | Time to request the pose. |
MLTransform * | out_transform | Transform from camera to world origin. |
Returns
MLResult | MLResult_InvalidParam | id parameter was not valid or out_transform parameter was not valid (null). |
MLResult | MLResult_Ok | Obtained transform successfully. |
MLResult | MLResult_PerceptionSystemNotStarted | Perception System has not been started. |
MLResult | MLResult_PoseNotFound | Pose is currently not available. |
MLResult | MLResult_UnspecifiedFailure | Failed to obtain transform due to internal error. |
Required Permissions:
- None
Use the timestamp provided from the #on_video_buffer_available callback from ml_camera_v2.h. The camera tracker only caches a limited set of poses. Retrieve the camera pose as soon as the timestamp is available else the API may return MLResult_PoseNotFound.
API Level:
- 5
MLCVCameraTrackingDestroy
MLResult MLCVCameraTrackingDestroy(
MLHandle camera_handle
)
Destroy Tracker after usage.
Parameters
MLHandle | camera_handle | MLHandle previously created with MLCVCameraTrackingCreate. |
Returns
MLResult | MLResult_Ok | On success. |
MLResult | MLResult_PerceptionSystemNotStarted | Perception System has not been started. |
Required Permissions:
- None
API Level:
- 5