A random pose gear visual measurement system, method, gear visual measurement device and computer readable storage medium based on dynamic measurement reference
The visual measurement method for gears with random poses based on dynamic measurement references solves the problems of low efficiency and measurement reference mismatch caused by random poses in traditional detection methods, and achieves efficient and stable measurement of gear geometric parameters.
Patent Information
- Application Number
- CN202611322694.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-08-28
- Publication Date
- 2026-11-06
AI Technical Summary
Traditional contact-based detection methods are inefficient and lack automation. Furthermore, random pose variations can lead to a mismatch between the fixed measurement reference and the gear's posture, affecting the stability and accuracy of gear geometric parameter measurements.
A visual measurement method for random pose gears using a dynamic measurement benchmark is proposed. By acquiring the gear center position and rotation angle, the detection area, edge search direction, and tooth pitch measurement feature points are updated to form a measurement benchmark that matches the real-time pose of the gear. Combined with zero-mean normalized cross-correlation template matching and image pyramid search, the pose acquisition accuracy is improved.
It reduces measurement reference mismatch caused by random pose, improves the ability to acquire gear center position and rotation angle, and enhances the stability and accuracy of tooth tip circle parameter and tooth pitch deviation measurement.
Smart Images

Figure CN123045231A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to a random pose gear vision measurement system, method, gear vision measurement device, and computer-readable storage medium based on a dynamic measurement reference. Background Technology
[0002] The accuracy of gear geometry parameter measurement directly affects the operating performance of mechanical transmission systems. Traditional contact-based inspection methods suffer from low inspection efficiency and insufficient automation, making them unsuitable for online inspection needs in industrial settings. Machine vision inspection, characterized by its non-contact nature, high efficiency, and ease of automation, has been applied to gear identification and geometry parameter measurement.
[0003] In actual visual inspection, the imaging environment of the gear under test is subject to background interference such as debris, oil stains, and local reflections, affecting the reliability of target localization and feature extraction. Furthermore, the gear under test undergoes random pose changes within the imaging plane, including random translation and rotation around the camera's optical axis. If a fixed detection area, fixed edge search direction, and fixed tooth pitch measurement feature points are pre-set in template mode, then after the random pose changes, a positional and directional mismatch occurs between the fixed measurement reference and the actual gear posture. Positional mismatch causes the detection area to deviate from the tooth profile, and directional mismatch causes inaccurate edge search direction and deviation of tooth pitch measurement feature points, thus affecting the stability of addendum circle fitting and tooth pitch deviation measurement.
[0004] Existing research has covered target detection, pose acquisition, and gear parameter measurement. However, pose information is mostly used for target localization or initial alignment, while there is a relative lack of technical solutions for further using pose information to synchronously update the detection area, edge search direction, and tooth pitch measurement feature points. Therefore, a visual measurement technique is needed that allows the measurement reference to change synchronously with the current gear posture to reduce measurement reference mismatch caused by random poses. Summary of the Invention
[0005] The present invention provides a random pose gear vision measurement system, method, gear vision measurement device, and computer-readable storage medium based on a dynamic measurement reference to solve the problems existing in the prior art.
[0006] The technical solutions adopted in this invention are as follows:
[0007] A visual measurement method for random pose gears based on a dynamic measurement reference includes the following steps:
[0008] S1: Acquire an image of the gear to be tested, and filter the target region of the gear from the image of the gear to be tested;
[0009] S2: Extract the gear center position and rotation angle based on the gear target area;
[0010] S3: Based on the gear center position and rotation angle, the preset detection area, edge search line and tooth pitch measurement feature points in the template state are rigidly transformed and mapped to the real-time image coordinate system of the current gear to form a dynamic measurement reference.
[0011] S4: Within the detection area defined by the dynamic measurement datum, perform edge positioning of the gear profile according to the updated edge search direction of the dynamic measurement datum to obtain the tooth tip circle parameters;
[0012] S5: Determine the theoretical pitch circle based on the module and number of teeth of the gear to be tested. Use the center of the tooth tip circle obtained by fitting in S4 as the reference for calculating the tooth pitch deviation. Extract tooth surface feature points in the neighborhood of the theoretical pitch circle according to the edge search direction updated by the dynamic measurement reference. Calculate the actual arc length tooth pitch based on the angle between adjacent tooth surface feature points and the center of the tooth tip circle and the radius of the theoretical pitch circle. Compare the actual arc length tooth pitch with the theoretical tooth pitch to obtain the tooth pitch deviation.
[0013] Furthermore, in S1, selecting the gear target region from the image of the gear to be tested includes:
[0014] The gear image to be tested is filtered, thresholded, and morphologically processed to obtain candidate connected components. The target gear region is then selected based on the area and shape factor of the candidate connected components through joint constraints.
[0015] The combined area and shape factor constraints are based on the theoretical projected area of the gear and the reference shape factor, and allowable deviations for area and shape factor are set to eliminate interference areas.
[0016] Furthermore, in S2, extracting the gear center position and rotation angle based on the gear target area includes:
[0017] By using zero-mean normalized cross-correlation template matching and multi-angle template search, and employing an image pyramid coarse-to-fine search strategy, the rotation angle that best matches the gear under test and the corresponding template center position are determined.
[0018] Furthermore, extracting the gear center position and rotation angle also includes: performing quadratic surface fitting on the optimal correlation peak and its 3×3 neighborhood, determining the sub-pixel position of the correlation peak by the extreme position of the fitted surface, taking the template center corresponding to the sub-pixel position as the gear center position, and taking the optimal matching angle in the multi-angle template search as the rotation angle.
[0019] Furthermore, in S3, rigid body transformation includes translation transformation and rotation transformation around the normal of the imaging plane; the predicted positions of the detection area center, edge search line position, edge search direction, and tooth pitch measurement feature points are updated synchronously through rigid body transformation.
[0020] Furthermore, in S4, edge localization includes gray-scale sampling along the radial edge search line updated by the dynamic measurement benchmark, selecting the extreme position of the gray-scale gradient as the candidate edge position, and obtaining the tooth tip contour feature point through sub-pixel localization;
[0021] Obtaining the tooth tip circle parameters based on the tooth tip profile feature points involves using the least squares method for circle fitting, calculating the absolute value of the radial residual based on the distance from each edge point to the center of the fitted circle, and then using the 3σ criterion to remove outliers before re-fitting the circle to obtain the final tooth tip circle parameters.
[0022] Furthermore, in S5, the gradient peak corresponding to the grayscale rising edge is uniformly selected for the tooth surface feature points, and a second interpolation is performed on the neighborhood of the gradient peak to obtain the sub-pixel tooth surface edge position.
[0023] This invention also discloses a visual measurement system for random pose gears based on a dynamic measurement benchmark, including...
[0024] The image acquisition module is used to acquire images of the gear under test.
[0025] The target region filtering module is used to filter the target region of the gear from the image of the gear to be tested;
[0026] The pose parameter extraction module is used to extract the center position and rotation angle of the gear based on the target area of the gear.
[0027] The dynamic measurement reference update module is used to perform rigid body transformation on the preset detection area, edge search line and tooth pitch measurement feature points in the template state according to the gear center position and the rotation angle, and map them to the real-time image coordinate system of the current gear to form a dynamic measurement reference.
[0028] The parameter measurement module is used to perform edge positioning of the gear profile within the detection area defined by the dynamic measurement reference, according to the updated edge search direction of the dynamic measurement reference, to obtain the tooth tip circle parameters. Using the gear center position as a reference, it extracts tooth surface feature points in the neighborhood of the theoretical pitch circle according to the updated edge search direction of the dynamic measurement reference. It calculates the actual arc length tooth pitch based on the angle between the line connecting adjacent tooth surface feature points and the gear center position and the theoretical pitch circle radius. It compares the actual arc length tooth pitch with the theoretical tooth pitch to obtain the tooth pitch deviation.
[0029] The present invention also discloses a gear vision measurement device, including a processor, a memory, and a computer program stored in the memory and executable on the processor, characterized in that: when the computer program is executed by the processor, the device performs the above-described method.
[0030] The present invention also discloses a computer-readable storage medium having a computer program stored thereon, wherein when the computer program is executed by a processor, the processor performs the above-described method.
[0031] The present invention has the following beneficial effects:
[0032] (1) By directly using the gear center position and rotation angle for dynamic measurement benchmark updates, the detection area changes with gear translation and the edge search direction changes with gear rotation, thereby reducing the positional and directional mismatch between the fixed measurement benchmark and the actual gear posture.
[0033] (2) By combining area and shape factor constraints, the allowable deviation is set based on the theoretical projected area of the gear and the reference shape factor, which is beneficial to screen the gear target area from the interference areas formed by debris, oil stains and local reflections.
[0034] (3) By using Zero-Mean Normalized Cross-Correlation (ZNCC) template matching, multi-angle template search, coarse-to-fine image pyramid search, and sub-pixel optimization of correlation peaks, the ability to obtain the gear center position and rotation angle under random pose conditions is improved.
[0035] (4) By using sub-pixel edge positioning, least squares circle fitting and 3σ criterion outlier removal, the stability of tooth tip circle parameter measurement is improved.
[0036] (5) By extracting tooth surface feature points under the edge search direction after dynamic measurement benchmark update and performing sub-pixel interpolation, it is possible to support tooth pitch deviation measurement under random pose conditions. Attached Figure Description
[0037] Figure 1 This is a schematic diagram of fixed measurement reference mismatch under random pose, where (a) is the position mismatch state and (b) is the orientation mismatch state.
[0038] Figure 2 A flowchart illustrating the overall framework for gear vision measurement;
[0039] Figure 3 This is a schematic diagram of the target region filtering process, where (a) is the original image, (b) is the connected component extraction result, (c) is the candidate region filtering process, and (d) is the gear target region obtained after filtering.
[0040] Figure 4 This is a schematic diagram of the measurement benchmark update results, where (a) is the regional positioning result and (b) is the dynamic measurement benchmark after the region and direction are updated.
[0041] Figure 5 is a schematic diagram of the extraction results of tooth surface feature points in the neighborhood of the pitch circle;
[0042] Figure 6 This is a schematic diagram of the structure of a vision measurement system;
[0043] Figure 7 A comparative diagram showing the impact of the dynamic update module on the measurement error of the tooth tip circle;
[0044] Figure 8 This is a schematic diagram illustrating the variation of measurement error in different rotation angle ranges under random pose conditions.
[0045] Figure 9 This is a schematic diagram showing the distribution of individual tooth pitch deviations for each tooth sequence. Detailed Implementation
[0046] The invention will now be further described with reference to the accompanying drawings.
[0047] like Figures 1 to 9 The visual measurement system of this invention consists of an industrial camera, a low-distortion fixed-focus lens, a ring light source, and a stage. The industrial camera is vertically mounted above the stage, and the ring light source is coaxially arranged below the lens to provide uniform diffuse illumination (e.g., ...) to the gear under test. Figure 6 The system is calibrated using a checkerboard calibration method and distortion compensation is performed using the Brown-Conrady model. In this embodiment, the industrial camera resolution is 3072×2048, the lens focal length is 16mm, the system's average reprojection error is 0.049 pixels, and the pixel equivalent is 0.0347mm / pixel. The object under test is a standard spur gear with a tooth tip circle diameter of 52mm, 24 teeth, and a module of 2. During measurement, the gear under test is placed on the stage surface with random translation and random rotation angles. Background interference such as metal chips and oil stains may exist on the stage surface.
[0048] After acquiring the image of the gear to be tested, the target region of the gear is first screened from the image. Median filtering, Otsu adaptive thresholding, and morphological closing operations are then performed sequentially on the acquired raw image to extract all connected components in the image, such as... Figure 3 (a) is the original image, and (b) is the binary image after connected component extraction. The area and perimeter of each candidate connected component are calculated. The shape factor is calculated based on the perimeter and area, using the circularity formula: 4π multiplied by the area and divided by the square of the perimeter. Using the theoretical projected area of the gear and the reference shape factor as benchmarks, allowable deviations for the area and shape factor are set. Joint constraints are applied to all candidate connected components, eliminating interference areas caused by debris, oil, and localized reflections where the area deviates too much from the theoretical projected area or the shape factor deviates too much from the reference value. Regions satisfying the constraints are retained as the gear target region, such as... Figure 3In diagram (c), the candidate region selection process is shown, and in diagram (d), the gear target region obtained after selection is shown. In this embodiment, the reference shape factor is set to 0.24, which provides the highest success rate for gear target recognition.
[0049] Based on the selected gear target region, the center position and rotation angle of the gear are extracted. Within the gear target region, the pose is solved using the zero-mean normalized cross-correlation template matching method. A standard gear template image is prepared in advance, and the matching correlation coefficient is obtained by calculating the gray-level mean normalized correlation between the template image and the corresponding region of the image to be detected.
[0050] A multi-angle template search strategy is adopted, rotating the template by a preset angular step size and calculating the correlation coefficient sequentially to determine the rotation angle that best matches the gear under test and the corresponding template center position. To improve search efficiency, a coarse-to-fine image pyramid search strategy is used. First, a coarse matching position is quickly located in the low-resolution pyramid layer, and then fine matching is performed layer by layer in the high-resolution layer. After obtaining the optimal correlation peak, a quadratic surface is fitted to the optimal correlation peak and its 3×3 neighborhood. The sub-pixel position of the correlation peak is determined by the extreme position of the fitted surface. The template center corresponding to the sub-pixel position is taken as the gear center position, and the optimal matching angle in the multi-angle template search is taken as the gear rotation angle.
[0051] Based on the obtained gear center position and rotation angle, the preset detection area, edge search line, and tooth pitch measurement feature points in the template state are subjected to rigid body transformation and mapped to the real-time image coordinate system of the current gear to form a dynamic measurement reference. A local measurement coordinate system in the template state is pre-established, and the initial positions and directions of the detection area, edge search line, and tooth pitch measurement feature points are preset in the template coordinate system.
[0052] Rigid body transformation includes translation transformation and rotation transformation about the normal to the imaging plane. Translation transformation maps the origin of the template coordinate system to the center position of the current gear, and rotation transformation maps the coordinate axis directions of the template coordinate system to the direction consistent with the rotation angle of the current gear.
[0053] After rigid body transformation, the detection area, edge search line, and tooth pitch measurement feature points in the template state are mapped to the real-time image coordinate system of the current gear. Through rigid body transformation, the center of the detection area, the position of the edge search line, the edge search direction, and the predicted position of the tooth pitch measurement feature points are updated synchronously, forming a measurement reference that dynamically updates with the gear's pose. For example... Figure 1 As shown, when the fixed measurement datum shifts position or rotates at an angle, positional or directional mismatches can occur, causing the detection area to deviate from the gear profile and the edge search direction to be inconsistent with the tooth surface normal direction; for example... Figure 4As shown, after dynamic updating, the detection area coincides with the actual position of the gear, and the edge search direction is consistent with the radial direction of the gear, thus achieving synchronous matching between the measurement reference and the actual position of the gear.
[0054] Within the detection area defined by the dynamic measurement datum, the gear profile is edge-localized according to the updated edge search direction of the dynamic measurement datum to obtain the addendum circle parameters. Gray-level sampling is performed along the updated radial edge search line of the dynamic measurement datum to obtain the gray-level distribution curve on each search line. The gradient value of the gray-level distribution is calculated, and the extreme value position of the gray-level gradient is selected as the candidate edge position. Then, sub-pixel interpolation is used to perform sub-pixel localization on the candidate edge position to obtain the addendum contour feature points. After obtaining all the addendum contour feature points, the least squares method is used for circle fitting to obtain the initial addendum circle center and addendum circle radius.
[0055] Calculate the distance from each tooth tip profile feature point to the fitted circle center to obtain the absolute value of the radial residual for each point. Use the 3σ criterion to remove outliers whose radial residual exceeds three times the standard deviation. Refit the remaining valid feature points with circles to obtain the final tooth tip circle center and tooth tip circle radius parameters.
[0056] Using the gear center position as a reference, tooth surface feature points are extracted within the neighborhood of the theoretical pitch circle according to the edge search direction updated by the dynamic measurement reference. The actual arc length and tooth pitch are calculated based on the angle between the line connecting adjacent tooth surface feature points and the gear center position, and the radius of the theoretical pitch circle. The actual arc length and tooth pitch are compared with the theoretical tooth pitch to obtain the tooth pitch deviation. The theoretical pitch circle and its radius are determined based on the module and number of teeth of the gear under test. Using the gear center position obtained from the previous steps as a reference, tooth surface edge feature points are extracted within the neighborhood of the theoretical pitch circle according to the edge search direction updated by the dynamic measurement reference. Gradient calculations are performed on the grayscale distribution along each tooth surface search line. The gradient peak corresponding to the rising edge of the grayscale is uniformly selected as the candidate position of the tooth surface feature point. Secondary interpolation is performed on the neighborhood of the gradient peak to obtain the tooth surface edge position with sub-pixel accuracy.
[0057] like Figure 5 The image shows the extraction results of tooth surface feature points in the neighborhood of the pitch circle. A total of 24 tooth surface feature points were extracted, each corresponding to one of the gear teeth. After obtaining the positions of all tooth surface feature points, the angle between the line connecting two adjacent tooth surface feature points and the gear center position was calculated. Combined with the theoretical pitch circle radius, the actual arc length tooth pitch was calculated. The actual arc length tooth pitch was compared with the theoretical tooth pitch to obtain the deviation of a single tooth pitch. The deviations of all adjacent tooth pitches were calculated sequentially and accumulated to obtain the total cumulative tooth pitch deviation.
[0058] To verify the measurement effect of this method, a total of 200 sets of random pose samples were collected, with rotation angles covering 0° to 120°. 50 sets of samples were set in each of the four intervals: 0° to 30°, 30° to 60°, 60° to 90°, and 90° to 120°. The translation position, rotation angle, and background interference of each set of samples varied randomly. The tooth tip circle radius measured by a coordinate measuring machine was used as the size reference.
[0059] Experimental results are as follows Figure 7 As shown, compared with the fixed benchmark scheme, after adding region filtering, detection region update, search direction update and complete algorithm in sequence, the mean deviation and standard deviation of tooth tip circle measurement gradually decrease. Under the complete algorithm, the mean deviation of tooth tip circle radius is reduced to 0.003mm and the standard deviation is reduced to 0.0198mm, while the mean deviation of the fixed measurement benchmark scheme is 0.042mm and the standard deviation is 0.0351mm, with a recognition success rate of only 68.5%. The recognition success rate of our method can reach 99.0%.
[0060] like Figure 8 As shown, within the rotation angle range of 0° to 120°, the mean absolute error, standard deviation, and maximum error of this method remain at a low level, and the error increase is small as the rotation angle increases, indicating good measurement stability.
[0061] like Figure 9 As shown, the individual pitch deviations of each gear sequence are all within ±12μm. The measured value of the individual pitch deviation is 11.5μm, and the measured value of the cumulative total pitch deviation is 76.1μm. The allowable value of the cumulative total pitch deviation corresponding to the 9th grade gear accuracy is 84μm. The measurement results do not exceed the corresponding allowable value, which verifies the feasibility of the method.
[0062] The above description is only a preferred embodiment of the present invention. It should be noted that those skilled in the art can make several improvements without departing from the principle of the present invention, and these improvements should also be considered within the scope of protection of the present invention.
Claims
1. A visual measurement method for random pose gears based on a dynamic measurement reference, characterized in that: Includes the following steps: S1: Acquire an image of the gear to be tested, and filter the target region of the gear from the image of the gear to be tested; S2: Extract the center position and rotation angle of the gear based on the target area of the gear; S3: Based on the gear center position and rotation angle, the preset detection area, edge search line and tooth pitch measurement feature points in the template state are rigidly transformed and mapped to the real-time image coordinate system of the current gear to form a dynamic measurement reference. S4: Within the detection area defined by the dynamic measurement datum, perform edge positioning of the gear profile according to the updated edge search direction of the dynamic measurement datum to obtain the tooth tip circle parameters; S5: Determine the theoretical pitch circle based on the module and number of teeth of the gear to be tested. Use the center of the tooth tip circle obtained by fitting in S4 as the reference for calculating the tooth pitch deviation. Extract tooth surface feature points in the neighborhood of the theoretical pitch circle according to the edge search direction updated by the dynamic measurement reference. Calculate the actual arc length tooth pitch based on the angle between adjacent tooth surface feature points and the center of the tooth tip circle and the radius of the theoretical pitch circle. Compare the actual arc length tooth pitch with the theoretical tooth pitch to obtain the tooth pitch deviation.
2. The visual measurement method for random pose gears based on dynamic measurement reference as described in claim 1, characterized in that: In S1, selecting the target region for the gear from the image of the gear to be tested includes: The gear image to be tested is filtered, thresholded, and morphologically processed to obtain candidate connected components. The target region of the gear is then selected based on the area and shape factor of the candidate connected components through joint constraints. The combined area and shape factor constraints are based on the theoretical projected area of the gear and the reference shape factor, and allowable deviations for area and shape factor are set to eliminate interference areas.
3. The visual measurement method for random pose gears based on dynamic measurement reference as described in claim 1, characterized in that: In S2, extracting the gear center position and rotation angle based on the gear target area includes: By using zero-mean normalized cross-correlation template matching and multi-angle template search, and employing an image pyramid coarse-to-fine search strategy, the rotation angle that best matches the gear under test and the corresponding template center position are determined.
4. The visual measurement method for random pose gears based on dynamic measurement reference as described in claim 3, characterized in that: Extracting the gear center position and rotation angle also includes: performing quadratic surface fitting on the optimal correlation peak and its 3×3 neighborhood, determining the sub-pixel position of the correlation peak by the extreme position of the fitted surface, taking the template center corresponding to the sub-pixel position as the gear center position, and taking the optimal matching angle in the multi-angle template search as the rotation angle.
5. The visual measurement method for random pose gears based on dynamic measurement reference as described in claim 1, characterized in that: In S3, rigid body transformation includes translation transformation and rotation transformation around the normal of the imaging plane; the predicted positions of the detection area center, edge search line position, edge search direction, and tooth pitch measurement feature points are updated synchronously through rigid body transformation.
6. The visual measurement method for random pose gears based on dynamic measurement reference as described in claim 1, characterized in that: In S4, edge localization includes gray-level sampling along the radial edge search line updated by the dynamic measurement benchmark, selecting the extreme value position of the gray-level gradient as the candidate edge position, and obtaining the tooth tip contour feature point through sub-pixel localization. Obtaining the tooth tip circle parameters based on the tooth tip profile feature points involves using the least squares method for circle fitting, calculating the absolute value of the radial residual based on the distance from each edge point to the center of the fitted circle, and then using the 3σ criterion to remove outliers before re-fitting the circle to obtain the final tooth tip circle parameters.
7. The visual measurement method for random pose gears based on dynamic measurement reference as described in claim 1, characterized in that: In S5, the gradient peak corresponding to the grayscale rising edge is uniformly selected for the tooth surface feature points, and the neighborhood of the gradient peak is interpolated twice to obtain the sub-pixel tooth surface edge position.
8. A visual measurement system for random pose gears based on a dynamic measurement reference, characterized in that: include The image acquisition module is used to acquire images of the gear under test. The target region filtering module is used to filter the target region of the gear from the image of the gear to be tested; The pose parameter extraction module is used to extract the center position and rotation angle of the gear based on the target area of the gear. The dynamic measurement reference update module is used to perform rigid body transformation on the preset detection area, edge search line and tooth pitch measurement feature points in the template state according to the gear center position and the rotation angle, and map them to the real-time image coordinate system of the current gear to form a dynamic measurement reference. The parameter measurement module is used to perform edge positioning of the gear profile within the detection area defined by the dynamic measurement reference, according to the updated edge search direction of the dynamic measurement reference, to obtain the tooth tip circle parameters. Using the gear center position as a reference, it extracts tooth surface feature points in the neighborhood of the theoretical pitch circle according to the updated edge search direction of the dynamic measurement reference. It calculates the actual arc length tooth pitch based on the angle between the line connecting adjacent tooth surface feature points and the gear center position and the theoretical pitch circle radius. It compares the actual arc length tooth pitch with the theoretical tooth pitch to obtain the tooth pitch deviation.
9. A gear vision measurement device, comprising a processor, a memory, and a computer program stored in the memory and executable on the processor, characterized in that: When the computer program is executed by the processor, it causes the device to perform the method of any one of claims 1 to 7.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by the processor, it causes the processor to perform the method according to any one of claims 1 to 7.
