Class SurfaceTracker
- Namespace
- easyar
SurfaceTracker implements tracking of environmental surfaces. SurfaceTracker occupies 1 camera buffer. Use the camera's setBufferCapacity to set no less than the total number of camera buffers occupied by all components. After creation, start/stop can be called to start and stop running. start/stop are very lightweight calls. When this component is no longer needed, call close to close it. It should not be used after close. SurfaceTracker inputs InputFrame through inputFrameSink. Connect InputFrameSource to inputFrameSink for use.
Methods
isAvailable
Returns true only on Android and iOS systems when the accelerometer and gyroscope are available.
bool easyar_SurfaceTracker_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
| Type | Description |
|---|---|
| Boolean |
inputFrameSink
InputFrame input port. InputFrame must have an image, timestamp, and camera parameters. Note: camera does not support the fisheye camera model.
void easyar_SurfaceTracker_inputFrameSink(easyar_SurfaceTracker * This, easyar_InputFrameSink * * Return)
std::shared_ptr<InputFrameSink> inputFrameSink()
public @Nonnull InputFrameSink inputFrameSink()
fun inputFrameSink(): InputFrameSink
- (easyar_InputFrameSink *)inputFrameSink
public func inputFrameSink() -> InputFrameSink
public virtual InputFrameSink inputFrameSink()
Returns
| Type | Description |
|---|---|
| InputFrameSink |
bufferRequirement
The number of camera buffers currently occupied by this component.
int easyar_SurfaceTracker_bufferRequirement(easyar_SurfaceTracker * This)
int bufferRequirement()
public int bufferRequirement()
fun bufferRequirement(): Int
- (int)bufferRequirement
public func bufferRequirement() -> Int32
public virtual int bufferRequirement()
Returns
| Type | Description |
|---|---|
| Int32 |
outputFrameSource
OutputFrame output port.
void easyar_SurfaceTracker_outputFrameSource(easyar_SurfaceTracker * This, easyar_OutputFrameSource * * Return)
std::shared_ptr<OutputFrameSource> outputFrameSource()
public @Nonnull OutputFrameSource outputFrameSource()
fun outputFrameSource(): OutputFrameSource
- (easyar_OutputFrameSource *)outputFrameSource
public func outputFrameSource() -> OutputFrameSource
public virtual OutputFrameSource outputFrameSource()
Returns
| Type | Description |
|---|---|
| OutputFrameSource |
create
Creates.
void easyar_SurfaceTracker_create(easyar_SurfaceTracker * * Return)
static std::shared_ptr<SurfaceTracker> create()
public static @Nonnull SurfaceTracker create()
companion object fun create(): SurfaceTracker
+ (easyar_SurfaceTracker *)create
public static func create() -> SurfaceTracker
public static SurfaceTracker create()
Returns
| Type | Description |
|---|---|
| SurfaceTracker |
start
Starts the tracking algorithm.
bool easyar_SurfaceTracker_start(easyar_SurfaceTracker * This)
bool start()
public boolean start()
fun start(): Boolean
- (bool)start
public func start() -> Bool
public virtual bool start()
Returns
| Type | Description |
|---|---|
| Boolean |
stop
Pauses the tracking algorithm. Call start to restart tracking.
void easyar_SurfaceTracker_stop(easyar_SurfaceTracker * This)
void stop()
public void stop()
fun stop(): Unit
- (void)stop
public func stop() -> Void
public virtual void stop()
Returns
| Type | Description |
|---|---|
| Void |
close
Closes. It should not be used after close.
void easyar_SurfaceTracker_close(easyar_SurfaceTracker * This)
void close()
public void close()
fun close(): Unit
- (void)close
public func close() -> Void
public virtual void close()
Returns
| Type | Description |
|---|---|
| Void |
alignTargetToCameraImagePoint
Aligns the tracked target point to the specified point in the camera image. In the image coordinate system ([0, 1]^2), x points right, y points down, and the origin is at the upper-left corner. Use imageCoordinatesFromScreenCoordinates to convert from screen coordinates to image coordinates.
void easyar_SurfaceTracker_alignTargetToCameraImagePoint(easyar_SurfaceTracker * This, easyar_Vec2F cameraImagePoint)
void alignTargetToCameraImagePoint(Vec2F cameraImagePoint)
public void alignTargetToCameraImagePoint(@Nonnull Vec2F cameraImagePoint)
fun alignTargetToCameraImagePoint(cameraImagePoint: Vec2F): Unit
- (void)alignTargetToCameraImagePoint:(easyar_Vec2F *)cameraImagePoint
public func alignTargetToCameraImagePoint(_ cameraImagePoint: Vec2F) -> Void
public virtual void alignTargetToCameraImagePoint(Vec2F cameraImagePoint)
Parameters
| Name | Type | Description |
|---|---|---|
| cameraImagePoint | Vec2F |
Returns
| Type | Description |
|---|---|
| Void |