03 01 PatternLocation PatMax 3D

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 11

Objectives

Pattern Location with At the end of this section participants will be able to:
PatMax 3D  Identify the property sheet parameters and outline what they are
Section 3 used for
 Demonstrate how to place the 3D region of interest to allow for
movement, size and rotation
 Demonstrate how to use the PatMax 3D tools to locate a part

Section 3 | Slide 2

The third section of the In-Sight 3D Standard class will cover Pattern Location with At the end of this section participants will be able to:
PatMax 3D.
 Identify the property sheet parameters and outline what they are used for
In-Sight 3D offers two high-speed and high-accuracy 3D pattern match tools:  Demonstrate how to place the 3D region of interest to allow for movement,
 TrainPatMax3D: extracts and trains a pattern from a point cloud. This pattern is size, and rotation
then used by the FindPatMax3D function.  Demonstrate how to use the PatMax 3D tools to locate a pattern
 FindPatMax3D: finds matches to the 3D pattern trained with TrainPatMax3D.

Section 3 | Slide 1 Section 3 | Slide 2


3D Pattern Match Functions TrainPatMax3D

Property Sheet

Section 3 | Slide 3 Section 3 | Slide 4

The In-Sight 3D Pattern Match Functions are used to train and find 3D patterns with The TrainPatMax3D Property Sheet includes the following parameters:
Cognex’s proprietary PatMax3D® technology. These PatMax3D functions allow you to
locate features in an input point cloud that exhibit maximum similarity to a trained 3D  Fixture3D specifies the point cloud coordinate system in which the 3D fixture is
pattern. The process specifics of pattern finding may differ depending on the nature of defined. This parameter is available only if the External Fixture is set to 0.
the similarity metrics employed, but the basic concepts remain more or less the same  External Fixture specifies a reference to a Fixture3D structure defined in another cell
regardless of the implementation. to be used as the function’s fixture. Set to 0 (off) to use the function’s internal fixture
instead.
The pattern finding process consists of two phases: Training and Finding.  Region3D specifies the dimensions, offset, and angle of the function’s 3D region of
 In the Training phase, a 3D Region of Interest (ROI) containing an example of interest.
the pattern to be located is manually identified and extracted to create a trained  External Region specifies a reference to the 3D region defined in another cell to be
pattern. used as the function’s region of interest.
 In the Finding phase, new point cloud acquisitions presented to the system are  Exclude Base Plane when enabled, the function adds a separate planar region of
searched for positions that exhibit maximum similarity, according to specified interest, so that the surface plane can be excluded when training and/or finding a 3D
metrics. These local match positions are sorted in order of descending pattern, improving the tool’s performance.
similarity, and the best responses above a specified minimum level of similarity  Plane3D specifies the offset and the angle of the plane to use.
are then reported.  External Plane specifies a reference to a Rectangle3D or Circle3D structure defined in
another cell to be used by the function.
 Train Event trains the configured pattern upon clicking the button.

Section 3 | Slide 3 Section 3 | Slide 4


TrainPatMax3D TrainPatMax3D

1.

2.

Section 3 | Slide 5 Section 3 | Slide 6

The TrainPatMax3D function is used to extract and train a 3D pattern in the point cloud. Follow these steps to set the 3D Region for the TrainPatMax3D function:
This pattern is then used with the FindPatMax3D function. This function returns a 1. Double-click the Region3D parameter.
Model3D structure. 2. Place the region around the feature to extract and click the <Enter> key.
 A best practice is to use the quick drop box feature to draw the region.

Section 3 | Slide 5 Section 3 | Slide 6


TrainPatMax3D TrainPatMax3D

3.

4.

5.
Section 3 | Slide 7 Section 3 | Slide 8

3. If the Base Plane is to be excluded from the search region uncheck the The 3D Pattern is trained and the Model3D structure is added to the spreadsheet. Or, if
Exclude Base Plane checkbox. any of the input parameters are invalid #ERR will be added to the spreadsheet.
4. Click the Train Event button.
5. Click the OK button to close the TrainPatMax3D Property Sheet.

