A machine vision extraction system and method for three-dimensional position of gear tooth profile chamfering

Through binocular vision imaging system and image processing technology, the problems of low automation and poor versatility of traditional gear tooth profile chamfering processing methods are solved, and efficient extraction of three-dimensional positions of gear tooth profile chamfering processing is achieved, improving machining automation and accuracy.

CN116385246BActive Publication Date: 2025-05-23NANJING GONGDA CNC TECH
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202211437897.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-11-15
Publication Date
2025-05-23
Estimated Expiration
2042-11-15

AI Technical Summary

Technical Problem

The traditional gear tooth profile chamfering processing methods have problems such as complex adjustment of processing parameters, low degree of automation and poor versatility.

Method used

A binocular vision imaging system is adopted to form a binocular vision system through a monocular camera, combining image preprocessing, edge extraction, subpixel positioning and stereo matching technologies to achieve the extraction of three-dimensional positions of gear tooth profile chamfering processing.

Benefits of technology

It effectively reduces the cost of gear tooth profile chamfering, improves the degree of automation, has strong applicability and convenience, and improves the accuracy and stability of the visual imaging system.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116385246B_ABST
    Figure CN116385246B_ABST
Patent Text Reader

Abstract

The present invention provides a three-dimensional position machine vision extraction system and an extraction method for chamfering gear tooth profiles. The system is characterized in that a binocular vision imaging system is formed by moving a monocular camera at a fixed baseline distance. The method first adjusts the monocular camera so that complete and clear gear images can be captured at both the left and right positions, and then calibrates the binocular vision system to obtain the internal and external parameters of the cameras at the left and right positions. Stereo rectification, preprocessing, and edge extraction are performed on the captured left and right gear images, the center of the gear tooth profile is obtained, the sub-pixel edges of the left and right tooth profiles are acquired, and stereo matching is carried out to obtain the three-dimensional position (x c , y c , z c ) of the gear tooth profile chamfering processing in the left camera coordinate system. The present invention greatly improves the automation and intelligence levels of gear chamfering processing, can realize the integrated functions of camera calibration, image preprocessing, image processing, and visual positioning, has a low input cost, and has high engineering application value.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention relates to the field of machine vision positioning and intelligent manufacturing, and in particular to a machine vision extraction system and method for three-dimensional position extraction of gear tooth profile chamfering. Background Art

[0002] Gears are widely used in manufacturing and automation. In the mass production of gears, the traditional gear tooth profile chamfering method has problems such as complex adjustment of processing parameters, low degree of automation, and poor versatility. With the development of machine vision and the iteration of related technologies, it is increasingly used in workpiece measurement, target recognition, and positioning guidance. Effectively obtaining the position coordinates of the gear tooth profile is an important prerequisite for chamfering. Obtaining the coordinate information required for chamfering through machine vision methods can realize automatic perception of the chamfering processing position, which has foreseeable convenience and versatility.

[0003] The extraction of the chamfer position of the tooth profile based on machine vision can realize online real-time non-contact positioning, which is helpful to overcome the shortcomings of traditional chamfering processing methods. Monocular vision has been widely used. Its advantages are simple structure and easy camera calibration, but it cannot obtain accurate three-dimensional information of the target object. Binocular vision can obtain three-dimensional information of the target object based on the principle of parallax. It has high efficiency and appropriate accuracy, which can further improve the degree of automation of gear tooth profile chamfering processing. Taking all factors into consideration, the present invention adopts a binocular vision imaging system to complete the extraction of the three-dimensional position of the gear tooth profile chamfering processing. Summary of the invention

[0004] The purpose of the present invention is to propose a machine vision extraction system and method for the three-dimensional position of gear tooth profile chamfering processing, so as to solve the problems of complex processing parameter adjustment, low degree of automation and poor versatility in the traditional gear tooth profile chamfering processing method during gear mass production.

