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

By using computer vision technology to detect shaft and hole assembly deviations, acquiring images and calculating the centroid deviation vector, the problem of misaligned shaft and holes is solved, and precise alignment and assembly of shaft and holes are achieved.

CN121639602APending Publication Date: 2026-03-10GEER TECH CO LTD

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-11-21
Publication Date
2026-03-10

AI Technical Summary

Technical Problem

When the robotic arm performs the shaft and hole assembly task, the positioning error causes the shaft workpiece and the hole workpiece to be unable to be fully aligned, resulting in unsuccessful assembly.

Method used

Using computer vision methods, images of the contact surfaces of the shaft workpiece and the hole workpiece are acquired, arc pairs are detected, the centroid position is calculated, and the centroid deviation vector is calculated. The movement vector of the shaft workpiece is then adjusted to achieve alignment.

Benefits of technology

It enables accurate calculation of the centroid deviation after the shaft workpiece and the hole workpiece come into contact, ensuring that the shaft workpiece and the hole workpiece are aligned and successfully completing the assembly.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121639602A_ABST
    Figure CN121639602A_ABST
Patent Text Reader

Abstract

The invention discloses a shaft hole assembly deviation calculation method and device, equipment and a medium, and relates to the technical field of image processing. The method comprises the following steps: acquiring a first image containing a contact surface of a shaft workpiece and a hole workpiece under the condition that the shaft workpiece is in contact with the hole workpiece; detecting an arc line pair in the first image; for any arc line pair, determining a first centroid position of a first arc line corresponding to the first centroid according to a first arc line in the arc line pair, determining a second centroid position corresponding to a second arc line according to a second arc line in the arc line pair, and calculating a deviation vector between the first centroid position and the second centroid position, and obtaining a centroid deviation vector of the first arc line and the second arc line. Based on the method, the deviation vector between the mass center of a shaft in the shaft workpiece and the mass center of a 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] The present application relates to the technical field of image processing, and more particularly, to a shaft-hole assembly deviation calculation method, device, equipment and medium. BACKGROUND

[0002] In the process of performing a shaft-hole assembly task using a mechanical arm, the mechanical arm will position a hole workpiece to obtain a positioning result of the hole workpiece. However, due to the existence of positioning errors and the like, when the mechanical arm controls a shaft workpiece to contact the hole workpiece according to the positioning result of the hole workpiece, the shaft workpiece and the hole workpiece cannot be completely aligned, which leads to the fact that the shaft workpiece cannot be assembled to the hole workpiece.

[0003] Based on this, how to determine the deviation between the shaft workpiece and the hole workpiece on the basis of the shaft workpiece contacting the hole workpiece so as to assemble the shaft workpiece to the hole workpiece becomes a technical problem to be solved urgently. SUMMARY

[0004] An object of the present application is to provide a new technical solution for shaft-hole assembly deviation calculation.

[0005] According to a first aspect of the present application, a shaft-hole assembly deviation calculation method is provided, comprising: acquiring a first image containing a contact surface of the shaft workpiece and the hole workpiece in the case that the shaft workpiece contacts the hole workpiece; detecting a circular arc line pair in the first image; for any circular arc line pair, determining a first centroid position of a first centroid corresponding to the first circular arc line according to the first circular arc line in the circular arc line pair, determining a second centroid position of a second circular arc line according to the second circular arc line in the circular arc line pair, and calculating a deviation vector between the first centroid position and the second centroid position to obtain a centroid deviation vector of the first circular arc line and the second circular arc line.

[0006] Optionally, before the acquiring a first image containing a contact surface of the shaft workpiece and the hole workpiece in the case that the shaft workpiece contacts the hole workpiece, the method further comprises: acquiring a second image containing the hole workpiece; detecting an edge that is a closed contour in the second image to obtain at least one circular edge; for any circular edge, determining a third centroid position of the circular edge; controlling the shaft workpiece to contact the hole workpiece according to the third centroid position.

