A method for generating a glue spraying track on a sheet bottom
By extracting the film base contour through mask area cropping, mean filtering and edge detection operators, and combining indentation processing and point interpolation, the problems of insufficient edge extraction accuracy and difficulty in increasing control points in the existing automatic film base spraying system are solved, and high-precision spraying trajectory generation is achieved.
Patent Information
- Application Number
- CN202310489580.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-05-04
- Publication Date
- 2025-10-10
- Estimated Expiration
- 2043-05-04
AI Technical Summary
The existing automatic glue spraying system for film substrates has problems such as insufficient edge extraction accuracy and inability to quickly and accurately add control points when generating trajectories, which affects the integrity of film substrate processing.
Mask area cropping, mean filtering and edge detection operators in eight directions are used to extract the film bottom contour. The glue spraying trajectory is generated by combining the shrinking processing and point interpolation method.
The accuracy of edge extraction of the film bottom contour is improved, the rapid and accurate control of the glue spraying trajectory is achieved, and the integrity of the film bottom processing is ensured.
Smart Images

Figure CN116630244B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to a trajectory generation method, in particular to a film bottom glue spraying trajectory generation method, and belongs to the technical field of machine vision. Background Art
[0002] With technological advancements, shoe sole glue spraying systems are developing towards intelligent, automated, and visual multifunctional CNC integrated systems. However, many shoe manufacturers still rely on manual glue application for sheet-sole-type shoes. This process has many drawbacks, such as the slightly toxic nature of water-based glue, and the 8-10 hours of manual glue application per day, which can negatively impact the body through long-term inhalation. Manual glue application can also lead to inadvertent failure to apply glue to certain areas, causing debonding when the sheet-sole is bonded to the shoe bag, impacting shoe quality. Furthermore, manual glue application can be difficult to accurately control the amount of glue applied, resulting in uneven glue distribution on the sheet-sole surface and preventing the glue from drying in certain areas when the sheet-sole enters the drying oven.
[0003] Therefore, existing technologies have developed automatic gluing systems for soles. These systems utilize machine vision technology to plan the gluing trajectory for shoe soles, replacing manual gluing. However, the trajectory generation methods implemented by existing automatic gluing systems for soles suffer from a slightly large average error when extracting the sole contour edge from the captured original image. This affects the accuracy of the sole contour edge extraction, potentially causing some of the generated sole gluing trajectories to deviate from reality. Furthermore, in actual production, it is often necessary to add control points to the gluing trajectory in real time to ensure processing integrity. Existing methods for generating gluing trajectories for soles cannot easily, quickly, and accurately add control points to the gluing trajectory. Summary of the Invention
[0004] Based on the above background, the purpose of the present invention is to provide a method for generating a film base glue spraying trajectory, improve the edge extraction accuracy of the film base contour during the film base glue spraying trajectory generation process, and realize convenient, fast and accurate addition of control points to the glue spraying trajectory to ensure the integrity of the film base processing.
[0005] In order to achieve the above-mentioned object of the invention, the present invention provides the following technical solutions:
[0006] A method for generating a film bottom glue spraying trajectory, the method comprising the following steps:
[0007] Acquiring an original image containing a film bottom contour, generating a mask region and cropping the original image using the mask region to obtain a masked image, performing mean filtering on the masked image to smooth the edges of the film bottom contour to obtain a filtered image, and performing edge detection on the filtered image using edge detection operators in eight directions to extract the film bottom contour;
[0008] Performing an indentation process on the film base contour to obtain the indentation contour and an indentation contour array of each discrete point constituting the indentation contour, reorganizing the indentation contour array, extracting key points from the reorganized indentation contour array to obtain three glue spraying control key points of the indentation contour, obtaining information of each glue spraying control point located at other positions based on the index positions of the three glue spraying control key points in the indentation contour array, and combining the information of each glue spraying control point to obtain glue spraying trajectory information;
[0009] When there is no need to increase the number of glue spraying control points, glue spraying control is performed according to the glue spraying trajectory information; when there is a need to increase the number of glue spraying control points, the point interpolation method is executed to interpolate new glue spraying control points, and the glue spraying trajectory information is updated, and glue spraying control is performed according to the updated glue spraying trajectory information.
[0010] Preferably, generating the mask area comprises the following steps:
[0011] Set the mask area to a rectangular area, set the lower limit of the filter pixel threshold to 0 and the upper limit to 20;
[0012] Analyze all points in the original image that meet the pixel threshold, and calculate the row minimum, column minimum, row maximum, and column maximum of all points;
[0013] The coordinates of the center point of the mask area are calculated by the row minimum, column minimum, row maximum, and column maximum;
[0014] The height of the mask area is obtained by subtracting the row maximum value from the row minimum value and adding the adjustment value. The width of the mask area is obtained by subtracting the column maximum value from the column minimum value and adding the adjustment value.
[0015] Preferably, between obtaining the masked image and performing mean filtering on the masked image, the method further comprises the following steps:
[0016] Calculate and list all points in the masked image with pixel values between 0 and 20;
[0017] The pixel values of all points with pixel values between 0 and 20 are set to 0.
[0018] Preferably, the mean filtering process comprises the following steps:
[0019] The 3*3 convolution kernel is used to filter the masked image. The mathematical expression of the filtering operation is:
[0020]
[0021] Where F(x,y) is the target matrix consisting of the target point and the 8 points around the target point in the masked image F, and G(x,y) is the new matrix obtained by multiplying the target matrix with the 3*3 convolution kernel;
[0022] Taking out each element in the new matrix, adding them up and taking the average value to obtain the pixel value of the target point;
[0023] Repeat the above calculation to obtain the pixel values of all points after filtering and obtain the filtered image.
[0024] Preferably, among the eight directional edge detection operators, the mathematical expression of the convolution kernel of the edge detection operator in each direction is:
[0025]
[0026]
[0027]
[0028]
[0029]
[0030]
[0031]
[0032]
[0033] In the formula, in the XY axis plane coordinate system of the filtered image, G x is the edge detection operator along the X-axis direction, G y is the edge detection operator along the Y axis, G 45° G is an edge detection operator with a 45° angle to the X axis. 135° G is an edge detection operator with an angle of 135° to the X axis. 180° G is an edge detection operator that is 180° to the X axis. 225° G is an edge detection operator with a 225° angle to the X axis. 270° G is an edge detection operator with a 270° direction to the X axis. 315° It is an edge detection operator with an angle of 315° to the X-axis.
[0034] Preferably, when edge detection is performed on the filtered image, the pixel value of the target point is calculated using the following mathematical expression:
[0035] S(x,y)=|G x ·G(x,y)|+|G y ·G(x,y)|+|G45° ·G(x,y)|+|G 135° ·G(x,y)|+|G 180° ·G(x,y)|+|G 225° ·G(x,y)|+|G 270° ·G(x,y)|+|G 315° ·G(x,y)|
[0036] Where G(x,y) is the target matrix composed of the target point and the 8 points around the target point in the filtered image G, G x G(x,y) is an edge detection operator along the X-axis and performs convolution calculation with G(x,y).
[0037] Preferably, the shrinking process comprises the following steps:
[0038] A circle is drawn with each point in the film bottom contour as the center and the set indentation distance as the radius. The areas contained in all circles are intersected with the area contained in the film bottom contour to obtain the indented area. Edge detection operators in eight directions are used to perform edge detection and extract the indented contour.
[0039] Preferably, the point interpolation method comprises the following steps:
[0040] Set any discrete point on the indented contour as the first discrete point P1, with coordinates (X1, Y1), the point adjacent to the first discrete point as the second discrete point P2, with coordinates (X2, Y2), the other point adjacent to the second discrete point as the third discrete point P3, with coordinates (X3, Y3), and the point to be interpolated between the first discrete point P1 and the second discrete point P2 as the interpolation point PN, with coordinates (X n ,Y n ), calculate the straight line connecting P2 and P3 and the straight line connecting P1 and P2 The angle θ formed between them;
[0041] If 170°<θ<180°, the indented contour between the first discrete point P1 and the second discrete point P2 is determined to be a straight line, and the coordinates of the interpolation point PN are calculated using linear interpolation.
[0042] If 0°<θ≤170°, the indented contour between the first discrete point P1 and the second discrete point P2 is determined to be a curve, and the coordinates of the to-be-interpolated point PN are calculated using a curve interpolation method.
[0043] Preferably, the linear interpolation method uses the following mathematical expression to calculate the PN coordinates:
[0044]
[0045] The curve interpolation method uses the following mathematical expression to calculate the PN coordinates:
[0046]
[0047] After calculating the PN coordinates, the curve interpolation method selects a value based on the curve interpolation judgment condition.
[0048] Preferably, the curve interpolation judgment condition is:
[0049]
[0050] Where, (X n1 ,Y n1 ) is the first coordinate value of PN, (X n2 ,Y n2 ) is the second coordinate value of PN, Y4 is the ordinate of the interpolation reference point P4, and Temp is the factor determining the curve offset direction;
[0051] Among them, the mathematical expression of the curve offset direction judgment factor Temp is:
[0052] Temp=(Y1-Y2)*X3+(X2-X1)*Y3+X1*Y2-X2*Y1
[0053] The interpolation reference point P4 is an interpolation point between the first discrete point P1 and the second discrete point P2 calculated using a linear interpolation method, and has coordinates of (X4, Y4).
[0054] Compared with the prior art, the present invention has the following advantages:
[0055] The present invention provides a method for generating a film base glue spraying trajectory, which smoothes the edge of the film base contour by performing mean filtering on the masked image, and uses edge detection operators in eight directions to perform edge detection on the filtered image, thereby improving the edge extraction accuracy of the film base contour. New glue spraying control points are interpolated by executing a point interpolation method, thereby realizing convenient, fast and accurate addition of control points to the glue spraying trajectory. BRIEF DESCRIPTION OF THE DRAWINGS
[0056] 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.
[0057] Figure 1 It is a flow chart of a method for generating a film bottom glue spraying trajectory according to the present invention;
[0058] Figures 2-5 The original images are those taken by the industrial camera at different angles with the same film substrate in the present invention;
[0059] Figures 6-9 yes Figures 2-5 Pixel distribution map corresponding to each original image in ;
[0060] Figures 10-13 It corresponds to Figures 2-5 The mask area map generated by each original image;
[0061] Figures 14-17 yes Figures 2-5 The masked images of each original image in ;
[0062] Figures 18-21 yes Figures 14-17 The image after filling with each mask image;
[0063] Figure 22 Yes Figure 18 The image after mean filtering of the padded image;
[0064] Figures 23-30 It is through the edge detection operators in eight directions Figure 18 The result of edge detection on the image after mean filtering;
[0065] Figure 31 It is the film bottom contour map obtained through edge extraction;
[0066] Figure 32 It is a schematic diagram of the division between the inner and outer circles;
[0067] Figure 33 It is a schematic diagram of the indented area;
[0068] Figure 34 It is a schematic diagram of the indented outline;
[0069] Figure 35 It is a schematic diagram of three key points of glue spraying control;
[0070] Figure 36 It is a schematic diagram of glue spraying trajectory information;
[0071] Figure 37 It is a schematic diagram of the curve offset direction;
[0072] Figure 38 This is another schematic diagram of the curve offset direction;
[0073] Figure 39 is a schematic diagram of interpolation reference points;
[0074] Figure 40 This is a schematic diagram of edge accuracy comparison. DETAILED DESCRIPTION
[0075] The technical solution of the present invention will be further described in detail below through specific embodiments and in conjunction with the accompanying drawings. It should be understood that the implementation of the present invention is not limited to the following embodiments, and any form of modification and / or change made to the present invention will fall within the scope of protection of the present invention.
[0076] In the present invention, unless otherwise specified, all parts and percentages are by weight. The equipment and raw materials used are commercially available or commonly used in the art. The methods in the following embodiments, unless otherwise specified, are conventional methods in the art. The components or equipment in the following embodiments, unless otherwise specified, are all universal standard parts or components known to those skilled in the art. Their structures and principles are known to those skilled in the art through technical manuals or routine experimental methods.
[0077] The following detailed description of the embodiments of the present invention is made in conjunction with the accompanying drawings. In the following detailed description, for ease of explanation, many specific details are set forth to provide a comprehensive understanding of the embodiments of the present invention. However, one or more embodiments may be implemented by those skilled in the art without these specific details.
[0078] like Figure 1 A method for generating a film bottom glue spraying trajectory is shown, and the method includes the following steps:
[0079] S1. Acquire an original image containing a film bottom contour, generate a mask region, and crop the original image using the mask region to obtain a masked image. Perform mean filtering on the masked image to smooth the edges of the film bottom contour, obtaining a filtered image. Perform edge detection on the filtered image using eight-directional edge detection operators to extract the film bottom contour.
[0080] S2. Perform indentation processing on the film base contour to obtain the indented contour and the indented contour array of the discrete points that make up the indented contour. Perform contour reorganization on the indented contour array and perform a key point extraction operation on the reorganized indented contour array to obtain three glue spraying control key points of the indented contour. Based on the index positions of the three glue spraying control key points in the indented contour array, obtain the information of each glue spraying control point at other positions. Combine the information of each glue spraying control point to obtain glue spraying trajectory information.
[0081] S3. When there is no need to increase the number of glue spraying control points, glue spraying control is performed according to the glue spraying trajectory information; when there is a need to increase the number of glue spraying control points, new glue spraying control points are interpolated using the point interpolation method, and the glue spraying trajectory information is updated, and glue spraying control is performed according to the updated glue spraying trajectory information.
[0082] The method of this embodiment is further described below in order of steps. First, step S1 is described in detail.
[0083] The original image is collected by an industrial camera, and the collected original image is as follows Figures 2-5 As shown, Figures 2-5 These are original images taken by an industrial camera with the same film rotated at different angles. It can be seen that the background is relatively complex, and more interference will be generated when extracting the edges to obtain a clear film contour.
[0084] In order to reduce the interference of complex background on edge extraction, the method of this embodiment adopts the method of generating a mask area and cropping the original image through the mask area. On the basis of covering the film base with the mask, the background of the original image is included as little as possible, thereby preventing the interference of complex background on subsequent edge extraction. Figures 6-9 The pixel distribution diagram shows that the pixel values in the bottom area are all below 20. Generating the mask area includes the following steps:
[0085] Set the mask area to a rectangular area, set the lower limit of the filter pixel threshold to 0 and the upper limit to 20;
[0086] Analyze all points in the original image that meet the pixel threshold and calculate the row minimum, column minimum, row maximum, and column maximum of all points;
[0087] The coordinates of the center point of the mask area are calculated by the row minimum, column minimum, row maximum, and column maximum;
[0088] The height of the mask area is obtained by subtracting the row maximum value from the row minimum value and adding an adjustment value of 60. The width of the mask area is obtained by subtracting the column maximum value from the column minimum value and adding an adjustment value of 60. The adjustment value of 60 is added to ensure that the rectangular mask area can completely cover the entire film bottom area. The generated mask area is as follows Figures 10-13 As shown. By cropping the original image with the mask area, we can get a masked image after removing a large amount of background, in which the bottom area is more obvious, making subsequent processing easier. Figures 14-17 shown.
[0089] In order to increase the contrast between the film bottom area and the background, thereby facilitating subsequent edge extraction, the method of this embodiment further provides an image filling process between obtaining the masked image and performing mean filtering on the masked image, including the following steps:
[0090] Calculate and list all points in the masked image with pixel values between 0 and 20;
[0091] Set the pixel values of all points between 0 and 20 to 0.
[0092] The filled image is as follows Figures 18-21 shown.
[0093] In order to obtain an accurate edge of the film bottom contour, the method of this embodiment adds a mean filtering process before edge extraction to smooth the edge of the film bottom contour. The mean filtering process includes the following steps:
[0094] The 3*3 convolution kernel is used to filter the masked image. The mathematical expression of the filtering operation is:
[0095]
[0096] Where F(x,y) is the target matrix consisting of the target point and the 8 points around the target point in the masked image F, and G(x,y) is the new matrix obtained by multiplying the target matrix with the 3*3 convolution kernel;
[0097] Take out each element in the new matrix, add them up and take the average value to obtain the pixel value of the target point;
[0098] Repeat the above calculation to obtain the pixel values of all points after filtering and obtain the filtered image.
[0099] Only the Figure 18 The image after mean filtering of the padded image is as follows: Figure 22 shown.
[0100] In order to obtain a more specific and accurate edge of the film bottom contour, the method of this embodiment uses eight-directional edge detection operators to extract data from different directions. The mathematical expression of the convolution kernel of the edge detection operator in each direction is:
[0101]
[0102]
[0103]
[0104]
[0105]
[0106]
[0107]
[0108]
[0109] In the formula, in the XY axis plane coordinate system of the filtered image, G x is the edge detection operator along the X-axis direction, Gy is the edge detection operator along the Y axis, G 45° G is an edge detection operator with a 45° angle to the X axis. 135° G is an edge detection operator with an angle of 135° to the X axis. 180° G is an edge detection operator that is 180° to the X axis. 225° G is an edge detection operator with a 225° angle to the X axis. 270° G is an edge detection operator with a 270° direction to the X axis. 315° It is an edge detection operator with an angle of 315° to the X-axis.
[0110] The results of edge detection on the filtered image using edge detection operators in eight directions are as follows: Figures 23-30 As shown. Since the time complexity of calculating the gradients in each direction using the existing pixel calculation formula is high, in order to reduce the amount of calculation, when the method of this embodiment performs edge detection on the filtered image, the pixel value of the target point is calculated using the following mathematical expression:
[0111] S(x,y)=|G x ·G(x,y)|+|G y ·G(x,y)|+|G 45° ·G(x,y)|+|G 135° ·G(x,y)|+|G 180° ·G(x,y)|+|G 225° ·G(x,y)|+|G 270° ·G(x,y)|+|G 315° ·G(x,y)|
[0112] Where G(x,y) is the target matrix composed of the target point and the 8 points around the target point in the filtered image G, G x G(x,y) is an edge detection operator along the X-axis and performs convolution calculation with G(x,y).
[0113] Finally, the bottom contour obtained after edge extraction is as follows Figure 31 shown.
[0114] The above is a detailed description of step S1. The following is a detailed description of step S2.
[0115] Before the film base glue spraying track is generated, the film base contour needs to be shrunk inward by the same distance to form a new shrunk contour. The shrunk process includes the following steps:
[0116] A circle is drawn with each point in the film bottom contour as the center and the set indentation distance as the radius. The area contained in all circles is intersected with the area contained in the film bottom contour to obtain the indentation area. Edge detection operators in eight directions are used to perform edge detection and extract the indentation contour.
[0117] The indentation process requires drawing a circle for each point on the film bottom contour. Set (X0, Y0) as the coordinates of the point, that is, the coordinates of the center of the circle, and R as the radius of the circle. The circle drawing formula is as follows:
[0118] (X-X0) 2 +(Y-Y0) 2 =R 2
[0119] Because a circle has 8-point symmetry, meaning a circle centered at the origin has four axes of symmetry: X = 0, Y = 0, X = Y, and X = -Y, if a point P(X, Y) on the arc is known, its seven symmetrical points about the four axes can be found: (X, -Y), (-X, Y), (-X, -Y), (Y, X), (Y, -X), (-Y, X), (-Y, -X). This property is called 8-point symmetry. Therefore, as long as one can draw an arc of 1 / 8 of a circle, the entire circle can be drawn using the above principle.
[0120] Assuming that a certain point on the contour is (0, 0) and the radius of the circle is R, then the points on the 1 / 8 arc of the circle with (0, 0) as the center and R as the radius can be obtained in the following way. Here, the 1 / 8 arc is calculated clockwise with (0, R) as the starting point.
[0121] The circle function divides the plane area into inside and outside the circle as shown below.
[0122] F(X,Y)=X 2 +Y 2 -R 2
[0123] The inner and outer parts of the circle are divided as follows Figure 32 shown.
[0124] Assume that the arc is generated from A to B. When a point P i After being determined, P i The next point P i+1 The value of F(X i ,Y i ) value to determine the principle of:
[0125] When F(X i ,Y i )≤0: take X i+1 =X i +1, Y i+1 =Yi . Go from inside the circle to outside the circle.
[0126] When F(X i ,Y i )>0: take X i+1 =X i , Y i+1 =Y i -1. Go from outside the circle to inside the circle.
[0127] For the discriminant F(X i+1 ,Y i+1 ) should also be deduced in two cases:
[0128] When F(X i ,Y i )≤0, P i The next point P i+1 Take X i+1 =X i +1, Y i+1 =Y i , discriminant F(X i+1 ,Y i+1 The calculation process of ) is shown as follows:
[0129] F(X i+1 ,Y i+1 )=F(X i +1,Y i )=(X i +1) 2 +Y i 2 -R 2 =F(X i ,Y i )+2X i +1
[0130] When F(X i ,Y i )>0, P i The next point P i+1 Take X i+1 =X i , Y i+1 =Y i -1, discriminant F(X i+1 ,Y i+1 The calculation process of ) is shown as follows:
[0131] F(X i+1 ,Y i+1 )=F(X i ,Y i -1)=X i 2 +(Y i-1) 2 -R 2 = F(X i , Y i ) - 2Y i +1
[0132] After getting 1 / 8 of the circle, the information of the points contained in the whole circle can be obtained through the 8-fold symmetry of the circle.
[0133] Through the way of loop, the circumscribed circle is drawn many times, each circumscribed circle is filled to become a region, and then the union of the regions formed by each circumscribed circle is calculated to form a new region, obtaining the spliced region as shown in Figure 33 , i.e. the inner shrinkage region. The edge detection is performed by using the edge detection operator of the eight directions described above to extract the inner shrinkage contour as shown in Figure 34 . When judging the contour, the actual lengths of the two contours are compared, and the contour with smaller length is the inner shrinkage contour.
[0134] Each inner shrinkage contour is fitted by a plurality of discrete points. It is found through testing that the starting position of the points obtained from different angle shoe sole pictures is not determined, resulting in uncertainty of the contour information. Because the starting point of the contour cannot be determined, the operation of reorganizing the contour is added before performing the subsequent processing.
[0135] The contour reorganization takes the minimum position of the whole contour row as the starting point. It can be seen from the image that the minimum point of the row is basically at the toe position, so the contour array after contour reorganization can all take the toe position as the starting point. The contour reorganization process is as follows:
[0136] Suppose the original contour row data array is [TR0...TR end ], the row data array obtained after contour reorganization is [TR min …TR end …TR0], wherein TR min is the index position of the minimum value in the contour [TR0...TR end ] of the row data array, and similarly, the column data array obtained after contour reorganization is [TC min …TR end …TC0].
[0137] Through the reorganization operation, no matter how the angle of the shoe sole changes, the starting point of the original contour is at what position, the starting point of the new contour is determined at the toe position.
[0138] After completing the contour reorganization, part of the point positions need to be extracted as the final trajectory points. In each trajectory generation, the positions of the shoe sole, the heel and the toe points need to be known, and these three key points for glue spraying control are the turning points of the whole contour, so they need to be obtained in advance. The extraction method is as follows.
[0139] By drawing a circumscribed circle around the indented contour, we can obtain the circumscribed circle of the indented contour. We then determine the intersection of the circumscribed circle and the indented contour. One intersection is the toe point, and the other is the left heel point. Since the approximate orientation of the incoming sole material is determined during operation, the sole is always at the top in the image window. This ensures that the row coordinates of the sole point are always smaller than those of the toe point. By comparing the row coordinates of the two intersection points, we can determine which is the toe point and which is the heel point.
[0140] By testing the relationship between the total number of points in the contour and the number of points on both sides of the heel, a fitting equation is obtained. The fitting equation is as follows:
[0141] [Distance]=6.24*Point T 2 -0.45Point T +6.25
[0142] Among them, [Distance] is the distance after rounding, Point T is the total number of contour points.
[0143] By calculating, we can get the number of points between the right intersection point and the left intersection point of the heel, and then find the right intersection point in the contour array. The three key points of glue spraying control are as follows: Figure 35 As shown. The information of other position trajectory points can be obtained through their index positions in the contour array, and the trajectory points can be combined to obtain the following Figure 36 The complete trajectory information shown is the glue spraying trajectory information.
[0144] The above is a detailed description of step S2. The following is a detailed description of step S3.
[0145] The usual method for point interpolation is linear interpolation, which uses a linear equation to calculate the coordinates of the points to be interpolated between two adjacent points. However, in actual production, the film base contour line between two adjacent points can be a straight line or a quasi-straight line, or a curve. Linear interpolation is calculated based on the straight line case, and in the case of a curve, it will cause a large error in the interpolated point coordinates. To address this problem, the method of this embodiment introduces the determination of the direction of the line segment between two adjacent points. The point interpolation method used includes the following steps:
[0146] like Figure 37 and Figure 38As shown in the figure, any discrete point on the indented contour is set as the first discrete point P1, with coordinates of (X1, Y1), a point adjacent to the first discrete point is set as the second discrete point P2, with coordinates of (X2, Y2), another point adjacent to the second discrete point is set as the third discrete point P3, with coordinates of (X3, Y3), and the point to be interpolated between the first discrete point P1 and the second discrete point P2 is set as the interpolation point PN, with coordinates of (X n ,Y n ), calculate the straight line connecting P2 and P3 and the straight line connecting P1 and P2 The angle θ formed between them;
[0147] If 170°<θ<180°, the indented contour between the first discrete point P1 and the second discrete point P2 is determined to be a straight line, and the coordinates of the interpolation point PN are calculated using linear interpolation.
[0148] If 0°<θ≤170°, the indented contour between the first discrete point P1 and the second discrete point P2 is determined to be a curve, and the coordinates of the to-be-interpolated point PN are calculated using a curve interpolation method.
[0149] In the above method, since the actual distance between the first discrete point P1 and the second discrete point P2 is small, if the line segment between P1 and P3 is approximately a straight line, then the line segment between P1 and P2 can be assumed to be approximately a straight line as well. Because the entire film base contour curve is closed, the direction of the entire contour is fixed, whether it is clockwise or counterclockwise.
[0150] For the judgment condition of θ, a margin of 10° is left. This is because in practice, the three points P1, P2, and P3 cannot be completely in a straight line, that is, in the case of a quasi-straight line, the error between the interpolated points and the actual edge points after judgment within 10° is small and acceptable.
[0151] The linear interpolation method uses the following mathematical expression to calculate the PN coordinates,
[0152]
[0153] The curve interpolation method uses the following mathematical expression to calculate the PN coordinates:
[0154]
[0155] The results calculated based on the mathematical expression of the curve interpolation method above have two point coordinates: (X n1 ,Y n1 ) is the first coordinate value of PN, (X n2 ,Y n2) is the second coordinate value of PN. The value needs to be selected through the curve interpolation judgment condition. The curve interpolation judgment condition is,
[0156]
[0157] Where Y4 is the ordinate of the interpolation reference point P4, as Figure 39 As shown, the interpolation reference point P4 is an interpolation point between the first discrete point P1 and the second discrete point P2 calculated using the linear interpolation method, with coordinates of (X4, Y4). The calculated P4 is located at the midpoint of Lin2.
[0158] Temp is the factor that determines the direction of curve offset, and its mathematical expression is:
[0159] Temp=(Y1-Y2)*X3+(X2-X1)*Y3+X1*Y2-X2*Y1
[0160] The curve offset direction judgment factor Temp is used to judge the offset between the actual edge point between two adjacent points and the point calculated by linear interpolation. There are two cases of offset, refer to Figure 37 and Figure 38 , one is to offset to the upper right based on the point originally calculated by linear interpolation, and the other is to offset to the lower left based on the point originally calculated by linear interpolation.
[0161] If Temp<0, then point P2 is on the right side of line segment P1P3, and is offset to the upper right based on the point originally calculated by linear interpolation;
[0162] If Temp>0, then point P2 is on the left side of line segment P1P3, and is offset to the lower left based on the point originally calculated by linear interpolation;
[0163] If Temp=0, point P2 is on line segment P1P3 and no offset occurs.
[0164] Based on the above content, a test platform was built to test the accuracy and error of the film bottom glue spraying trajectory generation method.
[0165] The test platform's hardware configuration includes: an ABB IRB1200 series robot, a Hikvision MV-CE050-30GM series industrial camera with a Hikvision 12mm lens, a Siemens IPC3000 SMART series industrial computer, and a Haizhining FJI-ASC350350-W series light source. In addition to the key hardware components involved in the test, the computer used for subsequent testing included an AMD Ryzen 5 4600H CPU, two Hynix 8GB 4600MHz memory sticks, and the VS2019 compiler, using the .NET 4.6.1 framework.
[0166] This embodiment compares the edge detection accuracy of the conventional Sobel operator used in the prior art and the Sobel operator used in this embodiment. Since it is impossible to observe and compare edge accuracy in an image, this embodiment converts the extracted edge point data into actual coordinates that can be used by an actual robot, and compares the operator accuracy by moving the robot. The number of edge points taken is 40, and the error value each time is the average of the distances from each of the 40 points to the actual edge. The test method is to move the robot to the edge point given by the algorithm, and then manually operate the robot controller to move the robot TCP to the X coordinate given by the actual edge extraction algorithm. f / Y f The value is the same as the actual edge X on the controller r / Y r The error value of each point is obtained by calculation. The calculation method is shown as follows (3-1).
[0167]
[0168] The test was performed 100 times with a total of 4000 points. The test data is as follows Figure 40 shown.
[0169] The average error of the ordinary Sobel operator for extracting 4000 points is 0.2483, and the average error of the improved Sobel operator for extracting 4000 points is 0.2238. In general, the improved Sobel operator formed by the method of this embodiment has higher accuracy in edge extraction and meets the accuracy requirements required for production.
[0170] This embodiment also tests the error between the interpolated points and the actual edges.
[0171] Setting (X f ,Y f ) is the actual edge point, (X r ,Y r) is the interpolation point calculated by linear interpolation, (X e ,Y e ) is the interpolation point calculated after the offset by the curve interpolation method, (X r ,Y r ) and (X e ,Y e ) are consistent with the actual edge point (X f ,Y f ) for comparison.
[0172] The test data of 40 interpolation points are shown in Table 1. As can be seen from Table 1, the errors of all 40 interpolation points are within 0.5 mm, which meets the accuracy requirements.
[0173] Table 140 interpolation point test data table
[0174]
[0175]
[0176] The calculation formula of position deviation μ is as follows: e ,Y e ) is calculated using the following formula:
[0177]
[0178] No (X e ,Y e ) is calculated using the following formula:
[0179]
[0180] In addition, this embodiment tested 100 different interpolation points and performed deviation calculation. The position deviation μ is shown in Table 2.
[0181] Table 2 Position deviation μ test results
[0182] Times 1 2 3 4 5 6 7 8 9 10 μ 0.30 0.18 0.24 0.26 0.30 0.26 0.17 0.24 0.15 0.22 Times 11 12 13 14 15 16 17 18 19 20 μ 0.36 0.24 0.16 0.23 0.36 0.21 0.19 0.31 0.33 0.44 Times 21 22 23 24 25 26 27 28 29 30 μ 0.36 0.31 0.18 0.25 0.18 0.23 0.39 0.43 0.23 0.36 Times 31 32 33 34 35 36 37 38 39 40 μ 0.24 0.19 0.22 0.32 0.30 0.29 0.25 0.19 0.26 0.32 Times 41 42 43 44 45 46 47 48 49 50 μ 0.30 0.24 0.18 0.21 0.32 0.26 0.23 0.25 0.16 0.19 Times 51 52 53 54 55 56 57 58 59 60 μ 0.24 0.23 0.32 0.30 0.29 0.30 0.25 0.19 0.24 0.26 Times 61 62 63 64 65 66 67 68 69 70 μ 0.25 0.31 0.19 0.16 0.22 0.26 0.25 0.18 0.21 0.30 Times 71 72 73 74 75 76 77 78 79 80 μ 0.25 0.22 0.23 0.18 0.16 0.31 0.28 0.25 0.26 0.17 Times 81 82 83 84 85 86 87 88 89 90 μ 0.19 0.21 0.26 0.24 0.28 0.27 0.17 0.16 0.21 0.32 Times 91 92 93 94 95 96 97 98 99 100 μ 0.26 0.29 0.14 0.18 0.16 0.20 0.26 0.24 0.25 0.31
[0183] It can be seen from Table 2 that the position deviations μ of the 100 different interpolation points are all less than 0.5, which further verifies that the point interpolation method of this embodiment meets the accuracy requirements.
[0184] This document uses specific examples to illustrate the principles and implementation methods of the present invention. The above examples are only intended to help understand the method and core concept of the present invention. It should be noted that those skilled in the art can make various improvements and modifications to the present invention without departing from the principles of the present invention, and such improvements and modifications also fall within the scope of protection of the claims of the present invention.
Claims
1. A method for generating a film bottom glue spraying trajectory, characterized by: The method comprises the following steps: Acquiring an original image containing a film bottom contour, generating a mask region and cropping the original image using the mask region to obtain a masked image, performing mean filtering on the masked image to smooth the edges of the film bottom contour to obtain a filtered image, and performing edge detection on the filtered image using edge detection operators in eight directions to extract the film bottom contour; Performing an indentation process on the film base contour to obtain the indentation contour and an indentation contour array of each discrete point constituting the indentation contour, reorganizing the indentation contour array, extracting key points from the reorganized indentation contour array to obtain three glue spraying control key points of the indentation contour, obtaining information of each glue spraying control point located at other positions based on the index positions of the three glue spraying control key points in the indentation contour array, and combining the information of each glue spraying control point to obtain glue spraying trajectory information; When the number of glue spraying control points does not need to be increased, glue spraying control is performed according to the glue spraying trajectory information; when the number of glue spraying control points needs to be increased, new glue spraying control points are interpolated using a point interpolation method, and the glue spraying trajectory information is updated, and glue spraying control is performed according to the updated glue spraying trajectory information; The point interpolation method comprises the following steps: Set any discrete point on the indented contour as the first discrete point P1, with coordinates (X1, Y1), the point adjacent to the first discrete point as the second discrete point P2, with coordinates (X2, Y2), the other point adjacent to the second discrete point as the third discrete point P3, with coordinates (X3, Y3), and the point to be interpolated between the first discrete point P1 and the second discrete point P2 as the interpolation point PN, with coordinates (X n ,Y n ), calculate the straight line connecting P2 and P3 and the straight line connecting P1 and P2 The angle θ formed between them; If 170°<θ<180°, the indented contour between the first discrete point P1 and the second discrete point P2 is determined to be a straight line, and the coordinates of the interpolation point PN are calculated using linear interpolation. If 0°<θ≤170°, the indented contour between the first discrete point P1 and the second discrete point P2 is determined to be a curve, and the coordinates of the to-be-interpolated point PN are calculated using a curve interpolation method.
2. The method for generating a film substrate glue spraying trajectory according to claim 1, characterized in that: Generating the mask area comprises the following steps: Set the mask area to a rectangular area, set the lower limit of the filter pixel threshold to 0 and the upper limit to 20; Analyze all points in the original image that meet the pixel threshold, and calculate the row minimum, column minimum, row maximum, and column maximum of all points; The coordinates of the center point of the mask area are calculated by the row minimum, column minimum, row maximum, and column maximum; The height of the mask area is obtained by subtracting the row maximum value from the row minimum value and adding the adjustment value. The width of the mask area is obtained by subtracting the column maximum value from the column minimum value and adding the adjustment value.
3. The method for generating a film substrate glue spraying trajectory according to claim 1, characterized in that: Between obtaining the masked image and performing mean filtering on the masked image, the method further includes the following steps: Calculate and list all points in the masked image with pixel values between 0 and 20; The pixel values of all points with pixel values between 0 and 20 are set to 0.
4. The method for generating a film substrate glue spraying trajectory according to claim 1, wherein: The mean filtering process comprises the following steps: The 3*3 convolution kernel is used to filter the masked image. The mathematical expression of the filtering operation is: Where F(x,y) is the target matrix consisting of the target point and the 8 points around the target point in the masked image F, and G(x,y) is the new matrix obtained by multiplying the target matrix with the 3*3 convolution kernel; Taking out each element in the new matrix, adding them up and taking the average value to obtain the pixel value of the target point; Repeat the above calculation to obtain the pixel values of all points after filtering and obtain the filtered image.
5. The method for generating a film substrate glue spraying trajectory according to claim 4, characterized in that: Among the edge detection operators in the eight directions, the mathematical expression of the convolution kernel of the edge detection operator in each direction is: In the formula, in the XY axis plane coordinate system of the filtered image, G x is the edge detection operator along the X-axis direction, G y is the edge detection operator along the Y axis, G 45 ° is the edge detection operator at 45° to the X axis, G 135 ° is the edge detection operator with an angle of 135° to the X axis, G 180 ° is the edge detection operator with a direction of 180° to the X axis, G 225 ° is the edge detection operator with a direction of 225° to the X axis, G 270 ° is the edge detection operator with a direction of 270° to the X axis, G 315 ° is the edge detection operator that is 315° to the X-axis.
6. The method for generating a film substrate glue spraying trajectory according to claim 5, characterized in that: When edge detection is performed on the filtered image, the pixel value of the target point is calculated using the following mathematical expression: S(x,y)=|G x ·G(x,y)|+|G y ·G(x,y)|+|G 45° ·G(x,y)|+|G 135° ·G(x,y)|+|G 180° ·G(x,y)|+|G 225° ·G(x,y)|+|G 270° ·G(x,y)|+|G 315° ·G(x,y)| Where G(x,y) is the target matrix composed of the target point and the 8 points around the target point in the filtered image G, G x G(x,y) is an edge detection operator along the X-axis and performs convolution calculation with G(x,y).
7. The method for generating a film substrate glue spraying trajectory according to claim 1, characterized in that: The shrinking process comprises the following steps: A circle is drawn with each point in the film bottom contour as the center and the set indentation distance as the radius. The areas contained in all circles are intersected with the area contained in the film bottom contour to obtain the indented area. Edge detection operators in eight directions are used to perform edge detection and extract the indented contour.
8. The method for generating a film substrate glue spraying trajectory according to claim 1, characterized in that: The linear interpolation method uses the following mathematical expression to calculate the PN coordinates: The curve interpolation method uses the following mathematical expression to calculate the PN coordinates: After calculating the PN coordinates, the curve interpolation method selects a value based on the curve interpolation judgment condition.
9. The method for generating a film substrate glue spraying trajectory according to claim 8, characterized in that: The curve interpolation judgment condition is: In the formula, (X n1 ,Y n1 ) is the first coordinate value of PN, (X n2 ,Y n2 ) is the second coordinate value of PN, Y4 is the ordinate of the interpolation reference point P4, and Temp is the factor determining the curve offset direction; Among them, the mathematical expression of the curve offset direction judgment factor Temp is: Temp=(Y1-Y2)*X3+(X2-X1)*Y3+X1*Y2-X2*Y1 The interpolation reference point P4 is an interpolation point between the first discrete point P1 and the second discrete point P2 calculated using a linear interpolation method, and has coordinates of (X4, Y4).
Citation Information
Patent Citations
Sole glue spraying device and method based on monocular vision
CN109671123A
Method for generating glue spraying path of special piece sole type sole based on contour splicing
CN115601424A