Section 3 | Slide 7 Section 3 | Slide 8


TrainPatMax3D Outputs FindPatMax3D

Property Sheet

Section 3 | Slide 9 Section 3 | Slide 10

The TrainPatMax3D Outputs: The FindPatMax3D Property Sheet includes the following parameters (in addition to
 Trained = GetTrained(Model3D) checks if the referenced cell contains a successfully those available in the TrainPatMax3D Property Sheet):
trained pattern or not. The function returns 1 if it does, and 0 if it does not.  Offset specifies the signed distance to the offset base plane.
 Origin = GetOrigin(Model3D) returns the origin point of the model as a Point3D  Model3D specifies a reference to a trained Model3D structure trained with eh
structure. TrainPatMax3D function in another cell.
 X = GetX(Point3D) returns the X-axis coordinate of the model’s origin point.  Num to Find specifies the number of pattern instances to find. The value range is 1 to
 Y = GetY(Point3D) returns the Y-axis coordinate of the model’s origin point. inf, and the default value is 1.
 Z = GetZ(Point3D) returns the Z-axis coordinate of the model’s origin point.  Accept Threshold specifies the minimum percentage score that a result must have to
be considered a found pattern. The value range is 0 to 100, and the default value is
180.
 Max In-Plane Rotation Angle specifies the maximum in-plane rotation angle that a
result can have to be considered a found pattern. The value range is 0 to 180, and the
default value is 180.
 Max Tilt Angle specifies the maximum tilt rotation angle that a result can have to be
considered to be considered a found pattern. The value range is 0 to 180, and the
default value is 90.
 Sort Key specifies the logic by which the found objects are sorted.
 Sort Order specifies whether to sort the results in ascending or descending order. This
parameter is disabled if Sort Key is set to None.
 Sort Tolerance specifies a threshold to determine if 2 or more results are tied, if they
are tied, they can be sorted by a subsequent sort. This only takes effect when multiple
sorting rules are applied.
 Sort Reference specifies the origin of the coordinate space in which the positional and
rotational values are defined.

Section 3 | Slide 9 Section 3 | Slide 10


FindPatMax3D FindPatMax3D

1.
2.

Section 3 | Slide 11 Section 3 | Slide 12

The FindPatMax3D function is used to find objects in the point cloud based on a trained Follow these steps to set the 3D Region for the FindPatMax3D function:
PatMax3D pattern configured with the TrainPatMax3D function. The function returns a 1. Double-click the Region3D parameter.
Patterns3D structure. 2. Place the region around the feature to extract and click the <Enter> key.
 A best practice is to use the quick drop box feature to draw the region.

Section 3 | Slide 11 Section 3 | Slide 12


FindPatMax3D FindPatMax3D

3.

4.

Section 3 | Slide 13 Section 3 | Slide 14

3. If the Base Plane is to be excluded from the search region uncheck the The Patterns3D structure is added to the spreadsheet. Or, if any of the input parameters
Exclude Base Plane checkbox. are invalid #ERR will be added to the spreadsheet..
4. Double-click the Model3D parameter to open – reference the TrainPatMax3D
cell (Model3D) and press the <Enter> key..
5. Click the OK button to close the FindPatMax3D Property Sheet.

Section 3 | Slide 13 Section 3 | Slide 14


FindPatMax3D Outputs 2D Grey Scale vs 3D Point Cloud Images

Section 3 | Slide 15 Section 3 | Slide 16

The FindPatMax3D Outputs: 2D Grey Scale Image (A1 cell in the spreadsheet):
 Num Found = GetNFound(FindPatMax3D) returns the number of found patterns.  Obtained from the camera using the laser line as the light source.
 Index =  It’s equivalent to the image obtained from a linescan camera.
 Score = GetScore(Patterns3D, index) returns the score of the found pattern specified  It works in 2 reference space: calibrated in the (X,Y) plane, and in pixels.
