SurfaceTracker Class

This type is an EasyAR Sense API in C#: SurfaceTracker . Some descriptions may not apply to Unity environment on this page.

This type is partially wrapped into Unity components: SurfaceTrackerFrameFilter . Members and instances of this type are not required to be used directly in most situations. Use this type by SurfaceTrackerFrameFilter.Tracker instead of creating new instances when a few unwrapped API is desired for use.

Description

SurfaceTracker implements tracking with environmental surfaces.

SurfaceTracker occupies one buffer of camera. Use setBufferCapacity of camera to set an amount of buffers that is not less than the sum of amount of buffers occupied by all components. Refer to Overview .

After creation, you can call start/stop to enable/disable the track process. start and stop are very lightweight calls.

When the component is not needed anymore, call close function to close it. It shall not be used after calling close.

SurfaceTracker inputs InputFrame from inputFrameSink. InputFrameSource shall be connected to inputFrameSink for use. Refer to Overview .


Methods

isAvailable

C#

public static bool isAvailable()

Returns true only on Android or iOS when accelerometer and gyroscope are available.

inputFrameSink

C#

public virtual InputFrameSink inputFrameSink()

InputFrame input port. InputFrame must have raw image, timestamp, and camera parameters.

Note: fisheye camera model is NOT supported.

bufferRequirement

C#

public virtual int bufferRequirement()

Camera buffers occupied in this component.

outputFrameSource

C#

public virtual OutputFrameSource outputFrameSource()

OutputFrame output port.

create

C#

public static SurfaceTracker create()

Creates an instance.

start

C#

public virtual bool start()

Starts the track algorithm.

stop

C#

public virtual void stop()

Stops the track algorithm. Call start to start the track again.

close

C#

public virtual void close()

Close. The component shall not be used after calling close.

alignTargetToCameraImagePoint

C#

public virtual void alignTargetToCameraImagePoint( Vec2F cameraImagePoint)

Sets the tracking target to a point on camera image. For the camera image coordinate system ([0, 1]^2), x-right, y-down, and origin is at left-top corner. CameraParameters.imageCoordinatesFromScreenCoordinates can be used to convert points from screen coordinate system to camera image coordinate system.