Shaft hole assembly deviation calculation method and device, equipment and medium

CN121639602BActive Publication Date: 2026-09-11GEER TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202511731677.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-11-21
Publication Date
2026-09-11
Estimated Expiration
2045-11-21

AI Technical Summary

Technical Problem

然而,由于定位误差等的存在,当机械臂根据孔工件的定位结果控制轴工件与孔工件接触后,轴工件与孔工件无法完全对齐,这导致轴工件仍无法装配至孔工件

Benefits of technology

[0015] This application provides a method for calculating shaft-hole assembly deviation. The method includes: acquiring a first image containing the contact surfaces of the shaft workpiece and the hole workpiece when they are in contact; detecting pairs of arc lines in the first image; for any pair of arc lines, determining the first centroid position corresponding to the first centroid of the first arc line based on the first arc line in the pair, determining the second centroid position corresponding to the second arc line based on the second arc line in the pair, and calculating the deviation vector between the first centroid position and the second centroid position to obtain the centroid deviation vector between the first arc line and the second arc line. Based on this method, the deviation vector between the centroid of the shaft in the shaft workpiece and the centroid of the hole in the hole workpiece after they come into contact can be calculated. In other words, this application provides a method based on computer vision for calculating the deviation vector between the centroid of the shaft in the shaft workpiece and the centroid of the hole in the hole workpiece after they come into contact.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121639602B_ABST
    Figure CN121639602B_ABST
Patent Text Reader

Abstract

The application discloses a shaft hole assembly deviation calculation method and device, equipment and medium, and relates to the technical field of image processing. The method comprises the following steps: in the case that the shaft workpiece is in contact with the hole workpiece, a first image containing the contact surface of the shaft workpiece and the hole workpiece is acquired; a circular arc line pair in the first image is detected; for any circular arc line pair, the first centroid position of the first centroid corresponding to the first circular arc line is determined according to the first circular arc line in the circular arc line pair, the second centroid position corresponding to the second circular arc line is determined according to the second circular arc line in the circular arc line pair, the deviation vector between the first centroid position and the second centroid position is calculated, and the centroid deviation vector of the first circular arc line and the second circular arc line is obtained. Based on the method, the centroid deviation vector of the shaft in the shaft workpiece and the centroid of the hole in the hole workpiece after the shaft workpiece is in contact with the hole workpiece can be calculated.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of image processing technology, and more specifically, to a method, apparatus, device, and medium for calculating shaft hole assembly deviation. Background Technology

[0002] During the process of using a robotic arm to perform shaft-hole assembly, the robotic arm positions the workpiece to obtain the positioning result. However, due to positioning errors, after the robotic arm controls the shaft workpiece to contact the workpiece based on the positioning result of the workpiece, the shaft workpiece and the workpiece cannot be completely aligned, which results in the shaft workpiece still not being able to be assembled into the workpiece.

[0003] Therefore, based on the contact between the shaft workpiece and the hole workpiece, how to determine the deviation between the shaft workpiece and the hole workpiece so that the shaft workpiece can be assembled into the hole workpiece has become an urgent technical problem to be solved. Summary of the Invention

[0004] One objective of this application is to provide a new technical solution for calculating shaft-hole assembly deviations.

[0005] According to a first aspect of this application, a method for calculating shaft and hole assembly deviations is provided, comprising: When the shaft workpiece and the hole workpiece are in contact, a first image including the contact surface of the shaft workpiece and the hole workpiece is obtained; Detect pairs of arc lines in the first image; For any pair of arc lines, the first centroid position corresponding to the first centroid of the first arc line is determined based on the first arc line in the pair, and the second centroid position corresponding to the second arc line is determined based on the second arc line in the pair. The deviation vector between the first centroid position and the second centroid position is calculated to obtain the centroid deviation vector between the first arc line and the second arc line.

[0006] Optionally, before acquiring a first image containing the contact surface between the shaft workpiece and the hole workpiece when they are in contact, the method further includes: Obtain a second image of the workpiece containing the hole; Detect the edges that are closed contours in the second image to obtain at least one circular edge; For any of the circular edges, determine the position of the third centroid of the circular edge; The contact between the shaft workpiece and the hole workpiece is controlled according to the third centroid position.

[0007] Optionally, detecting edges that are closed contours in the second image to obtain at least one circular edge includes: Perform a first image preprocessing operation on the second image to obtain a processed second image. The first image preprocessing operation includes: grayscale processing, noise reduction processing, binarization processing, and circular hole display processing. Detect the edges that are closed contours in the processed second image to obtain at least one circular edge.

[0008] Optionally, detecting edges that are closed contours in the second image to obtain at least one circular edge includes: Detect the edges that are closed contours in the second image to obtain at least one closed contour edge; From the at least one closed contour edge, select closed contour edges with a roundness greater than a preset roundness to obtain at least one circular edge.

