Working with Recipes#
Recipes are saved with the extension .precipe and can be imported into your application code. For more information about importing and working with recipes in your application, refer to the C++ Data Processing Programmer's Guide (accessible via the Help menu) or the Data Processing SDK samples.
There are three types of recipes:
- pylon Recipe: This is the standard recipe format.
- pylon Compressed Recipe: This applies compression to binary during saving. This makes the recipe files smaller but increases the time required to save and load recipes. It still contains the same amount of data as the standard pylon recipe, but in compressed form.
- pylon Lean Runtime Recipe: This saves a recipe with only the data required for runtime operation making it faster to load. It contains less data than the standard pylon recipe. This makes it a good choice for deploying recipes in your work environment. If you want to edit the recipe further, make sure to keep a copy of the standard recipe. Lean runtime recipes that contain Template Matching Basic and Geometric Pattern Matching Basic and Pro vTools are not backward-compatible.
Depending on the image processing tasks you want to perform, pick the required vTools and connect them in the desired order.
Creating a Recipe#
To create a recipe:
-
In the Workbench, open a new recipe:
- In the Workbench menu, select New Recipe or New from Template.
-
In the Workbench toolbar, click the New Recipe button:
-
Add vTools by selecting them in the vTools pane or by right-clicking in the recipe and selecting the desired vTools from the context menu.
- Connect the outputs of one vTool with the corresponding inputs of the next vTool in your design by clicking on an output pin and dragging the connection onto the input pin.
- Connect the outputs of the last vTool to the output terminal by clicking on an output pin and dragging the connection onto the output terminal.
-
Save the recipe in the desired format.
Info
If you want to save camera parameter settings of the camera allocated in the Camera vTool, click the Lock Resources button in the Workbench toolbar first. Otherwise, no camera settings will be saved in the recipe. For more information, see the Camera vTool topic.
Recipe Templates#
The Workbench provides a number of recipe templates to get you up and running quickly. Templates for the following application scenarios are available:
- Aztec code reading
- Barcode reading
- Blob analysis
- Color blob analysis
- Data Matrix code reading
- Geometric pattern matching
- Gray value transformation
- Image alignment
- Image combination
- Image format conversion
- Image loading
- Image morphology
- Measurements (circles, ellipses, lines, rectangles)
- PDF417 code reading
- QR code reading
- ROI creation
- Template matching
Running a Recipe#
Before importing a recipe into your application code, it's advisable to test it. That way you can verify that everything is configured correctly and produces the desired results.
To run a recipe:
- Click Lock Resources to exclusively allocate the cameras you want to use.
If you need to configure any camera settings, go to the Features - All pane. -
In the Workbench toolbar, click the Run button:
-
In the Preview Pin Data area of the Recipe Management pane, the data that goes into and comes out of the currently selected vTool's pins is displayed.
For a larger view, open a pin data view by clicking the Pin Data View button in the Workbench toolbar:
Collecting Statistical Data#
To check whether your recipe meets the timing requirements of your application, you can measure the execution times of individual vTools or all vTools included in the recipe.
To collect statistical data:
- Start the recipe that you want to examine.
- If you want to collect data about a vTool, select that vTool in the recipe.
If you want to collect data about the recipe, click anywhere in the recipe, not on a vTool, to select it. A blue frame around the recipe shows that the recipe has been selected. - In the Recipe Management pane, click the Statistics tab.
- Click Start Measurement.
Depending on your selection in step 2, the corresponding data will be displayed in the Recipe Statistics or (vTool) Statistics area.
The results will be logged in a .CSV file. By default, this file will be saved in your user folder: C:/Users/username.
To change the folder:
- Select the recipe by clicking anywhere in the recipe, not on a vTool.
A blue frame around the recipe shows that the recipe has been selected. - In the General Settings area, change the output folder.
For more information about the statistics feature, see Recipe Management.
Optimizing Recipes#
You can specify how many Workbench threads your CPU processes simultaneously.
To optimize your recipe:
- In the Recipe Management pane, click the Optimization tab.
- Enter the desired thread count.
For more information about optimization, see Recipe Management.