Skip to content

Best Practice

General

  1. To get the maximum from our SDK, please consult the reference manual of the main C++ library interface. It is directly mapped to multiple library wrappers and contains a log of useful functionality.

  2. The recognition engine initialization could take some time, but remember that the engine is constant with regards to recognition. The engine can only be initialized once, after that multiple recognition sessions can be spawned from the same engine. The sessions could be spawned in parallel and they will not influence each other in any way.

  3. We recommend evaluating the recognition result confidence by the fields' isAccepted flag. For a more accurate assessment of the confidence level, you can use the Confidence value, which is also available for each text field.

  4. Avoid preprocessing the input images. Our products work best with images taken directly from a capture device (a camera or a scanner).

  5. Avoid too large images. Sometimes a large image resolution does not guarantee better quality quality, but only increases recognition time.

  6. For phone numbers and bank card numbers (do not confuse with bank card recognition), you need a 2:1 image. For example, if the image width is 500px, then its height should be about 250px. The reason for this limitation is the fact that in these proportions the recognized object occupies the maximum area in the image. Our search network is trained for this scenario.

Mobile SDK

  1. Do not keep your personalized signature in a readable form (i.e. in resources), always keep it either encoded in the app's binary or even remotely downloadable.

  2. Always interact with the library interface asynchronously. Initialize the library and create a recognition session before or concurrently with opening the camera view. This ensures the scan button is available to the user almost immediately.

  3. Initialize only a single instance of the library. As library initialization is a resource-intensive operation, always perform it outside the UI thread to avoid blocking the user interface.

  4. Lazy library initialization is enabled in the mobile SDK by default. We recommend keeping this setting enabled in your application.

  5. A common practice for recognition screen interfaces is displaying a document outline overlay on the camera preview to help users align the document. However, we do not recommend cropping the image to fit this outline, especially for barcodes and bank cards. The reason is that the detection algorithm for these items is very fast, and they might be recognized before the user fully positions them within the designated area.

Server SDK

  1. Remember that you can disable the the internal multithreading of the recognition engine forcing the engine to load and initialize all resources at once. This approach can be useful for determining the peak memory consumption.
  2. When processing images loaded from local files, ensure these files are stored on high-performance storage. On systems with slow disk I/O, the time required to load an image file can exceed the actual recognition time.
  3. In server SDKs lazy initialization is disabled by default. We recommend to keep it disabled to reduce memory comsuption.