CloudRecognizer Class¶
Description¶
CloudRecognizer implements cloud recognition. It can only be used after created a recognition image library on the cloud. Please refer to EasyAR CRS documentation.
When the component is not needed anymore, call close function to close it. It shall not be used after calling close.
Before using a CloudRecognizer, an ImageTracker must be setup and prepared. Any target returned from cloud should be manually put into the ImageTracker using ImageTracker.loadTarget if it need to be tracked. Then the target can be used as same as a local target after loaded into the tracker. When a target is recognized, you can get it from callback, and you should use target uid to distinguish different targets. The target runtimeID is dynamically created and cannot be used as unique identifier in the cloud situation.
isAvailable¶
Returns 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¶
Creates an instance and connects to the server.
- 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¶
Creates an instance and connects to the server with 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¶
Send recognition request. The lowest available request interval is 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¶
Stops the recognition and closes connection. The component shall not be used after calling 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()