[0009] Optionally, detecting the pairs of arc lines in the first image includes: Perform a second image preprocessing operation on the first image to obtain a processed first image. The second image preprocessing operation includes: grayscale processing, noise reduction processing, binarization processing, and interference filtering processing. Extract the arc lines from the processed first image to obtain at least two arc lines; Two intersecting arcs among the at least two arcs are defined as an arc pair.

[0010] Optionally, the method further includes: Based on the centroid deviation vector corresponding to each of the arc lines, determine the first movement vector of the shaft workpiece when it is aligned with the hole workpiece. The shaft workpiece is controlled to move according to the first movement vector.

[0011] Optionally, controlling the shaft workpiece to move according to the first movement vector includes: The first movement vector is transformed into the robot arm coordinate system of the robot arm that holds the shaft workpiece to obtain the second movement vector; The robotic arm is controlled to move the shaft workpiece according to the second movement vector.

[0012] According to a second aspect of this application, a shaft hole assembly deviation calculation device is provided, comprising: The acquisition module is used to acquire a first image of the contact surface between the shaft workpiece and the hole workpiece when the shaft workpiece is in contact with the hole workpiece. The detection module is used to detect pairs of arc lines in the first image; The calculation module is used to, for any pair of arc lines, determine the first centroid position corresponding to the first centroid of the first arc line in the pair of arc lines, determine the second centroid position corresponding to the second arc line in the pair of arc lines, calculate the deviation vector between the first centroid position and the second centroid position, and obtain the centroid deviation vector between the first arc line and the second arc line.

[0013] According to a third aspect of this application, an electronic device is provided, the electronic device comprising the means as described in the second aspect; Alternatively, the electronic device includes a camera, a memory, and a processor, wherein the camera is used to acquire a first image including the contact surface of the shaft workpiece and the hole workpiece, the memory is used to store computer instructions, and the processor is used to retrieve the computer instructions from the memory to perform the method as described in any one of the first aspects; Alternatively, the electronic device includes a camera, a robotic arm, a memory, and a processor, wherein the robotic arm is used to control the shaft workpiece to contact the hole workpiece under the control of the processor, the camera is used to acquire a first image including the contact surface of the shaft workpiece and the hole workpiece, the memory is used to store computer instructions, and the processor is used to call the computer instructions from the memory to perform the method as described in any one of the first aspects.

[0014] According to a fourth aspect of this application, a computer-readable storage medium is provided having a computer program stored thereon, which, when executed by a processor, implements the method according to any one of the first aspects.

[0015] This application provides a method for calculating shaft-hole assembly deviation. The method includes: acquiring a first image containing the contact surfaces of the shaft workpiece and the hole workpiece when they are in contact; detecting pairs of arc lines in the first image; for any pair of arc lines, determining the first centroid position corresponding to the first centroid of the first arc line based on the first arc line in the pair, determining the second centroid position corresponding to the second arc line based on the second arc line in the pair, and calculating the deviation vector between the first centroid position and the second centroid position to obtain the centroid deviation vector between the first arc line and the second arc line. Based on this method, the deviation vector between the centroid of the shaft in the shaft workpiece and the centroid of the hole in the hole workpiece after they come into contact can be calculated. In other words, this application provides a method based on computer vision for calculating the deviation vector between the centroid of the shaft in the shaft workpiece and the centroid of the hole in the hole workpiece after they come into contact.

[0016] Other features and advantages of this application will become clear from the following detailed description of exemplary embodiments with reference to the accompanying drawings. Attached Figure Description

[0017] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments of the present application and, together with their description, serve to explain the principles of the present application.

[0018] Figure 1 This is a flowchart illustrating a method for calculating shaft and hole assembly deviations provided in this application; Figure 2 This is a schematic diagram of a first image provided in this application, showing that the shaft on the shaft workpiece and the corresponding hole on the hole workpiece are not aligned when the shaft workpiece and the hole workpiece are in contact. Figure 3 This is a schematic diagram of a grayscale image corresponding to a first image provided in this application; Figure 4 This is a schematic diagram of a binarized image corresponding to a first image provided in this application; Figure 5 This is a schematic diagram of a processed first image corresponding to a first image provided in this application; Figure 6 This is a schematic diagram of a second image of a workpiece containing a hole, provided in this application; Figure 7 This is a schematic diagram of a grayscale image corresponding to a second image provided in this application; Figure 8 This is a schematic diagram of a second image corresponding to a binarized image provided in this application; Figure 9 This is a schematic diagram of a second image corresponding to a circular hole image provided in this application; Figure 10 This is a schematic diagram of at least one circular edge included in a processed second image provided in this application; Figure 11 This is a schematic diagram of the structure of a shaft hole assembly deviation calculation device provided in this application; Figure 12 This is a schematic diagram of the structure of an electronic device provided in this application. Figure 1 ; Figure 13 This is a schematic diagram of the structure of an electronic device provided in this application. Figure 2 . Detailed Implementation

