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 is used to implement the auxiliary enhancement for the document photocopying process. It automatically identifies documents and returns the location information of documents in the orginal image. Based on the position of the document in the orginal image, the camera automatically adjusts the shooting angle of the document. This function performs impressively in the digitalization of old photos, letters, and drawings.
Scenarios
Enhanced photo-copying, efficient recording
This API automatically identifies document positions and adjusts document angles in an image, for improved photo-copying of paper documents and works of art.
Photo-copying and correcting photos and letters
This API can be used to photo-copy physical photographs and letters, for better memory preservation.
Photographing works of art
Works in an art exhibition can be recorded with ease, using this API, regardless of the shooting conditions, such as the angle, and flow of passersby.
Description
Request
Copy
Parameter request of document detection: DocRefine docRefine = new DocRefine(this); Frame frame = new Frame(); frame.setBitmap(bitmap); JSONObject obj2 = docRefine.docDetect(frame, null);
1Can prepare() method directly use detect() method without calling the API?
Yes. In detect() method engine startup is in default. The engine will not start up again if started, please use with confidence.
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.
3Does HiAI support multi-thread calls?
The HiAi Engine does not allow an app to call multiple threads for a single API. This is because if one thread finishes first, it will call the release() method and uninstall the model, resulting in errors in all of the other threads. In the NPU, the back end service also executes tasks in order, so it is unable to run multiple threads through one function at the same time. However, multiple threads can be enabled at the same time if they are calling different APIs. For example, it is possible to enable one thread for Aesthetic Scoring, and another one for Scene Detection.