Panel product post edging image metrology method and system
By combining grayscale mean sorting with batch OTSU segmentation, caliper algorithm, and Sobel convolution kernel selection, the edge detection error caused by environmental factors in traditional methods is solved, achieving more accurate image measurement of panel products after edge grinding, and improving the accuracy and stability of measurement results.
Patent Information
- Application Number
- CN202511263566.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-09-05
- Publication Date
- 2026-11-06
- Estimated Expiration
- 2045-09-05
AI Technical Summary
Traditional image measurement methods for panel products after edge grinding are prone to edge detection errors when faced with defects such as chipping and dirt caused by the edge grinding process, as well as environmental factors such as uneven lighting and unstable field of view. This affects the accuracy of dimensional measurement and product yield.
The gray-scale mean sorting and batch OTSU segmentation are used to locate the chamfered region. The edge point set is extracted by combining the caliper algorithm. Interference points are removed by polarity filtering and distance standard deviation filtering based on Sobel convolution kernel. Local least squares fitting and projection smoothing are performed to improve the consistency and accuracy of the edge point set.
It effectively removes interference from black and white defects, improves the reliability of edge point sets and the accuracy of measurement results, adapts to the image measurement needs in complex industrial environments, and significantly improves the accuracy and stability of dimensional measurement of panel products after edge grinding.
Smart Images