[0019] Various exemplary embodiments of the present application will now be described in detail with reference to the accompanying drawings. It should be noted that, unless otherwise specifically stated, the relative arrangement, numerical expressions, and values ​​of the components and steps set forth in these embodiments do not limit the scope of the present application.

[0020] The following description of at least one exemplary embodiment is merely illustrative and is in no way intended to limit the scope of this application and its application or use.

[0021] Techniques, methods, and equipment known to those skilled in the art may not be discussed in detail, but where appropriate, such techniques, methods, and equipment should be considered part of the specification.

[0022] In all the examples shown and discussed herein, any specific values ​​should be interpreted as merely exemplary and not as limitations. Therefore, other examples of exemplary embodiments may have different values.

[0023] It should be noted that similar labels and letters in the following figures indicate similar items; therefore, once an item is defined in one figure, it does not need to be discussed further in subsequent figures.

[0024] This application provides a method for calculating shaft-hole assembly deviation. This method can use computer vision to calculate the deviation vector between the centroid of the shaft in the shaft workpiece and the centroid of the corresponding hole in the hole workpiece after the shaft workpiece and the hole workpiece come into contact, so as to provide a basis for subsequent assembly or assembly quality assessment.

[0025] It should be noted that this application stipulates that the number of shafts in the shaft workpiece is the same as the number of holes in the hole workpiece, and does not limit the number of shafts in the shaft workpiece or the number of holes in the hole workpiece.

[0026] like Figure 1 As shown, the shaft hole assembly deviation calculation method provided in this application includes the following steps S1100 to S1300.

[0027] Step S1100: When the shaft workpiece is in contact with the hole workpiece, a first image containing the contact surface of the shaft workpiece and the hole workpiece is obtained.

[0028] In this embodiment, traditional assembly methods can be used to control the assembly of the shaft workpiece and the hole workpiece. However, due to various errors, issues such as… Figure 2 As shown, when the shaft workpiece and the hole workpiece are in contact, the shaft on the shaft workpiece and the corresponding hole on the hole workpiece are not aligned. That is, the shaft in the shaft workpiece and the corresponding hole in the hole workpiece do not completely overlap. In this case, the shaft workpiece cannot be assembled with the hole workpiece. Based on this, a first image containing the contact surface of the shaft workpiece and the hole workpiece is acquired by a camera. And through the following steps S1200 and S1300, image analysis of the first image is performed to determine the deviation vector between the centroid of the shaft in the shaft workpiece and the centroid of the corresponding hole in the hole workpiece after the shaft workpiece and the hole workpiece are in contact.

[0029] Understandably, the first image can reflect the deviation vector between the shaft workpiece and the hole workpiece.

[0030] Step S1200: Detect the pairs of arc lines in the first image.

[0031] When the shaft workpiece and the hole workpiece are not aligned, the shaft in the shaft workpiece and the corresponding hole in the hole workpiece do not completely overlap. Since the edges of the shaft in the shaft workpiece and the holes in the hole workpiece are both arc-shaped, the aforementioned misaligned portions form a pair of crescent-shaped arc lines. This pair of arc lines includes the arc line corresponding to the shaft edge and the arc line corresponding to the hole edge. It can be understood that this pair of arc lines can reflect the deviation vector between the shaft in the shaft workpiece and the corresponding hole in the hole workpiece. Therefore, after obtaining the first image, the pair of arc lines in the first image is detected.

[0032] In one embodiment of this application, arc pairs in the first image can be detected using deep learning.

[0033] In another embodiment of this application, step S1200 can be implemented by the following steps S1210 to S1212.

[0034] Step S1210: Perform a second image preprocessing operation on the first image to obtain the processed first image.

[0035] The second image preprocessing operation includes: grayscale processing, noise reduction, binarization, and interference removal.

[0036] by Figure 2 Taking step S1210 as an example, specifically, after performing grayscale processing on the first image, the following is obtained: Figure 3 The grayscale image shown highlights the shaft and hole workpieces in the first image; the grayscale image is denoised to remove noise, resulting in a denoised image; the denoised image is then binarized according to a first preset grayscale threshold, resulting in... Figure 4 The binarized image shown facilitates subsequent arc extraction, wherein the first preset grayscale threshold is set empirically; interference removal processing is performed on the binarized image to obtain the image shown below. Figure 5 The first image shown is the one after processing to remove interference information.

[0037] Noise removal in grayscale images can be achieved using a Gaussian filter. In one example, the Gaussian kernel in the Gaussian filter is set to a width and height of 5 pixels each, with a standard deviation of 0 in the X direction. Furthermore, the first preset grayscale threshold can be set empirically.

