Use the Text Detection Module

Taking an image dataset of identification numbers (download) as an example, this topic will show you how to use the Text Detection module to detect the text area in an image. The Text Detection module can be followed by a Text Recognition module to output the recognized numbers, letters, or some special symbols.

You can also use your own data. The usage process is overall the same, but the labeling part is different.

Workflow

  1. Create a new project and add the Text Detection module: Click New Project after you opened the software, name the project, and select a directory to save the project. Then, click example projects icon create in the upper-right corner and add the Text Detection module.

    example projects add project
  2. Import the image data of identification numbers: Unzip the downloaded data file. Click the Import/Export button in the upper left corner, select Import Folder, and import the image data.

    When you select Import Dataset, you can only import datasets in the DLKDB format (.dlkdb), which are datasets exported from Mech-DLK.
    example projects import images
  3. Select an ROI: Click the ROI Tool button example projects icon roi and adjust the frame to set an ROI that covers the text areas of all images. Then, click the tools introduction OK button in the lower right corner of the ROI to save the setting. Setting the ROI can avoid interferences from the background.

    example projects roi
  4. Split the dataset into the training set and validation set: By default, 80% of the images in the dataset will be split into the training set, and the rest 20% will be split into the validation set. You can click example projects icon slider and drag the slider to adjust the proportion. Please make sure that both the training set and validation set include all kinds of text areas to be detected. In the training set, the images with different text orientations should be balanced. If the default training set and validation set cannot meet this requirement, please right-click the name of the image and then click Switch to training set or Switch to validation set to adjust the set to which the image belongs.

    example projects move image
  5. Label the images: Select an appropriate tool from the toolbar to label the images. During labeling, the selection frame should be placed as close to the edges of the text area as possible to minimize interference. Incomplete selections or overly large selection frames should be avoided.

    example projects labeling
  6. Train the model: Keep the default training parameter settings and click Train to start training the model.

    example projects training chart
  7. Validate the model: After the training is completed, click Validate to validate the model and check the results.

    After you validate a model, you can import new image data to the current module and use the pre-trained labeling feature to perform auto-labeling based on this model. For more information, see Pre-trained labeling.

    example projects result verification
  8. Export the model: Click Export. Then, set Input image size in the pop-up dialog box, click Export, and select a directory to save the exported model.

    By default, the Input image size is consistent with that set in the Validation Parameters dialog box. In validation, if the inference speed and accuracy are up to standard, you can keep the default setting.
example projects model files

The exported model can be used in Mech-DLK SDK. Click here to view the details.

We Value Your Privacy

We use cookies to provide you with the best possible experience on our website. By continuing to use the site, you acknowledge that you agree to the use of cookies. If you decline, a single cookie will be used to ensure you're not tracked or remembered when you visit this website.