Lesson 8. Automatic vectorization, text recognition

Brief description: During this lesson you will learn how to tune vectorization and text recognition parameters, to vectorize raster images according to specified parameters, and to correct vectorization results.

For detailed information on these subjects see the following sections of the Quick Start guide: Tuning Vectorization, How to Vectorize, How to Recognize Text, Correcting Vectorization Results in the Automatic Vectorization section of the Quick Start guide.

Tuning Vectorization

You can use one of the pre-defined templates or tune the parameters yourself. During this lesson you’ll tune the parameters yourself.

Using the Open command from the File menu; open the Mech.tif file from the Lesson_8 folder.

Automatic vectorization is tuned in the R2V Conversion Options dialog. To open this dialog, choose Conversion Options from the Convert menu.

When tuning vectorization you need to specify the following parameters:

  1. The types of raster entities to recognize.
  2. The image geometry.
  3. Separating specified parameters by layer.
  4. Text recognition parameters (if you use the OCR module - set word patterns for text recognition).    

How to specify types of entities to recognize

  • Open the Recognition tab of the R2V Conversion Options dialog.
  • Select the entities, which you want to obtain after vectorization - select the corresponding checkboxes.
    The additional parameters for recognized objects, such as line type, arrows, hatch angle and others are located on the second level. Click on "+" to get access to these parameters.
    Specify the following types of entities to recognize on the image - Sample1.tif:
    • Lines - Line types, Arrows (as there are lines of different types and dimension lines with arrows in this image).
    • Arcs & Circles - Arrows (as there are dimension arcs with arrows in this image).
    • Test Areas - OCR (as we intend to recognize texts using the OCR module).
    • Hatches - 45° (as there are hatches with angle 45° in this image).
           

You can preview recognized objects in the Program window.

INFORMATION: To preview recognized objects you must clear the Use table checkbox in the Separate tab of R2V Conversion Options dialog.

Setting the geometry of the image

  • Open the Options tab of the R2V Conversion Options dialog.
  • Using the appropriate Measure buttons specify:
Min Length -minimum length of a raster object to be recognized.
Max Width - maximum width of raster lines. Set the value of this parameter slightly greater than the measured maximum line width on your drawing.
Max Break - maximum accepted breaks in a raster line to be ignored. Set the value of this parameter slightly greater than the distance between dashes in dash lines or breaks in lines.
Text Height - Set this parameter value equal to the maximum height of raster text symbols of upper case.
Arrow size - the size of dimension arrows in your image. Outline the arrow of an average size with a rectangle, as shown in the figure.
  • Move the Accuracy slider to the Low position to make the vectorization procedure less sensitive to any drawing errors. 
  • To make the lines orthogonal, select the Orthogonalization checkbox and set the value of Base Angle equal to 0°.
The appearance of the Options tab after tuning is complete.

Separating vector objects by width to different layers and colors

The criterion for separating vector objects to different layers and/or colors is the width of the original raster lines. You can define widths of the resulting vector objects and separate them by width to different layers and/or colors.

Let’s separate the resulting vector objects by width to different colors:

  • specify a width equal to 0.5mm and red color for vector objects resulting from vectorization of raster lines whose width is less than 0.8mm;
  • specify a width equal to 1mm and blue color for vector objects resulting from vectorization of raster lines whose width is greater than 0.8mm.
  • Open the Separate tab of the R2V Conversion Options dialog.
  • Select the Use Table checkbox.
  • Add a new separation interval by entering a value of 0.8 in the New Interval field and pressing the button.
  • Set parameters for each interval:
    • In the Width field, enter a width equal to 0.5 for thin lines and 1.0 for thick lines; 
    • In the Color field, select red for thin lines and blue for thick lines.
  • Select the checkboxes for each interval.
INFORMATION: Select the Use Table checkbox in the Separate tab to preview the results of the separation by width in the Program window.

Tuning text recognition

WiseImage features various ways of working with raster texts - you can use either the built-in or external OCR modules, recognize raster text areas, or approximate raster texts with vector polylines and outlines.

In this example you will learn how to use the built-in OCR for recognizing texts and creating the corresponding text objects.

  • In the Recognition tab, we have already selected the Text Areas checkbox and recognition method - OCR, and in the Options tab, we have specified Text Height.
  • Open the Texts tab of the R2V Conversion Options dialog.
  • In the Orientation field choose Horizontal and Vertical from the list.
  • Select the Standalone Letters checkbox, as they are present in this example.
  • Set patterns for recognizing text inscriptions, which are present in the drawing:
Text
Pattern
Text
Pattern
,
%D
,
%1E
,
%D%1S
,
%1S%D
2x%2D%1S
M%2D
2x%D
%E

 

  • Enter patterns one by one in the Patterns field, and press the Add Pattern button after entering each pattern.

For convenience you can select standard pattern fragments from the right-button menu.
If you enter a pattern incorrectly, choose it from the list, and then press the Delete Pattern button.

  • Select the Patterns checkbox to use the specified patterns when recognizing the text.
  • If you want to define height for recognized texts (e.g. 6mm) enter this value in the Height Table field and select the corresponding checkbox.
  • Choose default.ocr from the list of Template Files. 
  • Select a special layer for recognized texts (e.g. Texts) in the Place to Layer field.
  • Press OK to save the vectorization settings.

Saving vectorization settings for future use

If you want to save the settings for future use:

  • Press the Template button and choose Save.
  • Specify a name for the template in the File Name field of the Save Template File dialog.
  • To load a previously saved template, press the Template button, choose Load and specify a file to load

Running Vectorization

To run vectorization, choose Raster 2 Vector from the Convert menu.

Original raster drawing
Vectorization result

Correcting vectorization results

Correcting recognized texts

To correct recognized texts:

  • Choose Edit OCR Texts from the Convert menu.
  • The first recognized text is displayed in the screen center. Check it and correct it if necessary.
  • Press the Accept Recognized Texts button to accept the checked text, and then shift to the next one.
  • To delete a recognized text, press the Delete OCR Text button.

Automatic correction

To correct vectorization results in automatic mode:

  • Choose Vector Correction Options from the Convert menu.
  • Specify the operations and parameters. Press OK to close the dialog.
  • Select the vector objects to apply auto correction to.
    TIPS:You can select all vector objects by pressing the Vector Selection and Select All buttons on the Select toolbar.
  • Choose Vector Autocorrect from the Conversion menu.      

Manual correction of vectorization results

After applying automatic correction, we also recommend that you apply manual correction. The commands for interactive correction are located on the Vector Correction toolbar.

Using these tools you can join selected vector objects to lines, polylines, circles and arcs. You can trim, expand, break vector objects, correct them to intersections, align angles and distances, create chambers and fillets, etc.

 [ welcome ]   [ hybrid graphics ]   [ quick start ]   [ tutorial ]   [ reference ]   [ about ] 
 
 [ Welcome ]  [ WiseImage for Windows ]   [ WiseImage for AutoCAD ] 


 
top