[0038] The processed first image obtained through step S1210 facilitates the extraction of the arc in step S1211 below.

[0039] Step S1211: Extract arc lines from the processed first image to obtain at least two arc lines.

[0040] In one embodiment of this application, the processed first image is input to the Hough transform algorithm, and the Hough transform algorithm outputs at least two arcs in the first image.

[0041] The Hough transform is a method that "votes" pixels in the image space into a parameter space, and then searches for peaks of geometric shapes (lines, circles, ellipses, polygons, etc.) in the parameter space. It transforms discrete edge points, which are difficult to aggregate directly in the pixel domain, into a clustering problem in the parameter domain, making it particularly suitable for detecting regular geometric contours in noisy or incomplete environments. In Hough transform-based Hough arc detection, Canny edge detection is first used to obtain the edges, and then the plane equation of the circle is used... "Vote" for each edge to all possible A counter is established in the discretized parameter space. All edge points increment the count of the corresponding cell according to their possible parameter combinations. When the number of "votes" for a certain parameter cell exceeds the threshold, it is considered that an arc has appeared.

[0042] It should be noted that when the shaft workpiece is a single-shaft workpiece and the hole workpiece is a single-hole workpiece, if the shaft workpiece and the hole workpiece are not aligned after contact, there will be two arc lines in the processed first image. One arc line corresponds to the edge of the shaft workpiece, and the other arc line corresponds to the edge of the hole workpiece. When there are two or more shaft workpieces and two or more hole workpieces, there will be more than two arc lines in the processed first image.

[0043] Step S1212: Determine two intersecting arcs from at least two arcs as an arc pair.

[0044] In this embodiment, when the shaft workpiece and the hole workpiece are not aligned after contact, the non-overlapping portions of any shaft on the shaft workpiece and the corresponding hole in the hole workpiece form a crescent-shaped arc pair. Therefore, two intersecting arcs among at least two arcs are defined as an arc pair.

[0045] Step S1300: For any pair of arc lines, determine the first centroid position corresponding to the first centroid of the first arc line based on the first arc line in the pair of arc lines, determine the second centroid position corresponding to the second arc line based on the second arc line in the pair of arc lines, calculate the deviation vector between the first centroid position and the second centroid position, and obtain the centroid deviation vector between the first arc line and the second arc line.

[0046] It is understandable that after obtaining the arc pair, the arc with the smaller curvature in the arc pair corresponds to the arc edge of the hole. The arc with the larger curvature in the arc pair corresponds to the arc edge of the shaft. Based on this, the arc corresponding to the hole edge in the arc pair is designated as the first arc, and the arc corresponding to the shaft edge in the arc pair is designated as the second arc. Alternatively, the arc corresponding to the hole edge in the arc pair is designated as the second arc, and the arc corresponding to the shaft edge in the arc pair is designated as the first arc.

[0047] For any pair of arcs, calculate the position of the first centroid of the first arc, and denote it as the first centroid position. Simultaneously calculate the position of the second centroid of the second arc, and denote it as the second centroid position. The deviation vector between the first and second centroid positions is denoted as the centroid deviation vector. This centroid deviation vector includes the distance between the first and second centroid positions, as well as their relative directions. Thus, the deviation vector between the centroid of the shaft in the shaft workpiece and the centroid of the hole in the hole workpiece after contact can be calculated. This deviation vector reflects the deviation between the shaft workpiece and the hole workpiece after contact.

[0048] Through steps S1100 to S1300 described above, the deviation vector between the centroid of the shaft workpiece and the centroid of the hole in the shaft workpiece after contact can be calculated by image analysis of a first image containing the contact surface of the shaft workpiece and the hole workpiece. In other words, this application provides a method based on computer vision for calculating the deviation vector between the centroid of the shaft workpiece and the centroid of the hole in the shaft workpiece after contact.

[0049] This application provides a method for calculating shaft-hole assembly deviation. The method includes: acquiring a first image containing the contact surfaces of the shaft workpiece and the hole workpiece when they are in contact; detecting pairs of arc lines in the first image; for any pair of arc lines, determining the first centroid position corresponding to the first centroid of the first arc line based on the first arc line in the pair, determining the second centroid position corresponding to the second arc line based on the second arc line in the pair, and calculating the deviation vector between the first centroid position and the second centroid position to obtain the centroid deviation vector between the first arc line and the second arc line. Based on this method, the deviation vector between the centroid of the shaft in the shaft workpiece and the centroid of the hole in the hole workpiece after they come into contact can be calculated. In other words, this application provides a method based on computer vision for calculating the deviation vector between the centroid of the shaft in the shaft workpiece and the centroid of the hole in the hole workpiece after they come into contact.

[0050] In one embodiment of this application, the shaft hole assembly deviation calculation method provided in this application further includes the following steps S1400 and S1500 after the above step S1300.

