Tuning Symbol Recognition Template Library

The Symbol Recognition Template Library (SRTL) – is a library of symbol templates that used for symbol recognition and replacing in tracing, automatic vectorization, object selecting and also in Search and Replace as alternative method.
The procedures of selection, tracing and automatic vectorization of raster symbols are based on algorithms of raster symbol recognition by vector patterns. These vector patterns should be created before performing recognition activities.

The SRTL is intended for storing the information on what symbols should be found and with what are replaced. Every SRTL represents a collection of vector and raster Replace and Search items. To every Replace item in library put in conformity one or the several Search items.
The Search item is a vector or raster template that should be recognized. The Replace item is a vector or raster template, which should replace the corresponding to it Search item.

Every WiseImage command that uses SRTL tries to find a regular Search template in the document or on the raster image. In case of success, command replaces recognized symbol with the corresponding Replace template.

Symbol Recognition Template Library editor overview

The SRTL can be trained to recognize any raster or vector symbol. For this purpose users can add new symbol templates to one of the available libraries or create an entire new library.
Using the Symbol Recognition Template Library editor you can create, save in .SRT file for future use, open and edit these libraries. The user can select to exclude symbol templates from recognition process by simply deactivating them. You can import obsolete symbol template formats such as .SST.
To open SRTL editor choose Edit Symbol Recognition Template Library: from the Convert menu or press the button on the Raster to Vector toolbar.

The left part of the dialog box displays the contents of the current template library. This box shows the topological tree of Replace and Search templates. Collapsed Replace items are marked with . Open a set of Search items related to the Replace item by clicking on . Select an item by clicking on it. After an item is chosen, its content is shown on right part of the dialog box.

To include a template in recognize process set a checkmark to the left of the item name. Removing checkmark excludes templates and all sub-templates from this process.
 The Replace item will be ignored during symbol recognition if all its Search items are excluded.
On the left there is an example part of the SRTL, which included only Replace_2 with Search_1 items. The Replace_4 item will be ignored because of excluded Search_1 item.

SRTL basic operations

Choose Edit Symbol Recognition Template Library from the Convert menu or press the button of the Raster to Vector toolbar to open SRTL editor. The current library will be shown in SRTL editor dialog that appears.
Any SRTL could be saved to or opened from *.SRT file. To save current library into a file click the Save button and specify name for .SRT file in the appeared Save dialog. Use the Open button to open existing library and the New button to create a new one.
 Since libraries are stored in separate files, these can be deleted and copied, using standard operating system tools.
To insert a symbol template saved in an obsolete format, click the Import button and choose the *.SST file. The new one Replace item with corresponded to it Search item will be included into the current library.

Vector symbol template

Vector symbol templates are marked with sign inside SRTL tree. Vector symbol templates are used for recognizing raster symbols in such commands as symbol automatic vectorization, symbol tracing, symbol selecting and Search and Replace. In Search and Replace vector template can be used not only for finding raster symbols, but for vector too.
Before defining such a template for raster symbols recognition, create vector objects resembling the raster symbols. This can be done through vectorization, tracing or simply by drawing vector objects.
The set of such vector objects is used as a vector template. The template can consist of any set of objects, but for recognition only objects like line, arc, circle and polyline are used. The objects of a template can also be united in the block.
New vector template could be added to SRTL as Replace item or as Search item. When “Add Replace item” was performed, SRTL create new Replace item and associated new Search item with the same topological structure. The Search item could be added only to existing and selected Replace item.
Search item can have connecting lines. The setting of connecting lines increases the accuracy of symbols recognition, due to more exact and flexible description of the symbol geometry.
The connecting line is a vector object included in the template. One end of the connecting line joins the other objects in the template; the other end is free. The length of symbol parts corresponding to connection lines can be arbitrary. What matters are the position of points at which these objects join other symbol objects and contiguity angles.



The figure illustrates a symbol template where the connecting lines are worth adding

An arbitrary number of connecting lines can be specified. If the connecting lines are set in the symbol template, then only those symbols will be retrieved which have raster straight lines similar to the symbol’s, with the same points and at the same angles, as on the template; their lengths can differ from the length of the connecting line set in the template.

To create new vector symbol template

1 Draw vector objects, approximating raster symbols, or create them using vectorization or tracing procedures. Because of SRTL editor window is modeless, these operations can be done even this dialog is open.
 It is recommended to unite objects of a vector template in a block. After vectorization with symbol recognition or after the Search and Replace operations all named blocks can easily be replaced with other graphic symbols, for example, by applying the standard procedure of block redefinition.
2 Select created objects, using standard vector selection tools.
3 To add selected vector objects as Replace item click the Add Replace Item button. The selected objects will be included as new symbol template into SRTL. The new one Replace item with corresponded to it Search item will be included into the current library.
To add selected vector objects as Search item select appropriate vector Replace item in the left dialog window, because the Search item could be added only to existing Replace item. It is not possible to add vector symbol template as a Search item for a raster Replace item. Click the Add Search Item button. The selected objects will be included as new symbol template into SRTL. The new one Search item corresponding to the specified Replace item will be appeared in the left dialog window.
4 Select the newly added Search item in the left dialog window.
5 Click the Select Connection Lines button. Click in the right dialog window on those symbol template objects, which should be the connecting lines. The connecting line is highlighted with red colour. If the object is assigned by a line of connection by mistake, then click on it once more to deselect. The object colour will be changed to the original one.
 Note that the line of connection should be a segment with one end adjoining to template objects, and another being free. Otherwise, the program will not assign the object to the connecting line.

Raster symbol template

Raster symbol templates are marked with sign. These templates are used by the Search and Replace tool as Search or Replace items.
When raster symbol template is added to the library as Replace item, SRTL does not automatically create a corresponding to it Search item. This should be done manually.
A raster symbol template could be added as Search item for raster or vector Replace item. However, it is not possible to add a vector symbol template as a Search item for a raster Replace item.

To create new raster symbol template

1 Open a raster image and select some raster objects, using standard raster selection procedures. Because of SRTL editor window is modeless, these operations can be done even while this dialog is open.
2 To add selection as Replace template click the Add Replace Item button. The raster selection pattern will be included into SRTL.
To add raster selection as Search template select appropriate vector or raster Replace item in the left dialog window, because the Search item could be added only to existing Replace item. Click the Add Search Item button. The raster selection will be included as new template into SRTL. The new one raster Search item corresponded to specified Replace item will be appeared in the left dialog window.

SRTL editor dialog buttons and controls

Left dialog window (topological tree window) Shows structure of current Symbol Recognition Template Library (SRTL).
Right dialog window (template window) Shows content (template) of selected library item.
New-Creates a new empty SRTL.
Open – Load a library from *.SRT file into SRTL editor dialog.
Import- Import an old symbol template format (*.SST) in current library
Save- Saves the active (current) library in current *.SRT file.
Save As- Saves the library in a new *.SRT file.
Select Connection Lines- Allows to select connecting lines in the symbol template window of the dialog (useful only for vector template of Search item).
Add Search Item- Attaches Search item to the specified Replace item. The Replace item must be selected beforehand in the search-replace topological tree of the dialog.
Add Replace Item- Adds Replace item to the SRTL.
Delete- Deletes selected item from library.

 To exclude an item from recognition process, just remove checkmark on the left of the item’s name without deleting it from the library. The item is deactivated.

Feedback

Was this helpful?

Yes No
You indicated this topic was not helpful to you ...
Could you please leave a comment telling us why? Thank you!
Thanks for your feedback.

Post your comment on this topic.

Post Comment