[0007] Optionally, the detecting an edge that is a closed contour in the second image to obtain at least one circular edge comprises: performing a first image preprocessing operation on the second image to obtain a processed second image, the first image preprocessing operation comprising: grayscale processing, denoising processing, binarization processing and circle hole display processing; detecting edges that are closed contours in the processed second image to obtain at least one circular edge.

[0008] Optionally, the detecting edges that are closed contours in the second image to obtain at least one circular edge comprises: detecting edges that are closed contours in the second image to obtain at least one closed contour edge; selecting a closed contour edge with a circularity greater than a preset circularity from the at least one closed contour edge to obtain at least one circular edge.

[0009] Optionally, the detecting circular arc line pairs in the first image comprises: performing a second image preprocessing operation on the first image to obtain a processed first image, the second image preprocessing operation comprising: grayscale processing, denoising processing, binarization processing and interference filtering processing; extracting circular arc lines from the processed first image to obtain at least two circular arc lines; determining two circular arc lines that intersect in the at least two circular arc lines as a circular arc line pair.

[0010] Optionally, the method further comprises: determining, according to a centroid deviation vector corresponding to each circular arc line pair, a first movement vector of the shaft workpiece moving to a state in which the shaft workpiece is aligned with the hole workpiece; controlling the shaft workpiece to move according to the first movement vector.

[0011] Optionally, the controlling the shaft workpiece to move according to the first movement vector comprises: converting the first movement vector to a second movement vector in a mechanical arm coordinate system of a mechanical arm that clamps the shaft workpiece; controlling the mechanical arm to move the shaft workpiece according to the second movement vector.

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

[0013] According to a third aspect of the present application, an electronic device is provided, which comprises the apparatus according to the second aspect; Alternatively, the electronic device comprises a camera configured to capture a first image containing a contact surface between the shaft workpiece and the hole workpiece, a memory configured to store computer instructions, and a processor configured to invoke the computer instructions from the memory to perform the method according to any one of the first aspect. Alternatively, the electronic device comprises a camera configured to capture a first image containing a contact surface between the shaft workpiece and the hole workpiece, a memory configured to store computer instructions, and a processor configured to invoke the computer instructions from the memory to perform the method according to any one of the first aspect.

[0014] According to a fourth aspect of the present application, a computer readable storage medium is provided, which stores a computer program, the computer program being configured to implement the method according to any one of the first aspect when executed by a processor.

[0015] The present application provides a shaft-hole assembly deviation calculation method, which comprises: acquiring a first image containing a contact surface between a shaft workpiece and a hole workpiece when the shaft workpiece and the hole workpiece are in contact; detecting a pair of circular arc lines in the first image; for any pair of the circular arc lines, determining a first centroid position of a first centroid corresponding to a first circular arc line in the pair of the circular arc lines, determining a second centroid position of a second centroid corresponding to a second circular arc line in the pair of the circular arc lines, calculating a deviation vector between the first centroid position and the second centroid position to obtain a centroid deviation vector of the first circular arc line and the second circular arc line. 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 and the hole workpiece are in contact can be calculated. That is, the present application provides a method for calculating 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 and the hole workpiece are in contact based on computer vision.

[0016] Other features and advantages of the present application will become apparent from the following detailed description of exemplary embodiments thereof, taken in conjunction with the accompanying drawings. BRIEF DESCRIPTION OF DRAWINGS