[0051] Step S1400: Based on the centroid deviation vector corresponding to each of the arc lines, determine the first movement vector of the shaft workpiece when it is aligned with the hole workpiece.

[0052] Step S1500: Control the shaft workpiece to move according to the first movement vector.

[0053] In this embodiment, the deviation vector between the shaft workpiece and the hole workpiece can be determined based on the centroid deviation vector corresponding to each arc pair. Furthermore, the deviation vector between the shaft workpiece and the hole workpiece is determined as the first movement vector of the shaft workpiece. Based on this, after the shaft workpiece moves according to the first movement vector, the shaft of the shaft workpiece is aligned with the hole of the hole workpiece, so that the shaft of the shaft workpiece can be assembled into the hole of the hole workpiece.

[0054] In one embodiment of this application, step S1500 is specifically implemented through the following steps S1510 and S1511.

[0055] Step S1510: The first translation vector is converted to the robot arm coordinate system of the robot arm that holds the workpiece shaft to obtain the second translation vector.

[0056] In this embodiment, since the shaft workpiece is held by a robotic arm, and the robotic arm controls the assembly of the shaft workpiece and the hole workpiece, the first movement vector is not aligned with the robotic arm's coordinate system after it is obtained. Therefore, step S1510 needs to be executed.

[0057] Specifically, the first movement vector can be converted to obtain the second movement vector based on the camera's intrinsic parameters and the extrinsic parameters between the camera and the robotic arm.

[0058] Step S1511: Control the robotic arm to move the shaft workpiece according to the second movement vector.

[0059] After the above step S1510, the first movement vector is converted into the second movement vector in the coordinate system of the robotic arm that holds the shaft workpiece. The robotic arm moves according to the second movement vector, which makes the shaft of the shaft workpiece aligned with the hole of the hole workpiece, so that the shaft of the shaft workpiece can be assembled into the hole of the hole workpiece.

[0060] In one embodiment of this application, the shaft-hole assembly deviation calculation method provided in this application further includes, before the above-mentioned step S1100, the steps S1110 to S1113 shown below, the steps of controlling the contact between the shaft workpiece and the hole workpiece.

[0061] Step S1110: Obtain a second image of the workpiece containing the hole.

[0062] In this embodiment, an image of the workpiece with the hole to be assembled can be acquired using a camera to obtain a second image containing the workpiece with the hole. In one example, the second image is as follows: Figure 6 As shown.

[0063] Step S1111: Detect the edges of closed contours in the second image to obtain at least one circular edge.

[0064] In one embodiment of this application, edges in the second image are detected using, for example, the Canny edge detection algorithm, to obtain at least one edge. Furthermore, since the edge of the hole in the workpiece is a closed contour, the closed contour of the aforementioned detected at least one edge is determined to be at least one circular edge, and the hole in the workpiece can be determined based on this circular edge.

[0065] In one embodiment of this application, in order to accurately obtain at least one circular edge, the above step S1111 is specifically implemented through the following steps S1111-1 and S1111-2.

[0066] Step S1111-1: Detect the edges of closed contours in the second image to obtain at least one closed contour edge.

[0067] Step S1111-2: Select closed contour edges with a roundness greater than or equal to a preset roundness from at least one closed contour edge to obtain at least one circular edge.

[0068] The preset roundness is the minimum roundness of a circle. The roundness of the closed contour edge can be calculated using the roundness calculation formula.

[0069] If the roundness of the closed contour edge is greater than or equal to the preset roundness, then the closed contour edge can be determined as a circular edge, denoted as a circular edge.

[0070] By using the above steps S1111-1 and S1111-2, the circular edge can be accurately extracted.

[0071] Step S1112: For any circular edge, determine the position of the third centroid of the circular edge.

[0072] For any circular edge, calculate the position of its centroid, and denot it as the third centroid position. This third centroid position reflects the position of the hole in the workpiece.

[0073] Step S113: Control the contact between the shaft workpiece and the hole workpiece according to the third centroid position.

[0074] Based on the third centroid position, the position of the hole in the workpiece can be determined, thus achieving the positioning of the hole in the workpiece. At this time, the control shaft workpiece and the workpiece in the hole are in contact.

[0075] When the shaft workpiece is held by the robotic arm and the robotic arm controls the assembly of the shaft workpiece and the hole workpiece, it is necessary to convert the third centroid position into the centroid position in the robotic arm coordinate system. Further, the robotic arm is controlled to move the shaft workpiece according to the converted centroid position in the robotic arm coordinate system until the shaft workpiece contacts the hole workpiece.

[0076] In one embodiment of this application, in order to accurately obtain at least one circular edge, the above step S1111 is specifically implemented through the following steps S1111-3 and S1111-4.

[0077] Step S1111-3: Perform the first image preprocessing operation on the second image to obtain the processed second image.

