CloudRecognizer Class

Description

CloudRecognizer实现了云识别功能。云识别功能需要在云端创建云识别图库才能使用,请参考EasyAR CRS文档。

当不再需要该组件时,可以调用close对其进行关闭。close之后不应继续使用。

在使用CloudRecognizer之前,需要设置并准备好一个 ImageTracker 。任何返回的target在被track之前都应使用 ImageTracker.loadTarget 手动加载进入 ImageTracker 。加载之后,target的识别和跟踪即和本地target的使用相同。在一个target被识别到之后,你可以从回调中获取到,然后你应该使用target uid来区分不同的target。target runtimeID是动态生成的,不适用于作为云识别情况下的target的唯一区分。

isAvailable

返回true。

C

bool easyar_CloudRecognizer_isAvailable(void)

C++17

static bool isAvailable()

C++03(Deprecated)

static bool isAvailable()

Java

public static boolean isAvailable()

Kotlin

companion object fun isAvailable(): Boolean

Objective-C

+ (bool)isAvailable

Swift

public static func isAvailable() -> Bool

C#

public static bool isAvailable()

create

创建并连接服务器。

C

void easyar_CloudRecognizer_create(easyar_String * cloudRecognitionServiceServerAddress, easyar_String * apiKey, easyar_String * apiSecret, easyar_String * cloudRecognitionServiceAppId, easyar_CloudRecognizer * * Return)

C++17

static std::shared_ptr<CloudRecognizer> create(std::string cloudRecognitionServiceServerAddress, std::string apiKey, std::string apiSecret, std::string cloudRecognitionServiceAppId)

C++03(Deprecated)

static void create(String * cloudRecognitionServiceServerAddress, String * apiKey, String * apiSecret, String * cloudRecognitionServiceAppId, CloudRecognizer * * Return)

Java

public static @Nonnull CloudRecognizer create(java.lang.@Nonnull String cloudRecognitionServiceServerAddress, java.lang.@Nonnull String apiKey, java.lang.@Nonnull String apiSecret, java.lang.@Nonnull String cloudRecognitionServiceAppId)

Kotlin

companion object fun create(cloudRecognitionServiceServerAddress: String, apiKey: String, apiSecret: String, cloudRecognitionServiceAppId: String): CloudRecognizer

Objective-C

+ (easyar_CloudRecognizer *)create:(NSString *)cloudRecognitionServiceServerAddress apiKey:(NSString *)apiKey apiSecret:(NSString *)apiSecret cloudRecognitionServiceAppId:(NSString *)cloudRecognitionServiceAppId

Swift

public static func create(_ cloudRecognitionServiceServerAddress: String, _ apiKey: String, _ apiSecret: String, _ cloudRecognitionServiceAppId: String) -> CloudRecognizer

C#

public static CloudRecognizer create(string cloudRecognitionServiceServerAddress, string apiKey, string apiSecret, string cloudRecognitionServiceAppId)

createByCloudSecret

使用Cloud Secret创建并连接服务器。

C

void easyar_CloudRecognizer_createByCloudSecret(easyar_String * cloudRecognitionServiceServerAddress, easyar_String * cloudRecognitionServiceSecret, easyar_String * cloudRecognitionServiceAppId, easyar_CloudRecognizer * * Return)

C++17

static std::shared_ptr<CloudRecognizer> createByCloudSecret(std::string cloudRecognitionServiceServerAddress, std::string cloudRecognitionServiceSecret, std::string cloudRecognitionServiceAppId)

C++03(Deprecated)

static void createByCloudSecret(String * cloudRecognitionServiceServerAddress, String * cloudRecognitionServiceSecret, String * cloudRecognitionServiceAppId, CloudRecognizer * * Return)

Java

public static @Nonnull CloudRecognizer createByCloudSecret(java.lang.@Nonnull String cloudRecognitionServiceServerAddress, java.lang.@Nonnull String cloudRecognitionServiceSecret, java.lang.@Nonnull String cloudRecognitionServiceAppId)

Kotlin

companion object fun createByCloudSecret(cloudRecognitionServiceServerAddress: String, cloudRecognitionServiceSecret: String, cloudRecognitionServiceAppId: String): CloudRecognizer

Objective-C

+ (easyar_CloudRecognizer *)createByCloudSecret:(NSString *)cloudRecognitionServiceServerAddress cloudRecognitionServiceSecret:(NSString *)cloudRecognitionServiceSecret cloudRecognitionServiceAppId:(NSString *)cloudRecognitionServiceAppId

Swift

public static func createByCloudSecret(_ cloudRecognitionServiceServerAddress: String, _ cloudRecognitionServiceSecret: String, _ cloudRecognitionServiceAppId: String) -> CloudRecognizer

C#

public static CloudRecognizer createByCloudSecret(string cloudRecognitionServiceServerAddress, string cloudRecognitionServiceSecret, string cloudRecognitionServiceAppId)

resolve

请求识别。可用最低请求间隔为300ms。

C

void easyar_CloudRecognizer_resolve(easyar_CloudRecognizer * This, easyar_InputFrame * inputFrame, easyar_CallbackScheduler * callbackScheduler, easyar_FunctorOfVoidFromCloudRecognizationResult callback)

C++17

void resolve(std::shared_ptr<InputFrame> inputFrame, std::shared_ptr<CallbackScheduler> callbackScheduler, std::function<void(std::shared_ptr<CloudRecognizationResult>)> callback)

C++03(Deprecated)

void resolve(InputFrame * inputFrame, CallbackScheduler * callbackScheduler, FunctorOfVoidFromCloudRecognizationResult callback)

Java

public void resolve(@Nonnull InputFrame inputFrame, @Nonnull CallbackScheduler callbackScheduler, @Nonnull FunctorOfVoidFromCloudRecognizationResult callback)

Kotlin

fun resolve(inputFrame: InputFrame, callbackScheduler: CallbackScheduler, callback: FunctorOfVoidFromCloudRecognizationResult): Unit

Objective-C

- (void)resolve:(easyar_InputFrame *)inputFrame callbackScheduler:(easyar_CallbackScheduler *)callbackScheduler callback:(void (^)(easyar_CloudRecognizationResult * result))callback

Swift

public func resolve(_ inputFrame: InputFrame, _ callbackScheduler: CallbackScheduler, _ callback: @escaping (CloudRecognizationResult) -> Void) -> Void

C#

public virtual void resolve(InputFrame inputFrame, CallbackScheduler callbackScheduler, Action<CloudRecognizationResult> callback)

close

停止识别并关闭连接。close之后不应继续使用。

C

void easyar_CloudRecognizer_close(easyar_CloudRecognizer * This)

C++17

void close()

C++03(Deprecated)

void close()

Java

public void close()

Kotlin

fun close(): Unit

Objective-C

- (void)close

Swift

public func close() -> Void

C#

public virtual void close()