Self-adaptive edging width algorithm for automobile glass on line scanning camera imaging
Through the adaptive edge width algorithm, RDP algorithm and Gaussian filtering technology, the distortion and splicing error problems in line scanning imaging are solved, and high-precision edge width measurement is achieved, adapting to non-uniform speed conveyor belts and multi-field glass detection.
Patent Information
- Application Number
- CN202510480097.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-17
- Publication Date
- 2025-07-18
AI Technical Summary
Line-sweep imaging is prone to distortion and poor stitching image imaging in automotive glass edge measurements, and traditional algorithms are difficult to maintain high-precision measurements on non-uniform conveyor belts.
Adaptive edge width algorithm is used to extract the glass contour scatter points through the RDP algorithm, calculate the gradient change direction, eliminate the splicing burr points, convert them into a one-dimensional line chart and smooth the Gaussian filter, and calculate the maximum minimum value to divide the arc edge and compensate for the actual width.
Without changing the equipment tooling, maintain high-precision measurement, ignore splicing errors, adapt to the difference in the proportion of pixels and actual widths in different directions, adapt to glass styles and rotating placement, and achieve efficient and accurate measurement of edge-braded widths.
Smart Images

Figure CN120339250A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of automotive glass quality inspection, and particularly relates to an adaptive edge grinding width algorithm for automotive glass online line scan camera imaging. Background Art
[0002] In the field of the automotive industry, line scan cameras are often used for automotive glass quality inspection. Their advantage lies in that the photosensitive elements are only in one row. Compared with area array cameras, the frame rate is less restricted, making high scanning frequencies and high resolutions possible, which is suitable for online quality inspection of large automotive glass. However, the biggest pain point of line scan cameras is that they have high requirements for the mechanical precision of the conveyor belt and need to maintain high-precision uniform speed. Otherwise, the imaging will be stretched and deformed; in online glass quality inspection, in addition to detecting surface defects of the glass, the edge grinding width is also an important quality inspection index. Due to edge grinding, the edge appears as a black solid line in line scan imaging. Quality inspection requires measuring the width of this solid line with an accuracy of 0.1 mm and finding the maximum and minimum values of the edge grinding of the corresponding side.
[0003] In the traditional line scan imaging for glass edge grinding measurement algorithm solutions, the biggest difficulty is image distortion. One part comes from the perspective distortion generated by pinhole imaging in the non-movement direction of the line scan. The other part is in the movement direction. Although the distortion of perspective imaging is avoided, whether there is distortion completely depends on whether the conveyor belt is running at a uniform speed. However, in the actual industrial production scenario, limited by maintenance costs and production pressure, it is difficult for the equipment to maintain a high-precision uniform speed, which leads to the difficulty of adapting the traditional measurement algorithm, and the ratio of the pixels measured in different directions to the actual width represented is not the same.
[0004] Another difficulty lies in that the field of view of automotive glass is large and requires multiple line scan cameras to cover. There is a stitching problem, and during the measurement process, it is necessary to exclude the errors at the image stitching to avoid the appearance of maximum and minimum values.
[0005] In summary, a set of adaptive edge grinding measurement algorithms for line scan imaging scenarios is needed. Summary of the Invention
[0006] In order to solve the problems that the existing line scan imaging for glass edge grinding measurement algorithms are prone to distortion and the stitching image imaging is not good, the present invention provides an adaptive edge grinding width algorithm for automotive glass online line scan camera imaging, which overcomes the interference of distortion and poor stitching image imaging and at the same time maintains high-precision measurement.
[0007] The technical solution of the present invention is as follows:
[0008] An adaptive edge grinding width algorithm for automotive glass online line scan camera imaging, the steps are as follows:
[0009] Step 1: Extract the contour of the glass and obtain the approximate contour scatter points through the RDP algorithm;
[0010] Step 2: Approximate the tangent of adjacent scatter points to obtain the gradient change direction of the edging width;
[0011] Step 3: Calculate the gradient change of all points, exclude the burr points of image stitching according to the number of gradient change points, and obtain the edging width of all points;
[0012] Step 4: Fix the starting position, transform the edging width into a one-dimensional line graph, and perform Gaussian filtering and smoothing processing on the one-dimensional line graph;
[0013] Step 5: Calculate the maximum and minimum values of the line graph to judge the corners of the glass contour, thereby segmenting the arc edges in different directions of the glass, calculate the maximum and minimum values of the edging width and the point coordinates for different arc edges, and compensate to the true width according to different directions.
[0014] Further, the contour extraction of the glass in Step 1 is specifically: find the outer contour of the glass through the contour segmentation algorithm, and the contour segmentation algorithm includes but is not limited to the canny algorithm. For the conveyor belt with a running speed higher than the preset speed, use the pixel-level threshold segmentation algorithm, and then transform it into a contour. The pixel-level threshold segmentation algorithm includes the OTSU threshold segmentation algorithm and the mean dynamic threshold segmentation algorithm;
[0015] After obtaining the outer contour, obtain the best approximate points on the contour through the RDP algorithm.
[0016] Further, Step 2 is specifically: after obtaining the contour edge scatter points, calculate the edging width of the contour edge scatter points, and the contour edge scatter points are in the vertical direction of the tangent of the contour;
[0017] Use the connection line of adjacent discrete points obtained by the RDP algorithm to approximate the tangent of this point, thereby obtaining the vertical direction of the tangent of this point.
[0018] Further, Step 3 is specifically: after obtaining the gradient direction of the scatter points, calculate the gray change in this direction using the first derivative to obtain the edging width of this point; for the positions with abnormal contours, when calculating the first derivative, there will be more than 2 gradient change points, and at this time, this point is abandoned from the calculation of the edging width.
[0019] Further, the transformation of the edging width into a one-dimensional line graph by fixing the starting position in Step 4 is specifically: starting from a certain fixed position, sort the values of the edging width of the glass according to the contour direction into a line graph, where the x-axis of the line graph is the discrete points and the y-axis is the edging width of each point.
[0020] Further, the compensation in Step 5 is linear compensation.
[0021] Compared with the prior art, the present invention has the following beneficial effects:
[0022] (1) In terms of cost, without changing the equipment tooling, this algorithm maintains high-precision measurement while ignoring the errors generated by splicing. In terms of computational complexity, the RDP algorithm is tested and adopted to achieve the most efficient measurement method under limited computational resources. If other methods such as fixed spacing are used to extract contour points, either a large amount of duplicate data will be generated, or at the inflection points of small arc edges, too few contour points will be extracted, resulting in missed detection of this part of the data. The vertical gradient direction of any contour is obtained by approximating the tangent direction of the line connecting adjacent points in obtaining the edging width. This design avoids additional tangent calculations for all contour points, and the accurate gradient direction can filter out the burrs at the splicing point by the number of gradient change points in the vertical direction and thus exclude them.
[0023] (2) The algorithm of the present invention utilizes the situation that the pixel-to-actual width ratio of the line-scan camera is different in different directions, which is originally a disadvantage. By converting the edging width into a one-dimensional broken line graph and then performing smoothing processing through Gaussian filtering to extract local maximum and minimum values, the extraction of the arc edge corresponding to the outer contour of the glass is realized instead. The maximum and minimum values found through the extreme values on the corresponding side are tested to be the most in line with the actual situation, and it has a trend rather than outliers caused by the vibration of the conveyor belt.
[0024] (3) The algorithm of the present invention has good adaptability. After testing, it is not affected by the styles of the outer contours of the glass on the production line and the slight rotation and placement of the glass. The RDP algorithm will automatically generate different numbers of contour points according to the size of the glass, and the set threshold will not lock the output contour points. There will be no situation where the contour point density of small pieces of glass is too high while that of large pieces of glass is sparse. BRIEF DESCRIPTION OF THE DRAWINGS
[0025] Figure 1 It is a schematic diagram of converting the contour into scatter points by the RDP algorithm;
[0026] Figure 2 It is a schematic diagram of obtaining the gradient direction of the contour scatter points;
[0027] Figure 3 It is a schematic diagram of the abnormal contour splicing part;
[0028] Figure 4 It is a schematic diagram of the edging width broken line;
[0029] Figure 5 It is a schematic diagram of the maximum and minimum values of the edging width broken line;
[0030] Figure 6 It is a schematic diagram of the overall process of the present invention. DETAILED DESCRIPTION OF THE INVENTION
[0031] The present invention will be described in detail below in conjunction with the accompanying drawings and specific embodiments.
[0032] An adaptive edge grinding width algorithm for on-line scanning camera imaging of automotive glass is as follows:
[0033] Step 1: Extract the contour of the glass and obtain approximate contour scatter points through the RDP algorithm;
[0034] Step 2: Approximate the tangent of adjacent scatter points to obtain the gradient change direction of the edge grinding width;
[0035] Step 3: Calculate the gradient changes of all points, exclude the burr points of image stitching according to the number of gradient change points, and obtain the edge grinding width of all points;
[0036] Step 4: Fix the starting position, convert the edge grinding width into a one-dimensional broken line graph, and perform Gaussian filtering and smoothing processing on the one-dimensional broken line graph;
[0037] Step 5: Calculate the maximum and minimum values of the broken line graph to judge the corners of the glass contour, thereby segmenting the arc edges in different directions of the glass, calculate the maximum and minimum values of the edge grinding width and the point coordinates for different arc edges, and compensate to the true width according to different directions.
[0038] The invention will be further described below in conjunction with a specific embodiment:
[0039] An adaptive edge grinding width algorithm for on-line scanning camera imaging of automotive glass, the algorithm is as follows:
[0040] Step 1: Find the outer contour of the glass through a contour segmentation algorithm such as the canny algorithm, etc. If a higher running speed of the conveyor belt is required, pixel-level threshold segmentation is used, such as OTSU threshold segmentation or mean dynamic threshold segmentation to obtain, and then converted into a contour. If sub-pixel-level calculations are directly performed on a large high-resolution image, it is time-consuming. After obtaining the outer contour of the glass, it is necessary to determine which points are required for edge grinding width calculation. Since the contour is continuous and the points are infinite points, the RDP (Ramer-Douglas-Peucker) algorithm is used here to obtain the best approximate points on the contour. This algorithm limits the number of contours converted to discrete points by setting a threshold, and at the same time, these discrete points approximate the contour with the least number, using this algorithm greatly reduces the subsequent calculation amount of the edge grinding width, as Figure 1 shown, at the contour edge, the marked contour points are denser when the contour arc is larger, and the contour points are sparser when the contour is closer to a straight line.
[0041] Step 2: After obtaining the scattered points on the contour edge, it is necessary to calculate the edge grinding width at this point. This requires calculating the perpendicular direction of the tangent line of the contour at this point. Since calculating the derivative of the tangent line passing through the tangent point consumes a certain amount of computing resources, at this time, the line connecting adjacent discrete points obtained by the RDP algorithm can be used to approximate the tangent line of this point, so as to obtain the perpendicular direction of the tangent line of this point. As Figure 2 shown, the perpendicular direction of the tangent line of the tangent point, that is, the edge grinding measurement direction, has been well approximated. However, due to an overly large arc, two adjacent points may be too close, and at this time, the change of the tangent line is very sensitive. Some dense points should be appropriately ignored, and it is only when the adjacent points are higher than a certain distance threshold that the gradient line in the perpendicular direction of the tangent line can be obtained.
[0042] Step 3: After obtaining the gradient direction of the scattered points, calculate the gray-scale change in this direction using the first derivative, and the sub-pixel edge grinding width at this point can be obtained. There may be abnormal contours at the splicing position, such as Figure 3 shown. However, when calculating the first derivative at this burr position, there will be more than 2 gradient change points, and at this time, the algorithm will abandon adding this point to the calculation of the edge grinding width.
[0043] Step 4: After calculating the edge grinding width of all points, starting from a certain fixed position, sort the values of the edge grinding width of this glass in the contour direction into a line chart. After Gaussian filtering, as Figure 4 shown, the x-axis is the discrete points, and the y-axis is the edge grinding width of each point.
[0044] Step 5: The edge grinding width has periodic changes because the actual widths represented by unit pixels in the moving direction and non-moving direction of the line-scan camera are different. Therefore, the corresponding arc edges of the glass can be found by means of the change differences in the line chart. As Figure 5 shown, the longer dividing line is to find the local maximum value of this line chart, and the shorter dividing line is the local minimum value of this line chart. From Figure 5 , it can be found that the range of 60 - 200 on the x-axis is a long arc edge of the glass, and the range of 340 - 390 is a short arc edge of the glass. Since the minimum and maximum values of the entire line chart have been calculated, the maximum and minimum values of the edge grinding within its range can be obtained, and the scattered point coordinates of the maximum and minimum values can be found according to the index of the x-axis. Finally, since it is known that the ratio of pixels to the actual width of the line-scan camera in different directions is different, different linear compensations can be used to obtain the final edge grinding width.
[0045] The linear compensation described above is a prior art. Generally, devices such as flash measurement instruments will perform a linear compensation on the algorithm to improve the accuracy when the hardware conditions cannot be improved. However, in this invention, the compensation parameters for arc edges in different directions are independent.
[0046] In a preferred embodiment of the present invention, when the running speed of the conveyor belt is higher than 25 m / min, pixel-level threshold segmentation is used.
[0047] The above are only embodiments of the present invention, and do not limit the patent scope of the present invention accordingly. Any equivalent structure or equivalent process transformation made by using the content of the specification and drawings of the present invention, or directly or indirectly applied in other related technical fields, shall be equally included in the patent protection scope of the present invention.
Claims
1. An adaptive edge grinding width algorithm for on-line scanning camera imaging of automotive glass, characterized in that, The steps are as follows: Step 1: Extract the contour of the glass and obtain approximate contour scatter points through the RDP algorithm; Step 2: Approximate the tangent of adjacent scatter points to obtain the gradient change direction of the edging width; Step 3: Calculate the gradient changes at all points, exclude the burr points of image stitching according to the number of gradient change points, and obtain the edging width at all points; Step 4: Fix the starting position, convert the edging width into a one-dimensional broken line graph, and perform Gaussian filtering and smoothing on the one-dimensional broken line graph; Step 5: Calculate the maximum and minimum values of the broken line graph to judge the corners of the glass contour, thereby segmenting the arc edges in different directions of the glass, calculate the maximum and minimum values of the edging width and the point coordinates for different arc edges, and compensate to the true width according to different directions.
2. An adaptive edge grinding width algorithm for an online scanning camera imaging on an automotive glass, as claimed in claim 1, wherein The contour extraction of the glass described in Step 1 is specifically: find the outer contour of the glass through the contour segmentation algorithm, and the contour segmentation algorithm includes but is not limited to the canny algorithm. For a conveyor belt with a running speed higher than the preset speed, use the pixel-level threshold segmentation algorithm, and then convert it into a contour. The pixel-level threshold segmentation algorithm includes the OTSU threshold segmentation algorithm and the mean dynamic threshold segmentation algorithm; After obtaining the outer contour, obtain the best approximate points on the contour through the RDP algorithm.
3. An adaptive edge grinding width algorithm for an online scanning camera imaging on an automotive glass, as claimed in claim 1, wherein Step 2 is specifically: after obtaining the scatter points on the contour edge, calculate the edging width of the scatter points on the contour edge, and the scatter points on the contour edge are in the vertical direction of the tangent of the contour; Use the connection line of adjacent discrete points obtained by the RDP algorithm to approximate the tangent of this point, so as to obtain the vertical direction of the tangent of this point.
4. An adaptive edge grinding width algorithm for an online scanning camera imaging on an automotive glass according to claim 1, wherein Step 3 is specifically: after obtaining the gradient direction of the scatter points, use the first derivative to calculate the gray change in this direction, and the edging width of this point can be obtained; for abnormal positions of the contour, when calculating the first derivative, there will be more than 2 gradient change points. At this time, this point is abandoned from the calculation of the edging width.
5. An adaptive edge grinding width algorithm for an online scanning camera imaging on an automotive glass according to claim 1, wherein, The conversion of the edging width into a one-dimensional broken line graph by fixing the starting position described in Step 4 is specifically: starting from a certain fixed position, sort the values of the edging width of the glass according to the contour direction into a broken line graph, where the x-axis of the broken line graph is the discrete points and the y-axis is the edging width of each point.
6. An adaptive edge grinding width algorithm for an online scanning camera imaging on an automotive glass, as claimed in claim 1, wherein The compensation described in Step 5 is linear compensation.