[0078] The first image preprocessing operation includes: grayscale processing, noise reduction processing, binarization processing, and circular hole display processing.

[0079] It should be noted that the grayscale processing, denoising processing, and binarization processing in the first image preprocessing operation are described in the same way as the related processing in the second image preprocessing operation, and will not be repeated here.

[0080] The above-mentioned circular hole display processing can be achieved by contour level filling. The circular hole display processing is used to highlight the circular holes in the image, which facilitates the detection of the edges of the closed contour in the following steps S1111-4.

[0081] Step S1111-4: Detect the edges of closed contours in the processed second image to obtain at least one circular edge.

[0082] In this embodiment, edge detection of closed contours is performed on the processed second image, which can accurately detect at least one circular edge.

[0083] And, with Figure 6 For example, the grayscale image obtained after performing grayscale processing on the second image is as follows: Figure 7 As shown, for Figure 7 The grayscale image shown is denoised and binarized to obtain the binarized image as follows: Figure 8 As shown, for Figure 8 The circular hole image obtained by performing circular hole display processing on the binarized image shown is as follows: Figure 9 As shown. For Figure 9 The edges of the closed contour in the circular hole image shown are detected, and at least one circular edge is obtained as follows: Figure 10 As shown.

[0084] This application also provides a shaft hole assembly deviation calculation device 110, such as Figure 11 As shown, it includes: The acquisition module 111 is used to acquire a first image of the contact surface between the shaft workpiece and the hole workpiece when the shaft workpiece is in contact with the hole workpiece. Detection module 112 is used to detect pairs of arc lines in the first image; The calculation module 113 is used to, for any pair of arc lines, determine the first centroid position corresponding to the first centroid of the first arc line based on the first arc line in the pair of arc lines, determine the second centroid position corresponding to the second arc line based on the second arc line in the pair of arc lines, calculate the deviation vector between the first centroid position and the second centroid position, and obtain the centroid deviation vector between the first arc line and the second arc line.

[0085] In one embodiment of this application, the shaft-hole assembly deviation calculation device 110 provided in this application further includes: A contact module is used to acquire a second image of the workpiece containing the hole. Detect the edges that are closed contours in the second image to obtain at least one circular edge; For any of the circular edges, determine the position of the third centroid of the circular edge; The contact between the shaft workpiece and the hole workpiece is controlled according to the third centroid position.

[0086] In one embodiment of this application, the contact module is specifically used to: perform a first image preprocessing operation on the second image to obtain a processed second image, wherein the first image preprocessing operation includes: grayscale processing, noise reduction processing, binarization processing, and circular hole display processing; Detect the edges that are closed contours in the processed second image to obtain at least one circular edge.

[0087] In one embodiment of this application, the contact module is specifically used to: detect edges that are closed contours in the second image to obtain at least one closed contour edge; From the at least one closed contour edge, select closed contour edges with a roundness greater than a preset roundness to obtain at least one circular edge.

[0088] In one embodiment of this application, the detection module 112 is specifically used to perform a second image preprocessing operation on the first image to obtain a processed first image. The second image preprocessing operation includes: grayscale processing, noise reduction processing, binarization processing, and interference filtering processing. Extract the arc lines from the processed first image to obtain at least two arc lines; Two intersecting arcs among the at least two arcs are defined as an arc pair.

[0089] In one embodiment of this application, the shaft-hole assembly deviation calculation device 110 provided in this application further includes: The control module is used to determine, based on the centroid deviation vector corresponding to each arc pair, a first movement vector for the shaft workpiece to move to the point where the shaft workpiece is aligned with the hole workpiece. The shaft workpiece is controlled to move according to the first movement vector.

[0090] In one embodiment of this application, the control module is specifically used to: convert the first movement vector to the robot arm coordinate system of the robot arm that clamps the shaft workpiece to obtain a second movement vector; The robotic arm is controlled to move the shaft workpiece according to the second movement vector.

[0091] This application also provides an electronic device, which includes any of the shaft hole assembly deviation calculation devices 110 provided in the above-described device embodiments.

[0092] This application also provides another electronic device 120, such as Figure 12 As shown, the electronic device 120 includes a camera 121, a memory 122, and a processor 123. The camera 121 is used to acquire a first image containing the contact surface of the shaft workpiece and the hole workpiece. The memory 122 is used to store computer instructions. The processor 123 is used to retrieve the computer instructions from the memory 122 to execute the method as described in any of the above method embodiments.

[0093] This application also provides yet another electronic device 120, such as Figure 13 As shown, the electronic device 120 includes a camera 121, a robotic arm 124, a memory 122, and a processor 123. The robotic arm 124 is used to control the shaft workpiece to contact the hole workpiece under the control of the processor 123. The camera 121 is used to acquire a first image containing the contact surface of the shaft workpiece and the hole workpiece. The memory 122 is used to store computer instructions. The processor 123 is used to retrieve the computer instructions from the memory 122 to execute the method as described in any of the above method embodiments.

