Table of Contents

Class MotionTrackerCameraDevice

Namespace
easyar

MotionTrackerCameraDevice implements a real-scale 6DOF motion tracking camera device, outputting InputFrame (including image, camera parameters, timestamp, 6DOF position information, and tracking state). After creation, start/stop can be called to start and stop the data stream. When the device is no longer needed, call close to shut it down. Should not be used after close. MotionTrackerCameraDevice outputs InputFrame through inputFrameSource; inputFrameSource should be connected to InputFrameSink for use.

MotionTrackerCameraDevice

Constructors

MotionTrackerCameraDevice

Create a MotionTrackerCameraDevice object.

void easyar_MotionTrackerCameraDevice__ctor(easyar_MotionTrackerCameraDevice * * Return)
MotionTrackerCameraDevice()
public MotionTrackerCameraDevice()
constructor()
+ (easyar_MotionTrackerCameraDevice *) create
public convenience init()
public MotionTrackerCameraDevice()

Methods

isAvailable

Check if the device supports Motion Tracking. Returns True if the device supports the motion tracking feature, otherwise returns False.

bool easyar_MotionTrackerCameraDevice_isAvailable(void)
static bool isAvailable()
public static boolean isAvailable()
companion object fun isAvailable(): Boolean
+ (bool)isAvailable
public static func isAvailable() -> Bool
public static bool isAvailable()

Returns

Boolean

getQualityLevel

Get the quality of Motion Tracking on the device. Combined with application scenarios, this value can be used to determine whether to start Motion Tracking.

easyar_MotionTrackerCameraDeviceQualityLevel easyar_MotionTrackerCameraDevice_getQualityLevel(void)
static MotionTrackerCameraDeviceQualityLevel getQualityLevel()
public static int getQualityLevel()
companion object fun getQualityLevel(): Int
+ (easyar_MotionTrackerCameraDeviceQualityLevel)getQualityLevel
public static func getQualityLevel() -> MotionTrackerCameraDeviceQualityLevel
public static MotionTrackerCameraDeviceQualityLevel getQualityLevel()

Returns

MotionTrackerCameraDeviceQualityLevel

setFrameRateType

Set the current frame rate of the device. Called before start. If this feature is not called, the default is 30fps.

bool easyar_MotionTrackerCameraDevice_setFrameRateType(easyar_MotionTrackerCameraDevice * This, easyar_MotionTrackerCameraDeviceFPS fps)
bool setFrameRateType(MotionTrackerCameraDeviceFPS fps)
public boolean setFrameRateType(int fps)
fun setFrameRateType(fps: Int): Boolean
- (bool)setFrameRateType:(easyar_MotionTrackerCameraDeviceFPS)fps
public func setFrameRateType(_ fps: MotionTrackerCameraDeviceFPS) -> Bool
public virtual bool setFrameRateType(MotionTrackerCameraDeviceFPS fps)

Parameters

fps MotionTrackerCameraDeviceFPS

Returns

Boolean

setFocusMode

Set the focus mode to focusMode. Called before start. If this feature is not called, the default is continuous autofocus.

bool easyar_MotionTrackerCameraDevice_setFocusMode(easyar_MotionTrackerCameraDevice * This, easyar_MotionTrackerCameraDeviceFocusMode focusMode)
bool setFocusMode(MotionTrackerCameraDeviceFocusMode focusMode)
public boolean setFocusMode(int focusMode)
fun setFocusMode(focusMode: Int): Boolean
- (bool)setFocusMode:(easyar_MotionTrackerCameraDeviceFocusMode)focusMode
public func setFocusMode(_ focusMode: MotionTrackerCameraDeviceFocusMode) -> Bool
public virtual bool setFocusMode(MotionTrackerCameraDeviceFocusMode focusMode)

Parameters

focusMode MotionTrackerCameraDeviceFocusMode

Returns

Boolean

setFrameResolutionType

Set the frame resolution. Called before start. If this feature is not called, the default is 1280x960 or 1280x720.

bool easyar_MotionTrackerCameraDevice_setFrameResolutionType(easyar_MotionTrackerCameraDevice * This, easyar_MotionTrackerCameraDeviceResolution resolution)
bool setFrameResolutionType(MotionTrackerCameraDeviceResolution resolution)
public boolean setFrameResolutionType(int resolution)
fun setFrameResolutionType(resolution: Int): Boolean
- (bool)setFrameResolutionType:(easyar_MotionTrackerCameraDeviceResolution)resolution
public func setFrameResolutionType(_ resolution: MotionTrackerCameraDeviceResolution) -> Bool
public virtual bool setFrameResolutionType(MotionTrackerCameraDeviceResolution resolution)

Parameters

resolution MotionTrackerCameraDeviceResolution

Returns

Boolean

setTrackingMode

Set the tracking mode. Called before start. If this feature is not called, the default is anchor mode.

