Large-size grinding wheel concentricity error measurement method and system based on machine vision
Through machine vision technology, combined with RGB three-channel image processing and improved DBSCAN/RANSAC algorithm, the problems of low efficiency and poor accuracy of traditional grinding wheel measurement methods are solved, and high-precision measurement of the inner and outer diameters and concentricity of the grinding wheel are achieved.
Patent Information
- Application Number
- CN202510583571.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-05-07
- Publication Date
- 2025-08-15
AI Technical Summary
The traditional grinding wheel geometric parameter measurement methods are inefficient, have poor accuracy and are susceptible to human factors, and cannot meet the requirements of modern manufacturing for high precision and high speed.
Using a machine vision-based method, the RGB three-channel image is collected, filtered and binarized, combined with the improved DBSCAN clustering algorithm and the RANSAC algorithm that integrates geometric-angle hybrid constraints, the precise measurement of the inner and outer diameters and concentricity of the grinding wheel is achieved.
High-precision measurement with an inner diameter measurement error of 0.14%, an outer diameter error of 0.15%, and a concentricity deviation of 0.04 mm is achieved, which improves measurement efficiency and accuracy.
Smart Images

Figure CN120495231A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of grinding wheel concentricity error measurement, and more particularly to a large-size grinding wheel concentricity error measurement method and system based on machine vision. Background Art
[0002] With the development of modern manufacturing, all walks of life have increasingly higher requirements for the performance and precision of parts and components. Ceramic materials, titanium alloys, tungsten alloys and other difficult-to-process materials are being widely used in aerospace, biomedicine, transportation and other fields. These materials have excellent physical and chemical properties, but their difficult processing characteristics also bring challenges to the processing and manufacturing of high-precision parts. Grinding is an important processing technology for obtaining high-performance parts. Its unique advantage is that it can achieve high-precision processing effects and is particularly suitable for the processing of high-hardness and brittle materials. At the same time, grinding is also a relatively economical processing method for obtaining high-precision products. Precision grinding is also the last step in the manufacturing of precision parts.
[0003] The geometric dimensions of the grinding wheel are important parameters that affect processing quality and grinding efficiency, and are also important indicators for testing whether the grinding wheel is qualified. Traditional methods for measuring the geometric parameters of grinding wheels, such as contact measurement, have disadvantages such as low efficiency, significant influence from human factors, and easy damage to the grinding wheel surface. When faced with the requirements of higher precision and higher speed, traditional measurement methods often cannot meet production needs. Based on the many shortcomings of traditional measurement technology, it is no longer able to meet the needs of modern manufacturing. The search for a measurement technology with low human involvement, high efficiency and stability has become a hot topic. Machine vision is widely used in industrial measurement due to its advantages such as non-contact, high precision and high speed. It obtains image information of the object to be measured, uses image analysis and processing algorithms to extract the geometric features of the object, and then measures the geometric parameters of the object.
[0004] Therefore, how to propose a large-size grinding wheel concentricity error measurement method and system based on machine vision to overcome the defects of large error, low accuracy and slow speed in traditional manual measurement is an urgent problem that technicians in this field need to solve. Summary of the Invention
[0005] In view of this, the present invention provides a large-size grinding wheel concentricity error measurement method and system based on machine vision, which overcomes the defects of large error, low precision and slow speed in traditional manual measurement, and realizes accurate measurement of the inner and outer diameters and concentricity of the grinding wheel. In order to achieve the above purpose, the present invention adopts the following technical solutions:
[0006] A method for measuring the concentricity error of a large-size grinding wheel based on machine vision, comprising:
[0007] Collect the original image, extract the multi-channel grayscale image and perform multi-channel filtering operations;
[0008] Perform edge detection and contour sub-pixel optimization on the filtered image, and fuse the multi-channel contour point sets;
[0009] Clustering of fused contour points is performed based on the improved DBSCAN clustering algorithm;
[0010] The inner and outer circle fitting is performed based on the contour point clustering results and the RANSAC algorithm fused with geometric-angle mixed constraints. The concentricity error of large-size grinding wheels is measured according to the inner and outer circle fitting results.
[0011] Optionally, the collecting of the original image, extracting the multi-channel grayscale image and performing the multi-channel filtering operation includes:
[0012] Multi-channel separation: For the input image I, separate the RGB three channels:
[0013] IR=I[:,:,0], IG=I[:,:,1], IB=I[:,:,2];
[0014] Perform filtering and binarization operations on each channel:
[0015]
[0016] Among them, T c is the binarization threshold of channel c.
[0017] Optionally, fusing the multi-channel contour point sets includes:
[0018] P fused =P R ∪P G ∪P B ;
[0019] Among them, P fused To fuse the contour point set, P R is the red channel contour point set, P G is the green channel contour point set, P B is the blue channel contour point set.
[0020] Optionally, clustering the contour points based on the improved DBSCAN clustering algorithm includes:
[0021] S11: Set the contour point set extracted from the binary image to Satisfy concentric arcs, that is, there is a center So that all p i Distributed in The points on the inner and outer rings centered on the same arc satisfy the angle continuous distribution;
[0022] S12: Center estimation:
[0023]
[0024] S13: Perform coordinate transformation on each point:
[0025]
[0026] Among them, r i is the Euclidean distance from the point to the reference center, θ i Azimuth relative to the reference center, arctan2 is used to preserve quadrant information;
[0027] S14: Normalization and weighted features:
[0028]
[0029] in, is the median radius, which is used to eliminate the scale effect; α is the angle feature weight coefficient, which is used to balance the contribution of radius and angle to classification;
[0030] S15: Improve the distance metric and define a composite distance function:
[0031] Among them, f j For point p j The normalized eigenvector of j For point p j Azimuth relative to the reference center;
[0032] S16: Set density parameters:
[0033] S14 and S15 define the normalized feature space and composite distance function. The neighborhood radius parameter ∈ = 0.2 represents the minimum distance between the inner and outer circles that can be separated in the normalized feature space, ensuring that the inner and outer arc points can be effectively separated. The minimum number of points min_pts = 10 is used to prevent noise from forming pseudo clusters, thereby improving clustering quality. Because the inner and outer arcs are closely adjacent in space, relying solely on clustering results cannot accurately distinguish the physical meaning of each cluster. Therefore, a classification criterion based on radius expectation is introduced;
[0034] S17: Classification criteria:
[0035]
[0036] Where k is the cluster number, label=k represents the index condition of all points classified as cluster k, E is the expected operator, and the cluster with the smallest expected radius is selected as the inner circle point set.
[0037] Optionally, performing inner and outer circle fitting based on the contour point clustering result and the RANSAC algorithm integrating geometric-angle hybrid constraints includes:
[0038] S21: Input point set data is the non-noise point output by the improved DBSCAN clustering algorithm, point p in the point set P i Converted to polar coordinates (r i ,θ i );
[0039] S22: Introduce angle features and define the composite residual function:
[0040]
[0041] The angle penalty term is used to suppress angle jumps greater than π / 2. The angles of all inner points of the current candidate circle are calculated, where β is the angle penalty term weight, o is the coordinate of the center of the candidate circle, (x c ,y c ) is the center position fitted in each iteration of RANSAC, and r is the radius of the candidate circle;
[0042] θ j =atan2(y j -y c ,x j -x c );
[0043] Sort the angles, θ (1) ≤θ (2) ≤...≤θ (n) , calculate the maximum gap:
[0044]
[0045] However, the spatial rationality of the fitting area cannot be ensured by residual measurement alone. Therefore, a dynamic neighborhood mechanism based on arc span is introduced to further constrain the fitting range by adaptively adjusting the local neighborhood radius.
[0046] S23: Setting up dynamic neighborhood mechanism:
[0047] Define the neighborhood radius formula:
[0048] Among them, k is the basic coefficient, the arc angle θ arc Adaptive: when the actual arc is less than π / 2, the neighborhood range is automatically reduced to avoid including irrelevant areas; when the arc is greater than π / 2, the neighborhood is expanded;
[0049] S24: Perform two-stage optimization:
[0050] Initial estimate randomly sampled 3 points analytical solution:
[0051]
[0052] In order to improve the stability and computational efficiency of the solution, it is converted into matrix form:
[0053]
[0054] Interior point optimization:
[0055] Filter by: γ = 2.0 pixels;
[0056] Loss function:
[0057] Where λ = 0.01 is used to prevent overfitting, c represents the circle model parameter vector to be calculated in the current optimization process, and c (0) represents the initial model parameters.
[0058] Optionally, the edge detection and contour sub-pixel optimization operations on the image after the filtering operation include: using the Canny edge detection method to identify the contours in the image and generate edge lines with a single pixel width; performing sub-pixel edge optimization, calculating the true position of the edge point based on the Zernike moment through local grayscale information, and the optimized edge points are improved from integer precision to 0.1 pixel level precision.
[0059] Optionally, performing inner and outer circle fitting further includes:
[0060] An improved RANSAC algorithm based on angle constraints is used. First, the initial circle parameters are calculated by randomly sampling three contour points.
[0061] A weighted strategy of angular distribution consistency residual and geometric residual is introduced in model evaluation, focusing on penalizing the largest angular gap to balance the influence of sparse areas.
[0062] After double residual verification of the candidate circles obtained in each iteration, the optimal model is screened and the final parameters are obtained through nonlinear least squares optimization using all interior points.
[0063] Optionally, the inner and outer circle fitting results also include inner and outer diameters and concentricity parameters.
[0064] Optionally, a large-size grinding wheel concentricity error measurement system based on machine vision includes:
[0065] Preprocessing module: used to collect original images, extract multi-channel grayscale images and perform multi-channel filtering operations;
[0066] Fusion module: used to perform edge detection and contour sub-pixel optimization operations on the image after filtering operation, and fuse the contour point sets of multiple channels;
[0067] Clustering module: used to cluster fused contour points based on the improved DBSCAN clustering algorithm;
[0068] Measurement module: used to fit inner and outer circles based on the results of contour point clustering and the RANSAC algorithm that integrates geometric-angle hybrid constraints, and to measure the concentricity error of large-size grinding wheels based on the results of inner and outer circle fitting.
[0069] It can be seen from the above technical solution that, compared with the prior art, the present invention discloses a method and system for measuring the concentricity error of a large-size grinding wheel based on machine vision, which has the following beneficial effects:
[0070] This invention proposes a large-scale grinding wheel concentricity error measurement method based on machine vision, comprising: acquiring an original image, extracting a multi-channel grayscale image, and performing multi-channel filtering operations; performing edge detection and sub-pixel contour optimization operations on the filtered image, and fusing the multi-channel contour point sets; clustering the fused contour point sets based on an improved DBSCAN clustering algorithm; fitting the inner and outer circles based on the contour point clustering results and a RANSAC algorithm that incorporates geometric-angular hybrid constraints; and measuring the concentricity error of the large-scale grinding wheel based on the inner and outer circle fitting results. This invention addresses the problems of low efficiency and poor accuracy in manual measurement of grinding wheel geometric parameters. A high-precision measurement solution based on machine vision is proposed, and a supporting detection system is developed. The detection system consists of three main modules. First, an industrial CCD camera is calibrated using PyCharm software to capture images of a grinding wheel. The captured images are then subjected to RGB three-channel extraction, grayscale conversion, filtering, and binary segmentation. Second, the Canny edge operator is used to coarsely locate image edges. A new edge judgment criterion is then established to construct an edge detection model with sub-pixel accuracy. Finally, the sub-pixel contours of the RGB three-channels are fused, and the extracted discrete points are clustered using an improved DBSCAN algorithm. An improved RANSAC algorithm is then used for circular fitting to achieve accurate measurement of the inner and outer diameters and concentricity of the grinding wheel. The measurement results show that the inner diameter measurement error of the grinding wheel is 0.14%, the outer diameter error is 0.15%, and the concentricity deviation is 0.04 mm. BRIEF DESCRIPTION OF THE DRAWINGS
[0071] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are merely embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without paying any creative work.
[0072] Figure 1 This is a flow chart of a method for measuring the concentricity error of a large-size grinding wheel based on machine vision provided by the present invention.
[0073] Figure 2 This is a flow chart of the traditional DBSCAN algorithm provided by the present invention.
[0074] Figure 3 This is a schematic diagram of the RGB three-channel grayscale conversion provided by the present invention.
[0075] Figure 4 This is a schematic diagram of a binary image provided by the present invention.
[0076] Figure 5 This is a schematic diagram of the three-channel contour fusion provided by the present invention.
[0077] Figure 6 This is a schematic diagram of the comparison of contour pixels provided by the present invention.
[0078] Figure 7 This is a schematic diagram of contour breakpoints and density unevenness provided by the present invention.
[0079] Figure 8 A schematic diagram showing the comparison of clustering algorithms provided by the present invention.
[0080] Figure 9 This is a schematic diagram of the inner and outer circle fitting images provided by the present invention. DETAILED DESCRIPTION
[0081] The following will clearly and completely describe the technical solutions in the embodiments of the present invention in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. All other embodiments obtained by ordinary technicians in this field based on the embodiments of the present invention without making any creative efforts shall fall within the scope of protection of the present invention.
[0082] The embodiment of the present invention discloses a method for measuring the concentricity error of a large-size grinding wheel based on machine vision, comprising:
[0083] Collect the original image, extract the multi-channel grayscale image and perform multi-channel filtering operations;
[0084] Perform edge detection and contour sub-pixel optimization on the filtered image, and fuse the multi-channel contour point sets;
[0085] Clustering of fused contour points is performed based on the improved DBSCAN clustering algorithm;
[0086] The inner and outer circle fitting is performed based on the contour point clustering results and the RANSAC algorithm fused with geometric-angle mixed constraints. The concentricity error of large-size grinding wheels is measured according to the inner and outer circle fitting results.
[0087] In a specific embodiment, a method for measuring the concentricity error of a large-size grinding wheel based on machine vision comprises the following steps:
[0088] In step (1), a new three-channel contour fusion method is proposed in the image preprocessing stage. By extracting contours from each channel of the RGB color image independently and performing weighted fusion, the integrity and robustness of the contour features are effectively enhanced. Experiments show that this method can reduce the number of effective contour points compared to traditional single-channel processing, and is particularly suitable for complex industrial scenes such as reflections and shadows.
[0089] In step (2), an improved DBSCAN clustering algorithm is proposed in the point set classification link. By constructing a polar coordinate feature space and introducing an angle-weighted distance metric, the algorithm combines radius normalization processing with angle feature enhancement to achieve high-precision automatic separation of the inner and outer contours of the grinding wheel.
[0090] In step (3), a new measurement framework was developed during the parameter calculation phase, which organically combines the improved DBSCAN clustering results with the RANSAC fitting algorithm. This framework first uses DBSCAN to achieve accurate contour classification, then uses the RANSAC algorithm that integrates geometric-angular hybrid constraints for fitting, and finally measures key geometric parameters such as inner and outer diameters and concentricity.
[0091] This example develops a complete grinding wheel geometry measurement solution for industrial inspection needs. Through the collaborative optimization of three-channel profile fusion, improved DBSCAN clustering, and hybrid constrained RANSAC fitting, high-precision measurement of grinding wheel inner and outer diameters and concentricity is achieved, providing a reliable solution for grinding wheel quality inspection.
[0092] In a specific embodiment, a large-size grinding wheel concentricity error measurement method based on machine vision is provided. Figure 1As shown in the figure, the geometric parameters of the grinding wheel are measured. Due to the large size of the grinding wheel to be measured, in order to improve the measurement accuracy, this embodiment uses a local image fitting method to measure the overall profile. By taking multiple photos of different areas of the same grinding wheel, the geometric parameters of each part are measured separately, and the overall shape is reconstructed using a fitting algorithm. Finally, the average value of all the measurement results is used as the final measurement parameter of the grinding wheel. If there is a large deviation between the multiple measurement results, the grinding wheel quality is judged to be unqualified, thereby ensuring the reliability of measurement accuracy and product quality.
[0093] In a specific embodiment, the multi-channel fusion contour extraction in step (1) includes:
[0094] In image processing, contour extraction is a fundamental step for many tasks. Traditional methods usually perform contour extraction based on a single channel (such as a grayscale image). However, in complex scenes, single-channel information may not be sufficient to accurately extract the target contour. For example, in low-contrast or complex backgrounds, the target contour may be more obvious in certain channels. This embodiment proposes a sub-pixel contour extraction method based on multi-channel fusion, which improves the accuracy and robustness of contour extraction by fusing contour information from the RGB three channels.
[0095] (1) Multi-channel separation: For the input image I, separate the RGB three channels:
[0096] IR=I[:,:,0], IG=I[:,:,1], IB=I[:,:,2].
[0097] (2) Perform filtering and binarization operations on each channel:
[0098]
[0099] Among them, T c is the binarization threshold of channel c.
[0100] (3) Perform edge detection and contour sub-pixel optimization on the obtained binary image, and fuse the contour point sets of the three channels:
[0101] P fused =P R ∪P G ∪P B .
[0102] In a specific embodiment, the improved DBSCAN clustering algorithm in step (2) includes:
[0103] 1) DBSCAN (Density-Based Spatial Clustering of Applications with Noise) is a typical representative of density clustering algorithms. Unlike traditional clustering methods based on partitioning (such as K-means) or hierarchy (such as AGNES), DBSCAN identifies cluster structures by analyzing the density distribution of data in feature space. Its core concept is "the largest set of density-connected points in space." This density-based feature gives it three outstanding advantages: (1) it does not require the number of clusters to be specified in advance; (2) it can discover clusters of any shape (such as non-convex clusters such as rings and lines); and (3) it is naturally robust to noisy data.
[0104] like Figure 2 As shown, the specific steps of the DBSCAN algorithm include:
[0105] 1. Calculate the ε neighborhood of all points: For the data set P = {p1, p2, ..., p N}, Every point P in i , calculate how many neighbors there are in its ε neighborhood. The threshold of the number of neighbors is usually defined by a parameter MinPts. If the number of points in the neighborhood of a point is greater than or equal to MinPts, then the point is marked as a core point.
[0106] For each point p i ∈P, define its neighborhood as:
[0107] N ∈ (p i )={p j ∈P|dist(p i ,p j )≤∈};
[0108] Among them, dist(p i ,p j )≤∈ is p i to p j The Euclidean distance of .
[0109] Click p i A core point is if and only if:
[0110] |N ∈ (p i )|≥MinPts;
[0111] Core point set:
[0112] Core={p i ∈P||N ∈ (p i )|≥MinPts}.
[0113] 2. Find density-connected points: For each core point, find all points that are density-connected to it. If point p i At point p j In the neighborhood of , and p j is a core point, then p i It is a p j Density connected points.
[0114] 3. Marking noise points and boundary points: Points that are not marked as core points are marked as noise points. Points that are densely connected to a core point but are not core points are marked as boundary points.
[0115] Boundary point set:
[0116]
[0117] Noise point set:
[0118] Noise=P\(Core∪Border).
[0119] 4. Assign an independent cluster label to each core point or its densely connected points: Assign an independent cluster label to each core point or its densely connected points. If a point is densely connected to multiple core points, it will be assigned the cluster label of the first core point found.
[0120] 5. Noise points form independent clusters: All noise points form an independent cluster.
[0121] 2) Improved DBSCAN stage
[0122] Although DBSCAN can effectively discover clusters of arbitrary shapes and identify noise points, the standard DBSCAN has the problem of relying solely on Euclidean distance during the clustering process. In the arc clustering scenario, points that are spatially close but belong to different arcs may be incorrectly clustered. To address this problem, this embodiment proposes an improved DBSCAN clustering algorithm that improves the clustering effect by introducing angle feature constraints. The specific operation process is as follows:
[0123] The contour point set extracted from the binary image is Satisfy concentric arcs, that is, there is a center So that all p i Distributed in The points on the inner and outer rings as the center and on the same arc satisfy the angle continuous distribution.
[0124] (1) Estimation of the center of the circle:
[0125]
[0126] Compared with the mean, the median estimation is more robust to outliers such as noise or defective pixels, which meets the actual needs of industrial parts detection.
[0127] (2) Perform coordinate transformation on each point:
[0128]
[0129] Among them, r i is the Euclidean distance from the point to the reference center, θ i The azimuth angle relative to the reference center. arctan2 preserves the quadrant information and avoids angle jumps.
[0130] (3) Normalization and weighted features:
[0131]
[0132] in, is the median radius, which is used to eliminate the scale effect; α is the angle feature weight coefficient, which can balance the contribution of radius and angle to classification; normalization is to make the radius and angle feature dimensions consistent.
[0133] (4) Improve the distance metric and define a composite distance function:
[0134]
[0135] The angle feature weight coefficient α=1.5 is to enhance the angle feature.
[0136] (5) Set density parameters:
[0137] The neighborhood radius parameter ∈=0.2 represents the minimum distance between the inner and outer circles that can be separated in the normalized feature space, and the minimum number of points min_pts=10 avoids the formation of pseudo clusters due to noise.
[0138] (6) Classification criteria:
[0139]
[0140] The cluster with the smallest expected radius is selected as the inner circle point set, which conforms to the physical structure characteristics of the cylindrical end surface.
[0141] In a specific embodiment, the improved RANSAC fitting stage in step (3) includes:
[0142] The traditional RANSAC algorithm performs fitting based solely on geometric distance residuals. However, in circle detection tasks, the consistency of the angular distribution of points is equally important. This embodiment proposes a RANSAC fitting algorithm that combines radius residuals and angle residuals to better fit circles with angular distribution characteristics.
[0143] The input point set data of this algorithm is the non-noise point output by the improved DBSCAN clustering algorithm, point p in the point set P i Converted to polar coordinates (r i ,θ i ), because these points meet the local density conditions, belong to the "backbone" part of the inner and outer contour clusters, have high geometric consistency, and will have higher accuracy and stronger noise resistance in the subsequent fitting process. Specific improvements include:
[0144] (1) Define the composite residual function:
[0145] Traditional RANSAC only uses the minimum geometric distance to define the residual function. When the arc is occluded, minimizing the geometric distance will force the fitted circle to pass through the middle of the valid area, resulting in systematic deviations. This embodiment introduces angle features to define a composite residual function:
[0146]
[0147] The angle penalty term is used to suppress angle jumps greater than π / 2. The process is to first calculate the angles of all inner points of the current candidate circle, where β is the angle penalty term weight, which is 0.1 in this embodiment, and o is the coordinate of the center of the candidate circle. (x c ,y c ) is the center position fitted in each iteration of RANSAC, and r is the radius of the candidate circle.
[0148] θ j =atan2(y j -y c ,x j -x c );
[0149] Then sort the angles, θ (1) ≤θ (2) ≤...≤θ (n) , and finally calculate the maximum gap.
[0150]
[0151] (2) Dynamic neighborhood mechanism:
[0152] Define the neighborhood radius formula:
[0153]
[0154] Among them, the basic coefficient k = 1.0, the arc angle θ arc Adaptive: When the actual arc is smaller than π / 2, the neighborhood range is automatically narrowed to avoid including irrelevant areas; when the arc is larger than π / 2, the neighborhood is expanded.
[0155] (3) Two-stage optimization:
[0156] 1) Initial estimate randomly sample 3 points for analytical solution:
[0157]
[0158] Convert to matrix form:
[0159]
[0160] 2) Interior point optimization:
[0161] Filter by: γ = 2.0 pixels;
[0162] Loss function:
[0163] Among them, λ = 0.01 is used to prevent overfitting, c represents the circle model parameter vector to be calculated in the current optimization process, and c (0) represents the initial model parameters.
[0164] In a specific embodiment, to verify the effectiveness of the proposed method, a measurement system was constructed and multiple measurements were performed on a standard grinding wheel. The image acquisition equipment included an imaging device, a platform, a camera stand, and a computer. In this embodiment, an industrial CMOS camera with a resolution of 1280*1024 and a low-distortion lens was used. The detection process used an industrial camera to capture images of the grinding wheel surface and transferred the images to a computer via a camera device driver. This driver enabled the transmission of static image data and video streams. The computer, using PyCharm software, applied multiple algorithms to process the images and obtained measurement results through fitting methods. Finally, the computer analyzed the processed images and output the measurement data.
[0165] (1) Camera calibration
[0166] Pixel equivalent is a key parameter used to convert the number of pixels in an image into actual physical lengths. It is crucial for translating wear levels from pixel counts to real-world length units. Calculating pixel equivalent depends on the lens magnification and the size of the camera's photosensitive chip. Because lens magnification can vary due to manufacturing errors, camera calibration is necessary to obtain a more accurate pixel equivalent value. Spatial calibration converts the number of pixels in an image into real-world length units. This pixel equivalent value remains constant when the distance between the camera and the object remains constant.
[0167] In order to achieve accurate pixel equivalent calculation, this embodiment uses a customized calibration plate in which the side length of each grid is 6mm. By ensuring that the distance between the camera and the calibration plate remains unchanged and taking an image, the number of pixels n in each grid of the calibration plate can be obtained. Knowing that the actual side length L = 6mm of each grid, the pixel equivalent k can be calculated by the following formula: k = L / n. For example, the calibration results show that the actual physical length represented by each pixel is 0.140mm. Using this pixel equivalent value, the length of the inner and outer circles of the grinding wheel can be calculated. The length of the inner and outer circles is obtained by multiplying the number of pixels in the area by the pixel equivalent to obtain the corresponding physical length.
[0168] (2) Image preprocessing
[0169] In order to extract the outline of the image, the color image is converted into a grayscale image. However, direct conversion to a grayscale image may result in the loss of some details. To solve this problem, the three-channel image of the color image is first extracted separately, and each channel is converted into a grayscale image separately, such as Figure 3 As shown in the figure, (a) is the original image, (b) is the grayscale image of the red channel, (c) is the grayscale image of the green channel, and (d) is the grayscale image of the blue channel. By filtering the grayscale image of each channel, performing edge detection, and accurately locating sub-pixel edge coordinates, three independent contour information pieces are obtained. Finally, these three contour information pieces are fused to produce a more complete contour image with more details. This method can better preserve the original image information while enhancing the accuracy and robustness of contour extraction.
[0170] (3) Filtering and binarization
[0171] The original image often suffers from quality degradation due to noise pollution, and detailed information is covered or lost. This noise interference has a significant adverse effect on subsequent key tasks such as image segmentation and edge detection. Therefore, it is necessary to denoise the grayscale images of the three channels. Selecting the appropriate denoising technology to improve image quality is an important part of image preprocessing. Among the existing denoising methods, median filtering, due to its unique nonlinear characteristics, can effectively suppress noise while better retaining the edge and texture information of the image. Setting an appropriate threshold value can obtain a binary image such as Figure 4 shown.
[0172] (4) Sub-pixel edge detection and contour image fusion
[0173] Canny edge detection is a classic edge extraction method that can effectively identify contours in images and generate edge lines with a single pixel width. However, the edge point coordinates output by the Canny algorithm are at the integer pixel level. In order to further improve the measurement accuracy, sub-pixel edge optimization is performed. Based on the Zernike moment, the true position of the edge point can be accurately calculated through local grayscale information. The optimized edge point is improved from integer precision to 0.1 pixel level accuracy. After obtaining the sub-pixel precision contour, a fusion strategy is used to integrate it to retain the complete edge information to the maximum extent. The sub-pixel precision contour image obtained by the RGB three channels and the fused contour image are as follows: Figure 5 As shown, (a) is the fused image, (b) is the red channel contour image, (c) is the green channel contour image, and (d) is the blue channel contour image. The contrast of the number of pixels of the five contours is shown below: Figure 6 As shown in the figure, a comparison of the number of pixels in the contours obtained by different methods reveals that the contour obtained by three-channel contour fusion has the largest number of pixels, followed by the contour extracted by direct grayscale conversion, while the three contours extracted using the three channels have similar pixel counts. Experiments show that the fused contour is more complete than the single-channel contour, effectively improving the reliability of edge detection.
[0174] (5) Point clustering based on radius-angle dual feature constraints
[0175] In response to the challenge of contour point set classification in grinding wheel concentricity measurement, this embodiment proposes a point set clustering method based on radius-angle dual feature constraints. Due to the following technical difficulties in large-scale grinding wheel measurement: (1) Limited by the optical field of view, only local arc segments can be obtained; (2) Surface roughness causes breakpoints and uneven contour points in contour extraction, such as Figure 7 As shown in the figure, (a) is the breakpoint and (b) is the case of uneven density. Experiments show that traditional clustering algorithms (such as K-means and DBSCAN) have significant limitations in separating concentric arcs. Figure 8 As shown in the figure, (a) is the contour image, (b) is the improved DBSCAN clustering effect diagram, (c) is the standard DBSCAN clustering effect diagram, and (d) is the K-means clustering effect diagram. Figure 8 As shown in (c) and (d), the algorithm mistakenly mixes the local segments of the inner arc with the outer arc, and vice versa. To this end, this embodiment constructs the feature space through polar coordinate transformation and uses the improved DBSCAN algorithm to adaptively cluster the discrete points, in which the key parameter ε is dynamically adjusted according to the nominal radius of the grinding wheel. The experimental results are shown in Figure 2. Figure 8As shown in (b), the improved DBSCAN clustering algorithm has a better effect in separating internal and external points, which establishes a reliable data foundation for subsequent high-precision concentric circle fitting.
[0176] (6) Circle fitting
[0177] The circle fitting process adopts an improved RANSAC algorithm based on angle constraints. First, the initial circle parameters are calculated by randomly sampling three contour points, and a weighted strategy of angle distribution consistency residual (weight 10%) and geometric residual (weight 90%) is introduced in the model evaluation, focusing on penalizing the maximum angle gap to balance the influence of sparse areas; after double residual verification of the candidate circle obtained in each iteration, the optimal model is screened and the final parameters are obtained by nonlinear least squares optimization using all the inner points. Experiments show that when a 2.0 pixel residual threshold is set, the algorithm can still maintain sub-pixel fitting accuracy (error <1 pixel) under 30% outlier interference. In order to verify the effectiveness of the algorithm, this embodiment performs circle fitting on the inner and outer contour point sets separated by DBSCAN clustering. The fitting results are shown in the figure below. Figure 9 As shown in Table 1, the scheme described in this embodiment is compared with the traditional least squares method, the standard RANSAC algorithm and the direct grayscale conversion. The results are shown in Table 1.
[0178] Table 1 Comparison of measurement results
[0179]
[0180] This embodiment addresses the problems of low efficiency and poor accuracy in manual measurement of grinding wheel geometric parameters. A high-precision measurement solution based on machine vision is proposed and a matching detection system is developed. The detection system mainly consists of three modules. First, an industrial CCD camera is calibrated using PyCharm software to capture a partial image of the grinding wheel. The captured image is then subjected to RGB three-channel extraction, grayscale conversion, filtering, and binary segmentation processing. Secondly, the Canny edge operator is used to roughly locate the image edge. Then, a new edge judgment criterion is established to construct an edge detection model with sub-pixel accuracy. Finally, the sub-pixel contours of the RGB three channels are feature fused, and the extracted discrete point sets are clustered using the improved DBSCAN algorithm. Then, an improved RANSAC algorithm is used for circular fitting to achieve accurate measurement of the inner and outer diameters and concentricity of the grinding wheel. The measurement results show that the measurement error of the inner diameter of the grinding wheel is 0.14%, the outer diameter error is 0.15%, and the concentricity deviation is 0.04 mm.
[0181] In a specific embodiment, a large-size grinding wheel concentricity error measurement system based on machine vision includes:
[0182] Preprocessing module: used to collect original images, extract multi-channel grayscale images and perform multi-channel filtering operations;
[0183] Fusion module: used to perform edge detection and contour sub-pixel optimization operations on the image after filtering operation, and fuse the contour point sets of multiple channels;
[0184] Clustering module: used to cluster fused contour points based on the improved DBSCAN clustering algorithm;
[0185] Measurement module: used to fit inner and outer circles based on the results of contour point clustering and the RANSAC algorithm that integrates geometric-angle hybrid constraints, and to measure the concentricity error of large-size grinding wheels based on the results of inner and outer circle fitting.
[0186] The various embodiments in this specification are described in a progressive manner, with each embodiment focusing on the differences from other embodiments. Reference can be made to the common and similar parts between the various embodiments. For the devices disclosed in the embodiments, since they correspond to the methods disclosed in the embodiments, the description is relatively simple, and the relevant parts can be referred to the method description.
[0187] The above description of the disclosed embodiments is intended to enable one skilled in the art to implement or use the present invention. Various modifications to these embodiments will be readily apparent to one skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present invention. Therefore, the present invention is not limited to the embodiments shown herein but is intended to conform to the widest scope consistent with the principles and novel features disclosed herein.
Claims
1. A method for measuring the concentricity error of a large-size grinding wheel based on machine vision, characterized in that: include: Collect the original image, extract the multi-channel grayscale image and perform multi-channel filtering operations; Perform edge detection and contour sub-pixel optimization on the filtered image, and fuse the multi-channel contour point sets; Clustering of fused contour points is performed based on the improved DBSCAN clustering algorithm; The inner and outer circle fitting is performed based on the contour point clustering results and the RANSAC algorithm fused with geometric-angle mixed constraints. The concentricity error of large-size grinding wheels is measured according to the inner and outer circle fitting results.
2. The method for measuring the concentricity error of a large-size grinding wheel based on machine vision according to claim 1, characterized in that: The collecting of the original image, extracting the multi-channel grayscale image and performing the multi-channel filtering operation includes: Multi-channel separation: For the input image I, separate the RGB three channels: IR=I[:,:,0], IG=I[:,:,1], IB=I[:,:,2]; Perform filtering and binarization operations on each channel: Among them, T c is the binarization threshold of channel c.
3. The method for measuring the concentricity error of a large-size grinding wheel based on machine vision according to claim 1, characterized in that: The fusing of the multi-channel contour point sets includes: P fused =P R ∪P G ∪P B ; Among them, P fused To fuse the contour point set, P R is the red channel contour point set, P G is the green channel contour point set, P B is the blue channel contour point set.
4. The method for measuring the concentricity error of a large-size grinding wheel based on machine vision according to claim 1, characterized in that: The contour point clustering based on the improved DBSCAN clustering algorithm includes: S11: Set the contour point set extracted from the binary image to Satisfy concentric arcs, that is, there is a center So that all p i Distributed in The points on the inner and outer rings centered on the same arc satisfy the angle continuous distribution; S12: Center estimation: S13: Perform coordinate transformation on each point: Among them, r i is the Euclidean distance from the point to the reference center, θ i Azimuth relative to the reference center, arctan2 is used to preserve quadrant information; S14: Normalization and weighted features: in, is the median radius, which is used to eliminate the scale effect; α is the angle feature weight coefficient, which is used to balance the contribution of radius and angle to classification; S15: Improve the distance metric and define a composite distance function: Among them, f j For point p j The normalized eigenvector of j For point p j Azimuth relative to the reference center; S16: Set density parameters: The neighborhood radius parameter ∈ = 0.2 represents the minimum distance between the inner and outer circles that can be separated in the normalized feature space, and the minimum number of points min_pts = 10 is used to avoid the formation of pseudo clusters due to noise; S17: Classification criteria: Where k is the cluster number, label=k represents the index condition of all points classified as cluster k, E is the expected operator, and the cluster with the smallest expected radius is selected as the inner circle point set.
5. The method for measuring the concentricity error of a large-size grinding wheel based on machine vision according to claim 1, characterized in that: The inner and outer circle fitting based on the contour point clustering result and the RANSAC algorithm integrating the geometric-angle hybrid constraint includes: S21: Input point set data is the non-noise point output by the improved DBSCAN clustering algorithm, point p in the point set P i Converted to polar coordinates (r i ,θ i ); S22: Introduce angle features and define the composite residual function: The angle penalty term is used to suppress angle jumps greater than π / 2. The angles of all inner points of the current candidate circle are calculated, where β is the angle penalty term weight, o is the coordinate of the center of the candidate circle, (x c ,y c ) is the center position fitted in each iteration of RANSAC, and r is the radius of the candidate circle; θ j =atan2(y j -y c ,x j -x c ); Sort the angles, θ (1) ≤θ (2) ≤...≤θ (n) , calculate the maximum gap: S23: Setting up dynamic neighborhood mechanism: Define the neighborhood radius formula: Among them, k is the basic coefficient, the arc angle θ arc Adaptive: when the actual arc is less than π / 2, the neighborhood range is automatically reduced to avoid including irrelevant areas; when the arc is greater than π / 2, the neighborhood is expanded; S24: Perform two-stage optimization: 1) Initial estimate randomly sample 3 points for analytical solution: 2) Convert to matrix form: 3) Interior point optimization: Filter by: γ = 2.0 pixels; Loss function: Where λ = 0.01 is used to prevent overfitting, c represents the circle model parameter vector to be calculated in the current optimization process, and c (0) represents the initial model parameters.
6. The method for measuring the concentricity error of a large-size grinding wheel based on machine vision according to claim 1, characterized in that: The edge detection and sub-pixel contour optimization operations on the image after the filtering operation include: using the Canny edge detection method to identify the contours in the image and generate edge lines with a single pixel width; performing sub-pixel edge optimization, calculating the true position of the edge point based on the Zernike moment through local grayscale information, and improving the optimized edge point from integer precision to 0.1 pixel level precision.
7. The method for measuring the concentricity error of a large-size grinding wheel based on machine vision according to claim 1, characterized in that: The inner and outer circle fitting also includes: An improved RANSAC algorithm based on angle constraints is used. First, the initial circle parameters are calculated by randomly sampling three contour points. A weighted strategy of angular distribution consistency residual and geometric residual is introduced in model evaluation, focusing on penalizing the largest angular gap to balance the influence of sparse areas. After double residual verification of the candidate circles obtained in each iteration, the optimal model is screened and the final parameters are obtained through nonlinear least squares optimization using all interior points.
8. The method for measuring the concentricity error of a large-size grinding wheel based on machine vision according to claim 1, characterized in that: The inner and outer circle fitting results also include inner and outer diameters and concentricity parameters.
9. A large-size grinding wheel concentricity error measurement system based on machine vision, characterized in that: include: Preprocessing module: used to collect original images, extract multi-channel grayscale images and perform multi-channel filtering operations; Fusion module: used to perform edge detection and contour sub-pixel optimization operations on the image after filtering operation, and fuse the contour point sets of multiple channels; Clustering module: used to cluster fused contour points based on the improved DBSCAN clustering algorithm; Measurement module: used to fit inner and outer circles based on the results of contour point clustering and the RANSAC algorithm that integrates geometric-angle hybrid constraints, and to measure the concentricity error of large-size grinding wheels based on the results of inner and outer circle fitting.
Citation Information
Cited By
Self-adaptive detection method and device for molded surface size and volume density of energy-gathered cutting cable
CN121384158A
Industrial pipe multi-parameter visual detection system and method based on multi-model cooperation
CN122237440A
Glass fiber reinforced plastic cutout profile image fitting method based on edge gradient calculation
CN122510291A
Glass fiber reinforced plastic cutout profile image fitting method based on edge gradient calculation
CN122510291B