Table of Contents

Class ImageTracker

Пространство имен
easyar

ImageTracker implements detection and tracking of planar cards. ImageTracker occupies (1 + SimultaneousNum) camera buffers. Use camera 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 the component is no longer needed, close can be called to close it. It should not be used after close. ImageTracker inputs FeedbackFrame through feedbackFrameSink. FeedbackFrameSource should be connected to feedbackFrameSink for use. Before a Target can be tracked by ImageTracker, you need to load it with loadTarget/unloadTarget. The result of load/unload can be obtained through the callback passed to the interface.

ImageTracker

Методы

isAvailable

Возвращает true.

bool easyar_ImageTracker_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()

Возвращаемое значение

Тип Описание
Boolean

feedbackFrameSink

FeedbackFrame input port. The InputFrame member in FeedbackFrame must have image, timestamp, and camera parameters. camera supports pinhole and fisheye cameras.

void easyar_ImageTracker_feedbackFrameSink(easyar_ImageTracker * This, easyar_FeedbackFrameSink * * Return)
std::shared_ptr<FeedbackFrameSink> feedbackFrameSink()
public @Nonnull FeedbackFrameSink feedbackFrameSink()
fun feedbackFrameSink(): FeedbackFrameSink
- (easyar_FeedbackFrameSink *)feedbackFrameSink
public func feedbackFrameSink() -> FeedbackFrameSink
public virtual FeedbackFrameSink feedbackFrameSink()

Возвращаемое значение

Тип Описание
FeedbackFrameSink

bufferRequirement

The number of camera buffers occupied by the current component.

int easyar_ImageTracker_bufferRequirement(easyar_ImageTracker * This)
int bufferRequirement()
public int bufferRequirement()
fun bufferRequirement(): Int
- (int)bufferRequirement
public func bufferRequirement() -> Int32
public virtual int bufferRequirement()

Возвращаемое значение

Тип Описание
Int32

outputFrameSource

OutputFrame output port.

