A method, system, riveting equipment, and working method for positioning rivet nuts.
By combining image processing of the rivet nut with a three-axis moving device, precise positioning of the rivet nut was achieved, solving the consistency and efficiency problems of manual riveting and improving the adaptability and production efficiency of automated equipment.
Patent Information
- Application Number
- CN202410530556.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-04-29
- Publication Date
- 2026-11-17
- Estimated Expiration
- 2044-04-29
AI Technical Summary
In existing technologies, manual riveting of nuts results in poor consistency, unstable quality, and high labor intensity. Automated riveting equipment requires high precision fixtures, making it difficult to adapt to the riveting position requirements of different workpieces, thus limiting the improvement in production efficiency.
By acquiring the original image of the workpiece to be riveted and performing binarization processing, the inner and outer circular features of the rivet nut are extracted and fitted. Precise positioning is achieved using an industrial camera and a three-axis moving device. Combined with a control device, the position of the riveting device is automatically adjusted, reducing the accuracy requirements of the fixture.
It achieves precise positioning of rivet nuts, improves production efficiency and yield, reduces labor intensity, adapts to riveting operations of different workpieces, and enhances the system's flexibility and automation.
Smart Images

Figure CN118417863B_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of riveting technology, and in particular relates to a riveting nut positioning method, system, riveting equipment and its working method. Background Technology
[0002] The statements in this section are merely background information related to the present invention and do not necessarily constitute prior art.
[0003] Threaded connections are widely used in sheet metal fastening due to their ease of installation and disassembly. However, when dealing with thin metal sheets and pipes, traditional welded nuts can cause the substrate to melt and deform, while tapping internal threads can easily lead to stripping. In such cases, using rivet nuts can effectively improve the strength and stability of the connection. A rivet nut is a permanent mechanical fastener; by quickly riveting it to either side of a profile, the nut is fixed to the profile and provides threads for subsequent assembly. Rivet nuts are widely used for fastening various metal structural components in automobiles, aerospace, electronic equipment, and other industries, and have strong load-bearing capacity.
[0004] The rivet nut has a cylindrical outer shell with a through hole in the center. The upper half of the through hole has a smooth inner wall, while the lower half has a threaded inner wall for connection with external screws. A flange extends radially from the top of the through hole. Before riveting, the rivet nut is placed in the rivet hole of the sheet metal, with the inner side of the flange of the rivet nut pressed tightly against the upper surface of the sheet metal. The rivet head of the rivet gun has external threads. After the rivet head is screwed into the rivet nut on the sheet metal, the rivet head retracts, and the upper half of the through hole of the rivet nut is compressed and expanded. The expanded part clamps the sheet metal with the flange, achieving a reliable connection.
[0005] In manual riveting operations, the direction and force with which the worker holds the rivet gun directly affect the riveting effect. Manually riveted nuts exhibit poor consistency and unstable quality. Furthermore, manual riveting is physically demanding, easily causing worker fatigue and leading to decreased production efficiency.
[0006] To address the shortcomings of manual riveting, automated riveting technology has been introduced. Currently, the main automated riveting methods use fixtures to hold the workpiece in place, and a moving device drives the rivet gun to perform the riveting operation. This method requires the rivet nut to be positioned precisely, and the riveting position must be pre-set in the moving device. It also demands high precision from the fixtures, and different riveting positions need to be set for different workpieces, limiting its effectiveness in improving production efficiency.
[0007] Therefore, how to accurately position the rivet nuts for different workpieces in order to achieve full automation of the riveting operation is a problem that needs to be solved. Summary of the Invention
[0008] To overcome the shortcomings of the prior art, the present invention provides a rivet nut positioning method, system, riveting equipment and its working method, which realizes the precise positioning of the rivet nut, and then realizes the subsequent automated riveting operation based on the positioned rivet nut. It can adapt to the riveting processing operation of different workpieces, and improves production efficiency and the yield of rivet nuts.
[0009] To achieve the above objectives, a first aspect of the present invention provides a method for positioning a rivet nut, comprising:
[0010] Obtain the original image of the workpiece to be riveted and perform binarization to obtain a binary image;
[0011] Extract continuous edge segments from the obtained binary image, fit closed edge segments among the extracted continuous edge segments, and use the successfully fitted segments as candidate circles or candidate ellipses.
[0012] The remaining edge segments are converted into line segments. The converted line segments are then combined into an arc and fitted. The successfully fitted arcs are used as candidate circles or candidate ellipses.
[0013] The candidate circles or ellipses that have been successfully fitted are clustered at the center to obtain the positions of the inner and outer circles of each rivet nut in the binary image.
[0014] Based on the position in the binary image, the positions of the inner and outer circles of each rivet nut in the original image are obtained.
[0015] A second aspect of the present invention provides a riveting device, comprising: a riveting apparatus, a three-axis moving device, and a control device;
[0016] The riveting device includes a rivet nut gun mounted on a fixed plate, a ring light source, and an industrial camera, the industrial camera being used to acquire the original image of the workpiece to be riveted;
[0017] The riveting device is fixed to the execution end of the three-axis moving device, which is used to receive the movement command from the control device and drive the riveting device to move.
[0018] The control device is configured to: receive the original image of the workpiece to be riveted captured by the industrial camera, execute a rivet nut positioning method as described above, obtain the rivet nut positioning result, and send a movement command to the three-axis moving device according to the positioning result.
[0019] A third aspect of the present invention provides a method for operating a riveting device, comprising:
[0020] Start the industrial camera to acquire the raw image of the riveted workpiece;
[0021] The control device is activated, and the positioning process is performed based on the original image of the riveted workpiece to obtain the positioning result of the rivet nut in the riveted workpiece. The movement command is then sent to the three-axis moving device based on the positioning result of the rivet nut.
[0022] Start the three-axis moving device, and drive the riveting device to move according to the received moving command.
[0023] A fourth aspect of the present invention provides a rivet nut positioning system, comprising:
[0024] Acquisition module: Acquires the original image of the workpiece to be riveted and performs binarization processing to obtain a binary image;
[0025] The first fitting module extracts continuous edge segments from the obtained binary image, fits closed edge segments among the extracted continuous edge segments, and uses the successfully fitted segments as candidate circles or candidate ellipses.
[0026] The second fitting module converts the remaining edge segments into line segments, combines the converted line segments into arcs, and then fits them. The successfully fitted ones are used as candidate circles or candidate ellipses.
[0027] Clustering module: Performs center clustering on the successfully fitted candidate circles or candidate ellipses to obtain the positions of the inner and outer circles of each rivet nut in the binary image of the riveted workpiece;
[0028] Positioning module: Based on the position in the binary image, obtain the position of the inner and outer circles of each rivet nut in the original image.
[0029] A fifth aspect of the present invention provides a computer-readable storage medium storing a computer program that, when executed by a processor, performs a rivet nut positioning method.
[0030] The above one or more technical solutions have the following beneficial effects:
[0031] In this invention, the original image of the workpiece to be riveted is binarized to obtain a binary image that highlights the inner and outer circular features of the rivet nut. Then, edge segments are extracted from the binary image, the extracted edge segments are fitted, and the fitted candidate circles or candidate ellipses are clustered at the center to obtain the inner and outer circles of each rivet nut in the binary image. The position of the rivet nut in the original image is then obtained, achieving precise positioning of the rivet nut. Subsequently, the rivet nut is positioned to realize the subsequent automated riveting operation. This invention can adapt to the riveting processing of different workpieces, improving production efficiency and the yield rate of rivet nuts.
[0032] Advantages of additional aspects of the invention will be set forth in part in the description which follows, and in part will be obvious from the description, or may be learned by practice of the invention. Attached Figure Description
[0033] The accompanying drawings, which form part of this invention, are used to provide a further understanding of the invention. The illustrative embodiments of the invention and their descriptions are used to explain the invention and do not constitute an improper limitation of the invention.
[0034] Figure 1 This is a flowchart of the rivet nut positioning process provided in Embodiment 1 of the present invention;
[0035] Figure 2 This is a schematic diagram of image acquisition during the automatic riveting process provided in Embodiment 2 of the present invention;
[0036] Figure 3 This is a schematic diagram of the automatic riveting device provided in Embodiment 2 of the present invention;
[0037] Figure 4 This is a flowchart of the automatic riveting process provided in Embodiment 2 of the present invention;
[0038] In the diagram: 1. Riveting device, 101. Rivet nut gun, 102. Ring light source, 103. Industrial camera, 104. Fixing plate, 2. Three-axis moving device, 3. Control device, 4. Workpiece to be riveted. Detailed Implementation
[0039] It should be noted that the following detailed descriptions are exemplary and intended to provide further illustration of the invention. Unless otherwise specified, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this invention pertains.
[0040] It should be noted that the terminology used herein is for the purpose of describing particular implementations only and is not intended to limit the exemplary implementations of the present invention.
[0041] Where there is no conflict, the embodiments and features in the embodiments of the present invention can be combined with each other.
[0042] Example 1
[0043] This embodiment discloses a method for positioning rivet nuts, including:
[0044] Obtain the original image of the workpiece to be riveted and perform binarization to obtain a binary image;
[0045] Extract continuous edge segments from the obtained binary image, fit closed edge segments among the extracted continuous edge segments, and use the successfully fitted segments as candidate circles or candidate ellipses.
[0046] The remaining edge segments are converted into line segments. The converted line segments are then combined into an arc and fitted. The successfully fitted arcs are used as candidate circles or candidate ellipses.
[0047] The candidate circles or ellipses that have been successfully fitted are clustered at the center to obtain the positions of the inner and outer circles of each rivet nut in the binary image.
[0048] Based on the position in the binary image, the positions of the inner and outer circles of each rivet nut in the original image are obtained.
[0049] The following is combined Figure 1 This embodiment provides a detailed description of a rivet nut positioning method, which specifically includes:
[0050] Step 1: Preprocessing
[0051] First, a grayscale image of the workpiece to be riveted, captured by an industrial camera, is obtained as the initial image. The image size is then reduced using bilinear interpolation. The reduced image is then binarized to highlight the inner and outer circular features of the nut.
[0052] Specifically, bilinear interpolation is used to reduce the length and width of the initial image D to 1 / 4 of their original values, resulting in image D1. Image D2 is then created, where the pixel value of each point in image D2 is the maximum pixel value within the corresponding 3x3 region of image D1. Image D1 is then divided by image D2 to obtain image D3.
[0053]
[0054] Set the binarization threshold to 0.5, set pixels in image D3 that are less than the binarization threshold to 0, and pixels that are greater than the binarization threshold to 255, to obtain the final binary image D3.
[0055] After image preprocessing, the inner and outer circular features of the rivet nut are highlighted.
[0056] Step 2: Nut Inspection Section
[0057] The nut detection section is mainly used to detect the inner and outer circles of each rivet nut. In the preprocessed image D3, continuous edge segments are extracted. Specifically, the EDPF parameterless edge drawing algorithm is used to detect all possible edge segments in the image, and the extracted edge segments are verified by the Helmholtz principle to eliminate erroneous detections.
[0058] For the closed edge segments extracted, directly fit them to a circle or ellipse, and add the successfully fitted ones to the candidate circle or candidate ellipse.
[0059] The closed edge segments may include polygons, fan rings, circles, or ellipses. In the process of fitting closed edge segments into circles or ellipses, polygons cannot pass the mean square error test, while a fan ring edge segment passes the mean square error test because the centers and radii of its front and rear edge arcs are basically similar. It is incorrectly extracted as a candidate circle, which not only does not conform to the goal of extracting closed circles, but also reduces the number of arcs generated in subsequent steps.
[0060] In this embodiment, the centroid of the candidate circles or ellipses obtained above is verified, and the closed edge segments of the fan-shaped rings are selected and treated as arcs. If the closed edge segment of the fan-shaped ring is a superior arc, it is directly used to generate a candidate circle; if the closed edge segment of the fan-shaped ring is a inferior arc, it is released as an edge segment.
[0061] For the remaining edge segments, convert them into line segments, and then combine these line segments into arcs. Merge arcs belonging to the same circle or ellipse, and use these arcs to fit a circle or ellipse. Similarly, successfully fitted arcs are added to the candidate circles or ellipses. The candidate circles and ellipses are then validated to obtain successfully validated circles and ellipses.
[0062] Specifically, in the remaining edge segments, starting from any short line that meets a certain straightness standard, as long as the root mean square error is less than a certain threshold, this line is extended to obtain multiple line segments. In the algorithm, each arc is considered to be a set of multiple continuous line segments turning in the same direction. The line segments constituting the edge segments in the graph are traversed, and the turning angles of adjacent lines are calculated. If at least three lines turn in the same direction, and the angles between the lines are within a threshold, then these lines constitute an arc. After obtaining all arcs, they are sorted in descending order of length. The longest arc is extended, and other arcs are selected to combine with the current arc according to certain constraints. These constraints specifically include radius difference constraints and center distance constraints. The arcs that satisfy the constraints are connected to the current arc to form a circle or ellipse.
[0063] Centroid clustering is performed on all verified candidate circles and ellipses. Specifically, the center of each candidate circle and the foci of each candidate ellipse are first calculated, and the midpoint between the two foci of the candidate ellipse is taken as its center. These center points are traversed, and the distance between each pair of center points is calculated. A threshold is applied to the distance values, and center points with a distance less than the threshold are classified as circles or ellipses belonging to the same rivet nut.
[0064] The largest candidate circle or ellipse in each cluster represents the outer circle of the nut, and outer circles extending beyond the boundary are ignored. Based on the characteristic that the inner and outer circles of the nut are concentric, candidate circles and ellipses representing the inner circle of the nut in each cluster are selected using the following three parameters: the distance between the centers of the two circles, the shortest distance between the two circles, and the radius range of the inner circle of the nut. The candidate ellipses representing the inner circle of the nut are then transformed into circles, with the radius of the transformed circle being half the sum of the major and minor axes of the ellipse.
[0065] After nut inspection, the inner and outer circles of each rivet nut in the image are obtained.
[0066] Step 3: Precise positioning of the nut
[0067] The inner circle of the nut obtained in step 2 is enlarged in reverse according to the ratio of the preprocessing to obtain the position of the inner and outer circles of the nut in the initial image;
[0068] The relocation region T is determined based on the center and diameter of the outer circle of the nut, and the relocation region T in the initial image is binarized.
[0069] For each point on the inner circle, the nearest point found within a certain distance along its radial direction is regarded as a new inner circle point. The new inner circle point is fitted into a circle and used as the final inner circle of the nut. The center of the inner circle of the nut is the center point of the rivet nut.
[0070] During preprocessing, bilinear interpolation is used to reduce the image size, and candidate circles and ellipses are detected in the reduced image to reduce the amount of data processed. However, image compression reduces the accuracy of detecting the inner and outer circles of the nut.
[0071] The inner circle of the nut must be within the outer circle of the nut. Therefore, in the initial image, the Region of Interest (ROI) is determined by the center and diameter of the outer circle of the nut. The ROI is binarized, and the calculated inner circle is plotted in the binary image. For each point on the inner circle, the nearest point found within a certain distance along its radial direction is considered as a new inner circle point.
[0072] After precise positioning of the nut, the positioning accuracy of the inner circle of the nut is significantly improved.
[0073] The above process achieves precise positioning of the rivet nut, with a root mean square error of ≤0.3mm, which meets the requirements of automated riveting.
[0074] Example 2
[0075] like Figures 2-3 As shown, this embodiment provides an automatic riveting device, including: a riveting device, a three-axis moving device, and a control device;
[0076] The riveting device includes a rivet nut gun mounted on a fixed plate, a ring light source, and an industrial camera, the industrial camera being used to acquire the original image of the workpiece to be riveted;
[0077] The riveting device is fixed to the execution end of the three-axis moving device, which is used to receive the movement command from the control device and drive the riveting device to move.
[0078] The control device is configured to: receive the original image of the workpiece to be riveted captured by the industrial camera, execute a rivet nut positioning method as described in Embodiment 1, obtain the rivet nut positioning result, and send a movement command to the three-axis moving device according to the positioning result.
[0079] The riveting device 1 includes a rivet nut gun 101, a ring light source 102, an industrial camera 103 for acquiring images of rivet nuts in the work area, and a fixing plate 104.
[0080] The rivet gun 101, the ring light source 102, and the industrial camera 103 are fixed on the mounting plate 104. The rivet gun 101 is parallel to the industrial camera 103, and the ring light source 102 is installed below the industrial camera 103.
[0081] The three-axis moving device 2 includes three drive shafts (X, Y, Z) and a base; the riveting device 1 is fixed at the end of the three-axis moving device 2.
[0082] The control device 3 mainly includes components such as a computer and a display screen. The computer is connected to the industrial camera 103 to acquire images. The computer stores computer programs. When the computer programs are executed, they can implement the steps in the rivet nut positioning method in Embodiment 1.
[0083] Example 3
[0084] Based on the working method of the riveting equipment in Embodiment 2, it includes:
[0085] Start the industrial camera to acquire the raw image of the riveted workpiece;
[0086] The control device is activated, and the positioning process is performed based on the original image of the riveted workpiece to obtain the positioning result of the rivet nut in the riveted workpiece. The movement command is then sent to the three-axis moving device based on the positioning result of the rivet nut.
[0087] Start the three-axis moving device, and drive the riveting device to move according to the received moving command.
[0088] like Figure 4 As shown, in this embodiment, hand-eye calibration is performed on the industrial camera 103 and the three-axis moving device 2 to obtain the coordinate transformation relationship between the camera coordinate system and the three-axis moving device coordinate system.
[0089] The three-axis moving device 2 moves the riveting device 1 into the work area, and the industrial camera 103 captures images of the work area.
[0090] Using the rivet nut positioning method in Example 1, the initial image is preprocessed to complete nut detection and precise nut positioning. The position coordinates of each rivet nut in the coordinate system of the three-axis moving device are calculated through coordinate transformation.
[0091] Based on the calculated coordinates of the rivet nut position, the three-axis moving device 2 moves to align the rivet head of the rivet nut gun 101 with the rivet nut. The Z-axis of the three-axis moving device 2 descends, and the rivet head screws into the rivet nut. The rivet head retracts, and the rivet nut is fixed to the plate. The rivet head unscrews the rivet nut, and after the Z-axis of the three-axis moving device 2 rises a certain distance, it moves to the next rivet nut position to perform the riveting operation.
[0092] Complete the riveting operation for all nuts to be riveted in the work area. The three-axis moving device 2 moves the riveting device 1 to the initial position, waiting for the next riveting operation.
[0093] This embodiment achieves precise positioning of rivet nuts within the work area and rivets each rivet nut individually. The automated riveting process eliminates the need to pre-determine the rivet nut's position, reducing the requirements for high-precision fixtures, lowering labor intensity, increasing production efficiency, and significantly improving system flexibility and yield.
[0094] Example 4
[0095] This embodiment provides a rivet nut positioning system, including:
[0096] Acquisition module: Acquires the original image of the workpiece to be riveted and performs binarization processing to obtain a binary image;
[0097] The first fitting module extracts continuous edge segments from the obtained binary image, fits closed edge segments among the extracted continuous edge segments, and uses the successfully fitted segments as candidate circles or candidate ellipses.
[0098] The second fitting module converts the remaining edge segments into line segments, combines the converted line segments into arcs, and then fits them. The successfully fitted ones are used as candidate circles or candidate ellipses.
[0099] Clustering module: Performs center clustering on the successfully fitted candidate circles or candidate ellipses to obtain the positions of the inner and outer circles of each rivet nut in the binary image of the riveted workpiece;
[0100] Positioning module: Based on the position in the binary image, obtain the position of the inner and outer circles of each rivet nut in the original image.
[0101] Example 5
[0102] The purpose of this embodiment is to provide a computer-readable storage medium.
[0103] A computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, performs the steps of the above-described method.
[0104] The steps and methods involved in the apparatuses of Embodiments 4 and 5 above correspond to those in Embodiment 1. For specific implementation details, please refer to the relevant description section of Embodiment 1. The term "computer-readable storage medium" should be understood as a single medium or multiple media including one or more instruction sets; it should also be understood as including any medium capable of storing, encoding, or carrying an instruction set for execution by a processor and enabling the processor to perform any of the methods in this invention.
[0105] Those skilled in the art will understand that the modules or steps of the present invention described above can be implemented using general-purpose computer devices. Optionally, they can be implemented using computer-executable program code, thereby allowing them to be stored in a storage device for execution by a computer device, or they can be fabricated as separate integrated circuit modules, or multiple modules or steps can be fabricated as a single integrated circuit module. The present invention is not limited to any particular combination of hardware and software.
[0106] While the specific embodiments of the present invention have been described above in conjunction with the accompanying drawings, this is not intended to limit the scope of protection of the present invention. Those skilled in the art should understand that various modifications or variations that can be made by those skilled in the art without creative effort based on the technical solutions of the present invention are still within the scope of protection of the present invention.
Claims
1. A method of positioning a riv-nut, characterized in that, include: The original image of the workpiece to be riveted is acquired and binarized to obtain a binary image, specifically: The original image of the workpiece to be riveted is scaled using bilinear interpolation to obtain a first image; a second image is created, where the pixel value of each point in the second image is the maximum pixel value within the set area where the corresponding pixel point is located in the first image; Divide the pixel value at the corresponding position in the second image by the pixel value in the first image, and obtain a binary image based on the division result and a set binarization threshold. Extract continuous edge segments from the obtained binary image, fit closed edge segments among the extracted continuous edge segments, and use the successfully fitted segments as candidate circles or candidate ellipses. The remaining edge segments are converted into line segments. The converted line segments are then combined into an arc and fitted. The successfully fitted arcs are used as candidate circles or candidate ellipses. The candidate circles or ellipses that have been successfully fitted are clustered at the center to obtain the positions of the inner and outer circles of each rivet nut in the riveted workpiece in the binary image. The step of performing center clustering on the successfully fitted candidate circles or candidate ellipses specifically involves: The midpoint of the two foci of the candidate ellipse is taken as the center of the candidate ellipse. The center of the candidate ellipse and the center of the candidate circle are traversed, and the distance between each pair of center points is calculated. The calculated distance value is compared with the threshold. Center points whose calculated distance value is less than the threshold are classified as candidate circles or candidate ellipses of the same rivet nut. The candidate circle or candidate ellipse with the largest size in each cluster is taken as the outer circle of the rivet nut. Based on the feature that the inner and outer circles of each rivet nut are concentric circles, and based on the distance between the centers of the two circles, the shortest distance between the two circles, and the radius range of the inner circle of the nut, the candidate circle or candidate ellipse corresponding to the inner circle of the rivet nut in each cluster center is selected. Based on the position in the binary image, the positions of the inner and outer circles of each rivet nut in the original image are obtained.
2. A method of positioning a riv-nut as in claim 1, characterized in that For the obtained binary To extract continuous edge segments, the following steps are taken: the EDPF parameterless edge drawing algorithm is used to detect all possible edge segments in the image, and the extracted edge segments are verified by the Helmholtz principle.
3. The rivet nut positioning method as described in claim 1, characterized in that, Also includes: Centroid verification is performed on the candidate circles or ellipses fitted with continuous edge segments to screen out the closed edge segments of the fan rings. The closed edge segments of the fan rings are regarded as fan ring arcs. If the fan ring arc is a superior arc, it is directly fitted into a candidate circle. If the fan ring arc is a inferior arc, it is regarded as an edge segment.
4. A riveting device, characterized in that, include: Riveting device, three-axis moving device and control device; The riveting device includes a rivet nut gun mounted on a fixed plate, a ring light source, and an industrial camera, the industrial camera being used to acquire the original image of the workpiece to be riveted; The riveting device is fixed to the execution end of the three-axis moving device, which is used to receive the movement command from the control device and drive the riveting device to move. The control device is configured to: receive the original image of the workpiece to be riveted captured by the industrial camera, execute a rivet nut positioning method as described in any one of claims 1-3, obtain the rivet nut positioning result, and send a movement command to the three-axis moving device according to the positioning result.
5. A method for operating a riveting device, characterized in that, include: Start the industrial camera to acquire the raw image of the riveted workpiece; The control device is activated to perform a positioning process on the original image of the riveted workpiece as described in any one of claims 1-3, to obtain the positioning result of the riveted nut in the riveted workpiece, and to send a movement command to the three-axis moving device according to the positioning result of the riveted nut. Start the three-axis moving device, and drive the riveting device to move according to the received moving command.
6. A rivet nut positioning system, characterized in that, include: Acquisition module: Acquires the original image of the workpiece to be riveted and performs binarization processing to obtain a binary image. Specifically: The original image of the workpiece to be riveted is scaled using bilinear interpolation to obtain a first image; a second image is created, where the pixel value of each point in the second image is the maximum pixel value within the set area where the corresponding pixel point is located in the first image; Divide the pixel value at the corresponding position in the second image by the pixel value in the first image, and obtain a binary image based on the division result and a set binarization threshold. The first fitting module extracts continuous edge segments from the obtained binary image, fits closed edge segments among the extracted continuous edge segments, and uses the successfully fitted segments as candidate circles or candidate ellipses. The second fitting module converts the remaining edge segments into line segments, combines the converted line segments into arcs, and then fits them. The successfully fitted ones are used as candidate circles or candidate ellipses. Clustering module: Performs center clustering on the successfully fitted candidate circles or candidate ellipses to obtain the positions of the inner and outer circles of each rivet nut in the binary image of the riveted workpiece; The step of performing center clustering on the successfully fitted candidate circles or candidate ellipses specifically involves: The midpoint of the two foci of the candidate ellipse is taken as the center of the candidate ellipse. The center of the candidate ellipse and the center of the candidate circle are traversed, and the distance between each pair of center points is calculated. The calculated distance value is compared with the threshold. Center points whose calculated distance value is less than the threshold are classified as candidate circles or candidate ellipses of the same rivet nut. The candidate circle or candidate ellipse with the largest size in each cluster is taken as the outer circle of the rivet nut. Based on the feature that the inner and outer circles of each rivet nut are concentric circles, and based on the distance between the centers of the two circles, the shortest distance between the two circles, and the radius range of the inner circle of the nut, the candidate circle or candidate ellipse corresponding to the inner circle of the rivet nut in each cluster center is selected. Positioning module: Based on the position in the binary image, obtain the position of the inner and outer circles of each rivet nut in the original image.
7. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that, when executed by a processor, performs a rivet nut positioning method as described in any one of claims 1 to 3.
Citation Information
Patent Citations
Locating algorithm for light spot center of track laser measuring device
CN114419140A
Automatic riveting method and system based on machine vision
CN117911339A