[0005] The system forms a binocular vision imaging system (composed of the left and right positions of the camera) by moving a monocular camera with a fixed baseline distance. The method first adjusts the monocular camera so that it can capture a complete and clear gear image at both the left and right positions. Then the binocular vision system is calibrated to obtain the internal and external parameters of the left and right position cameras. The left and right images of the captured gear are stereo corrected, and the stereo corrected left and right images of the gear are preprocessed, including image denoising, image enhancement, and threshold segmentation. Then the edge of the left and right images of the gear is extracted, and the edge of the gear shaft hole is eliminated based on the connected domain analysis method to obtain the tooth profile edge image without the shaft hole edge, and the center of the gear tooth profile is obtained using the centroid method. The tooth profile edge is divided into the top edge, the involute edge, and the root transition edge according to the distance threshold range from the tooth profile edge point to the gear tooth profile center. Different methods are used to perform sub-pixel positioning on the different edges obtained by the classification of the left and right tooth profiles, thereby obtaining the sub-pixel edges of the left and right tooth profiles. Finally, stereo matching is performed on the extracted left and right tooth profile sub-pixel edges to obtain the three-dimensional position (x c ,y c ,z c ).

[0006] To achieve the above object, the present invention provides the following technical solutions:

[0007] A machine vision extraction system for three-dimensional position of gear tooth profile chamfering, comprising a monocular industrial camera, a fixed-focus lens, a camera bracket 1 with a pneumatic slide 6, an electric guide rail slide 2, a backlight source 3, a light source controller 4 and a gear 5; the industrial camera is a monocular CCD camera with high imaging quality and high stability; the camera bracket 1 can be moved up and down by the pneumatic slide 6 to adjust the camera imaging field of view; the electric guide rail slide 2 is fixedly installed above the camera bracket 1 and can be moved left and right based on a ball screw; the monocular CCD camera is fixedly installed on the slide by four round head nuts, and slides a fixed distance based on the electric guide rail slide 2 mechanism, and the fixed distance is used as the baseline distance to form a binocular vision system; the monocular CCD camera interface is a GigE (an interface name) interface; the backlight source 3 is a side-emitting backlight source 3, whose LED lamp beads are evenly arranged on the side, and the backlight source 3 is provided with a light guide plate, and the light source controller 4 is used to control the illumination intensity of the backlight source 3.

[0008] A method for machine vision extraction of three-dimensional position of gear tooth profile chamfering, comprising the following steps:

[0009] S1: First, the pneumatic slide rail 6 on the camera bracket 1 is controlled to move up and down through the C++ program, thereby driving the monocular camera to move up and down until a suitable imaging field of view is met; and the electric guide rail slide 2 above the camera bracket 1 is controlled to reach position 1 (left position), and then the electric guide rail slide 2 is controlled to move precisely to the left by a fixed baseline distance to reach position 2 (right position), ensuring that the camera can capture a complete gear image at both the left and right positions; the camera focal length and aperture are adjusted, and the camera gain is controlled through software to ensure that the camera can clearly image within the field of view;

[0010] S2: Use a checkerboard calibration plate to calibrate the above binocular vision system, and obtain the left and right camera intrinsic parameter matrices cameraMatrixL and cameraMatrixR, the left and right camera distortion matrices distCoeffL and distCoeffR, the rotation matrix R and translation matrix T of the right camera relative to the left camera, and other parameters through calibration;

[0011] S3: Use the light source controller 4 to adjust the backlight source 3 to a suitable brightness, and take the left and right images of the gear respectively based on the binocular vision system; based on the calibration parameters obtained in step 2, perform stereo correction on the left and right images of the gear to achieve remapping of the left and right images of the gear to ensure that the polar lines where the matching points are located are collinear;

[0012] S4: performing image preprocessing on the left and right images of the gear after stereo correction, including image denoising, image enhancement, threshold segmentation, etc.;

[0013] S5: Extract the edges of the preprocessed left and right images of the gear, eliminate the edges of the gear shaft hole based on the connected domain analysis method, obtain the tooth profile edge image without the shaft hole edge, and use the centroid method to find the center of the gear tooth profile; calculate the distance from each tooth profile edge point to the center of the gear tooth profile, generate a distance value histogram, set a threshold for the distance, and divide the tooth profile edge into the tooth top edge, the involute edge, and the tooth root transition edge according to different threshold ranges;

[0014] S6: Perform sub-pixel positioning on different edges obtained by classification of the left and right tooth profiles; perform sub-pixel positioning on the tooth top edge using the fitting method; perform sub-pixel positioning on the involute edge using the interpolation method; perform sub-pixel positioning on the tooth root transition edge using the moment method; thereby obtaining the sub-pixel edges of the left and right tooth profiles;

[0015] S7: Perform stereo matching on the extracted left and right tooth profile sub-pixel edges to obtain the three-dimensional position (x c ,y c ,z c ).

[0016] The step S2 specifically includes the following contents:

