A recognition method of a U-shaped slot on a side edge of a door handle plate applied to a spraying system
By calculating the minimum bounding rectangle and using image difference technology, the U-shaped groove on the side of the door handle panel is accurately identified and extended, solving the problem of poor spraying in the existing technology and improving spraying efficiency and effect.
Patent Information
- Application Number
- CN202211385278.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-11-07
- Publication Date
- 2025-11-21
- Estimated Expiration
- 2042-11-07
Smart Images

Figure CN115761485B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of furniture plate spraying recognition, in particular to a recognition method of a door handle plate side U-shaped groove applied to a spraying system. BACKGROUND
[0002] Through retrieval, Chinese invention patent application CN112757293A discloses an identification and spraying method for multiple mixed plates, and CN111002317A discloses a novel door and window spraying method. Although the above two patents provide identification methods for common furniture plates, they do not provide an identification method for a door handle plate side U-shaped groove.
[0003] CN114474043A discloses a bedside visual intelligent spraying method, which provides an outer edge recognition algorithm. The algorithm can spray the edge where the door handle U-shaped groove is located through the edge selection function in the robot trajectory planning. However, this operation has the following disadvantages: 1. The edge selection function makes the robot spray gun unable to strictly adhere to the U-shaped groove for spraying, which will result in poor spraying of the corner parts of the U-shaped groove and the upper and lower surfaces inside the U-shaped groove, affecting the spraying effect; 2. The edge selection function operation is complicated, resulting in reduced spraying efficiency. This processing method cannot meet the increasingly demanding needs of customers. SUMMARY
[0004] To solve the problems in the prior art, the present application provides a recognition method of a door handle plate side U-shaped groove applied to a spraying system. The smallest circumscribed rectangle of the entire plate is first calculated, and the non-U-shaped groove area is extracted through image difference. The non-side U-shaped groove edge is recognized and the primitive is refined to find the pixel points inside the smallest circumscribed rectangle. Then, the length of the primitive to which the pixel point belongs and the distance from the pixel point to the center of the entire plate are calculated, and the target primitive is obtained through screening. Finally, the complete door handle side U-shaped groove feature is obtained through forward and reverse extension of the target primitive.
[0005] The side U-shaped groove can be better obtained, which can make the robot trajectory planning path strictly adhere to the door handle side U-shaped groove, improve the spraying efficiency, and meet the needs of customers.
[0006] The technical problems solved by the present application are solved by the following technical solutions:
[0007] A recognition method of a door handle plate side U-shaped groove applied to a spraying system, comprising the following steps:
[0008] Step (1) placing the workpiece to be identified into the field of view of the vision sensor to obtain image 1;
[0009] Step (2) calculating the smallest circumscribed rectangle of image 1;
[0010] Step (3) extracts the gray recessed area from image 1 to obtain image 2;
[0011] Step (4) performs difference between image 1 and image 2 to obtain image 3;
[0012] Step (5) performs edge recognition and element thinning on image 3, and saves the element into external_uedge container:
[0013] Step (51) performs erosion operation on image 3 to obtain image 4;
[0014] Step (52) performs inflation operation on image 4 to obtain image 5;
[0015] Step (53) performs edge detection on image 5 to obtain edge image 6;
[0016] Step (54) performs corner point recognition on edge image 6;
[0017] Step (55) connects all corner points in step (54) to form an element;
[0018] Step (56) performs thinning operation on all elements to delete redundant elements and retain the most accurate element;
[0019] Step (57) saves all elements into external_uedge container;
[0020] Step (6) traverses external_uedge container to obtain elements inside the minimum circumscribed rectangle and stores them into point_index container:
[0021] Step (61) judges whether the end point coordinates of each element are inside the minimum circumscribed rectangle;
[0022] Step (62) if yes, stores the index of the element with end point inside the minimum circumscribed rectangle into point_index container;
[0023] Step (63) if no, discards the element;
[0024] Step (7) traverses point_index container to obtain the index value of target element:
[0025] Step (71) obtains the center coordinates of the entire workpiece, calculates the distance between the end point of each element in point_index container and the center of the workpiece distance, and stores distance_center into distance_center container;
[0026] Step (72) traverses the distance_center container to obtain the two primitives primitive_0 and primitive_1 with the smallest distance;
[0027] Step (73) calculates the lengths length_0 and length_1 of the two primitives primitive_0 and primitive_1;
[0028] Step (74) compares the lengths length_0 and length_1;
[0029] Step (8) obtains the target primitive primitive_2 according to the obtained index value value_index, and performs forward extension and reverse extension on the primitive_2:
[0030] Step (81) forward extension: the target primitive primitive_2, i.e. the primitive with an angle between adjacent primitives less than 45 degrees, is extended in the clockwise direction:
[0031] Step (811) traverses the external_uedge container in step (57), and assigns value_index to index_0 and index_0 += 1;
[0032] Step (812) obtains the start point and end point a1, a2 of the target primitive corresponding to index_0;
[0033] Step (813) obtains the start point and end point b1, b2 of the primitive corresponding to index_0+1;
[0034] Step (814) calculates the angle between the two adjacent primitives according to the four points a1, a2, b1, b2;
[0035] Step (815) if lines_angle≥angle_temp, the entire traversal is ended;
[0036] Step (816) traverses index_0, and saves the primitives corresponding to the index values from value_index to index_0 in the external_uedge container to the primitive_uedge container;
[0037] Step (82) reverse extension: the target primitive primitive_2, i.e. the primitive with an angle between adjacent primitives less than 45 degrees, is extended in the counterclockwise direction:
[0038] Step (821) traverses the external_uedge container in step (57) while assigning value_index to index_0 and index_0 -= 1;
[0039] Step (822) obtains the start point and end point c1, c2 of the target primitive corresponding to index_1;
[0040] Step (823) obtains the start point and end point d1, d2 of the primitive corresponding to index_1-1;
[0041] Step (824) calculates the included angle of the two adjacent primitives according to the four points c1, c2, d1, d2;
[0042] Step (825) if lines_angle ≥ angle_temp, the entire traversal is ended;
[0043] Step (826) traverses value_index-1, and saves the primitives corresponding to the index values from index_1 to value_index-1 in the external_uedge container to the primitive_uedge container;
[0044] Step (9) obtains the complete side U-shaped slot primitive.
[0045] Preferably, the specific steps of step (53) are as follows:
[0046] Step (531) traverses all pixels of image 5 to determine whether it is a background pixel with a pixel value of 0;
[0047] Step (532) if yes, skip this iteration;
[0048] Step (533) if no, use the four-neighbor connected component algorithm to perform edge detection to obtain edge image 6.
[0049] Preferably, the specific steps of step (533) are as follows:
[0050] Step (5331) determines whether the four pixels p2, p4, p6, p8 adjacent to pixel p1 of image 5 are > 0;
[0051] Step (5332) if yes, set the corresponding pixels p2, p4, p6, p8 to 1;
[0052] Step (5333) calculates the sum sum_p of p2, p4, p6, p8, and determines whether sum_p ≠ 4 and sum_p > 1 are satisfied;
[0053] If yes, the pixel value is set to 1, and the edge image 6 is obtained.
[0054] Preferably, the specific steps of step (54) are as follows:
[0055] Step (541) uses an eight-neighborhood connected component algorithm to preliminarily detect the corner points and save them into the coord_point_corner container.
[0056] Step (542) sorts all the corner point coordinates in the coord_point_corner container.
[0057] Preferably, the specific steps of step (541) are as follows:
[0058] Step (5411) traverses all the pixels of the image 6, and judges whether it is a background pixel, i.e., the pixel value is 0.
[0059] Step (5412) if yes, the current iteration is skipped.
[0060] Step (5413) if no, it is judged whether the eight pixels p2, p3, p4, p5, p6, p7, p8, p9 adjacent to the pixel p1 of the image 6 are >0.
[0061] Step (5414) if yes, the corresponding pixels p2, p3, p4, p5, p6, p7, p8, p9 are set to 1.
[0062] Step (5415) if no, it is judged whether the symmetric pixels in the eight-neighborhood are simultaneously >0, i.e., p2>0 and p6>0.
[0063] Step (5416) if yes, the current iteration is skipped.
[0064] Step (5417) if no, it is judged whether p8>0 and p4>0 are satisfied.
[0065] Step (5418) if yes, the current iteration is skipped.
[0066] Step (5419) if no, it is judged whether p9>0 and p5>0 are satisfied.
[0067] Step (54110) if yes, the current iteration is skipped.
[0068] Step (54111) if no, it is judged whether p7>0 and p3>0 are satisfied.
[0069] Step (54112) if yes, the current iteration is skipped.
[0070] Step (54113) if no, the coordinates (x, y) of the pixel pi are saved in the container coord_point_corner.
[0071] Preferably, the specific steps of step (56) are as follows:
[0072] Step (561) delete the primitives whose length is less than the threshold length_min.
[0073] Step (562) delete the primitives whose angle is less than the threshold angle_min.
[0074] Step (563) delete the primitives which are parallel to each other.
[0075] Preferably, the specific steps of step (61) are as follows:
[0076] Step (611) get the four points of the minimum circumscribed rectangle.
[0077] Step (612) convert the minimum circumscribed rectangle into the contour contour.
[0078] Step (613) judge whether the end point of the primitive is in the contour contour.
[0079] Preferably, the specific steps of step (613) are as follows:
[0080] Step (6131) traverse the end point of each primitive, draw a straight line through this point, and count the number of intersections num_intersect between this straight line and the contour.
[0081] Step (6132) if the number num_intersect is odd, it indicates that the point is inside the contour contour; if the number num_intersect is even, it indicates that the point is outside the contour contour.
[0082] Preferably, the specific steps of step (74) are as follows:
[0083] Step (741) if length_0≥length_1, get the index value value_index of the primitive corresponding to length_0.
[0084] Step (742) if length_0 g length_1, get the index value value_index of the primitive corresponding to length_1.
[0085] Preferably, the specific steps of step (814) are as follows:
[0086] Step (8141) calculate the slope of two primitives according to two points respectively.
[0087] Step (8142) slope of the first base element:
[0088] k_line1 = (a2.y - a1.y) / (a2.x - a1.x) ;
[0089] Step (8143) slope of the second base element:
[0090] k_line2 = (b2.y - b1.y) / (b2.x - b1.x) ;
[0091] Step (8144) calculate the tangent value of the included angle according to the two slopes:
[0092] tan_k = (k_line2 - k_line1) / (1 + k_line2 * k_line1) ;
[0093] Step (8145) calculate the arctangent value to get the included angle lines_angle.
[0094] The beneficial effects of the present application are:
[0095] Compared with the prior art, the present application can accurately identify and locate the side U-shaped groove of the door handle plate, make the spraying trajectory more consistent with the specific shape of the side U-shaped groove of the actual plate, make the spraying trajectory more smooth, and improve the spraying efficiency; in addition, it provides a new identification idea for the field of intelligent spraying of furniture, and meets the market demand. BRIEF DESCRIPTION OF DRAWINGS
[0096] The present application will be further described below in conjunction with the drawings and examples:
[0097] Figure 1 The flowchart of the present application is shown in the figure;
[0098] Figure 2 The structure diagram of the door handle U-shaped groove plate with an oblique angle U-shaped groove is shown in the figure;
[0099] Figure 3 The scanning diagram of the door handle U-shaped groove plate with an oblique angle U-shaped groove is shown in the figure;
[0100] Figure 4 The recognition result diagram of the door handle U-shaped groove plate with an oblique angle U-shaped groove is shown in the figure;
[0101] Figure 5 The structure diagram of the door handle U-shaped groove plate with a right angle U-shaped groove is shown in the figure;
[0102] Figure 6 The scanning diagram of the door handle U-shaped groove plate with a right angle U-shaped groove is shown in the figure;
[0103] Figure 7 The recognition result diagram of the door handle U-shaped groove plate with a right angle U-shaped groove is shown in the figure;
[0104] Figure 8A door handle U-shaped groove plate structure diagram of a double-bevel angle U-shaped groove;
[0105] Figure 9 A door handle U-shaped groove plate scanning diagram of a double-bevel angle U-shaped groove;
[0106] Figure 10 A door handle U-shaped groove plate recognition result diagram of a double-bevel angle U-shaped groove. DETAILED DESCRIPTION
[0107] In order to make the technical means, creative features, purposes and effects of the present application easy to understand, the present application is further described below in combination with the drawings and examples.
[0108] As shown in Figures 2 to 10 , three types of door handle plate side U-shaped groove commonly seen on the market are shown, which are bevel angle U-shaped groove, right angle U-shaped groove and double-bevel angle U-shaped groove; the purpose of the present recognition method is to recognize and locate three different types of door handle plate side U-shaped groove in the image.
[0109] As shown in Figure 1 , a door handle plate side U-shaped groove recognition method applied to a spraying system, comprising the following steps:
[0110] Step (1) place the workpiece to be recognized into the visual sensor field of view to obtain image 1.
[0111] Step (2) perform minimum circumscribed rectangle calculation on image 1.
[0112] Step (3) extract the gray recessed groove area of image 1 to obtain image 2.
[0113] Step (4) perform difference on image 1 and image 2 to obtain image 3.
[0114] Step (5) perform edge recognition and primitive thinning on image 3, and save the primitive to the external_uedge container.
[0115] Step (51) perform erosion operation on image 3 to obtain image 4.
[0116] Step (52) perform inflation operation on image 4 to obtain image 5.
[0117] Step (53) perform edge detection on image 5 to obtain edge image 6, and the specific steps are as follows:
[0118] Step (531) traverse all pixels of image 5 to determine whether it is a background pixel, and the pixel value is 0;
[0119] Step (532) if yes, skip this iteration;
[0120] If no, step (533), edge detection is performed using a four-neighborhood connected component algorithm to obtain an edge image 6, the specific steps are as follows:
[0121] Step (5331), it is judged whether the four pixels p2, p4, p6 and p8 adjacent to the pixel p1 of the image 5 are greater than 0;
[0122] Step (5332), if yes, the corresponding pixels p2, p4, p6 and p8 are set to 1;
[0123] Step (5333), the sum sum_p of p2, p4, p6 and p8 is calculated, and it is judged whether sum_p≠4 and sum_p>1 are satisfied;
[0124] Step (5334), if yes, the pixel value is set to 1, and the edge image 6 is obtained.
[0125] Step (54), corner point recognition is performed on the edge image 6, and the specific steps are as follows:
[0126] Step (541), an eight-neighborhood connected component algorithm is used to preliminarily detect a corner point, and the corner point is saved into a coord_point_corner container;
[0127] Step (542), all corner point coordinates in the coord_point_corner container are sorted;
[0128] Step (5411), all pixels of the image 6 are traversed, and it is judged whether the pixel is a background pixel with a pixel value of 0;
[0129] Step (5412), if yes, the current iteration is skipped;
[0130] Step (5413), if no, it is judged whether the eight pixels p2, p3, p4, p5, p6, p7, p8 and p9 adjacent to the pixel p1 of the image 6 are greater than 0;
[0131] Step (5414), if yes, the corresponding pixels p2, p3, p4, p5, p6, p7, p8 and p9 are set to 1;
[0132] Step (5415), if no, it is judged whether the symmetric pixels in the eight-neighborhood are greater than 0 at the same time, that is, p2>0 and p6>0;
[0133] Step (5416), if yes, the current iteration is skipped;
[0134] Step (5417), if no, it is judged whether p8>0 and p4>0 are satisfied;
[0135] Step (5418), if yes, the current iteration is skipped;
[0136] Step (5419) if no, then judge whether p9>0 and p5>0 are satisfied;
[0137] Step (54110) if yes, then skip this iteration;
[0138] Step (54111) if no, then judge whether p7>0 and p3>0 are satisfied;
[0139] Step (54112) if yes, then skip this iteration;
[0140] Step (54113) if no, then save the coordinates (x, y) of the pixel p1 in the container coord_point_corner.
[0141] Step (55) connect all the corner points in step (54) to form primitives.
[0142] Step (56) perform a refinement operation on all the primitives to delete redundant primitives and retain the most accurate primitives, the specific steps are as follows:
[0143] Step (561) delete the primitives with a length less than the threshold length_min;
[0144] Step (562) delete the primitives with an angle less than the threshold angle_min;
[0145] Step (563) delete the primitives that are parallel to each other.
[0146] Step (57) save all the primitives in the external_uedge container.
[0147] Step (6) traverse the external_uedge container to obtain the primitives inside the minimum bounding rectangle and store them in the point_index container:
[0148] Step (61) judge whether the end point coordinates of each primitive are inside the minimum bounding rectangle, the specific steps are as follows:
[0149] Step (611) obtain the four points of the minimum bounding rectangle;
[0150] Step (612) convert the minimum bounding rectangle into a contour contour;
[0151] Step (613) judge whether the end point of the primitive is in the contour contour, the specific steps are as follows:
[0152] Step (6131) traverse the end point of each primitive, draw a straight line through this point, and count the number of intersections num_intersect between this straight line and the contour;
[0153] Step (6132) If the number of intersections num intersect is odd, it means that the point is inside the contour; if the number of intersections num intersect is even, it means that the point is outside the contour.
[0154] Step (62) If yes, store the index of the primitive whose end point is inside the minimum bounding rectangle into the point_index container.
[0155] Step (63) If no, discard the primitive.
[0156] Step (7) Traverse the point_index container to obtain the index value of the target primitive:
[0157] Step (71) Obtain the center coordinates of the entire workpiece, calculate the distance between the end point of each primitive in the point_index container and the center of the workpiece, and store the distance into the distance_center container.
[0158] Step (72) Traverse the distance_center container to obtain the two primitives primitive_0 and primitive_1 with the smallest distance distance.
[0159] Step (73) Calculate the lengths length_0 and length_1 of primitive_0 and primitive_1.
[0160] Step (74) Compare the lengths length_0 and length_1, and the specific steps are as follows:
[0161] Step (741) If length_0 ≥ length_1, obtain the index value value_index of the primitive corresponding to length_0.
[0162] Step (742) If length_0 < length_1, obtain the index value value_index of the primitive corresponding to length_1.
[0163] Step (8) According to the obtained index value value_index, obtain the target primitive peimitive_2, and perform forward extension and reverse extension on primitive_2:
[0164] Step (81) Forward extension: extend the target primitive primitive_2, i.e., the primitive with an angle between adjacent primitives less than 45 degrees, in the clockwise direction:
[0165] Step (811) traverses the external_uedge container in step (57) while assigning value_index to index_0 and index_0 += 1;
[0166] Step (812) obtains the start point and end point a1, a2 of the target primitive corresponding to index_0;
[0167] Step (813) obtains the start point and end point b1, b2 of the primitive corresponding to index_0+1;
[0168] Step (814) calculates the included angle of the two adjacent primitives according to the four points a1, a2, b1, b2;
[0169] Step (8141) calculates the slope of the two primitives according to the two points respectively;
[0170] Step (8142) the slope of the first primitive:
[0171] k_line1 = (a2.y - a1.y) / (a2.x - a1.x);
[0172] Step (8143) the slope of the second primitive:
[0173] k_line2 = (b2.y - b1.y) / (b2.x - b1.x) ;
[0174] Step (8144) calculates the tangent value of the included angle according to the two slopes:
[0175] tan_k = (k_line2 - k_line1) / (1 + k_line2 * k_line1) ;
[0176] Step (8145) calculates the arctangent value to obtain the included angle lines_angle;
[0177] Step (815) if lines_angle ≥ angle_temp, end the entire traversal;
[0178] Step (816) traverses index_0 and saves the primitives corresponding to the index values from value_index to index_0 in the external_uedge container to the primitive_uedge container.
[0179] Step (82) reverse extension: clockwise extension is performed on the target primitive primitive_2, i.e. the primitive whose included angle between adjacent primitives is less than 45 degrees:
[0180] Step (821) traverses the external_uedge container in step (57) while assigning value_index to index_0 and index_0 -= 1;
[0181] Step (822) obtains the start point and end point c1, c2 of the target primitive corresponding to index_1.
[0182] Step (823) obtains the start point and end point d1, d2 of the primitive corresponding to index_1-1.
[0183] Step (824) is the same as step (814), and the angle between the two adjacent primitives is calculated according to the four points c1, c2, d1, d2.
[0184] Step (825) is the same as step (815), and if lines_angle ≥ angle_temp, the entire traversal is ended.
[0185] Step (826) traverses value_index-1, and saves the primitives corresponding to the index values from index_1 to value_index-1 in the external_uedge container to the primitive_uedge container.
[0186] Step (9) obtains the complete side U-shaped slot primitive.
[0187] When the door handle side U-shaped slot is recognized and positioned, the threshold values length_min and angle_min in steps (561) and (562) can be customized by the user, and the empirical threshold value angle_temp in step (815) is 45.
[0188] The basic principles, main features and advantages of the present application are shown and described above. It should be understood by those skilled in the art that the present application is not limited by the above examples, and the above examples and descriptions in the specification are only the principles of the present application. Without departing from the spirit and scope of the present application, various changes and improvements can be made to the present application, and these changes and improvements all fall within the scope of the present application. The scope of protection of the present application is defined by the appended claims and their equivalents.
Claims
1. A method for identifying the side U-shaped slot of a door handle plate applied to a spraying system, characterized in that: The method comprises the following steps: Step (1) place the workpiece to be identified into the visual sensor field of view, and acquire image 1; Step (2) perform minimum circumscribed rectangle calculation on image 1; Step (3) extract the gray groove area from image 1 to obtain image 2; Step (4) perform difference on image 1 and image 2 to obtain image 3; Step (5) perform edge recognition and primitive thinning on image 3, and save the primitives into the external_uedge container: Step (51) perform erosion operation on image 3 to obtain image 4; Step (52) perform inflation operation on image 4 to obtain image 5; Step (53) perform edge detection on image 5 to obtain edge image 6; Step (54) perform corner point recognition on edge image 6; Step (55) connect all the corner points in step (54) to form a primitive; Step (56) perform thinning operation on all the primitives to delete redundant primitives and retain the most accurate primitives; Step (57) save all the primitives into the external_uedge container; Step (6) traverse the external_uedge container, obtain the primitives inside the minimum circumscribed rectangle, and store them into the point_index container: Step (61) judge whether the end point coordinates of each primitive are inside the minimum circumscribed rectangle; Step (62) if yes, store the index of the primitive with the end point inside the minimum circumscribed rectangle into the point_index container; Step (63) if no, discard the primitive; Step (7) traverse the point_index container to obtain the index value of the target primitive: Step (71) obtain the center coordinates of the entire workpiece, calculate the distance distance from the end point of each primitive in the point_index container to the workpiece center, and store the distance distance into the distance_center container; Step (72) traverse the distance_center container to obtain the first two primitives with the minimum distance distance, primitive_0 and primitive_1; Step (73) calculate the lengths length_0 and length_1 of primitive_0 and primitive_1; Step (74) compare the lengths length_0 and length_1; Step (8) according to the obtained index value value_index, obtain the target primitive primitive_2, and perform forward extension and reverse extension on primitive_2: Step (81) forward extension: perform clockwise direction extension on the target primitive primitive_2, i.e. on the primitives with the included angle between adjacent primitives less than 45 degrees: Step (811) traverse the external_uedge container in step (57), simultaneously assign value_index to index_0, and index_0 += 1; Step (812) obtain the start point and end point a1 and a2 of the target primitive corresponding to index_0; Step (82) reverse extension: perform counterclockwise direction extension on the target primitive primitive_2, i.e. on the primitives with the included angle between adjacent primitives greater than 45 degrees: Step (821) traverse the external_uedge container in step (57), simultaneously assign value_index to index_0, and index_0 += 1; Step (822) obtain the start point and end point a1 and a2 of the target primitive corresponding to index_0; Step (9) according to the obtained index value value_index, obtain the target primitive primitive_3, and perform forward extension and reverse extension on primitive_3: Step (91) forward extension: perform clockwise direction extension on the target primitive primitive_3, i.e. on the primitives with the included angle between adjacent primitives less than 45 degrees: Step (911) traverse the external_uedge container in step (57), simultaneously assign value_index to index_0, and index_0 += 1; Step (912) obtain the start point and end point a1 and a2 of the target primitive corresponding to index_0; Step (92) reverse extension: perform counterclockwise direction extension on the target primitive primitive_3, i.e. on the primitives with the included angle between adjacent primitives greater than 45 degrees: Step (921) traverse the external_uedge container in step (57), simultaneously assign value_index to index_0, and index_0 += 1; Step (922) obtain the start point and end point a1 and a2 of the target primitive corresponding to index_0. Step (813) obtains the start point and end point b1, b2 of the primitive corresponding to index_0+1; Step (814) calculates the included angle of two adjacent primitives according to four points a1, a2, b1, b2; Step (815) if lines_angle≥angle_temp, the whole traversal is ended; Step (816) traverses index_0, and saves the primitives corresponding to the index values from value_index to index_0 in the external_uedge container to the primitive_uedge container; Step (82) reverse extension: the target primitive primitive_2, that is, the primitive with an included angle between adjacent primitives less than 45 degrees, is extended in the clockwise direction: Step (821) traverses the external_uedge container in step (57), assigns value_index to index_0 at the same time, and index_0-=1; Step (822) obtains the start point and end point c1, c2 of the target primitive corresponding to index_1; Step (823) obtains the start point and end point d1, d2 of the primitive corresponding to index_1-1; Step (824) calculates the included angle of two adjacent primitives according to four points c1, c2, d1, d2; Step (825) if lines_angle≥angle_temp, the whole traversal is ended; Step (826) traverses value_index-1, and saves the primitives corresponding to the index values from index_1 to value_index-1 in the external_uedge container to the primitive_uedge container; Step (9) obtains the complete side U-shaped groove primitive.
2. The method for identifying the side U-shaped slot of the door handle plate applied to the spraying system according to claim 1, characterized in that: The specific steps of step (53) are as follows: Step (531) traverses all pixels of image 5, and judges whether it is a background pixel, that is, the pixel value is 0; Step (532) if yes, skip this time of traversal; Step (533) if no, edge detection is performed using the four-neighbor connected component algorithm to obtain edge image 6.
3. The method of claim 2, wherein the method is applied to a U-shaped slot of a side edge of a door handle plate of a painting system. The specific steps of step (533) are as follows: Step (5331) judges whether the four pixels p2, p4, p6, p8 adjacent to pixel p1 of image 5 are greater than 0; Step (5332) if yes, sets the corresponding pixels p2, p4, p6, p8 to 1; Step (5333) calculates the sum sum_p of p2, p4, p6, p8, and judges whether sum_p≠4 and sum_p>1 are satisfied; Step (5334) if yes, sets the pixel value to 1 to obtain edge image 6.
4. The method of claim 1, wherein the method is applied to a side U-shaped slot of a door handle plate of a painting system. The specific steps of step (54) are as follows: Step (541) uses the eight-neighbor connected component algorithm to preliminarily detect the corner points and saves them into the coord_point_corner container; Step (542) sorts all the corner point coordinates in the coord_point_corner container.
5. The method of claim 4, wherein the method is applied to a side U-shaped slot of a door handle plate of a painting system. The specific steps of step (541) are as follows: Step (5411) traverses all pixels of image 6 to determine whether it is a background pixel, i.e., the pixel value is 0. Step (5412) if yes, skip this iteration. Step (5413) if no, determine whether the eight pixels p2, p3, p4, p5, p6, p7, p8, and p9 adjacent to the pixel p1 of image 6 are greater than 0. Step (5414) if yes, set the corresponding pixels p2, p3, p4, p5, p6, p7, p8, and p9 to 1. Step (5415) if no, determine whether the symmetric pixels in the eight-neighborhood are both greater than 0, i.e., p2>0 and p6>0. Step (5416) if yes, skip this iteration. Step (5417) if no, determine whether p8>0 and p4>0 are satisfied. Step (5418) if yes, skip this iteration. Step (5419) if no, determine whether p9>0 and p5>0 are satisfied. Step (54110) if yes, skip this iteration. Step (54111) if no, determine whether p7>0 and p3>0 are satisfied. Step (54112) if yes, skip this iteration. Step (54113) if no, save the coordinates (x, y) of the pixel p1 in the container coord_point_corner.
6. The method of claim 1, wherein the method is applied to a side U-slot of a door handle plate of a painting system. The specific steps of step (56) are as follows: Step (561) delete the primitives with a length less than the threshold length_min. Step (562) delete the primitives with an angle less than the threshold angle_min. Step (563) delete the primitives that are parallel to each other.
7. The method of claim 1, wherein the method is applied to a side U-shaped slot of a door handle plate of a painting system. The specific steps of step (61) are as follows: Step (611) obtain the four points of the minimum bounding rectangle. Step (612) convert the minimum bounding rectangle into a contour contour. Step (613) determine whether the end point of the primitive is in the contour contour.
8. The method of claim 7, wherein the method is applied to a side U-shaped slot of a door handle plate of a spraying system. The specific steps of step (613) are as follows: Step (6131) traverse each end point of the primitive, draw a straight line through this point, and count the number of intersections num_intersect between this straight line and the contour. Step (6132) if the number of intersections num_intersect is odd, it indicates that the point is inside the contour contour; if the number of intersections num_intersect is even, it indicates that the point is outside the contour contour.
9. The method of claim 1, wherein the method is applied to a side U-shaped slot of a door handle plate of a painting system. The specific steps of step (74) are as follows: Step (741) if length_0≥length_1, obtain the index value value_index of the primitive corresponding to length_0. Step (742) if length_0<length_1, obtain the index value value_index of the primitive corresponding to length_1.
10. The method of claim 1, wherein the method is applied to a side U-slot of a door handle plate of a painting system. The specific steps of step (814) are as follows: Step (8141) calculate the slope of the two primitives according to the two points. Step (8142) the slope of the first primitive: ; Step (8143) the slope of the second primitive: ; Step (8144) calculate the tangent value of the included angle according to the two slopes: ; Step (8145) calculate the inverse tangent value to obtain the included angle lines_angle.
Citation Information
Patent Citations
Novel spraying method and device for door and window spraying industry based on robot vision
CN111002317A
Identification and spraying method for various mixed plates based on robot vision
CN112757293A
Mechanical arm visual servo target recognition method based on local contour
CN110766750A
Spherical workpiece identification method and system based on contour edge number fitting and convex hull processing
CN112750107A