bool easyar_MotionTrackerCameraDevice_setTrackingMode(easyar_MotionTrackerCameraDevice * This, easyar_MotionTrackerCameraDeviceTrackingMode trackingMode)
bool setTrackingMode(MotionTrackerCameraDeviceTrackingMode trackingMode)
public boolean setTrackingMode(int trackingMode)
fun setTrackingMode(trackingMode: Int): Boolean
- (bool)setTrackingMode:(easyar_MotionTrackerCameraDeviceTrackingMode)trackingMode
public func setTrackingMode(_ trackingMode: MotionTrackerCameraDeviceTrackingMode) -> Bool
public virtual bool setTrackingMode(MotionTrackerCameraDeviceTrackingMode trackingMode)

Parameters

trackingMode MotionTrackerCameraDeviceTrackingMode

Returns

Boolean

setBufferCapacity

Set the buffer capacity of InputFrame. bufferCapacity indicates the buffer capacity of InputFrame. If there are more than this number of InputFrame output from this device and not released, the device will stop outputting new InputFrame until previous InputFrame are released. This may cause issues like frame freeze.

void easyar_MotionTrackerCameraDevice_setBufferCapacity(easyar_MotionTrackerCameraDevice * This, int capacity)
void setBufferCapacity(int capacity)
public void setBufferCapacity(int capacity)
fun setBufferCapacity(capacity: Int): Unit
- (void)setBufferCapacity:(int)capacity
public func setBufferCapacity(_ capacity: Int32) -> Void
public virtual void setBufferCapacity(int capacity)

Parameters

capacity Int32

Returns

Void

bufferCapacity

Get the buffer capacity of InputFrame, default value is 8.

int easyar_MotionTrackerCameraDevice_bufferCapacity(const easyar_MotionTrackerCameraDevice * This)
int bufferCapacity()
public int bufferCapacity()
fun bufferCapacity(): Int
- (int)bufferCapacity
public func bufferCapacity() -> Int32
public virtual int bufferCapacity()

Returns

Int32

inputFrameSource

Output port of InputFrame

void easyar_MotionTrackerCameraDevice_inputFrameSource(easyar_MotionTrackerCameraDevice * This, easyar_InputFrameSource * * Return)
std::shared_ptr<InputFrameSource> inputFrameSource()
public @Nonnull InputFrameSource inputFrameSource()
fun inputFrameSource(): InputFrameSource
- (easyar_InputFrameSource *)inputFrameSource
public func inputFrameSource() -> InputFrameSource
public virtual InputFrameSource inputFrameSource()

Returns

InputFrameSource

start

Start motion tracking, or trigger relocalization from pause; continue tracking after success. Note: If the device is paused by calling stop and then start is called for tracking, relocalization will be triggered, and continue tracking only after relocalization succeeds.

bool easyar_MotionTrackerCameraDevice_start(easyar_MotionTrackerCameraDevice * This)
bool start()
public boolean start()
fun start(): Boolean
- (bool)start
public func start() -> Bool
public virtual bool start()

Returns

Boolean

stop

Pause motion tracking. Calling start triggers relocalization, continue motion tracking after relocalization succeeds.

void easyar_MotionTrackerCameraDevice_stop(easyar_MotionTrackerCameraDevice * This)
void stop()
public void stop()
fun stop(): Unit
- (void)stop
public func stop() -> Void
public virtual void stop()

Returns

Void

close

Close the motion tracking process. Should not be used after close.

void easyar_MotionTrackerCameraDevice_close(easyar_MotionTrackerCameraDevice * This)
void close()
public void close()
fun close(): Unit
- (void)close
public func close() -> Void
public virtual void close()

Returns

Void

type

Camera type. Called after successful start.

easyar_CameraDeviceType easyar_MotionTrackerCameraDevice_type(const easyar_MotionTrackerCameraDevice * This)
CameraDeviceType type()
public int type()
fun type(): Int
- (easyar_CameraDeviceType)type
public func type() -> CameraDeviceType
public virtual CameraDeviceType type()

Returns

CameraDeviceType

cameraOrientation

Clockwise rotation angle needed when displaying the camera image in the device's natural orientation. Called after successful start.

int easyar_MotionTrackerCameraDevice_cameraOrientation(const easyar_MotionTrackerCameraDevice * This)
int cameraOrientation()
public int cameraOrientation()
fun cameraOrientation(): Int
- (int)cameraOrientation
public func cameraOrientation() -> Int32
public virtual int cameraOrientation()

Returns

Int32

size

Get current image size. Called after successful start.

easyar_Vec2I easyar_MotionTrackerCameraDevice_size(const easyar_MotionTrackerCameraDevice * This)
Vec2I size()
public @Nonnull Vec2I size()
fun size(): Vec2I
- (easyar_Vec2I *)size
public func size() -> Vec2I
public virtual Vec2I size()