[0017] S2.1: Place a checkerboard calibration plate between the left and right positions of the camera, ensure that the calibration plate can be clearly and completely imaged in the camera field of view at both positions, and ensure that the checkerboard occupies 1 / 2 to 3 / 4 of the entire camera field of view. Place calibration plates at the four corners and the center of the field of view, change the calibration plate placement angle 4 times, and ensure that the angle between the calibration plate and the plane is not greater than 30°. Use the camera to take pictures at two fixed positions, and obtain a total of 20 sets of calibration plate images;

[0018] S2.2: Based on the OpenCV open source image processing library, write a calibration program to calibrate the binocular vision system, obtain various calibration parameters, calculate the reprojection error of each group of images, and obtain the average reprojection error;

[0019] S2.3: Check the above parameters. If the average reprojection error of the binocular calibration meets the requirements, take the calibration parameters as the final calibration result. Otherwise, delete several groups of images with large reprojection errors and recalibrate to obtain the final calibration result.

[0020] In step S3, the main steps of the stereo correction include:

[0021] S3.1: Based on the obtained binocular positioning parameters, use Rodrigues transformation to obtain the left and right position camera rotation matrix R l and R r , and obtain the left and right position camera projection matrix P l and P r ;

[0022] S3.2: Based on the acquired parameter R l , R r , P l , P r , get the remapping parameters mapL in the x direction of the left and right position cameras x ,mapR x , reprojection parameters mapL in the y direction y ,mapR y ;

[0023] Among them mapL x is the remapping parameter of the left position camera in the x direction, mapR x is the remapping parameter of the right position camera in the x direction, mapL y is the remapping parameter of the left position camera in the y direction, mapR y Remapping parameters for the right position camera in the y direction.

[0024] S3.3: Remap the input left and right images of the gear to ensure that the imaging planes of the left and right position cameras are parallel and the baseline is parallel to the imaging plane, and finally achieve stereo correction.

[0025] In step S4, the image denoising is based on bilateral filtering combined with a multi-scale guided filter to filter out macro and micro noise points in the image while maintaining image edge features at multiple scales;

[0026] The image enhancement is to perform a hierarchical sharpening operation on the image based on the impact filter, that is, to strongly sharpen the medium detail area, not to sharpen the low detail area, and slightly sharpen the high detail area, so as to achieve the purpose of enhancing the edge details of the image and maintaining the original information of the image to the greatest extent;

[0027] The threshold segmentation uses an iterative threshold segmentation based on the grayscale histogram; first, the image grayscale histogram is counted, and the image histogram is analyzed to obtain the minimum grayscale value G min and the maximum gray value G max , let the initial threshold:

[0028]

[0029] According to the threshold T k The image is divided into two groups of images: foreground and background. Calculate the number of images less than T. k The mean of all gray values ​​μ k1 and greater than T k The mean of all gray values ​​μ k2 , find the new threshold:

[0030]

[0031] Substitute the initial threshold and repeat the above steps until T is satisfied. k =T k+1 , the threshold obtained at this time is used as the optimal segmentation threshold.

[0032] In step S5, the edge detection algorithm is an improved Canny edge detection algorithm, and the main improvements include:

[0033] 1) An improved Sobel operator is used to replace the 2×2 templates in the horizontal and vertical directions to calculate the image gradient; a third-order Sobel operator template in 8 directions with an interval of 45° is used to calculate the image gradient, and the template direction is used to approximate the gradient direction of the calculated pixel point;

[0034] 2) Use OpenCV to adaptively obtain high and low thresholds instead of global fixed thresholds, and use double hysteresis thresholds for edge detection and connection based on DFS depth-first search;

[0035] The center of gravity method is used to obtain the center of the gear tooth profile (X 0 ,Y 0 ) is calculated as follows:

[0036]

[0037] Where: (x i ,y i ) is the coordinate set of the tooth profile edge points, and N is the number of coordinate points.

[0038] In step S6, the tooth top edge is specifically located by the least square circle fitting method; the involute edge is specifically located by the bilinear interpolation method; and the tooth root transition edge is specifically located by the 7×7 template Zernike moment method.

[0039] In step S7, the main steps of the stereo matching method include:

[0040] S7.1: Draw a horizontal line through the binocular image and scan the binocular image up and down with a scanning interval of 1 pixel;

[0041] S7.2: When the horizontal line touches the sub-pixel edge of the tooth profile, the intersection points of the left sub-pixel edge of the tooth profile and the horizontal line are stored in a to-be-matched list in order from left to right;