[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 3 Taking step S1210 as an example, specifically, after performing grayscale processing on the first image, the following is obtained: Figure 4 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 5 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 6 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 an embodiment of the present application, the first image after processing is input into a Hough transform algorithm, and at least two circular arc lines in the first image are output by the Hough transform algorithm.

[0041] The Hough transform is a kind of detection method that "votes" pixels in the image space into the parameter space, and then finds the peak value of geometric shapes (straight lines, circles, ellipses, polygons, etc.) in the parameter space. It converts discrete edge points that are difficult to aggregate directly in the pixel domain into clustering problems in the parameter domain, and is particularly suitable for detecting regular geometric contours in the presence of noise and gaps. When the Hough transform performs Hough circular arc detection, first, the edges are obtained by using Canny edge detection, and then the plane equation of the circle is used to "vote" each edge to all possible Each edge "votes" for all possible A counter is established in the discretized parameter space, and all edge points increment the count of the corresponding grid according to the respective possible parameter combination. When the "voting" number of a certain parameter grid exceeds a threshold value, it is considered that a circular arc appears.

[0042] It should be noted that, in the case of a single shaft workpiece and a single hole workpiece, if the shaft workpiece and the hole workpiece are not aligned after contact, then there are two circular arc lines in the first image after processing, one of which is a circular arc line corresponding to the shaft edge in the shaft workpiece, and the other is a circular arc line corresponding to the hole edge in the hole workpiece. In the case of two or more shaft workpieces and two or more hole workpieces, there are more than two circular arc lines in the first image after processing.

[0043] Step S1212, two circular arc lines intersecting in the at least two circular arc lines are determined as a circular arc line pair.

[0044] In the present embodiment, in the case where the shaft workpiece and the hole workpiece are not aligned after contact, the non-coincidence part of any shaft on the shaft workpiece and the corresponding hole in the hole workpiece forms a crescent-shaped circular arc line pair. Therefore, two circular arc lines intersecting in the at least two circular arc lines are determined as a circular arc line pair.

[0045] Step S1300, for any circular arc line pair, a first centroid position of a first centroid corresponding to a first circular arc line in the circular arc line pair is determined according to the first circular arc line, a second centroid position corresponding to a second circular arc line is determined according to the second circular arc line, a deviation vector between the first centroid position and the second centroid position is calculated, and a centroid deviation vector of the first circular arc line and the second circular arc line is obtained.

[0046] It can be understood that, after the pair of circular arcs is obtained, the circular arc with smaller curvature in the pair of circular arcs is the circular arc corresponding to the hole edge. The circular arc with larger curvature in the pair of circular arcs is the circular arc corresponding to the shaft edge. Based on this, the circular arc corresponding to the hole edge in the pair of circular arcs is recorded as the first circular arc, and the circular arc corresponding to the shaft edge in the pair of circular arcs is recorded as the second circular arc. Alternatively, the circular arc corresponding to the hole edge in the pair of circular arcs is recorded as the second circular arc, and the circular arc corresponding to the shaft edge in the pair of circular arcs is recorded as the first circular arc.

[0047] For any pair of circular arcs, the position of the first centroid of the first circular arc is calculated and recorded as the first centroid position. At the same time, the position of the second centroid of the second circular arc is calculated and recorded as the second centroid position. The deviation vector between the first centroid position and the second centroid position is recorded as the centroid deviation vector. The centroid deviation vector includes the distance between the first centroid position and the second centroid position, and the relative direction between the first centroid position and the second centroid position. In this way, 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 and the hole workpiece are in contact can be calculated. The centroid deviation vector can reflect the deviation between the shaft workpiece and the hole workpiece after the shaft workpiece and the hole workpiece are in contact.

[0048] Through the above steps S1100 to S1300, 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 and the hole workpiece are in contact can be calculated by image analysis on the first image containing the contact surface of the shaft workpiece and the hole workpiece. That is, the present application provides a method for calculating 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 and the hole workpiece are in contact based on computer vision.

[0049] The present application provides a shaft-hole assembly deviation calculation method, which comprises: obtaining a first image containing the contact surface of a shaft workpiece and a hole workpiece under the condition that the shaft workpiece and the hole workpiece are in contact; detecting a pair of circular arcs in the first image; for any pair of circular arcs, determining the first centroid position of the first centroid corresponding to the first circular arc in the pair of circular arcs according to the first circular arc, determining the second centroid position of the second centroid corresponding to the second circular arc according to the second circular arc, and calculating the deviation vector between the first centroid position and the second centroid position to obtain the centroid deviation vector of the first circular arc and the second circular arc. Based on this 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 and the hole workpiece are in contact can be calculated. That is, the present application provides a method for calculating 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 and the hole workpiece are in contact based on computer vision.

[0050] In an embodiment of the present application, the shaft-hole assembly deviation calculation method provided by the present application further comprises the following steps S1400 and S1500 after the above step S1300.

[0051] Step S1400, according to each of the arc line pair corresponding to the centroid deviation vector, determine the shaft workpiece to the shaft workpiece and the hole workpiece alignment case of the first movement vector.

[0052] Step S1500, control the shaft workpiece according to the first movement vector moves.

[0053] In this embodiment, according to each of the arc line pair corresponding to the centroid deviation vector, the shaft workpiece and the hole workpiece deviation vector can be determined, and further, the shaft workpiece and the hole workpiece deviation vector is determined as the first movement vector of the shaft workpiece. Based on this, after controlling the shaft workpiece to move according to the first movement vector, the shaft of the shaft workpiece and the hole of the hole workpiece are aligned, so as to assemble the shaft of the shaft workpiece to the hole of the hole workpiece.

[0054] In an embodiment of the present application, the above-mentioned step S1500 is specifically implemented by the following steps S1510 and S1511.

[0055] Step S1510, the first movement vector is converted to the mechanical arm coordinate system of the mechanical arm clamping the shaft workpiece, to obtain the second movement vector.

[0056] In this embodiment, since the shaft workpiece is clamped by the mechanical arm, the mechanical arm controls the assembly of the shaft workpiece and the hole workpiece, therefore, after obtaining the first movement vector, the first movement vector is not aligned with the mechanical arm coordinate system of the mechanical arm. At this time, the above-mentioned step S1510 needs to be performed.

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

[0058] Step S1511, control the mechanical arm to drive the shaft workpiece to move according to the second movement vector.

[0059] After the above-mentioned step S1510, the first movement vector is converted to the second movement vector in the mechanical arm coordinate system of the mechanical arm clamping the shaft workpiece, and then the mechanical arm moves according to the second movement vector, so that the shaft of the shaft workpiece and the hole of the hole workpiece are aligned, so as to assemble the shaft of the shaft workpiece to the hole of the hole workpiece.

[0060] In an embodiment of the present application, the shaft hole assembly deviation calculation method provided by the present application further comprises the steps of controlling the shaft workpiece and the hole workpiece to contact before the above-mentioned step S1100, as shown in steps S1110 to S1113.

[0061] Step S1110, obtaining a second image containing a hole workpiece.

[0062] In the embodiment, an image of the hole workpiece to be assembled can be acquired by the camera to obtain a second image containing the hole workpiece. In an example, the second image is as shown in Figure 6

[0063] In step S1111, edges in the second image that are closed contours are detected to obtain at least one circular edge.

[0064] In an embodiment of the present application, the edges in the second image are detected by, for example, a canny edge detection algorithm to obtain at least one edge. Further, since the hole edge in the hole workpiece is a closed contour, the closed contour in the at least one edge detected in the foregoing is determined as the at least one circular edge, and the position of the hole in the hole workpiece can be determined based on the circular edge.

[0065] In an embodiment of the present application, in order to accurately obtain the at least one circular edge, the foregoing step S1111 is implemented by the following steps S1111-1 and S1111-2.

[0066] In step S1111-1, edges in the second image that are closed contours are detected to obtain at least one closed contour edge.

[0067] In step S1111-2, closed contour edges with a circularity greater than or equal to a preset circularity are selected from the at least one closed contour edge to obtain at least one circular edge.

[0068] The preset circularity is the minimum circularity of a circle, and the circularity of the closed contour edge can be calculated by a circularity calculation formula.

[0069] In the case where the circularity of the closed contour edge is greater than or equal to the preset circularity, the closed contour edge can be determined as a circular edge, denoted as a circular edge.

[0070] The foregoing steps S1111-1 and S1111-2 can achieve accurate extraction of the circular edge.

[0071] In step S1112, for any circular edge, a third centroid position of the circular edge is determined.

[0072] For any circular edge, the position of the centroid of the circular edge is calculated, denoted as a third centroid position. The third centroid position can reflect the position of the hole in the hole workpiece.

[0073] In step S113, the shaft workpiece is controlled to contact the hole workpiece based on the third centroid position.

[0074] The position of the hole in the hole workpiece can be determined based on the third centroid position to achieve positioning of the hole in the hole workpiece, and the shaft workpiece is controlled to contact the hole workpiece at this time.​

[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 7 For example, the grayscale image obtained after performing grayscale processing on the second image is as follows: Figure 7 As shown, for Figure 8 The grayscale image shown is denoised and binarized to obtain the binarized image as follows: Figure 8 As shown, for Figure 9 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 10 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 11 As shown.

[0084] This application also provides a shaft hole assembly deviation calculation device 110, such as Figure 12 As shown, it includes: The acquisition module 111 is configured to acquire a first image of a contact surface of the shaft workpiece and the hole workpiece when the shaft workpiece is in contact with the hole workpiece. The detection module 112 is configured to detect a circular arc line pair in the first image. The calculation module 113 is configured to, for any circular arc line pair, determine a first mass center position of a first mass center corresponding to a first circular arc line in the circular arc line pair, determine a second mass center position of a second mass center corresponding to a second circular arc line in the circular arc line pair, and calculate a deviation vector between the first mass center position and the second mass center position to obtain a mass center deviation vector of the first circular arc line and the second circular arc line.

[0085] In an embodiment of the present application, the shaft-hole assembly deviation calculation device 110 provided by the present application further comprises: The contact module is configured to acquire a second image containing the hole workpiece. Detect edges in the second image as closed contours to obtain at least one circular edge. For any circular edge, determine a third mass center position of the circular edge. Control the contact between the shaft workpiece and the hole workpiece according to the third mass center position.

[0086] In an embodiment of the present application, the contact module is specifically configured to perform a first image preprocessing operation on the second image to obtain a processed second image, and the first image preprocessing operation includes grayscale processing, denoising processing, binarization processing, and circular hole display processing. Detect edges in the processed second image as closed contours to obtain at least one circular edge.

[0087] In an embodiment of the present application, the contact module is specifically configured to detect edges in the second image as closed contours to obtain at least one closed contour edge. From the at least one closed contour edge, filter out a closed contour edge with a circular degree greater than a preset circular degree to obtain at least one circular edge.

[0088] In an embodiment of the present application, the detection module 112 is specifically configured to perform a second image preprocessing operation on the first image to obtain a processed first image, and the second image preprocessing operation includes grayscale processing, denoising processing, binarization processing, and interference filtering processing. Extract circular arc lines from the processed first image to obtain at least two circular arc lines. Determine two circular arc lines intersecting in the at least two circular arc lines as a circular arc line pair.

[0089] In one embodiment of the present application, the shaft-hole assembly deviation calculation device 110 provided by the present application further comprises: a control module configured to determine a first movement vector of the shaft workpiece to a situation where the shaft workpiece is aligned with the hole workpiece according to the corresponding centroid deviation vector of each of the circular arc lines; control the shaft workpiece to move according to the first movement vector.

[0090] In one embodiment of the present application, the control module is specifically configured to convert the first movement vector to a mechanical arm coordinate system of a mechanical arm clamping the shaft workpiece to obtain a second movement vector; control the mechanical arm to drive the shaft workpiece to move according to the second movement vector.

[0091] The present application also provides an electronic device comprising any one of the shaft-hole assembly deviation calculation devices 110 provided by the above device embodiments.

[0092] The present application also provides another electronic device 120, as shown in Figure 13 The electronic device 120 comprises a camera 121, a memory 122 and a processor 123, the camera 121 is configured to collect a first image containing a contact surface of the shaft workpiece and the hole workpiece, the memory 122 is configured to store computer instructions, and the processor 123 is configured to call the computer instructions from the memory 122 to execute the method in any one of the above method embodiments.

[0093] The present application also provides another electronic device 120, as shown in ​ The electronic device 120 comprises a camera 121, a mechanical arm 124, a memory 122 and a processor 123, the mechanical arm 124 is configured to control the shaft workpiece to contact the hole workpiece under the control of the processor 123, the camera 121 is configured to collect a first image containing a contact surface of the shaft workpiece and the hole workpiece, the memory 122 is configured to store computer instructions, and the processor 123 is configured to call the computer instructions from the memory 122 to execute the method in any one of the above method embodiments.

[0094] The present application also provides a computer readable storage medium having a computer program stored thereon, the computer program being executed by a processor to implement the method in any one of the above method embodiments.

[0095] The present application can be a system, a method and / or a computer program product. The computer program product can include a computer readable storage medium having computer readable program instructions embodied therewith, the computer readable program instructions being used to cause a processor to implement various aspects of the present application.

[0096] Computer readable storage media can be tangible storage media which can retain and store instructions for use by an instruction execution device. Computer readable storage media can be, for example, but is not limited to, an electronic storage device, a magnetic storage device, an optical storage device, an electromagnetic storage device, a semiconductor storage device, or any suitable combination of the foregoing. More specific examples (a non-exhaustive list) of computer readable storage media include the following: a portable computer diskette, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or Flash memory), a static random access memory (SRAM), a portable compact disc read-only memory (CD-ROM), a digital versatile disk (DVD), a memory stick, a floppy disk, a mechanically encoded device such as punch-cards or raised structures in a groove having instructions recorded thereon, and any suitable combination of the foregoing. A computer readable storage medium, as used herein, is not to be construed as being transitory signals per se, such as radio waves or other freely propagating electromagnetic waves, electromagnetic waves propagating through a waveguide or other transmission media (e.g., light pulses passing through a fiber-optic cable), or electrical signals transmitted through a wire.

[0097] Computer readable program instructions described herein can be downloaded to respective computing / processing devices from a computer readable storage medium or to an external computer or external storage device via a network, for example, the Internet, a local area network, a wide area network and / or a wireless network. The network can comprise copper transmission cables, optical transmission fibers, wireless transmission, routers, firewalls, switches, gateway computers and / or edge servers. A network adapter card or network interface in each computing / processing device receives computer readable program instructions from the network and forwards the computer readable program instructions for storage in a computer readable storage medium within the respective computing / processing device.

[0098] Computer readable program instructions for carrying out operations of the present application can be assembler instructions, instruction-set-architecture (ISA) instructions, machine instructions, machine dependent instructions, microcode, firmware instructions, state-setting data, or either source code or object code written in any combination of one or more programming languages, including an object oriented programming language such as Smalltalk, C++ or the like and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The computer readable program instructions can execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the latter scenario, the remote computer can be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or the connection can be made to an external computer (for example, through the Internet using an Internet Service Provider). In some embodiments, electronic circuitry including, for example, programmable logic circuitry, field-programmable gate array (FPGA), or programmable logic array (PLA) can execute the computer readable program instructions by utilizing state information of the computer readable program instructions to personalize the electronic circuitry, in order to perform aspects of the present application.

[0099] The computer readable program instructions can 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 apparatus or other device to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide processes for implementing the functions / acts specified in the flowchart and / or block diagram block or blocks.

[0100] The computer readable program instructions can 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 apparatus or other device to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide processes for implementing the functions / acts specified in the flowchart and / or block diagram block or blocks.

[0101] The computer readable program instructions can 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 such that the instructions which execute on the computer, other programmable data processing apparatus, or other device implement the functions / acts specified in the flowchart and / or block diagram block or blocks.

[0102] The computer readable program instructions can 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 such that the instructions which execute on the computer, other programmable data processing apparatus, or other device implement the functions / acts specified in the flowchart and / or block diagram block or blocks.

[0103] Embodiments of the present application have been described above, and the description is intended to be illustrative, and not restrictive, of the various embodiments of the present application. Many modifications and variations of the described embodiments of the present application are possible, given the benefit of the present disclosure, without departing from the scope and spirit of the described embodiments of the present application. The scope of the present application is defined by the appended claims.

Claims

1. A shaft hole assembly deviation calculation method characterized by, The method comprises the following steps: acquiring a first image containing a contact surface of the shaft workpiece and the hole workpiece in a state where the shaft workpiece is in contact with the hole workpiece; detecting a circular arc line pair in the first image; for any circular arc line pair, determining a first center of mass position of a first center of mass corresponding to a first circular arc line in the circular arc line pair, determining a second center of mass position of a second center of mass corresponding to a second circular arc line in the circular arc line pair, and calculating a deviation vector between the first center of mass position and the second center of mass position to obtain a center of mass deviation vector of the first circular arc line and the second circular arc line.

2. The method of claim 1, wherein, Before the step of acquiring the first image containing the contact surface of the shaft workpiece and the hole workpiece in the state where the shaft workpiece is in contact with the hole workpiece, the method further comprises: acquiring a second image containing the hole workpiece; detecting edges that are closed contours in the second image to obtain at least one circular edge; for any circular edge, determining a third center of mass position of the circular edge; controlling the shaft workpiece to be in contact with the hole workpiece according to the third center of mass position.

3. The method of claim 2, wherein, The step of detecting edges that are closed contours in the second image to obtain at least one circular edge comprises: performing a first image preprocessing operation on the second image to obtain a processed second image, and the first image preprocessing operation comprises grayscale processing, denoising processing, binarization processing, and circular hole display processing; detecting edges that are closed contours in the processed second image to obtain at least one circular edge.

4. The method of claim 2, wherein, The step of detecting edges that are closed contours in the second image to obtain at least one circular edge comprises: detecting edges that are closed contours in the second image to obtain at least one closed contour edge; selecting a closed contour edge with a circular degree greater than a preset circular degree from the at least one closed contour edge to obtain at least one circular edge.

5. The method of claim 1, wherein, The step of detecting a circular arc line pair in the first image comprises: performing a second image preprocessing operation on the first image to obtain a processed first image, and the second image preprocessing operation comprises grayscale processing, denoising processing, binarization processing, and interference filtering processing; extracting circular arc lines from the processed first image to obtain at least two circular arc lines; determining two intersecting circular arc lines in the at least two circular arc lines as a circular arc line pair.

6. The method of claim 1, wherein, The method further comprises: determining a first movement vector of the shaft workpiece in a state where the shaft workpiece is aligned with the hole workpiece according to a center of mass deviation vector corresponding to each circular arc line pair; controlling the shaft workpiece to move according to the first movement vector.

7. The method of claim 6, wherein, The step of controlling the shaft workpiece to move according to the first movement vector comprises: converting the first movement vector into a second movement vector in a mechanical arm coordinate system of a mechanical arm clamping the shaft workpiece; controlling the mechanical arm to drive the shaft workpiece to move according to the second movement vector.

8. A shaft hole assembly deviation calculating device characterized by comprising: The method comprises the following steps: an acquiring module, configured to acquire a first image containing a contact surface of the shaft workpiece and the hole workpiece in a state where the shaft workpiece is in contact with the hole workpiece; a detecting module, configured to detect a circular arc line pair in the first image; The computing module is configured to, for any pair of the circular arc lines, determine a first centroid position of a first centroid corresponding to a first circular arc line in the pair of the circular arc lines, determine a second centroid position of a second centroid corresponding to a second circular arc line in the pair of the circular arc lines, and calculate a deviation vector between the first centroid position and the second centroid position to obtain a centroid deviation vector of the first circular arc line and the second circular arc line.

9. An electronic device, comprising: The electronic device comprises the apparatus of claim 7; Alternatively, the electronic device comprises a camera configured to capture a first image containing a contact surface of the shaft workpiece and the hole workpiece, a memory configured to store computer instructions, and a processor configured to call the computer instructions from the memory to execute the method of any one of claims 1-7. Alternatively, the electronic device comprises a camera configured to capture a first image containing a contact surface of the shaft workpiece and the hole workpiece, a mechanical arm configured to control the shaft workpiece to contact the hole workpiece under control of the processor, a memory configured to store computer instructions, and a processor configured to call the computer instructions from the memory to execute the method of any one of claims 1-7.

10. A computer-readable storage medium, characterized in that, A computer program is stored thereon, and the computer program, when executed by a processor, implements the method of 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

  • Method and device for positioning center point of wafer, storage medium and electronic equipment

    CN115546143A

  • Pupil determination method and device, equipment and storage medium

    CN117814743A

  • Ring flaw detection method and system and storage medium

    CN118247241A

Cited By

  • Hole searching method, device and equipment based on shaft hole assembly and medium

    CN121315973A