Data Processing
I. Adjust the Top Surface of Pins to Horizontal Position
If the surface for pin tip detection is tilted in the image data, it is difficult to select the surface data of pins and use depth information (Z values) for data filtering. For accurate measurements, the surface of pin tips must be adjusted to a horizontal level (parallel to the XOY plane). You can use the Transform Surface Step to transform the reference frame of the surface data and thus make the surface of pin tips horizontal.
Process Details
Use the Transform Surface Step to transform the surface data to a new reference frame.
The Plane + Line approach is used to transform the reference frame since the surface surrounding pins is relatively flat, and extracting line features is simple.
-
Extract a plane feature: Use the Measure Surface Flatness Step to obtain a plane feature, which will be taken as the XOY plane of the new reference frame.
-
Extract a line feature: Use the Fit Line to Surface Edge Step to obtain a line feature, and the line will be projected onto the input plane. The projection of the line will be the X-axis of the new reference frame.
Increasing the Outlier Fraction can help fit a more accurate line when there is a lot of noise. -
Transform the reference frame: Run the Transform Surface Step to complete the transformation and thus adjust the surface of pin tips to a horizontal level.
-
In the Output Results panel, click or to switch the data visualization status, and the data viewer will display the visual content accordingly.
-
The running speed of the Transform Surface Step is affected by the Scan Line Count parameter set in Mech-Eye Viewer. When the parameter value is large, the image processing speed of the Step will slow down, which is likely to increase the cycle time.
-
Tilted incoming material |
Transformed data |
II. Preprocess Data
The obtained surface data contains irrelevant data and noise. To increase the stability and accuracy of data, you can filter and denoise the surface data before measurement.
Preprocessing workflow: Filtering ➡ Rough locating ➡ Precise locating + filtering again
1) Filtering
Use the Filter Surface Points by Normals Step to extract pin data from the transformed surface data and then perform data filtering to remove noise.
-
Use a feature region to select the pin data.
-
In the parameter configuration panel of the Step, adjust parameters to remove noise.
After the Step is run, it will output processed surface data:
- Tuning experience
-
-
The Filter Surface Points by Normals Step is very effective in removing noise, especially for obtaining flat surface data. When the noise is slanted or consists of irregularly scattered points, this Step can achieve good denoising results.
-
You can adjust the Max Polar Angle parameter to filter out slanted noise of varying degrees (recommended value: 60°) and adjust the Remove Noise parameter to filter out irregular points of varying degrees. Adjusting both parameters can produce better results. For more details on parameters, see Angle-Based Filtering.
-
2) Rough Locating
Use the Blob Analysis Step to roughly locate pin tips from the filtered surface data.
-
In the parameter configuration panel of the Step, set appropriate height thresholds and area thresholds to detect the surface data of pin tips, i.e., multiple blobs.
-
Set the blob ordering method to number the detected blobs so that each blob can be accurately located in subsequent processes.
As shown in the figure, blobs are ordered “Row-wise.” The blob numbers (index) are for reference only.
Order blobs according to the actual needs. - Tuning experience
-
-
The Blob Analysis Step is essential for locating and outputting the surface data of each pin tip. In most cases, you can obtain good surface data of pin tips by setting reasonable height thresholds and area thresholds.
-
If data adhesion occurs, you can address the issue in the previous filtering process.
-
3) Precise locating + filtering again
Due to the physical characteristics of pins, the surface data of pin tips may not be flat enough or may have warped edges. It is necessary to further narrow down data range and apply additional filtering to remove noise.
-
Use the Locate Feature Point of Surface Step to extract the center point of each pin from the roughly located surface data of pin tips.
As shown in the figure, the feature point type is set to “Mean” to extract the center point of each blob (in bright yellow).
-
Use the Extract Alignment Parameter Group Step to obtain the coordinates of each center point.
When narrowing down the data range next, you only need to set one feature region, and the rest feature regions will be automatically aligned with the surface data of pin tips according to the coordinates of center points. -
Next, use the Process Surface by Filter Step to filter the roughly located surface data of pin tips to further narrow down the data range.
- Tuning experience
-
-
The measurement of pins requires high precision. The obtained surface data of pins may not be stable, but the central part of each pin tip is usually stable. The center point of the pin tip data (blob) can be used as the center of a small feature region to effectively extract the stable data.
-
You can use the Process Surface by Filter Step to further process the surface data and thus reduce data fluctuations.
As shown in the figure, remove the highest and lowest points from the data to further enhance data stability.
-
Up to now, you have finished data processing.
Next, you can start to measure the height and position of pins.