[0042] S7.3: searching for a position along the horizontal line on the right tooth profile sub-pixel edge, searching for edge points to the right, and matching the found edge points with the edge points in the to-be-matched list in order;

[0043] S7.4: After obtaining the matching point, the three-dimensional coordinates (x c ,y c ,z c ).

[0044] Compared with the prior art, the present invention has the following beneficial effects:

[0045] The present invention fully considers the problems of low automation and poor versatility in the existing gear tooth profile chamfering processing methods, and proposes a machine vision extraction system and method for the three-dimensional position of the gear tooth profile chamfering processing. Based on the captured left and right images of the gear, the three-dimensional position extraction of the gear tooth profile chamfering processing is conveniently realized through binocular positioning, stereo correction, image preprocessing, image edge detection, image center detection, image edge sub-pixel positioning and stereo matching. The present invention effectively reduces the cost of gear tooth profile chamfering processing, has a high degree of automation, and has strong applicability and convenience. In addition, a binocular visual imaging system is formed by moving a monocular camera with a fixed baseline distance, which effectively reduces the complexity of the visual imaging system and increases the accuracy and stability of the visual imaging system. BRIEF DESCRIPTION OF THE DRAWINGS

[0046] Figure 1 Schematic diagram of a machine vision extraction system for three-dimensional position of gear tooth profile chamfering in an embodiment of the method of the present invention;

[0047] Figure 2 It is a schematic diagram of the process described in the embodiment of the method of the present invention;

[0048] FIG3(a) and FIG3(b) are left and right images of a gear taken by the binocular vision system described in the embodiment of the method of the present invention; FIG3(a) is a left image of the gear, and FIG3(b) is a right image of the gear;

[0049] Figure 4 The left and right images of the gear after stereo correction described in the embodiment of the method of the present invention;

[0050] Figure 5 The left and right images of the gear after preprocessing described in the embodiment of the method of the present invention;

[0051] Figure 6 The left and right tooth profile sub-pixel edges extracted in the embodiment of the method of the present invention;

[0052] Figure 7 Schematic diagram of left and right tooth profile sub-pixel edge stereo matching described in the method embodiment of the present invention;

[0053] In the figure: 1- camera bracket; 2- electric guide rail slide; 3- backlight; 4- light source controller; 5- gear; 6- pneumatic slide. DETAILED DESCRIPTION

[0054] In order to clarify the technical problems, technical solutions, implementation processes and performance demonstrations, the present invention is further described in detail below in conjunction with embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not intended to limit the present invention. Various exemplary embodiments, features and aspects of the present disclosure will be described in detail below with reference to the accompanying drawings. The same reference numerals in the accompanying drawings represent elements with the same or similar functions. Although various aspects of the embodiments are shown in the accompanying drawings, the drawings do not have to be drawn to scale unless otherwise specified.

[0055] The word “exemplary” is used exclusively herein to mean “serving as an example, example, or illustration.” Any embodiment described herein as “exemplary” is not necessarily to be construed as preferred or advantageous over other embodiments.

[0056] In addition, in order to better illustrate the present disclosure, numerous specific details are given in the following specific embodiments. It should be understood by those skilled in the art that the present disclosure can also be implemented without certain specific details. In some examples, methods, means, components and circuits well known to those skilled in the art are not described in detail in order to highlight the subject matter of the present disclosure.

[0057] Example 1

[0058] like Figure 1 As shown, a machine vision extraction system for three-dimensional position of gear tooth profile chamfering processing includes a monocular industrial camera, a fixed-focus lens, a camera bracket 1 with a pneumatic slide 6, an electric guide slide 2, a backlight source 3, a light source controller 4 and a gear 5; the industrial camera is a monocular CCD camera with high imaging quality and high stability; the camera bracket 1 can be moved up and down by the pneumatic slide 6 to adjust the camera imaging field of view; the electric guide slide 2 is fixedly installed on the top of the camera bracket 1, and can be moved left and right based on a ball screw; the monocular CCD camera is fixedly installed on the slide by four round head nuts, and slides a fixed distance based on the electric guide slide 2 mechanism, and this fixed distance is used as the baseline distance to form a binocular vision system; the monocular CCD camera interface is a GigE interface; the backlight source 3 is a side-emitting backlight source 3, and its LED lamp beads are evenly arranged on the side, and the backlight source 3 is provided with a light guide plate, and the light source controller 4 is used to control the illumination intensity of the backlight source 3.