Returns

Vec2I

frameRateRangeLower

Get the lower bound of current frame rate range. Called after successful open.

double easyar_MotionTrackerCameraDevice_frameRateRangeLower(const easyar_MotionTrackerCameraDevice * This)
double frameRateRangeLower()
public double frameRateRangeLower()
fun frameRateRangeLower(): Double
- (double)frameRateRangeLower
public func frameRateRangeLower() -> Double
public virtual double frameRateRangeLower()

Returns

Double

frameRateRangeUpper

Get the upper bound of current frame rate range. Called after successful open.

double easyar_MotionTrackerCameraDevice_frameRateRangeUpper(const easyar_MotionTrackerCameraDevice * This)
double frameRateRangeUpper()
public double frameRateRangeUpper()
fun frameRateRangeUpper(): Double
- (double)frameRateRangeUpper
public func frameRateRangeUpper() -> Double
public virtual double frameRateRangeUpper()

Returns

Double

hitTestAgainstPointCloud

Perform Hit Test on the current point cloud to get the nearest 3D point position coordinate along a ray from the camera (from near to far). The point is represented by three consecutive values, representing coordinates on X, Y, Z axes respectively. Input image coordinate system ([0, 1]^2) has x to the right, y downward, origin at top-left. Use imageCoordinatesFromScreenCoordinates to convert from screen coordinates to image coordinates.

void easyar_MotionTrackerCameraDevice_hitTestAgainstPointCloud(easyar_MotionTrackerCameraDevice * This, easyar_Vec2F cameraImagePoint, easyar_ListOfVec3F * * Return)
std::vector<Vec3F> hitTestAgainstPointCloud(Vec2F cameraImagePoint)
public java.util.@Nonnull ArrayList<@Nonnull Vec3F> hitTestAgainstPointCloud(@Nonnull Vec2F cameraImagePoint)
fun hitTestAgainstPointCloud(cameraImagePoint: Vec2F): ArrayList<Vec3F>
- (NSArray<easyar_Vec3F *> *)hitTestAgainstPointCloud:(easyar_Vec2F *)cameraImagePoint
public func hitTestAgainstPointCloud(_ cameraImagePoint: Vec2F) -> [Vec3F]
public virtual List<Vec3F> hitTestAgainstPointCloud(Vec2F cameraImagePoint)

Parameters

cameraImagePoint Vec2F

Returns

List<Vec3F>

hitTestAgainstHorizontalPlane

Perform Hit Test on the real-time detected horizontal plane within the current field of view; returns the 3D point position coordinate on the plane that is closest to the Hit Test ray after hitting a horizontal plane. Input image coordinate system ([0, 1]^2) has x to the right, y downward, origin at top-left. Use imageCoordinatesFromScreenCoordinates to convert from screen coordinates to image coordinates. Output is the coordinates of the point cloud on the plane in the world coordinate system. Each point is represented by three consecutive values, representing coordinates on X, Y, Z axes respectively.

void easyar_MotionTrackerCameraDevice_hitTestAgainstHorizontalPlane(easyar_MotionTrackerCameraDevice * This, easyar_Vec2F cameraImagePoint, easyar_ListOfVec3F * * Return)
std::vector<Vec3F> hitTestAgainstHorizontalPlane(Vec2F cameraImagePoint)
public java.util.@Nonnull ArrayList<@Nonnull Vec3F> hitTestAgainstHorizontalPlane(@Nonnull Vec2F cameraImagePoint)
fun hitTestAgainstHorizontalPlane(cameraImagePoint: Vec2F): ArrayList<Vec3F>
- (NSArray<easyar_Vec3F *> *)hitTestAgainstHorizontalPlane:(easyar_Vec2F *)cameraImagePoint
public func hitTestAgainstHorizontalPlane(_ cameraImagePoint: Vec2F) -> [Vec3F]
public virtual List<Vec3F> hitTestAgainstHorizontalPlane(Vec2F cameraImagePoint)

Parameters

cameraImagePoint Vec2F

Returns

List<Vec3F>

getLocalPointsCloud

Get current point cloud data position information. The point cloud position is in world coordinate system; each point is represented by three consecutive values, representing coordinates on X, Y, Z axes respectively.

void easyar_MotionTrackerCameraDevice_getLocalPointsCloud(easyar_MotionTrackerCameraDevice * This, easyar_ListOfVec3F * * Return)
std::vector<Vec3F> getLocalPointsCloud()
public java.util.@Nonnull ArrayList<@Nonnull Vec3F> getLocalPointsCloud()
fun getLocalPointsCloud(): ArrayList<Vec3F>
- (NSArray<easyar_Vec3F *> *)getLocalPointsCloud
public func getLocalPointsCloud() -> [Vec3F]
public virtual List<Vec3F> getLocalPointsCloud()

Returns

List<Vec3F>