Class SurfaceTracker
- Namespace
- easyar
SurfaceTracker implements the tracking of environmental surfaces. SurfaceTracker occupies 1 camera's buffer. Should use camera's setBufferCapacity to set the number of camera buffers occupied by all components to be no less than. After creation, start/stop can be called to start and stop operation, and start/stop are very lightweight calls. When the component is no longer needed, close can be called to close it. Should not be used continue after close. SurfaceTracker inputs through inputFrameSink InputFrame, and InputFrameSource should be connected to inputFrameSink for use.
Methods
isAvailable
Returns true only when on Android, iOS systems and accelerometer, 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
- Boolean
inputFrameSink
InputFrame input port. InputFrame requires having image, timestamp and camera parameters. Note: Camera does not support 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
bufferRequirement
The number of camera buffers occupied by the current 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
- 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
create
Create.
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
start
Start 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
- Boolean
stop
Pause 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
- Void
close
Close. Should not be used continue 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
- Void
alignTargetToCameraImagePoint
Align the tracking target point to the specified point in the camera image. The image coordinate system ([0, 1]^2) has x to the right, y downward, and the origin at the top-left corner. Can 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
cameraImagePointVec2F
Returns
- Void