[0059] The present invention is described below by taking the visual extraction of the three-dimensional position of the chamfer of a straight gear tooth profile as an example.

[0060] like Figure 2 As shown, a machine vision extraction method for three-dimensional position of gear tooth profile chamfering processing includes the following steps:

[0061] S1: First, the pneumatic slide rail 6 on the camera bracket 1 is controlled to move up and down through the C++ program, thereby driving the monocular camera to move up and down until a suitable imaging field of view is met; and the electric guide rail slide 2 above the camera bracket 1 is controlled to reach position 1 (left position), and then the electric guide rail slide 2 is controlled to move precisely to the left by a fixed baseline distance to reach position 2 (right position), ensuring that the camera can capture a complete gear image at both the left and right positions; the camera focal length and aperture are adjusted, and the camera gain is controlled through software to ensure that the camera can clearly image within the field of view;

[0062] S2: Use a checkerboard calibration plate to calibrate the above binocular vision system, and obtain the left and right camera intrinsic parameter matrices cameraMatrixL and cameraMatrixR, the left and right camera distortion matrices distCoeffL and distCoeffR, the rotation matrix R and translation matrix T of the right camera relative to the left camera, and other parameters through calibration;

[0063] S2.1: Place a checkerboard calibration plate between the left and right positions of the camera, ensure that the calibration plate can be clearly and completely imaged in the camera field of view at both positions, and ensure that the checkerboard occupies 1 / 2 to 3 / 4 of the entire camera field of view. Place calibration plates at the four corners and the center of the field of view, change the calibration plate placement angle 4 times, and ensure that the angle between the calibration plate and the plane is not greater than 30°. Use the camera to take pictures at two fixed positions, and obtain a total of 20 sets of calibration plate images;

[0064] S2.2: Based on the OpenCV open source image processing library, write a calibration program to calibrate the binocular vision system, obtain various calibration parameters, calculate the reprojection error of each group of images, and obtain the average reprojection error;

[0065] S2.3: Check the above parameters. If the average reprojection error of the binocular calibration meets the requirements, take the calibration parameters as the final calibration result. Otherwise, delete several groups of images with large reprojection errors and recalibrate to obtain the final calibration result.

[0066] S3: Use the light source controller 4 to adjust the backlight source 3 to an appropriate brightness, and take the left and right images of the gear respectively based on the binocular vision system. The taken left and right images of the gear are shown in FIG3 ; Based on the calibration parameters obtained in step 2, the left and right images of the gear are stereo corrected to achieve remapping of the left and right images of the gear to ensure that the polar lines of the matching points are collinear. The left and right images of the gear after stereo correction are shown in FIG3 . Figure 4 As shown;

[0067] Preferably, the main steps of the stereo correction include:

[0068] S3.1: Based on the obtained binocular positioning parameters, use Rodrigues transformation to obtain the left and right position camera rotation matrix R l and R r , and obtain the left and right position camera projection matrix P l and P r ;

[0069] S3.2: Based on the acquired parameter R l , R r , P l , P r , get the remapping parameters mapL in the x direction of the left and right position cameras x ,mapR x , reprojection parameters mapL in the y direction y ,mapR y ;

[0070] Among them mapL x is the remapping parameter of the left position camera in the x direction, mapR x is the remapping parameter of the right position camera in the x direction, mapL y is the remapping parameter of the left position camera in the y direction, mapR y Remapping parameters for the right position camera in the y direction.

[0071] S3.3: Remap the input left and right images of the gear to ensure that the imaging planes of the left and right position cameras are parallel and the baseline is parallel to the imaging plane, and finally achieve stereo correction.

[0072] S4: Preprocess the left and right images of the gear after stereo correction, including image noise reduction, image enhancement, threshold segmentation, etc. The preprocessed left and right images of the gear are as follows: Figure 5 As shown;

[0073] Preferably, the image denoising is based on bilateral filtering combined with a multi-scale guided filter to filter out macro and micro noise points in the image while maintaining image edge features at multiple scales;

[0074] Preferably, the image enhancement is to perform a hierarchical sharpening operation on the image based on an impact filter, that is, to strongly sharpen the medium detail area, not to sharpen the low detail area, and slightly sharpen the high detail area, so as to achieve the purpose of enhancing the edge details of the image and maintaining the original information of the image to the greatest extent;

