Introduction
In automated manufacturing and robotics, the ability to accurately grasp components like bolts is a fundamental requirement. Effective grasping necessitates precise knowledge of an object's orientation and, crucially, its tip direction. While modern solutions often leverage computationally intensive 3D imaging or deep learning models requiring vast training datasets, these approaches can be overkill for well-defined geometric tasks. This paper presents a streamlined 2D computer vision pipeline that utilizes fundamental geometric properties to determine both the axis and the specific tip direction of bolts, offering a computationally efficient alternative to complex machine learning systems.
Methodology
The proposed vision pipeline relies on a multi-step process designed for speed and robustness. The workflow is divided into preprocessing, primary axis detection, and a novel tip-detection phase.
- Preprocessing & Centroid Extraction: Input images undergo smoothing followed by edge detection using a Sobel operator. Image moments are then used to calculate the bolt's centroid.
- Primary Axis Detection: The study compares two traditional methods for finding the bolt's initial angle:
- PCA-based: Principal Component Analysis is applied to the contour pixel coordinates. The primary eigenvector defines the major axis of variation, representing the bolt's orientation.
- PPHT-based: The Progressive Probabilistic Hough Transform identifies the longest straight line within the contour, typically corresponding to the bolt's shank.
- Tip Detection: Exploiting the physical asymmetry of bolts, where the head is wider than the tip, the centroid naturally shifts toward the head. By projecting rays from the centroid along the detected axis, the algorithm measures the Euclidean distance to the contour. The longer distance identifies the direction of the narrower tip.
Experimental Evaluation
The methods were evaluated using two custom synthetic datasets generated in Blender, featuring an M12 hex bolt at various rotations (0°, 45°, and 90°).
- Dataset 1 (Ideal): Controlled lighting with no shadows.
- Dataset 2 (Shadow-heavy): Studio lighting designed to create challenging shadows. Both datasets were augmented with Gaussian noise at Signal-to-Noise Ratios (SNR) ranging from 100 down to 1 to test robustness in industrial environments.
Results and Discussion
The comparative analysis revealed distinct trade-offs between PCA and PPHT. In ideal conditions (Dataset 1), both methods achieved high precision, with angular errors under ±0.5° even at high noise levels. However, Dataset 2 highlighted a significant divergence in performance.
PCA demonstrated superior robustness to shadows. At the highest noise level (SNR = 1), PCA maintained a maximum average angular error of just ±1.49°. In contrast, PPHT's error increased dramatically to ±23.58°, as shadows disrupted the continuous lines required for accurate Hough transform detection.
Computational efficiency was a highlight for both approaches, with PCA averaging 0.0358 seconds and PPHT averaging 0.0365 seconds per image. This performance makes either method suitable for real-time robotic applications, though PCA is the clear choice for environments with inconsistent lighting.
Conclusion
This study validates that traditional computer vision techniques remain highly relevant for specific industrial tasks. By leveraging the inherent geometric properties of objects, the proposed pipeline achieves high accuracy and real-time performance without the need for extensive training data or high-end hardware. Future work will focus on improving edge detection robustness using alternative gradient operators to further enhance performance in extreme noise conditions.
Summary updated