[0094] This application also provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the method according to any one of the above-described method embodiments.

[0095] This application may be a system, method, and / or computer program product. A computer program product may include a computer-readable storage medium having computer-readable program instructions loaded thereon for causing a processor to implement various aspects of this application.

[0096] Computer-readable storage media can be tangible devices capable of holding and storing instructions for use by an instruction execution device. Computer-readable storage media can be, for example—but not limited to—electrical storage devices, magnetic storage devices, optical storage devices, electromagnetic storage devices, semiconductor storage devices, or any suitable combination of the foregoing. More specific examples (a non-exhaustive list) of computer-readable storage media include: portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), static random access memory (SRAM), portable compact disc read-only memory (CD-ROM), digital multifunction disc (DVD), memory sticks, floppy disks, mechanical encoding devices, such as punch cards or recessed protrusions storing instructions thereon, and any suitable combination of the foregoing. The computer-readable storage media used herein are not to be construed as transient signals themselves, such as radio waves or other freely propagating electromagnetic waves, electromagnetic waves propagating through waveguides or other transmission media (e.g., light pulses through fiber optic cables), or electrical signals transmitted through wires.

[0097] The computer-readable program instructions described herein can be downloaded from computer-readable storage media to various computing / processing devices, or downloaded via a network, such as the Internet, local area network, wide area network, and / or wireless network, to an external computer or external storage device. The network may include copper transmission cables, fiber optic transmission, wireless transmission, routers, firewalls, switches, gateway computers, and / or edge servers. A network adapter card or network interface in each computing / processing device receives the computer-readable program instructions from the network and forwards them to the computer-readable storage media in the respective computing / processing device.

[0098] The computer program instructions used to perform the operations of this application may be assembly instructions, instruction set architecture (ISA) instructions, machine instructions, machine-dependent instructions, microcode, firmware instructions, status setting data, or source code or object code written in any combination of one or more programming languages, including object-oriented programming languages ​​such as Smalltalk, C++, etc., and conventional procedural programming languages ​​such as the "C" language or similar programming languages. The computer-readable program instructions may be executed entirely on the user's computer, partially on the user's computer, as a standalone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving a remote computer, the remote computer may be connected to the user's computer via any type of network—including a local area network (LAN) or a wide area network (WAN)—or may be connected to an external computer (e.g., via the Internet using an Internet service provider). In some embodiments, electronic circuits, such as programmable logic circuits, field-programmable gate arrays (FPGAs), or programmable logic arrays (PLAs), are personalized by utilizing the status information of the computer-readable program instructions. These electronic circuits can execute the computer-readable program instructions to implement various aspects of this application.

[0099] Various aspects of this application are described herein with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of this application. It should be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer-readable program instructions.

[0100] These computer-readable program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing apparatus to produce a machine such that, when executed by the processor of the computer or other programmable data processing apparatus, they create means for implementing the functions / actions specified in one or more blocks of the flowchart and / or block diagram. These computer-readable program instructions can also be stored in a computer-readable storage medium that causes a computer, programmable data processing apparatus, and / or other device to operate in a particular manner; thus, the computer-readable medium storing the instructions comprises an article of manufacture that includes instructions for implementing aspects of the functions / actions specified in one or more blocks of the flowchart and / or block diagram.

[0101] Computer-readable program instructions may also be loaded onto a computer, other programmable data processing apparatus, or other device to cause a series of operational steps to be performed on the computer, other programmable data processing apparatus, or other device to produce a computer-implemented process, thereby causing the instructions executed on the computer, other programmable data processing apparatus, or other device to perform the functions / actions specified in one or more boxes of a flowchart and / or block diagram.

[0102] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of this application. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of an instruction containing one or more executable instructions for implementing a specified logical function. In some alternative implementations, the functions marked in the blocks may occur in a different order than those marked in the drawings. For example, two consecutive blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in the block diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts, can be implemented using a dedicated hardware-based system that performs the specified function or action, or using a combination of dedicated hardware and computer instructions. It will be well known to those skilled in the art that implementation in hardware, implementation in software, and implementation using a combination of software and hardware are equivalent.

[0103] The various embodiments of this application have been described above. These descriptions are exemplary and not exhaustive, nor are they limited to the disclosed embodiments. Many modifications and variations will be apparent to those skilled in the art without departing from the scope and spirit of the described embodiments. The terminology used herein is chosen to best explain the principles, practical applications, or technical improvements to the technology in the market, or to enable others skilled in the art to understand the embodiments disclosed herein. The scope of this application is defined by the appended claims.

Claims