[0075] Preferably, the threshold segmentation uses an iterative threshold segmentation based on a grayscale histogram; first, the image grayscale histogram is counted, and the image histogram is analyzed to obtain the minimum grayscale value G min and the maximum gray value G max , let the initial threshold:

[0076]

[0077] According to the threshold T k Segment the image into two groups of foreground and background images, and calculate the mean μ k of all gray values less than T k1 and the mean μ k of all gray values greater than T k2 , and find the new threshold:

[0078]

[0079] Substitute the initial threshold and repeat the above steps until T k = T k+1 . At this time, the obtained threshold is used as the optimal segmentation threshold.

[0080] S5: Perform edge extraction on the preprocessed left and right images of the gear, eliminate the edge of the gear shaft hole based on the connected component analysis method, obtain the tooth profile edge image without the edge of the shaft hole, and use the centroid method to obtain the center of the gear tooth profile; calculate the distance from each tooth profile edge point to the center of the gear tooth profile, generate a distance value histogram, set a threshold for the distance, and divide the tooth profile edge into the tooth top edge, involute edge, and tooth root transition edge according to different threshold ranges;

[0081] Preferably, the edge detection algorithm is an improved Canny edge detection algorithm, and the main improvement parts include:

[0082] 1) Use an improved Sobel operator to replace the 2×2 templates in the horizontal and vertical directions to calculate the image gradient; use the 3rd-order Sobel operator templates in 8 directions with an interval of 45° to calculate the image gradient, and approximately represent the gradient direction of the calculated pixel points with the template direction;

[0083] 2) Use OpenCV to adaptively obtain the high and low thresholds instead of the globally fixed thresholds, and based on the DFS depth-first search, use the double hysteresis threshold for edge detection and connection;

[0084] The formula for obtaining the center (X 0 , Y 0 ) of the gear tooth profile by the centroid method is as follows:

[0085]

[0086] In the formula: (x i , y i ) is the coordinate set of the tooth profile edge points, and N is the number of coordinate points.

[0087] S6: Sub-pixel positioning is performed on different edges obtained by classification of the left and right tooth profiles; the sub-pixel positioning is performed on the tooth top edge using the fitting method; the sub-pixel positioning is performed on the involute edge using the interpolation method; the sub-pixel positioning is performed on the tooth root transition edge using the moment method; thereby obtaining the sub-pixel edges of the left and right tooth profiles such as Figure 6 As shown;

[0088] Preferably, the tooth top edge is specifically positioned in sub-pixel by using the least squares circle fitting method;

[0089] Preferably, the involute edge is specifically positioned in sub-pixel using a bilinear interpolation method;

[0090] Preferably, the tooth root transition edge is specifically positioned in sub-pixel using a 7×7 template Zernike moment method.

[0091] S7: Stereo matching is performed on the extracted left and right tooth profile sub-pixel edges to obtain the three-dimensional position (xc, yc, zc) of the gear tooth profile chamfering in the left camera coordinate system. The stereo matching diagram is shown in Figure 7 shown.

[0092] Preferably, the main steps of the stereo matching method include:

[0093] S7.1: Draw a horizontal line through the binocular image and scan the binocular image up and down with a scanning interval of 1 pixel;

[0094] S7.2: When the horizontal line touches the sub-pixel edge of the tooth profile, the intersection points of the left sub-pixel edge of the tooth profile and the horizontal line are stored in a to-be-matched list in order from left to right;

[0095] S7.3: searching for a position along the horizontal line on the right tooth profile sub-pixel edge, searching for edge points to the right, and matching the found edge points with the edge points in the to-be-matched list in order;

[0096] S7.4: After obtaining the matching point, the three-dimensional coordinates (xc, yc, zc) corresponding to the sub-pixel edge point in the left camera coordinate system are calculated based on the triangulation principle.

[0097] The main innovative features of the method of the present invention are:

[0098] 1) In the field of machine vision positioning and intelligent manufacturing, a new machine vision extraction system and extraction method for three-dimensional position of gear tooth profile chamfering are disclosed.

[0099] 2) The present invention forms a binocular visual imaging system by moving a monocular camera with a fixed baseline distance, which effectively reduces the complexity of the visual imaging system and increases the accuracy and stability of the visual imaging system.

[0100] 3) In terms of edge extraction of left and right gear images, the existing edge extraction algorithm is improved to obtain pixel-level edges. Based on the proposed image processing algorithm and process, the left and right tooth profile edges are innovatively classified into tooth top edge, involute edge and tooth root transition edge. Different methods are used for sub-pixel positioning of different edges obtained by classification, thereby obtaining the left and right tooth profile sub-pixel edges.

