We use essential cookies for the website to function, as well as analytics cookies for analyzing and creating statistics of the website performance. To agree to the use of analytics cookies, click "Accept All". You can manage your preferences at any time by clicking "Cookie Settings" on the footer. More Information.
We use essential cookies for the website to function, as well as analytics cookies for analyzing and creating statistics of the website performance. To agree to the use of analytics cookies, click "Accept All". You can manage your preferences at any time by clicking "Cookie Settings" on the footer. More Information.
We use essential cookies for the website to function, as well as analytics cookies for analyzing and creating statistics of the website performance. To agree to the use of analytics cookies, click "Accept All". You can manage your preferences at any time by clicking "Cookie Settings" on the footer. More Information.
We use essential cookies for the website to function, as well as analytics cookies for analyzing and creating statistics of the website performance. To agree to the use of analytics cookies, click "Accept All". You can manage your preferences at any time by clicking "Cookie Settings" on the footer. More Information.
This API provides code recognition service, by identifying QR and bar codes, sharing the information in them with the system, and providing service framework based on the information. The service framework can be integrated into a wide range of apps. This API can be used to parse QR codes and bar codes in 11 scenarios, including Wi-Fi and SMS messaging. It provides effective code detection and detection-result-based service capabilities for various programs and apps.
Scenarios
Image parsing, barcode reading
This API parses QR and bar codes in images, and can be applied in diverse scanning scenarios in applications.
Code scanning-based payments
This function is used in mobile services, such as payment app scanning.
Image extraction via code scanning
Code information is extracted when users scan the code, and related services are provided, according to the code recognition results.
Description
Request
Copy
BarcodeDetector detector = new BarcodeDetector(getApplicationContext()); Frame frame = new Frame(); frame.setBitmap(bitmap); JSONObject jsonObject = detector.detect(frame,null);
1Can I call the faceCompare() method without calling the prepare() method of the API?
Yes, you can. The engine is started by default in the faceCompare() method. If the engine has already been started, it will not restart.
2When should I call the release() method?
The release() method will uninstall a model that has been loaded to the NPU chip. If the app is no longer using face detection, uninstall the model in a timely manner to free up resources.