Workpiece Locating
Before using this tutorial, you should have created a Mech-Vision solution using the “General Workpiece Recognition” case project in the “Hand-Eye Calibration” section.
In this tutorial, you will first learn the project workflow, and then deploy the project by adjusting the Step parameters to recognize the workpiece poses and output the vision result.
In this tutorial, you will need to convert the model file of the workpiece in the CAD format into a point cloud matching model. Since it takes a long time to prepare the CAD model file, you are recommended to prepare the CAD model file of the workpiece before using this tutorial. |
Introduction to the Project Workflow
The following table describes each Step in the project workflow.
No. | Phase | Step | Image | Description |
---|---|---|---|---|
1 |
Capture images |
Capture Images from Camera |
Connect to the camera and capture images |
|
2 |
Recognize workpieces |
3D Workpiece Recognition |
Use 3D matching algorithms to calculate the workpieces’ poses (as pick points) |
|
3 |
Adjust poses |
Adjust Poses |
Transform the pick points from the camera reference frame to the robot reference frame |
|
4 |
Output the vision result |
Procedure Out |
Output the workpieces’ poses for the robot to pick |
A pick point refers to a point on the workpiece on which the robot can pick the object. |
Adjust Step Parameters
In this section, you will deploy the project by adjusting the parameters of each Step.
Capture Images from Camera
You should adjust the parameters of the “Capture Images from Camera” Step to connect to the camera.
-
Select the “Capture Images from Camera” Step, and click Select camera on the Step parameters tab.
-
In the prompted window, click on the right of the camera serial No. to connect the camera. After the camera is connected, the icon will turn into .
After the camera is connected, select the parameter group. Click Select from and select the displayed parameter group.
-
After the camera is connected and the parameter group is selected, the calibration parameter group, IP address, and ports of the camera will be obtained automatically. Just keep the default settings of the other parameters.
Now, you have connected the software to the camera.
3D Workpiece Recognition
The “3D Workpiece Recognition” Step has integrated a 3D Workpiece Recognition visualized configurator, which provides point cloud preprocessing, model-based matching, and pose (pick point) calculation.
Select the “3D Workpiece Recognition” Step, and click Open an Editor on the Step parameters tab.
The 3D Workpiece Recognition visualized configurator is shown below.
Then follow the procedure to recognize workpieces.
Select workpiece
After entering the 3D Workpiece Recognition visualized configurator, you need to make the point cloud model for the workpieces to recognize.
-
Open the Model Editor.
On the upper part of the 3D Workpiece Recognition visualized configurator. click Select workpiece.
In the prompted Workpiece Library window, click Model Editor.
The following figure shows the Model Editor.
-
Import the CAD file.
On the Matching Model and Pick Point Editor interface, click Import CAD file.
Import the prepared workpiece model in STL format, select the unit of measurement of the model object with which the workpiece was created, and click OK.
After the CAD file is imported, it will be displayed in the visualization area of the Matching Model and Pick Point Editor interface.
-
Use the CAD file to make the point cloud model.
On the left resource list of the Matching Model and Pick Point Editor interface, select the CAD file, and click the button on the toolbar. Then, set the sampling interval on the prompted window to generate the point cloud outside the exterior surface of the CAD model.
-
View the generated point cloud model.
The point cloud model generated based on the CAD file will be displayed in the resource list.
Select the point cloud model file and you will see the point cloud model in the visualization area of the Matching Model and Pick Point Editor interface.
-
Add a pick point.
Click the button on the toolbar to add a pose as a pick point to the point cloud model of the workpiece.
The following figure shows the added pick point.
-
Save the model and the pick point.
Close the Matching Model and Pick Point Editor, and click Yes in the prompted window.
-
Select this workpiece from the Workpiece Library.
After closing the Matching Model and Pick Point Editor, select the saved point cloud model of the workpiece, and click OK.
Subsequently, the target workpiece to recognize is displayed in the upper-right corner of the 3D Workpiece Recognition visualized configurator.
Now, you have selected the workpiece. Click Next on the bottom of the 3D Workpiece Recognition visualized configurator.
Preprocessing
Preprocessing is used to set an effective region for recognition to exclude the point cloud of unnecessary parts and keep only the point cloud of the workpiece, thus improving recognition efficiency.
The following figure displays the Preprocessing interface.
-
Set the region for recognition.
Click Settings.
In visualized interface, set the region for recognition (3D ROI). Press and hold the Ctrl key, select the vertices of the 3D ROI, and drag the 3D ROI to the proper size. The following figure displays the set 3D ROI.
-
Save the region for recognition.
Click Save and apply to save the region for recognition.
Now, you have finished the preprocessing procedure. Click Next on the bottom of the 3D Workpiece Recognition visualized configurator to enter the recognition procedure.
Recognize workpieces
In this procedure, you can adjust the 3D matching related parameters in a visualized manner, and output the workpieces’ poses.
The following figure displays the Recognition interface.
-
Since this project needs to recognize a maximum of five workpieces, set the Output count upper limit to 5.
-
View the visualized output result.
Click Run Step.
You can view the visualized output result in the visualized area. As the figure below, the poses of four workpieces are output.
-
Save the configuration.
Click the Finish button on the bottom of the 3D Workpiece Recognition visualized configurator.
In the prompted window, click Save.
Now, you have recognized the workpieces and calculated their pick points.
Adjust Poses
The pick points output by the “3D Workpiece Recognition” Step is in the camera reference frame. To facilitate robot picking, you need to adjust the workpieces’ poses to transform them from the camera reference frame to the robot reference frame.
-
Open the pose editor.
Select the “Adjust Poses” Step, and click Open pose editor on the Step Parameters tab.
The following figure shows the pose editor.
-
Adjust the reference frame.
On the upper-left corner of the pose editor, set Effect to Camera_To_Robot.
-
View the reference frame transformation result.
On the bottom of the pose editor, click the Run button.
You can see the transformed pick points in the Scene View of the pose editor.
-
Save the configuration.
Close the pose editor, and click Save in the prompted window.
Now, the reference frame of the pick points has been transformed.