Figure CN121120573B_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of image processing technology, and in particular relates to a method and system for measuring images after edge grinding of panel products. Background Technology
[0002] With the development of industrial automation, machine vision equipment and integrated circuit chips have achieved automated mass production. As an extension of human vision, machine vision boasts multiple advantages, including high precision, high speed, low cost, and ease of information integration. It can replace manual labor in various production environments for high-intensity, continuous, and precise operations, significantly improving work efficiency and quality. Currently, my country's machine vision market is in a golden age of development, with some high-precision products requiring high accuracy in surface defects and process trace distances. This necessitates measurement using high-precision image algorithms.
[0003] Traditional methods for measuring images after edge grinding of panel products generally involve caliper line-finding measurement, which is an edge detection technology based on image grayscale changes. It searches for edges in the image in a preset direction. It uses calipers to scan the image along a specific direction, detects points of abrupt grayscale changes as edge points, and then fits a straight line.
[0004] like Figure 1 As shown, during image measurement of panel products after edge grinding, defects such as chipping and dirt caused by the edge grinding process, as well as environmental factors such as uneven lighting, inconsistent field of view, and process differences, can interfere with the image measurement results. Figure 2 As shown, the traditional caliper line finding method is prone to extracting incorrect edge points when there are many defects on the edge, resulting in inaccurate fitted straight lines, which in turn affects the accuracy of subsequent dimensional measurements and product yield. Summary of the Invention
[0005] To address the problems existing in the prior art, this invention proposes a method and system for measuring images after edge grinding of panel products.
[0006] The technical solution of the present invention is as follows:
[0007] A method for measuring the image of a panel product after edge grinding, comprising:
[0008] For the product end measurement area in the image, sorting and batching are performed based on the grayscale mean. The method involves segmenting and locating the chamfered area;
[0009] Within the chamfered area, a set of edge points consisting of multiple edge points is extracted using a caliper algorithm, and a preliminary fitted straight line containing the absolute error caused by image defects is formed.
[0010] The edge point set is filtered based on the polarity of the gray value change direction of the edge points to remove edge points that are disturbed by black defects. The edge point set is also filtered based on the standard deviation of the distance between the edge points and the preliminary fitted line to remove discrete edge points that are disturbed by white defects.
[0011] Local least squares fitting and projection smoothing are performed on the selected edge points to obtain a smoothed edge point sequence.
[0012] The final straight line is fitted based on the smoothed edge point sequence to complete the measurement of the image after edge grinding of the panel product.
[0013] Furthermore, the measurement area of the product end in the image is sorted and batched by grayscale mean. The specific methods for segmenting and locating the chamfered region include:
[0014] Calculate the mean gray value of each row in the gray-level histogram and sort them in ascending order;
[0015] The first N rows are taken as the initial chamfer area, where the threshold N for determining the number of rows in the initial chamfer area is determined according to the product chamfer size.
[0016] The initial chamfered area is processed in batches. Segmentation, including global Segmentation and Local Divide the area and take the intersection of the two as the final beveled area.
[0017] Furthermore, the specific method for extracting an edge point set consisting of multiple edge points within the chamfered area using a caliper algorithm and fitting it to form a preliminary fitted straight line containing the absolute error caused by image defects includes:
[0018] Using the center of the chamfered area as a reference, create a straight line equal to the width of the image;
[0019] Multiple calipers are set at equal intervals along this straight line, each caliper having a preset length and width;
[0020] The image is scanned with calipers to detect abrupt changes in grayscale and to extract edge points that meet preset polarity and contrast thresholds.
[0021] An edge point set is constructed based on the extracted edge points, and a fitted straight line is formed that includes the absolute error caused by image defects.
[0022] Furthermore, the specific method for performing polarity filtering on the edge point set based on the direction of grayscale change of the edge points to remove edge points interfered with by black defects includes:
[0023] The Sobel convolution kernel is used to perform convolution operations on the image, and the gradient value in the Y direction is calculated.
[0024] Based on the sign of the calculated gradient value, the polarity of the corresponding edge point is determined, and edge points with the characteristic of changing from light to dark are selected to remove edge points that are disturbed by black defects in the edge point concentration.
[0025] Furthermore, the specific method for removing discrete edge points from the edge point set by performing tolerance screening based on the standard deviation of the distance between the edge point and the preliminary fitted line includes:
[0026] Calculate the distance from each edge point to the initially fitted line;
[0027] Calculate the standard deviation of the distance and set the tolerance coefficient k;
[0028] Select edge points whose distance is less than or equal to k times the standard deviation, and remove discrete points that are outside this range.
[0029] Furthermore, the specific method for performing local least-squares fitting and projection smoothing on the selected edge points to obtain the smoothed edge point sequence includes:
[0030] For each edge point, select m neighboring points on both sides to form a neighborhood point set;
[0031] The neighborhood point set is fitted with least squares linearly to obtain a local regression line;
[0032] The current edge point is projected onto the regression line, and the original point coordinates are replaced with the coordinates of the projected point to achieve smoothing.
[0033] Furthermore, the specific method for fitting the final straight line based on the smoothed edge point sequence includes:
[0034] The edge points in the smoothed edge point sequence are used as contour points and connected to form the final straight line.
[0035] An image measurement system for panel products after edge grinding includes a chamfered area segmentation and positioning module, a caliper algorithm module, a filtering module, a smoothing processing module, and a fitting measurement module;
[0036] The chamfered region segmentation and positioning module is used to sort and batch the measurement area of the product end in the image by grayscale mean. The method involves segmenting and locating the chamfered area;
[0037] The caliper algorithm module is used to extract an edge point set consisting of multiple edge points within the chamfered area using the caliper algorithm, and to fit and form a preliminary fitted straight line containing the absolute error caused by image defects.
[0038] The filtering module is used to perform polarity filtering on the edge point set based on the direction of gray change of the edge points, so as to remove edge points in the edge point set that are disturbed by black defects, and to perform tolerance filtering based on the standard deviation of the distance between the edge points and the preliminary fitted line, so as to remove discrete edge points in the edge point set that are disturbed by white defects.
[0039] The smoothing module is used to perform local least squares fitting and projection smoothing on the filtered edge points to obtain a smoothed edge point sequence.
[0040] The smoothing module is used to fit a final straight line based on the smoothed edge point sequence to complete the measurement of the image after edge grinding of the panel product.
[0041] An electronic device includes a memory and a processor, the memory storing a computer program, the processor being configured to invoke and run the computer program stored in the memory to perform the method as described in any one of claims 1 to 7.
[0042] A computer-readable storage medium storing a computer program that, when executed by a processor, implements the steps of the method as described in any one of claims 1 to 7.
[0043] Compared with the prior art, the present invention has the following beneficial effects:
[0044] This invention provides a method and system for measuring images after edge grinding of panel products. The method locates the chamfered area by combining gray-scale mean sorting with batch OTSU segmentation, which overcomes the shortcomings of traditional threshold segmentation methods that are sensitive to uneven illumination and local gray-scale changes. This achieves faster and more accurate chamfered area extraction, providing a stable region of interest basis for subsequent edge point detection.
[0045] This invention employs a multi-dimensional screening approach, introducing polarity screening based on Sobel convolution kernels and tolerance screening based on distance standard deviation. In polarity screening, the edge point polarity (from bright to dark) is determined by calculating the gradient in the Y direction and judging its sign accordingly. This specifically removes interference points caused by defects such as black edge chipping and dirt, enhancing the algorithm's resistance to black defects. In tolerance screening, the distance from each edge point to the initially fitted line is calculated, and discrete points are eliminated using k times the standard deviation as a threshold. This effectively suppresses abnormal edge points caused by white edge chipping and dirt, improving the consistency and reliability of the edge point set.
[0046] The method of this invention employs local least squares fitting and projection smoothing to perform neighborhood fitting and projection replacement on each edge point, thereby further improving the smoothness of the edge lines and the accuracy of the measurement results.
[0047] The method of this invention has strong anti-interference ability and adaptability, and can effectively cope with the image measurement needs in complex industrial environments such as changes in lighting, process differences, and field of view deviation. It significantly improves the accuracy and stability of dimensional measurement of panel products after edge grinding, and is particularly suitable for application in edge grinding, cleaning equipment and packaging wiring equipment. Attached Figure Description
[0048] Figure 1 This is a schematic diagram of the panel product after edge grinding.
[0049] Figure 2 This diagram illustrates the traditional method of line finding and measurement, with the green line representing the measurement result.
[0050] Figure 3 This is a grayscale value distribution chart for different rows.
[0051] Figure 4 This is a sorted image based on grayscale mean; the chamfer should be around row 2495.
[0052] Figure 5 To extract the approximate area of the chamfer positions for the first N rows;
[0053] Figure 6 This is a schematic diagram of a straight line measurement.
[0054] Figure 7 This is a schematic diagram of grayscale contour lines. The upper part of the diagram shows the grayscale contour lines, and the lower part shows the first derivative lines.
[0055] Figure 8 This is a schematic diagram of edge lines. The red lines in the diagram are the lines formed after multi-dimensional filtering, and the green lines are the lines after smoothing.
[0056] Figure 9 This is a schematic diagram of the final straight line;
[0057] Figure 10 This is a schematic diagram of the fitted straight line result obtained by using the traditional caliper line finding measurement method on an image with chipped edges.
[0058] Figure 11 This is a schematic diagram of the fitted line result obtained by the method of the present invention on an image with broken edges;
[0059] Figure 12 This is a schematic diagram of the fitted straight line result obtained from an image affected by dirt using the traditional caliper line-finding measurement method.
[0060] Figure 13 This is a schematic diagram of the fitted straight line result obtained by the method of the present invention on an image affected by dirt. Detailed Implementation
[0061] The present invention will be further illustrated below with reference to the accompanying drawings and specific embodiments. It should be understood that these embodiments are for illustrative purposes only and are not intended to limit the scope of the invention. After reading this invention, any modifications of the invention in various equivalent forms by those skilled in the art will fall within the scope defined by the appended claims.
[0062] Example 1:
[0063] The present invention provides a method for measuring images of panel products after edge grinding, comprising:
[0064] For the measurement area at the end of the product in the image, sorting and batching are performed based on the grayscale mean. The method involves segmenting and locating the chamfered area;
[0065] Within the chamfered area, a caliper algorithm is used to extract a set of edge points consisting of multiple edge points, and a preliminary fitted straight line is formed that includes the absolute error caused by image defects.
[0066] The edge point set is filtered based on the polarity of the gray value change direction of the edge points to remove edge points that are disturbed by black defects. The edge point set is also filtered based on the standard deviation of the distance between the edge points and the preliminary fitted line to remove discrete edge points that are disturbed by white defects.
[0067] Local least squares fitting and projection smoothing are performed on the selected edge points to obtain a smoothed edge point sequence.
[0068] The final straight line is fitted based on the smoothed edge point sequence to complete the measurement of the image after edge grinding of the panel product.
[0069] Example 2:
[0070] This embodiment, based on Embodiment 1, further designs the measurement area at the end of the product in the image by sorting and batching based on the grayscale mean. The specific methods for segmenting and locating the chamfered region include:
[0071] Calculate the mean gray value of each row in the gray-level histogram and sort them in ascending order;
[0072] The first N rows are taken as the initial chamfer area, where the threshold N for determining the number of rows in the initial chamfer area is determined according to the product chamfer size.
[0073] Perform the initial chamfering in batches Segmentation (binarization segmentation of the major laws), including global segmentation. Segmentation and Local Divide the area and take the intersection of the two as the final beveled area.
[0074] Furthermore, the following example will provide a detailed explanation of the positioning of the chamfered area, such as... Figures 3-5 As shown, this example obtains the grayscale histogram of the image, acquires the grayscale mean distribution of each row, sorts the grayscale mean of each row in ascending order, and obtains the first N rows to get the approximate chamfer location region. Large-scale binary segmentation is performed on this region using an automatically determined global threshold. Appropriate vertical concatenation operations (closing operations) are then performed on this region to ensure the integrity of the chamfer region. Finally, the approximate chamfer location regions at the ends and bottoms are filtered out based on their position. (See attached image.) Figure 4 The grayscale mean sorting chart, as shown in the image, should have its chamfered corners around rows 2400-2600. Specific steps include:
[0075] 1) Mean filtering is applied to the image of the panel product after edge grinding, with a preset width and a preset height. The preset width can be the product of the image width w and the preset stretching coefficient MeanPrecent, and the preset height can be 3. This step yields the image after mean filtering, which also indirectly extracts the grayscale mean of each row of the image. Moreover, the mean filtering with a height of 3 also extracts the mean of the grayscale values of adjacent rows, resulting in a smoother grayscale mean for each row.
[0076] 2) Sort the average grayscale of each row of the image in ascending order, and take the first n rows with the approximate size related to the process. The specific number of rows n can be determined according to the precision of the chamfer size in the grinding process. After chamfering and grinding, the image is a black straight line, so the average grayscale value is lower than that of the product background area.
[0077] 3) The OTSU (Otsu's method - Otsu's method for maximum inter-class variance) algorithm is used to process each row of the image into two batches, specifically including:
[0078] Calculating the inter-class variance: The OTSU algorithm assumes that there exists a threshold TH that divides all pixels in the image into two classes. Let the first class C1 be less than the threshold TH and the second class C2 be greater than the threshold TH. Then the means of these two classes of pixels are m1 and m2, respectively, and the global mean of the image is mG. The probabilities of a pixel being classified into the first class C1 and the second class C2 are p1 and p2, respectively.
[0079] (1);
[0080] (2);
[0081] Based on the concept of variance, the expression for between-class variance is:
[0082] (3);
[0083] Substituting equation (1) into equation (3), we get:
[0084] (4);
[0085] In fact, finding the gray level k that maximizes the above formula is the OTSU threshold, and then achieving automatic segmentation of the image threshold.
[0086] 3.1) Connect the number of rows of the nearest neighbor with a preset width of Blcok_w as the region of interest Mask1 of the image. Then, perform OTSU algorithm segmentation on the image within the Mask1 region to obtain coarse region 1.
[0087] 3.2) Perform a separation operation on the image within the Mask1 region. The number of rows of non-nearest preset neighbor width Blcok_w is counted as a separate image. Perform OTSU algorithm segmentation on all separate images to obtain coarse region 2.
[0088] By taking the intersection of coarse region 1 and coarse region 2, this design considers the gray-level mean relationship of neighboring regions as well as the gray-level relationship of the global image region, resulting in a more accurate segmentation effect.
[0089] 4) Obtain the image features of the segmented region, filter by region width, the width must be equal to the image width, and the grinding chamfer size must be the length of a whole side.
[0090] Example 3:
[0091] This embodiment, based on Embodiment 2, further designs the following: In this example, the method for extracting an edge point set consisting of multiple edge points within the chamfered area using a caliper algorithm and fitting it to form a preliminary fitted straight line containing the absolute error caused by image defects includes:
[0092] Using the center of the chamfered area as a reference, create a straight line equal to the width of the image;
[0093] Multiple calipers are set at equal intervals along this straight line, each caliper having a preset length and width;
[0094] The image is scanned with calipers to detect abrupt changes in grayscale and to extract edge points that meet preset polarity and contrast thresholds.
[0095] An edge point set is constructed based on the extracted edge points, and a fitted straight line is formed that includes the absolute error caused by image defects.
[0096] Furthermore, the formation of the aforementioned edge point set will be specifically illustrated below with an example, such as... Figure 6 and Figure 7 As shown, this example includes:
[0097] 1) Obtain the center point of the beveled area, and create a straight line with the same width as the image using the center point of the beveled area.
[0098] 2. Based on the preset caliper length Cliper_h, caliper width Cliper_w, and caliper number Cliper_num, create Cliper_num calipers with equal spacing of Cliper_h*Cliper_w;
[0099] 3. Set the caliper target polarity to filter only feature points from the bright area to the dark area. The chamfering process makes the product background area brighter and the chamfered area darker. The target point corresponds to the peak or trough position of the derivative profile. From white to black, its first derivative is negative, corresponding to a trough position; from black to white, its first derivative is positive, corresponding to a peak position.
[0100] 4. Set the preset smoothing coefficient Cliper_Sigma to smooth the chamfered edge area and reduce the noise impact caused by the drastic fluctuation of grayscale at rough edges.
[0101] 5. Set a preset contrast threshold, Cliper_Thr, to filter feature points that transition from the product background area to the chamfered area.
[0102] The gradient is obtained using the Sobel algorithm. The image is convolved in a plane using a convolution factor of [1,2,1,0,0,0,-1,-2,-1] to obtain the brightness difference in the y-direction of the image. Feature points that are greater than the preset contrast threshold Cliper_Thr are selected to form an edge point set.
[0103] Example 4:
[0104] This embodiment, based on Embodiment 3, further designs the following method for removing edge points affected by black defects by performing polarity-based filtering on the edge point set according to the direction of grayscale change:
[0105] The Sobel convolution kernel is used to perform convolution operations on the image, and the gradient value in the Y direction is calculated.
[0106] Based on the sign of the calculated gradient value, the polarity of the corresponding edge point is determined, and edge points with the characteristic of changing from light to dark are selected to remove edge points that are disturbed by black defects in the edge point concentration.
[0107] In this invention, an edge refers to a place in an image where the gray level changes significantly; it is the boundary between different gray level regions.
[0108] The basic principle of edge detection is that at the edges of an image, the grayscale values change significantly, resulting in a larger grayscale difference in the edge region. Therefore, this property can be used to identify edges by calculating the image's gradient (grayscale change).
[0109] The Sobel algorithm utilizes convolution operations to calculate the gradient of an image and determine the approximate direction of edges. This kernel calculates the vertical pixel differences using weighted averages, with the center row having a weight of 0, and the upper and lower rows taking negative and positive values respectively to emphasize vertical edges. The edge boundaries are illustrated below:
[0110] ;
[0111] The following example illustrates polarity filtering in detail:
[0112] Pixel traversal: For each pixel in the image, align the center of the convolution kernel with that pixel. Specific methods include:
[0113] For the current pixel, treat it as the center point of the Sobel convolution kernel, and overlay the Sobel convolution kernel with that point as the center. The range allows for boundary padding for pixels at the edges.
[0114] The Sobel convolution kernel (Gy vertical direction) is represented as follows:
[0115] ;
[0116] Weighted summation: Calculates the sum of the products of pixel values within the kernel coverage area and their corresponding kernel weights. The formula is:
[0117] ;
[0118] in Indicates the image in coordinates The pixel value at that location.
[0119] Output: The value reflects the gradient intensity of the point in the Y direction; a positive value indicates a transition from dark to light, and a negative value indicates a transition from light to dark.
[0120] Polarity determination method: Positive polarity (from dark to light): When the convolution result is positive, it means that the pixel value changes from dark to light from bottom to top (from the negative Y-axis direction to the positive direction). Negative polarity (from light to dark): When the convolution result is negative, it means that the pixel value changes from light to dark from bottom to top.
[0121] This method can be used for the first step of screening: filtering out edge points from bright to light to initially remove measurement interference caused by black chipped edges and dirt.
[0122] Example 5:
[0123] This embodiment, based on Embodiment 4, further incorporates a tolerance screening method for removing discrete edge points from the edge point set. This method involves filtering based on the standard deviation of the distance between the edge points and the initially fitted straight line.
[0124] Calculate the distance from each edge point to the initially fitted line;
[0125] Calculate the standard deviation of the distance and set the tolerance coefficient k;
[0126] Select edge points whose distance is less than or equal to k times the standard deviation, and remove discrete points that are outside this range.
[0127] Furthermore, the formation of the above edge point set will be specifically illustrated below with an example, which includes:
[0128] Calculate the distance between each edge point and the preliminary fitted line line1 obtained by the caliper algorithm. Perform standard tolerance calculation on the distance data corresponding to each edge point, and filter out edge points whose distance is less than the tolerance coefficient * standard tolerance to remove interference from special discrete points. Generally, the tolerance coefficient is set to 2 by default.
[0129] The distance from the aforementioned edge points to the initially fitted line is calculated using the following method:
[0130] For any edge point The distance to the initially fitted line line1 The calculation formula is: ;in, and Each is an arbitrary edge point of coordinates and coordinate; , and These represent the first, second, and third coefficients in the expression for the preliminary fitted line line1, which is: .
[0131] The above standard tolerance (standard deviation) is calculated using the following method: ;in, The average distance from all edge points to the initially fitted line. ; This represents the total number of edge points.
[0132] The above filtering criteria can be set as follows.
[0133] Set the tolerance coefficient to k, and filter out edge points that meet the following conditions: Generally, k=2. That is, edge points with a distance less than or equal to k times the standard tolerance are retained, and discrete points (special points) that do not meet this condition are discarded.
[0134] Example 6:
[0135] This embodiment, based on Embodiment 5, further designs the following: In this example, the method for performing local least squares fitting and projection smoothing on the selected edge points to obtain the smoothed edge point sequence includes:
[0136] For each edge point, select m neighboring points on both sides to form a neighborhood point set;
[0137] The local regression line is obtained by performing a least-squares linear fit on the neighborhood point set;
[0138] The current edge point is projected onto the regression line, and the original point coordinates are replaced with the coordinates of the projected point to achieve smoothing.
[0139] Furthermore, such as Figure 8 As shown, the following example illustrates the formation of the edge point set, where a sequence of contour points is already available. The smoothing process is performed on each point, and the specific steps and formulas are as follows:
[0140] 1. Selecting neighboring points
[0141] Take the current point Both sides There are 10 adjacent points, totaling 1000 points. The set of _n neighboring points is represented as: Boundary points require special handling; only existing neighboring points are considered.
[0142] 2. Local linear regression model
[0143] Assume the neighborhood points conform to a linear model The parameters slope a and intercept b are solved by the least squares method, and the sum of squared errors is defined. : ;
[0144] Taking the partial derivatives and setting them to zero, we obtain the normal system of equations: ;
[0145] Solve for the parameters. ; ;
[0146] in Indicates the neighboring region Summing the points within the range.
[0147] 3. Formula for the projection of a point onto a line:
[0148] Current point Projected onto the regression line New coordinates on for:
[0149] ; ;
[0150] 4. Smoothing Results:
[0151] Using projection points Replace the origin point This yields a smoothed sequence of contour points.
[0152] This method preserves the overall trend of the contour while suppressing local noise through local linear fitting and projection. The smoothing effect can be controlled by adjusting the neighborhood size m, and the larger m is, the stronger the smoothing effect.
[0153] Example 7:
[0154] This embodiment, based on Embodiment 1, further designs the following: The specific method for fitting the final straight line based on the smoothed edge point sequence includes:
[0155] The edge points in the smoothed edge point sequence are used as contour points and connected to form a final straight line, as shown in the figure. Figure 9 As shown.
[0156] Example 8:
[0157] The present invention provides an image measurement system for panel products after edge grinding, comprising a chamfered area segmentation and positioning module, a caliper algorithm module, a filtering module, a smoothing processing module, and a fitting measurement module;
[0158] The chamfered region segmentation and positioning module is used to segment and locate the measurement area at the end of the product in the image, sorting and batching by grayscale mean. The method involves segmenting and locating the chamfered area;
[0159] The caliper algorithm module is used to extract a set of edge points consisting of multiple edge points in the chamfered area using the caliper algorithm, and to fit a preliminary fitted straight line that includes the absolute error caused by image defects.
[0160] The filtering module is used to perform polarity filtering on the edge point set based on the direction of gray-scale change of the edge points to remove edge points that are disturbed by black defects, and to perform tolerance filtering based on the standard deviation of the distance between the edge points and the preliminary fitted line to remove discrete edge points that are disturbed by white defects.
[0161] The smoothing module is used to perform local least squares fitting and projection smoothing on the filtered edge points to obtain a smoothed edge point sequence.
[0162] The smoothing module is used to fit a final straight line based on the smoothed edge point sequence to complete the measurement of the image after the panel product is edge-ground.
[0163] Example 9:
[0164] An electronic device according to the present invention includes a memory and a processor. The memory stores a computer program, and the processor is used to call and run the computer program stored in the memory to perform the method as described in any of the above embodiments.
[0165] The present invention provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the steps of any of the above embodiments.
[0166] Application Examples:
[0167] This example simulates the application of the measurement method of this invention to an image of a panel product after edge grinding. The image shows edge chipping caused by the grinding process. The fitted straight line obtained using the traditional caliper line-finding measurement method is as follows: Figure 10 As shown, the final fitted line result obtained using the measurement method of this invention is as follows: Figure 11 As shown.
[0168] This example also simulates the measurement method of this invention on an image of another panel product after edge grinding. This image is affected by dirt, and the fitted straight line result obtained using the traditional caliper line-finding measurement method is as follows: Figure 12 As shown, the final fitted line result obtained using the measurement method of this invention is as follows: Figure 13 As shown.
[0169] pass Figure 10 and Figure 11 ,as well as Figure 12 and Figure 13 The comparison shows that the fitted straight line obtained by the traditional caliper line-finding measurement method cannot effectively avoid interference from some defects inherent in the product itself, while the final fitted straight line obtained by the method of the present invention has high accuracy, better anti-interference ability, and strong robustness.
[0170] The above description is merely a specific embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in the present invention should be included within the scope of protection of the present invention.
Claims
1. A method for measuring the image of a panel product after edge grinding, characterized in that, include: For the product end measurement area in the image, the chamfered area is segmented and positioned by sorting the grayscale mean and batching. Within the chamfered area, a set of edge points consisting of multiple edge points is extracted using a caliper algorithm, and a preliminary fitted straight line containing the absolute error caused by image defects is formed. The edge point set is filtered based on the polarity of the gray value change direction of the edge points to remove edge points that are disturbed by black defects. The edge point set is also filtered based on the standard deviation of the distance between the edge points and the preliminary fitted line to remove discrete edge points that are disturbed by white defects. Local least squares fitting and projection smoothing are performed on the selected edge points to obtain a smoothed edge point sequence. The final straight line is fitted based on the smoothed edge point sequence to complete the measurement of the image of the panel product after edge grinding. The specific method for segmenting and locating the chamfered region in the product end measurement area of the image by sorting by grayscale mean and batching includes: Calculate the mean gray value of each row in the gray-level histogram and sort them in ascending order; Take before N The rows are used as the initial chamfered region, where the threshold number of rows for determining the initial chamfered region is defined. N Determined based on the product's chamfer dimensions; The initial chamfered region is segmented in batches, including global segmentation and local segmentation, and the intersection of the two is taken as the final chamfered region; The specific method for filtering edge points based on the polarity of the edge point grayscale change direction to remove edge points affected by black defects includes: use Sobel Convolution kernels perform convolution operations on images to calculate... Y The gradient value in the direction; Based on the sign of the calculated gradient value, the polarity of the corresponding edge point is determined, and edge points with the characteristic of changing from light to dark are selected to remove edge points that are affected by black defects. The specific method for removing discrete edge points from the edge point set by performing tolerance screening based on the standard deviation of the distance between the edge point and the initially fitted line includes: Calculate the distance from each edge point to the initially fitted line; Calculate the standard deviation of the distance and set the tolerance factor. k ; Filter for distances less than or equal to k Edge points are selected by multiples of the standard deviation; discrete points outside this range are removed.
2. The method for measuring the image of a panel product after edge grinding according to claim 1, characterized in that, The specific method for extracting an edge point set consisting of multiple edge points within the chamfered area using a caliper algorithm and fitting it to form a preliminary fitted straight line that includes the absolute error caused by image defects includes: Using the center of the chamfered area as a reference, create a straight line equal to the width of the image; Multiple calipers are set at equal intervals along this straight line, each caliper having a preset length and width; The image is scanned with calipers to detect abrupt changes in grayscale and to extract edge points that meet preset polarity and contrast thresholds. An edge point set is constructed based on the extracted edge points, and a fitted straight line is formed that includes the absolute error caused by image defects.
3. The method for measuring the image of a panel product after edge grinding according to claim 1, characterized in that, The specific method for performing local least-squares fitting and projection smoothing on the selected edge points to obtain the smoothed edge point sequence includes: For each edge point, select m neighboring points on both sides to form a neighborhood point set; The neighborhood point set is fitted with least squares linearly to obtain a local regression line; The current edge point is projected onto the regression line, and the original point coordinates are replaced with the coordinates of the projected point to achieve smoothing.
4. The method for measuring the image of a panel product after edge grinding according to claim 1, characterized in that, The specific method for fitting the final straight line based on the smoothed edge point sequence includes: The edge points in the smoothed edge point sequence are used as contour points and connected to form the final straight line.
5. A system for implementing the image measurement method for panel products after edge grinding as described in any one of claims 1 to 4, characterized in that, It includes a chamfered region segmentation and positioning module, a caliper algorithm module, a filtering module, a smoothing module, and a fitting measurement module; The chamfered region segmentation and positioning module is used to segment and position the chamfered region in the product end measurement area of the image by sorting the grayscale mean and batching the area. The caliper algorithm module is used to extract an edge point set consisting of multiple edge points within the chamfered area using the caliper algorithm, and to fit and form a preliminary fitted straight line containing the absolute error caused by image defects. The filtering module is used to perform polarity filtering on the edge point set based on the direction of gray change of the edge points, so as to remove edge points in the edge point set that are disturbed by black defects, and to perform tolerance filtering based on the standard deviation of the distance between the edge points and the preliminary fitted line, so as to remove discrete edge points in the edge point set that are disturbed by white defects. The smoothing module is used to perform local least squares fitting and projection smoothing on the filtered edge points to obtain a smoothed edge point sequence. The smoothing module is used to fit a final straight line based on the smoothed edge point sequence to complete the measurement of the image after edge grinding of the panel product.
6. An electronic device, characterized in that, The electronic device includes a memory and a processor, the memory storing a computer program, and the processor being configured to invoke and run the computer program stored in the memory to perform the method as described in any one of claims 1 to 4.
7. A computer-readable storage medium storing a computer program, characterized in that, When the computer program is executed by a processor, it implements the steps of the method as described in any one of claims 1 to 4 above.
Citation Information
Patent Citations
Anti-jamming sub pixel straight line fitting method
CN108921865A
Industrial component visual edge detection method based on sine curve scanning
CN112581474A