[0101] 4) An innovative stereo matching algorithm is proposed to perform stereo matching on the extracted sub-pixel edges of the left and right tooth profiles to obtain the three-dimensional position (xc, yc, zc) of the gear tooth profile chamfering processing in the left camera coordinate system.

[0102] 5) It realizes the integrated functions of camera calibration, image preprocessing, image processing, and visual positioning, with a high degree of automation and intelligence, strong versatility and convenience. It can achieve the goal of low investment and high production capacity while meeting the accuracy requirements of three-dimensional position extraction of gear tooth profile chamfering.

[0103] The above shows and describes the basic principles, main features and advantages of the present invention. Those skilled in the art should understand that the present invention is not limited by the above embodiments. The above embodiments and descriptions are only preferred examples of the present invention and are not intended to limit the present invention. Without departing from the spirit and scope of the present invention, the present invention may have various changes and improvements, which fall within the scope of the present invention. The scope of protection of the present invention is defined by the attached claims and their equivalents.

Claims

1. A machine vision extraction method for the three-dimensional position of gear tooth profile chamfering. It is characterized in that The steps include: S1: First, the pneumatic slide rail (6) on the camera bracket (1) is controlled by a C++ program to move up and down, thereby driving the monocular camera to move up and down until a suitable imaging field of view is met; and the electric guide rail slide (2) above the camera bracket (1) is controlled to reach the left position, and then the electric guide rail slide (2) is controlled to move precisely to the left by a fixed baseline distance to reach the right position, so as to ensure that the camera can capture a complete gear image at both the left and right positions; the camera focal length and aperture are adjusted, and the camera gain is controlled by software to ensure that the camera can clearly image within the field of view; S2: Use the checkerboard calibration board to calibrate and obtain the left and right position camera intrinsic parameter matrix through calibration cameraMatrixL , cameraMatrixR , left and right position camera distortion matrix distCoefL , distCoefR , the rotation matrix of the right position camera relative to the left position camera R and translation matrix T parameter; S3: Using the light source controller (4) to adjust the backlight source (3) to an appropriate brightness, and respectively photographing the left and right images of the gear; based on the calibration parameters obtained in step 2, stereo correction is performed on the left and right images of the gear to achieve remapping of the left and right images of the gear to ensure that the polar lines of the matching points are collinear; S4: performing image preprocessing on the left and right images of the gear after stereo correction, including image denoising, image enhancement, and threshold segmentation; S5: Extract the edges of the preprocessed left and right images of the gear, eliminate the edges of the gear shaft hole based on the connected domain analysis method, obtain the tooth profile edge image without the shaft hole edge, and use the centroid method to find the center of the gear tooth profile; calculate the distance from each tooth profile edge point to the center of the gear tooth profile, generate a distance value histogram, set a threshold for the distance, and divide the tooth profile edge into the tooth top edge, the involute edge, and the tooth root transition edge according to different threshold ranges; S6: Perform sub-pixel positioning on different edges obtained by classification of the left and right tooth profiles; perform sub-pixel positioning on the tooth top edge using the fitting method; perform sub-pixel positioning on the involute edge using the interpolation method; perform sub-pixel positioning on the tooth root transition edge using the moment method; thereby obtaining the sub-pixel edges of the left and right tooth profiles; S7: Perform stereo matching on the extracted left and right tooth profile sub-pixel edges to obtain the three-dimensional position (xc , yc , z ) .

2. The machine vision extraction method for three-dimensional position of gear tooth profile chamfering according to claim 1, It is characterized in that The step S2 specifically includes the following contents: S2.1: Place a checkerboard calibration plate between the left and right positions of the camera, ensure that the calibration plate can be clearly imaged in the camera field of view at both positions, and ensure that the checkerboard occupies 1 / 2~3 / 4 of the entire camera field of view. Place calibration plates at the four corners and the center of the field of view, change the calibration plate placement angle 4 times, and ensure that the angle between the calibration plate and the plane is not greater than 30°. Use the camera to take pictures at two fixed positions, and obtain a total of 20 sets of calibration plate images; S2.2: Based on the OpenCV open source image processing library, write a calibration program to calibrate the binocular vision system, obtain various calibration parameters, calculate the reprojection error of each group of images, and obtain the average reprojection error; S2.3: Check the above parameters. If the average reprojection error of the binocular calibration meets the requirements, take the calibration parameters as the final calibration result. Otherwise, delete several groups of images with large reprojection errors and recalibrate to obtain the final calibration result.

