Abstract
This article describes measurement of the internal screw thread by the camera system. Especially thread handedness detection is focused. For this purpose, a geometric transformation on camera image was used, followed by the FFT method to detect thread direction. Possible issues of the measurement precision are also discussed.
Access provided by Autonomous University of Puebla. Download conference paper PDF
Similar content being viewed by others
Keywords
1 Introduction
Screw thread measurement is motivated by the requirement of the manufacturing practice. According to measurement results is decided whether the inset part is the correct type or not. Main evaluated thread parameters are diameter, pitch and handedness. In our case the most difficult is to determine handedness. Two examples of tested parts are shown on the Fig. 1. Both threads are metric with diameter 39 mm, but the left-handed thread is on the left side and the right-handed thread is on the right side.
The customer’s requirement was that the screw thread has to be correctly recognized with at least 99.7% reliability. Real threads have different surface quality and color, also the light conditions are variable. Due to the used method has to be sufficiently robust.
2 Measurement
2.1 Diameter Measurement
The standard image processing methods are used for the diameter measurement. The hole’s ellipse is extracted from image and then the least squares method is used to find the best fit ellipse. The semi-major axis of the found ellipse corresponds with screw thread diameter.
2.2 Handedness Measurement
It is difficult to decide about handedness from the original image (see Fig. 1). Due to it is better to map the thread image back to cylinder and unfold it to the plane. This transformation will be described more precisely bellow.
The first step is to determine transformation between thread’s cylinder coordinate system (denoted as \(T\)) and camera coordinate system (denoted as \(G\)).
Symbol \(\left\{ r \right\}_{T}\) denotes coordinates of the vector \(r\) in the coordinate system \(T\). This transformation can be known or can be estimated by the image features (e.g. hole’s ellipse orientation). Cylinder axis is identical to z-axis of the T base. This relation between camera and thread is displayed on Fig. 2.
The second transformation is projection to the focal plane. For simplicity, we assume unit focal length.
Cylinder points can be mapped to plane by the polar transformation which is described by the equation:
Composed map function \({\Phi } = {\Phi }_{p} \circ {\Phi }_{G \to T} \circ {\Phi }_{c}\) assigns image coordinates to polar coordinates of the cylindrical surface. If \(I\left( {x,y} \right)\) is brightness function of the camera image, then function \(\left( {I \circ {\Phi }} \right)\left( {z,\varphi } \right)\) is an image of the cylindrical surface in the polar coordinates. Example of this image transformation is shown on Fig. 3.
With real image it is also necessary to perform a transformation between physical and pixel coordinates. These details will be ignored in this article for simplicity, but the texture mapping and image warping is described more precisely in [1].
This image can be processed by the many different approaches. Our procedure was chosen with respect to evaluation speed and robustness. To the edge detection, the image is processed by the some standard filters in the vertical direction. Then FFT is used to obtain image periodogram. 2D FFT method can be used to detect of fibres direction how is described in [2]. This idea is used to detect direction of the lines from Fig. 3. Both periodograms (left-handed and right-handed thread) are shown in Fig. 4.
Image periodogram is thresholded and the selected points are processed by statistical moments. Let be \(p\left( {x,y} \right)\) value of the thresholded and normalized image periodogram, which can be considered as probability density. Let be \(S = \{ \left( {x,y} \right):p\left( {x,y} \right) > 0\}\). Then we can express the moments up to order 2 by the next equations:
Eigensystem of the matrix \(M\) can be displayed as the ellipse which has axis identical with eigenvectors and axes lengths ratio is equal to ratio of the eigenvalues. These ellipses are shown in Fig. 5. The idea of image moments and moment invariants is usually used to pattern recognition. This topic is described in [3].
Note that the real situation is influenced by the variable thread surface quality, variable light conditions and metallic shiny thread surface. In these cases is not possible to find edges in the same quality which are displayed above. But evaluation by described procedure seems to be sufficiently reliable.
2.3 Pitch Measurement
Pitch is measured from image of the cylinder map which is turned by the found angle. Image rotation makes the edge line horizontal and then is simple to measure pitch. We calculate point counts over rotated image rows. These counts as function of the row position have significant peaks. Distances between these peaks correspond to the pitch value.
3 Measurement Error
Quality of the image mapping to cylindrical surface depends on the function \({\Phi }_{T \to G}\). If this function is not determined exactly then the mapped image \(I \circ {\Phi }\) is deformed. That can adversely affects the result. Some errors that can occur in our case will be discussed below. For simplicity, assume unit cylinder radius and unit focal length. Let be.
The point set \(\left\{ {s\left( \alpha \right),\alpha \in \left( {0,\pi } \right)} \right\} \subset V\) is a part of helix. Projection of this curve to the focal plane is \(s_{p} \left( \alpha \right) = \left( {{\Phi }_{p} \circ {\Phi }_{T \to G} } \right)\left( {s\left( \alpha \right)} \right),\alpha \in \left( {0,\pi } \right)\). Example of this projection is shown on the Fig. 6.
We want to map the curve \(s_{p}\) to the wrongly detected cylinder \(V_{E}\). Relations between the original cylinder coordinate system \(T\) and error cylinder coordinate system (denoted as \(E\)) is given by mapping \({\Phi }_{T \to E} :\left\{ r \right\}_{T} \mapsto \left\{ r \right\}_{E}\). For example, in our case, this error can be caused by detecting of the incorrect edge on the thread hole. Two cases which can occur in our task will be discussed next.
It is necessary to solve inverse problem to map the curve \(s_{p}\) to the error cylinder \(V_{e}\). Let be \(P_{f}\) focal point and \(\rho \left( t \right) = \left( {1 - t} \right)\left\{ {P_{f} } \right\}_{E} + t \left\{ {s_{p} \left( \alpha \right)} \right\}_{E} , t > 0\) for some \(\alpha \in \left( {0,\pi } \right).\) We want to find intersection \(\{ \rho \left( t \right):t > 0\} \cap V_{E}\). This leads to quadratic equation with one unknown parameter \(t\). Equation can be solved exactly for all \(t\) but for our case is sufficient to solve equation only for some points and use linear approximation.
3.1 Translation Error
Assume translation in \(x\)-direction. This transformation is described by function \(\left( {x,y,z} \right) \mapsto \left( {x + \delta , y,z} \right), d \in {\mathbb{R}}\). Evaluation for some discrete values of the parameter \(d\) is shown on Fig. 7.
We use image processing as it is described above. Results for the original cylinder and shifted cylinders are shown on Fig. 8.
3.2 Diameter Measurement Error
In this case we can suppose that error coordinate system \(E\) is identical with the thread’s cylinder coordinate system \(T\). But the projection to cylinder surface leads to equation \(\rho_{x}^{2} \left( t \right) + \rho_{y}^{2} \left( t \right) = \left( {1 + \delta } \right)^{2}\), where \(\rho \left( t \right) \in {\mathbb{R}}^{3}\) is parametric equation for infinite line which contains the focal point with some curve point on the focal plane. Alternatively we can suppose translation in the camera view direction. Due to projection the more distant cylinder seems smaller. It causes that the results are similar as it is mentioned for translation error in Sect. 3.1.
3.3 General Case
How it is mentioned in the previous section, the radius error can be considered as shift in the view direction. So the general case can be expressed as composition of some affine transformations. In our case the errors are caused by the detection of different edges on the screw thread (it depends how the thread is rotated around its axis). The error magnitude corresponds with the height of the thread.
Other case is when we expect the fixed position of screw thread but the real thread is shifted due to geometric tolerance. Methods mentioned above can be used to estimate maximal possible error. Alternatively, we can find conditions to ensure sufficient accuracy.
4 Conclusion
Methods mentioned in this article were used to develop camera inspection system which is used in manufacturing industry. System controls parts with internal screw thread and decides whether the inset part is the correct type. In this case some geometric conditions are known but methods can be generalized for the cases when the thread’s cylinder position is unknown. Method can also be used for the external screw thread.
References
Heckbert, P.: Fundamentals of texture mapping and image warping. Master’s thesis (1989)
Tunák, M., Linka, A.: Analysis of planar anisotropy of fibre systems by using 2D Fourier transform. Fibres Text. East. Eur. 15(5–6), 86–90 (2007)
Hu, M.K.: Visual pattern recognition by moment invariants. IRE Trans. Inf. Theory 8(2), 179–187 (1962)
Author information
Authors and Affiliations
Corresponding author
Editor information
Editors and Affiliations
Rights and permissions
Copyright information
© 2022 The Author(s), under exclusive license to Springer Nature Switzerland AG
About this paper
Cite this paper
Prošek, A. (2022). Screw Thread Measurement by Camera Inspection System. In: Beran, J., Bílek, M., Václavík, M., Žabka, P. (eds) Advances in Mechanism Design III. TMM 2020. Mechanisms and Machine Science, vol 85. Springer, Cham. https://doi.org/10.1007/978-3-030-83594-1_27
Download citation
DOI: https://doi.org/10.1007/978-3-030-83594-1_27
Published:
Publisher Name: Springer, Cham
Print ISBN: 978-3-030-83593-4
Online ISBN: 978-3-030-83594-1
eBook Packages: EngineeringEngineering (R0)