Info |
---|
This page shows several examples of how to use the current code module. The examples are structured as a copy-and-paste code that works without any knowledge of programming. (Some codes might require primitive modification based on the description provided) |
To implement any of these codes into your project it is necessary that you:
Create a new Code module and name it according to the feature
Delete all of the predefined example code - “make your canvas clean ”
Copy and paste the code provided and modify only the specified variables.
Expand | |||||||
---|---|---|---|---|---|---|---|
| |||||||
Exit image evaluation from flow:It is possible to stop evaluation early to save time based on a specific condition e.g. a Classifier distinguishes product types and chooses different evaluation branches to meet the specific product requirements.
See the example of different evaluation flows based on product type:
|
...
awfawf
awfwa wa fwa fwa
...
title | Cut by a detected rectangle |
---|
...
It is necessary to modify the list |
Expand | |||||
---|---|---|---|---|---|
| |||||
Crop image by a detected rectangleUseful when the image contains unnecessary elements and the goal is to focus only on a certain part. To do this:
It is necessary to modify the |
Expand | |||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| |||||||||||||
Save evaluated images to foldersUseful when your goal is to inspect the evaluated images at a later time.
It is necessary to modify at least The folder path to copy and paste is written here: |
Expand | |||||
---|---|---|---|---|---|
| |||||
Send data to S7-1200 PLCTo send your custom data or data from Pekat to a PLC:
This is for sending booleans. To send other type of data: Set up
|
Expand | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|
| ||||||||||
Use Heatmap as a maskIt is possible to use previously detected heatmap (from anomaly or surface) as a masking tool to hide specific objects or features.
To get back the original image (delete the mask), copy and paste the following code into a different code module:
See image: Surface detector finds the heatmap of an object → Code module masks out the image → Further detections are done → Code module unmasks back to the original. |
Expand | |||||
---|---|---|---|---|---|
| |||||
Measure the distance between rectanglesIt is possible to calculate the distance between detected objects for further evaluation.
This code:
|
Expand | |||||
---|---|---|---|---|---|
| |||||
Color a grayscale depth map imageThe grayscale depth map can be colored based on a specified threshold and color. Useful when using a 3D scanner (like Photoneo) that returns a depth map. The extreme pixels (white and black) in the image are ignored, other pixels are linearly interpolated and assigned a color.
|
Expand | |||||
---|---|---|---|---|---|
| |||||
Rename existing model classesIt is possible to change the names of classes that were used in training. Useful when you made a mistake during naming or only made numeric names like “Type 1” - see images
Classes not mentioned in the dictionary will not be modified.
|
Expand | |||||
---|---|---|---|---|---|
| |||||
Rescaling the heatmap back to the original is useful in a project where Anomaly or Surface modules are applied on a smaller cut-out version of the image to lower evaluation time and increase heatmap accuracy.
|
Expand | ||
---|---|---|
| ||
It is possible to count and show the amount of rectangles belonging to a specific class using the following guide.
|