Documentation
Table of contents

Thanks for downloading Dynamsoft Label Recognizer Package!

Your download will start shortly. If your download does not begin, click here to retry.

RecognizeTextLinesWithCameraEnhancer

This sample illustrates how to recognize text lines from the video streaming. In this sample, you can read how to use DynamsoftCameraEnhancer to capture the video streaming.

View the sample code

There are some basic concepts that are helpful on understanding the SDK.

CaptureVisionRouter

CaptureVisionRouter is a router that responsible for retrieving images from the source, coordinating the image processing tasks and dispatching the processing results. To implement a text line recognizing task, what you have to do are:

  • Set a standard input for your CaptureVisionRouter instance.
  • Set a result receiver via your CaptureVisionRouter instance.
  • Tell your CaptureVisionRouter instance to start working and specify a text line recognizing template with its name.
  • (Additional) Configure the image processing Parameters to optimize the text line recognizing performance.

Standard Input

Use the setInput method of the CaptureVisionRouter to bind an ImageSourceAdapter (ISA) instance is the simplest way to access to the standard input. CameraEnhancer is one of the official implementation of the ISA for you to quickly set up the mobile camera as the image source.

Output

To get the output result, you have to implement the CapturedResultReceiver and bind it with your CaptureVisionRouter instance. You will receive the text line recognizing results in the onDecodedBarcodesReceived method each time when a image (video frame) is processed.

Control the Start & Stop of the Capturing

If only one text line recognizing result is required in one scan, you can stop the text line recognizing thread via stopCapturing method. You can call the startCapturing at any time when you want to restart the text line recognizing.

  • Objective-C
  • Swift
  1. - (void)onRecognizedTextLinesReceived:(DSRecognizedTextLinesResult *)result {
       if (result.items.count > 0) {
          // Stop capturing if barcode result is no empty.
          dispatch_async(dispatch_get_main_queue(), ^{
             [self.cvr stopCapturing];
          });
          for (DSBarcodeResultItem *item in result.items) {
             // Deal with the result you get.
          }
       }
    }
    
  2. func onRecognizedTextLinesReceived(_ result: RecognizedTextLinesResult) {
       if let items = result.items, items.count > 0 {
          DispatchQueue.main.async {
             self.cvr.stopCapturing()
          }
          for item in items {
             // Deal with the result you get.
          }
       }
    }
    

This page is compatible for:

Version 7.5.0

Is this page helpful?

YesYes NoNo

In this article:

latest version

    • Latest version (3.2.30)
    • Version 3.x
      • Version 3.0.20
    • Version 2.x
      • Version 2.2.20
      • Version 2.0.0
    • Version 1.x
      • Version 1.2.1
      • Version 1.2.0
      • Version 1.0.0
    Change +
    © 2003–2024 Dynamsoft. All rights reserved.
    Privacy Statement / Site Map / Home / Purchase / Support