void easyar_ImageTracker_outputFrameSource(easyar_ImageTracker * 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()

Возвращаемое значение

Тип Описание
OutputFrameSource

create

Создает. The default tracking mode is ImageTrackerMode.PreferQuality.

void easyar_ImageTracker_create(easyar_ImageTracker * * Return)
static std::shared_ptr<ImageTracker> create()
public static @Nonnull ImageTracker create()
companion object fun create(): ImageTracker
+ (easyar_ImageTracker *)create
public static func create() -> ImageTracker
public static ImageTracker create()

Возвращаемое значение

Тип Описание
ImageTracker

createWithMode

Создает with a specific tracking mode. On low-end phones, ImageTrackerMode.PreferPerformance can be used to obtain better performance, but tracking quality will be slightly reduced.

void easyar_ImageTracker_createWithMode(easyar_ImageTrackerMode trackMode, easyar_ImageTracker * * Return)
static std::shared_ptr<ImageTracker> createWithMode(ImageTrackerMode trackMode)
public static @Nonnull ImageTracker createWithMode(int trackMode)
companion object fun createWithMode(trackMode: Int): ImageTracker
+ (easyar_ImageTracker *)createWithMode:(easyar_ImageTrackerMode)trackMode
public static func createWithMode(_ trackMode: ImageTrackerMode) -> ImageTracker
public static ImageTracker createWithMode(ImageTrackerMode trackMode)

Параметры

Имя Тип Описание
trackMode ImageTrackerMode

Возвращаемое значение

Тип Описание
ImageTracker

createWithConfig

Создает with a specific configuration.

void easyar_ImageTracker_createWithConfig(easyar_ImageTrackerConfig * config, easyar_ImageTracker * * Return)
static std::shared_ptr<ImageTracker> createWithConfig(std::shared_ptr<ImageTrackerConfig> config)
public static @Nonnull ImageTracker createWithConfig(@Nonnull ImageTrackerConfig config)
companion object fun createWithConfig(config: ImageTrackerConfig): ImageTracker
+ (easyar_ImageTracker *)createWithConfig:(easyar_ImageTrackerConfig *)config
public static func createWithConfig(_ config: ImageTrackerConfig) -> ImageTracker
public static ImageTracker createWithConfig(ImageTrackerConfig config)

Параметры

Имя Тип Описание
config ImageTrackerConfig

Возвращаемое значение

Тип Описание
ImageTracker

setResultPostProcessing

Устанавливает result post-processing. enablePersistentTargetInstance defaults to false. When enabled, if InputFrame data contains spatial information, targetInstances in ImageTrackerResult will contain all recognized instances, including those currently not tracked. enableMotionFusion defaults to false. When enabled, if InputFrame data contains time information and spatial information, the pose of targetInstances in ImageTrackerResult will be processed with RealTimeCoordinateTransform.

void easyar_ImageTracker_setResultPostProcessing(easyar_ImageTracker * This, bool enablePersistentTargetInstance, bool enableMotionFusion)
void setResultPostProcessing(bool enablePersistentTargetInstance, bool enableMotionFusion)
public void setResultPostProcessing(boolean enablePersistentTargetInstance, boolean enableMotionFusion)
fun setResultPostProcessing(enablePersistentTargetInstance: Boolean, enableMotionFusion: Boolean): Unit
- (void)setResultPostProcessing:(bool)enablePersistentTargetInstance enableMotionFusion:(bool)enableMotionFusion
public func setResultPostProcessing(_ enablePersistentTargetInstance: Bool, _ enableMotionFusion: Bool) -> Void
public virtual void setResultPostProcessing(bool enablePersistentTargetInstance, bool enableMotionFusion)

Параметры

Имя Тип Описание
enablePersistentTargetInstance Boolean
enableMotionFusion Boolean

Возвращаемое значение

Тип Описание
Void

setResultAsyncMode

Устанавливает result async mode. If results are output through outputFrameSource, this should be set to true; if results are obtained through getSyncResult, it should be set to false. The default enableAsync is true. Sync mode can take effect only when the input frame contains spatial information and an XR License is used.

bool easyar_ImageTracker_setResultAsyncMode(easyar_ImageTracker * This, bool enableAsync)
bool setResultAsyncMode(bool enableAsync)
public boolean setResultAsyncMode(boolean enableAsync)
fun setResultAsyncMode(enableAsync: Boolean): Boolean
- (bool)setResultAsyncMode:(bool)enableAsync
public func setResultAsyncMode(_ enableAsync: Bool) -> Bool
public virtual bool setResultAsyncMode(bool enableAsync)

Параметры

Имя Тип Описание
enableAsync Boolean

Возвращаемое значение

Тип Описание
Boolean

start

Запускает the tracking algorithm.

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

Возвращаемое значение

Тип Описание
Boolean

stop

Приостанавливает the tracking algorithm. Call start to restart tracking.

void easyar_ImageTracker_stop(easyar_ImageTracker * This)
void stop()
public void stop()
fun stop(): Unit
- (void)stop
public func stop() -> Void
public virtual void stop()

Возвращаемое значение

Тип Описание
Void

close

Закрывает. It should not be used after close.

void easyar_ImageTracker_close(easyar_ImageTracker * This)
void close()
public void close()
fun close(): Unit
- (void)close
public func close() -> Void
public virtual void close()

Возвращаемое значение

Тип Описание
Void

loadTarget

Загружает a Target into the tracker. A Target can be recognized and tracked only after it is successfully loaded into the tracker. This method is asynchronous. The loading process may take some time to complete. During this period, detection of new and lost targets may take longer than usual, but tracking after detection is not affected. If you want to know the loading result, handle the callback data. The callback will be called on the thread specified by CallbackScheduler. The tracking thread and operations other than other load/unload operations will not be blocked.

void easyar_ImageTracker_loadTarget(easyar_ImageTracker * This, easyar_Target * target, easyar_CallbackScheduler * callbackScheduler, easyar_FunctorOfVoidFromTargetAndBool callback)
void loadTarget(std::shared_ptr<Target> target, std::shared_ptr<CallbackScheduler> callbackScheduler, std::function<void(std::shared_ptr<Target>, bool)> callback)
public void loadTarget(@Nonnull Target target, @Nonnull CallbackScheduler callbackScheduler, @Nonnull FunctorOfVoidFromTargetAndBool callback)
fun loadTarget(target: Target, callbackScheduler: CallbackScheduler, callback: FunctorOfVoidFromTargetAndBool): Unit
- (void)loadTarget:(easyar_Target *)target callbackScheduler:(easyar_CallbackScheduler *)callbackScheduler callback:(void (^)(easyar_Target * target, bool status))callback
public func loadTarget(_ target: Target, _ callbackScheduler: CallbackScheduler, _ callback: @escaping (Target, Bool) -> Void) -> Void
public virtual void loadTarget(Target target, CallbackScheduler callbackScheduler, Action<Target, bool> callback)

Параметры

Имя Тип Описание
target Target
callbackScheduler CallbackScheduler
callback Action<,>

Возвращаемое значение

Тип Описание
Void

unloadTarget

Выгружает a Target from the tracker. This method is asynchronous. The unloading process may take some time to complete. During this period, detection of new and lost targets may take longer than usual, but tracking after detection is not affected. If you want to know the unloading result, handle the callback data. The callback will be called on the thread specified by CallbackScheduler. The tracking thread and operations other than other load/unload operations will not be blocked.

void easyar_ImageTracker_unloadTarget(easyar_ImageTracker * This, easyar_Target * target, easyar_CallbackScheduler * callbackScheduler, easyar_FunctorOfVoidFromTargetAndBool callback)
void unloadTarget(std::shared_ptr<Target> target, std::shared_ptr<CallbackScheduler> callbackScheduler, std::function<void(std::shared_ptr<Target>, bool)> callback)
public void unloadTarget(@Nonnull Target target, @Nonnull CallbackScheduler callbackScheduler, @Nonnull FunctorOfVoidFromTargetAndBool callback)
fun unloadTarget(target: Target, callbackScheduler: CallbackScheduler, callback: FunctorOfVoidFromTargetAndBool): Unit
- (void)unloadTarget:(easyar_Target *)target callbackScheduler:(easyar_CallbackScheduler *)callbackScheduler callback:(void (^)(easyar_Target * target, bool status))callback
public func unloadTarget(_ target: Target, _ callbackScheduler: CallbackScheduler, _ callback: @escaping (Target, Bool) -> Void) -> Void
public virtual void unloadTarget(Target target, CallbackScheduler callbackScheduler, Action<Target, bool> callback)

Параметры

Имя Тип Описание
target Target
callbackScheduler CallbackScheduler
callback Action<,>

Возвращаемое значение

Тип Описание
Void

targets

Возвращает targets currently loaded into the tracker. If asynchronous load/unload is being executed, the return value before load/unload completes will not reflect the results of those load/unload operations.

void easyar_ImageTracker_targets(const easyar_ImageTracker * This, easyar_ListOfTarget * * Return)
std::vector<std::shared_ptr<Target>> targets()
public java.util.@Nonnull ArrayList<@Nonnull Target> targets()
fun targets(): ArrayList<Target>
- (NSArray<easyar_Target *> *)targets
public func targets() -> [Target]
public virtual List<Target> targets()

Возвращаемое значение

Тип Описание
List<>

setSimultaneousNum

Устанавливает the maximum number of targets that can be tracked by the tracker. The default value is 1.

bool easyar_ImageTracker_setSimultaneousNum(easyar_ImageTracker * This, int num)
bool setSimultaneousNum(int num)
public boolean setSimultaneousNum(int num)
fun setSimultaneousNum(num: Int): Boolean
- (bool)setSimultaneousNum:(int)num
public func setSimultaneousNum(_ num: Int32) -> Bool
public virtual bool setSimultaneousNum(int num)

Параметры

Имя Тип Описание
num Int32

Возвращаемое значение

Тип Описание
Boolean

simultaneousNum

Получает the maximum number of targets that can be tracked by the tracker. The default value is 1.

int easyar_ImageTracker_simultaneousNum(const easyar_ImageTracker * This)
int simultaneousNum()
public int simultaneousNum()
fun simultaneousNum(): Int
- (int)simultaneousNum
public func simultaneousNum() -> Int32
public virtual int simultaneousNum()

Возвращаемое значение

Тип Описание
Int32

getSyncResult

Получает the synchronous output result. If ImageTracker is paused, or if result async mode has not been set to false through setResultAsyncMode, the return value is empty.

void easyar_ImageTracker_getSyncResult(easyar_ImageTracker * This, easyar_MotionInputData * motionInputData, easyar_OptionalOfImageTrackerResult * Return)
std::optional<std::shared_ptr<ImageTrackerResult>> getSyncResult(std::shared_ptr<MotionInputData> motionInputData)
public @Nullable ImageTrackerResult getSyncResult(@Nonnull MotionInputData motionInputData)
fun getSyncResult(motionInputData: MotionInputData): ImageTrackerResult?
- (easyar_ImageTrackerResult *)getSyncResult:(easyar_MotionInputData *)motionInputData
public func getSyncResult(_ motionInputData: MotionInputData) -> ImageTrackerResult?
public virtual Optional<ImageTrackerResult> getSyncResult(MotionInputData motionInputData)

Параметры

Имя Тип Описание
motionInputData MotionInputData

Возвращаемое значение

Тип Описание
Optional<ImageTrackerResult>