Collapse
CollapsingX
  • - or -

Reconfigure step overview


The Reconfigure step can change the values of other step inputs. It is the only means of allowing users to modify collections or to access individual pixels at runtime. To support the runtime training of models and redefinition of shapes, you need to use the Reconfigure step.

When modifying simple inputs, it is usually easier and more efficient to bind the input to the operator view, link the input to a variable modified by a Store step, or link the input to an output of a step.

The following items can be reconfigured:

  • Simple input properties.

  • Model collections (for example, Add and Delete models).

  • Individual models (for example, change the Model image).

  • Individual shapes (for example, a search region).

You can add reconfigurations to a Reconfigure step by clicking on the Add button in the Configuration pane. You will then be able to select the input to be reconfigured.

Each reconfiguration has an Enabled input which can be linked to (for example, the reconfiguration can be enabled during model training and disabled at other times).

Note that reconfiguring an input that is linked to an expression will overwrite that expression.

For an example that uses the Reconfigure step to modify models at runtime, see the Runtime Model Definition example project, available from the Quick Start tab.

To reconfigure the shape searched for by a shape finder step (for example, the RectangleFinder step), you must add a reconfiguration for the step itself instead of an individual input.

Note that when reconfiguring points, the X- and Y-coordinates are reconfigured individually. For information on accessing the individual X- and Y-coordinates of a point object, see the Using TRANSFORMCOORDINATES and accessing individual coordinates subsection of the Transforming from one coordinate system to another section in Chapter 32: Fixturing.

Persistence

Steps that are the target of a Reconfigure step are persistent by default. For more information about persistence, see Persistence and the SavePersistentData step.

Note that modifications made to persistent steps by a Reconfigure step are only saved when your project terminates correctly, or when a SavePersistentData step is executed.

Reconfiguring items in a collection

The Reconfigure step can be used to add or modify the models, templates, or samples in a collection at runtime. This allows users to add new items to steps in the Finders category at runtime (you might also be familiar with the terms retrain and relearn for this process).

Changing a model image or mask

To change the image or mask of a model at runtime, select the model for reconfiguration (see the Runtime Model Definition example, included with Matrox Design Assistant).

If a model is created using circular overscan from PatternMatching step, you must configure a region that is no closer than the root of 2 multiplied by the largest dimension of the expected model from any edge.

ModelFinder models

The Reconfigure step can Create, CreateFromDXF, Clone, and Delete models in a ModelFinder step. To access these operations, select the Models collection for reconfiguration.

Note that you can also configure the model's reference frame.

PatternMatching

The Reconfigure step can Create, Clone, Rotate, or Delete models in a PatternMatching step. To access these operations, select the Models collection for reconfiguration.

When creating a new model, you need to specify a region of an image and the model type. For all actions that create a new model you can specify the model name. Any subsequent Create with the same name will overwrite the existing model.

A newly-created model will have the default settings, while a newly-cloned model will have a copy of the original model's settings. Use a sequence of reconfigurations to change any settings that need to be modified. To be able to refer to the inputs of a model that does not exist yet, there is a special placeholder in the tree structure that can be used to access the runtime model. The placeholder has the following form:

PatternMatching.Models(Reconfigure.Reconfigurations("Reconfiguration").ModelName)

So, for example, to change the number of occurrences to find in a newly create model, add a reconfiguration on the input:

PatternMatching.Models(Reconfigure.Reconfigurations("Reconfiguration").ModelName).Number