1. A method for calculating shaft-hole assembly deviation, characterized in that, include: When the shaft workpiece and the hole workpiece are in contact, a first image including the contact surface of the shaft workpiece and the hole workpiece is obtained; Detecting the arc line pairs in the first image, when the shaft workpiece and the hole workpiece are not aligned, the shaft in the shaft workpiece and the corresponding hole in the hole workpiece do not completely overlap, and the non-overlapping part forms the arc line pair, the arc line pair includes the arc line corresponding to the edge of the shaft and the arc line corresponding to the edge of the hole; For any pair of arc lines, the first centroid position corresponding to the first centroid of the first arc line is determined based on the first arc line in the pair, and the second centroid position corresponding to the second arc line is determined based on the second arc line in the pair. The deviation vector between the first centroid position and the second centroid position is calculated to obtain the centroid deviation vector between the first arc line and the second arc line.

2. The method according to claim 1, characterized in that, Before acquiring a first image containing the contact surface between the shaft workpiece and the hole workpiece when they are in contact, the method further includes: Obtain a second image of the workpiece containing the hole; Detect the edges that are closed contours in the second image to obtain at least one circular edge; For any of the circular edges, determine the position of the third centroid of the circular edge; The contact between the shaft workpiece and the hole workpiece is controlled according to the third centroid position.

3. The method according to claim 2, characterized in that, The step of detecting edges that are closed contours in the second image to obtain at least one circular edge includes: Perform a first image preprocessing operation on the second image to obtain a processed second image. The first image preprocessing operation includes: grayscale processing, noise reduction processing, binarization processing, and circular hole display processing. Detect the edges that are closed contours in the processed second image to obtain at least one circular edge.

4. The method according to claim 2, characterized in that, The step of detecting edges that are closed contours in the second image to obtain at least one circular edge includes: Detect the edges that are closed contours in the second image to obtain at least one closed contour edge; From the at least one closed contour edge, select closed contour edges with a roundness greater than a preset roundness to obtain at least one circular edge.

5. The method according to claim 1, characterized in that, The detection of arc line pairs in the first image includes: Perform a second image preprocessing operation on the first image to obtain a processed first image. The second image preprocessing operation includes: grayscale processing, noise reduction processing, binarization processing, and interference filtering processing. Extract the arc lines from the processed first image to obtain at least two arc lines; Two intersecting arcs among the at least two arcs are defined as an arc pair.

6. The method according to claim 1, characterized in that, The method further includes: Based on the centroid deviation vector corresponding to each of the arc lines, determine the first movement vector of the shaft workpiece when it is aligned with the hole workpiece. The shaft workpiece is controlled to move according to the first movement vector.

7. The method according to claim 6, characterized in that, The control of the shaft workpiece to move according to the first movement vector includes: The first movement vector is transformed into the robot arm coordinate system of the robot arm that holds the shaft workpiece to obtain the second movement vector; The robotic arm is controlled to move the shaft workpiece according to the second movement vector.

8. A device for calculating shaft-hole assembly deviation, characterized in that, include: The acquisition module is used to acquire a first image of the contact surface between the shaft workpiece and the hole workpiece when the shaft workpiece is in contact with the hole workpiece. The detection module is used to detect the arc line pairs in the first image. When the shaft workpiece and the hole workpiece are not aligned, the shaft in the shaft workpiece and the corresponding hole in the hole workpiece do not completely overlap. The non-overlapping part forms the arc line pair. The arc line pair includes the arc line corresponding to the edge of the shaft and the arc line corresponding to the edge of the hole. The calculation module is used to, for any pair of arc lines, determine the first centroid position corresponding to the first centroid of the first arc line in the pair of arc lines, determine the second centroid position corresponding to the second arc line in the pair of arc lines, calculate the deviation vector between the first centroid position and the second centroid position, and obtain the centroid deviation vector between the first arc line and the second arc line.

9. An electronic device, characterized in that, The electronic device includes the apparatus as described in claim 8; Alternatively, the electronic device includes a camera, a memory, and a processor, wherein the camera is used to acquire a first image containing the contact surface of the shaft workpiece and the hole workpiece, the memory is used to store computer instructions, and the processor is used to retrieve the computer instructions from the memory to perform the method as described in any one of claims 1-7; Alternatively, the electronic device includes a camera, a robotic arm, a memory, and a processor, wherein the robotic arm is used to control the shaft workpiece to contact the hole workpiece under the control of the processor, the camera is used to acquire a first image including the contact surface of the shaft workpiece and the hole workpiece, the memory is used to store computer instructions, and the processor is used to call the computer instructions from the memory to perform the method as described in any one of claims 1-7.

10. A computer-readable storage medium, characterized in that, It stores a computer program that, when executed by a processor, implements the method according to any one of claims 1-7.

Citation Information

Patent Citations

  • Mounting structure, rotating machine and air conditioning device

    CN109505806A

  • Centering method for stepped shaft and hole assembling process

    CN111322967A