3. The machine vision extraction method for three-dimensional position of gear tooth profile chamfering according to claim 1, It is characterized in that In step S3, the main steps of the stereo correction include: S3.1: Based on the obtained binocular positioning parameters, use Rodrigues transformation to obtain the left and right position camera rotation matrices Rl and Rr , and get the left and right position camera projection matrix Pl and Pr ; S3.2: Based on the parameters obtained Rl , Rr , Pl , Pr , get the left and right positions of the camera x Remap parameters in direction mapLx , mapRx ,exist y Remap parameters for directions mapLy , mapRy ; in mapLx For the left position of the camera x remapping parameters in direction, mapRx For the right position camera is x Remapping parameters in direction, mapLy For the left position of the camera y remapping parameters in direction, mapRy For the right position camera is y remapping parameters in direction; S3.3: Remap the input left and right images of the gear to ensure that the imaging planes of the left and right position cameras are parallel and the baseline is parallel to the imaging plane, and finally achieve stereo correction.

4. The machine vision extraction method for three-dimensional position of gear tooth profile chamfering according to claim 1, It is characterized in that In step S4, the image denoising is based on bilateral filtering combined with a multi-scale guided filter to filter out macro and micro noise points in the image while maintaining image edge features at multiple scales; The image enhancement is to perform a hierarchical sharpening operation on the image based on the impact filter, that is, to strongly sharpen the medium detail area, not to sharpen the low detail area, and slightly sharpen the high detail area, so as to achieve the purpose of enhancing the edge details of the image and maintaining the original information of the image to the greatest extent; The threshold segmentation uses an iterative threshold segmentation based on the grayscale histogram; firstly, the grayscale histogram of the image is counted, and the image histogram is analyzed to obtain the minimum grayscale value. G min and max grayscale values G max, let the initial threshold: ; Based on the threshold Tk The image is divided into two groups of images: foreground and background. Tk The mean of all gray values μk 1 and greater than Tk The mean of all gray values μk 2. Find the new threshold: ; Substitute the initial threshold and repeat the above steps until the Tk = Tk+ 1, and the threshold obtained at this time is used as the optimal segmentation threshold.

5. The machine vision extraction method for three-dimensional position of gear tooth profile chamfering according to claim 1, It is characterized in that In step S5, the edge detection algorithm is an improved Canny edge detection algorithm, and the main improvements include: 1) An improved Sobel operator is used to replace the 2×2 templates in the horizontal and vertical directions to calculate the image gradient; a third-order Sobel operator template in 8 directions with an interval of 45° is used to calculate the image gradient, and the template direction is used to approximate the gradient direction of the calculated pixel point; 2) Use OpenCV to adaptively obtain high and low thresholds instead of global fixed thresholds, and use double hysteresis thresholds for edge detection and connection based on DFS depth-first search; The center of gravity method is used to obtain the center of the gear tooth profile (X 0, Y 0) The calculation formula is as follows: ; Where: (xi , yi) is the coordinate set of the tooth profile edge points, N is the number of coordinate points.

6. The machine vision extraction method for three-dimensional position of gear tooth profile chamfering according to claim 1, It is characterized in that In step S6, the tooth top edge is specifically located by the least square circle fitting method; the involute edge is specifically located by the bilinear interpolation method; and the tooth root transition edge is specifically located by the 7×7 template Zernike moment method.

7. The machine vision extraction method for three-dimensional position of gear tooth profile chamfering according to claim 1, It is characterized in that In step S7, the main steps of the stereo matching method include: S7.1: Draw a horizontal line through the binocular image and scan the binocular image up and down with a scanning interval of 1 pixel; S7.2: When the horizontal line touches the sub-pixel edge of the tooth profile, the intersection points of the left sub-pixel edge of the tooth profile and the horizontal line are stored in a to-be-matched list in order from left to right; S7.3: searching for a position along the horizontal line on the right tooth profile sub-pixel edge, searching for edge points to the right, and matching the found edge points with the edge points in the to-be-matched list in order; S7.4: After obtaining the matching point, the three-dimensional coordinates (xc , yc , z ) .

Citation Information

Patent Citations

  • Single-camera binocular vision simulation system and single-camera binocular vision simulation method

    CN104637048A