with the index, as a value between 0 – 100.  The 2D Grey Scale image acquisition must be enabled from the A0 cell 
 Fixture = GetFixture(Patterns3D, index) returns the FIxture3D structure of the found PointCloud menu
pattern’s fixture.  This image does NOT contain any information on heights along Z.
 X = GetX(Fixture3D, index) returns the X-axis coordinate of the pattern fixture’s center
point. 3D PointCloud Image (A0 cell in the spreadsheet):
 Y = GetY(Fixture3D, index) returns the Y-axis coordinate of the patten fixture’s center  3D image obtained by geometric triangulation
point.  Works in a fully calibrated (X, Y, Z) space
 Z = GetZ(Fixture3D, index) returns the Z-axis coordinate of the pattern fixture’s center
point.
 Rotation = GetRotation(Fixture3D) returns the rotation of the pattern fixture (in
degrees) about the PointCloud Z-axis.
 Tilt = GetTilt(Fixture3D) returns the tilt angle of the pattern fixture (in degrees) on the
PointCloud Z-axis as an integer.
 Tilt Direction =GetTiltDirection(Fixture3D) returns the pattern fixture’s direction of tilt (in
degrees) from the rotated PointCloud X-axis about the PointCloud Z-axis as an
integer.

Section 3 | Slide 15 Section 3 | Slide 16


2D Grey Scale vs 3D Point Cloud Images Example: fixturing on the 2D image using PatMax Redline

1. Localization using
PatMax Redline on the
GreyScale image
2. Building up a new Fixture
3D from PM Redline
output data (X, Y, Angle)
3. 3D tools are fixtured
using this new fixture.

2D TOOLS 3D TOOLS
Section 3 | Slide 17 Section 3 | Slide 18

2D Vision Tools, Controls, Structures, and Graphics operate on the Grey Scale image The 2D localization with PatMax Redline can be done in the following way:
(A1 cell).
3D Vision Tools, Controls, Structures, and Graphics operate on the 3D Point Cloud image  The Train PatMax Redline function is trained on the Grey Scale image (A1)  features
(A0 cell). for training must be evident in this image, which is purely 2D
 The Find PatMax Redline function runs on the A1 image
 A Fixture 3D structure is inserted from the 3D Structures menu
 X = X from the PM Redline
 Y = Y from the PM Redline
 Rotation = Angle from the PM Redline
 All the other parameters are left as default (0)

 3D Tools now refer this new 3D Fixture


 Be careful: PM Redline does not contain any info on Z and tilt angles with respect to
the X and Y axes. If parts are not at the same Z (overlapping parts) or they’re tilted
along X and Y, this procedure can result in inaccurate localization.

Section 3 | Slide 17 Section 3 | Slide 18


Example: fixturing on the 2D image using PatMax Redline Summary

 The Property Sheets make it easy to specify the


parameters for a function
 The parameters available in the Property Sheets are
specific for each function
 The pattern finding process utilizing the PatMax3D
tools consist of two phases: Training and Finding

Section 3 | Slide 19 Section 3 | Slide 20

The final result is that 3D tools can be effectively fixtured to the new 3D Fixture created In this section we covered the following:
from the PatMax Redline, and this procedure can be approx. 15 times faster than full 3D
fixture with PatMax 3D at parity of search tolerance parameters.  The Property Sheets make it easy to specify the parameters for a function
 The parameters available in the Property Sheets are specific for each function
 The pattern finding process utilizing the PatMax3D tools consist of two phases:
Training and Finding.

Section 3 | Slide 19 Section 3 | Slide 20


Skills Journal Lab Exercise

Complete:
Section 3
Skills Journal

Section 3 | Slide 21

Complete:
Skills Journal (image designed by pngtree)
Lab Exercise

Section 3 | Slide 21

You might also like