Part centering method and device based on machine vision
The reference circles in the image are acquired and fitted through machine vision technology, and the center position of the parts is determined in combination with arcs, which solves the problem that the shaft hole equipment of different sizes cannot be automatically centered, and improves assembly efficiency and accuracy.
Patent Information
- Application Number
- CN202411086683.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-08
- Publication Date
- 2024-11-26
AI Technical Summary
In the prior art, the equipment process of shaft holes of different sizes cannot be automatically centered, resulting in low assembly efficiency and difficult to ensure accuracy.
The target image is obtained through machine vision technology, the first reference circle is fitted with at least three points of interest and the second reference circle is fitted with at least one arc, and the center position of the part is determined in combination with the two to achieve automatic centering of the part.
Accurate alignment of parts of different sizes is achieved, assembly efficiency and accuracy is improved, and error problems caused by manual operation in traditional methods are solved.
Smart Images

Figure CN119027488A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of part centering, and in particular to a part centering method and device based on machine vision. Background Art
[0002] At present, the assembly of shaft and hole parts often adopts manual centering or automatic assembly, which results in each set of tooling being only suitable for one product and low assembly efficiency. Based on the above background, how to improve the centering accuracy of shaft parts has become a technical problem currently faced.
[0003] To address the above-mentioned problems, no effective solution has been proposed yet. Summary of the invention
[0004] The embodiments of the present invention provide a method and device for part centering based on machine vision, so as to at least solve the technical problem in the prior art that the equipment process of shaft holes of different sizes cannot be automatically centered.
[0005] According to one aspect of an embodiment of the present invention, there is provided a method for acquiring a target image, wherein the target image is obtained by capturing a target part; determining a first reference circle based on the target image, wherein the first reference circle is obtained by fitting at least three points of interest on the target image, wherein the points of interest are not on the same straight line; determining a second reference circle based on the target image, wherein the second reference circle is obtained by fitting at least one arc on the target image; determining a center position of a part based on the first reference circle and the second reference circle; and centering the target part based on the center position of the part.
[0006] Furthermore, the target part is a shaft part, and acquiring the target image includes: capturing the image of the target part along the axial direction of the target part.
[0007] Further, determining the center position of the part based on the first reference circle and the second reference circle includes: determining the first reference circle center based on the first reference circle; determining the second reference circle center based on the second reference circle; and determining the center position of the part based on the first reference circle center and the second reference circle center.
[0008] Further, determining the center position of the part based on the first reference circle center and the second reference circle center includes: performing centroid calculation according to the coordinates of the first reference circle center and the coordinates of the second reference circle center to obtain the center position of the part.
[0009] Furthermore, determining a first reference circle based on the target image includes: selecting at least three interest points within a first preset interval of the outer perimeter of the target image to obtain first position information of the multiple interest points; and performing circular fitting on the multiple interest points based on the first position information to determine the first reference circle.
[0010] Furthermore, before selecting at least three points of interest within a first preset interval of the outer periphery of the target image, determining the first reference circle based on the target image also includes: when it is identified that there is a recessed interval on the outer periphery of the target image that is recessed toward the middle of the target part, determining the portion of the outer periphery other than the recessed interval as the first preset interval.
[0011] Furthermore, determining a second reference circle based on the target image includes: selecting multiple edge feature points within a second preset interval of the outer circumference of the target image to obtain second position information of the multiple edge feature points, wherein the multiple edge feature points; performing arc fitting on the multiple edge features based on the second position information to determine an arc; and performing circle fitting based on the arc to determine a second reference circle.
[0012] Furthermore, before selecting multiple edge feature points within a second preset interval of the outer periphery of the target image, determining the second reference circle based on the target image also includes: when it is identified that there is a recessed interval on the outer periphery of the target image that is recessed toward the middle of the target part, determining the portion of the outer periphery other than the recessed interval and with a smooth and continuous curve as the second preset interval.
[0013] Furthermore, before selecting a plurality of edge feature points within a second preset interval of the outer perimeter of the target image, determining the second reference circle based on the target image further includes: performing Gaussian filtering on the target image.
[0014] According to another aspect of an embodiment of the present invention, a part alignment device based on machine vision is also provided, and the part alignment device includes: an acquisition unit, used to acquire a target image, the target image is obtained by capturing a target part; a first determination unit, used to determine a first reference circle based on the target image, the first reference circle is obtained by fitting at least three interest points on the target image, and the interest points are not on the same straight line; a second determination unit, used to determine a second reference circle based on the target image, the second reference circle is obtained by fitting at least one circular arc on the target image; a third determination unit, used to determine a part center position based on the first reference circle and the second reference circle; and a control unit, used to center the target part based on the part center position.
[0015] In an embodiment of the present invention, a method of obtaining a first reference circle by fitting at least three points of interest and obtaining a second reference circle by fitting at least one arc is adopted, and the center position of a part is determined by the first reference circle and the second reference circle, thereby achieving the purpose of determining the center position of parts of different sizes, thereby realizing the technical effect of using parts for centering and assembling parts, and further solving the technical problem in the prior art that the equipment process of shaft holes of different sizes cannot be automatically centered. BRIEF DESCRIPTION OF THE DRAWINGS
[0016] The drawings described herein are used to provide a further understanding of the present invention and constitute a part of this application. The exemplary embodiments of the present invention and their descriptions are used to explain the present invention and do not constitute an improper limitation of the present invention. In the drawings:
[0017] Figure 1 is a flow chart of an optional method for part alignment based on machine vision according to an embodiment of the present invention;
[0018] Figure 2 is a flow chart of an optional method for part alignment based on machine vision according to an embodiment of the present invention;
[0019] Figure 3 is a schematic diagram of an optional principle of fitting a first reference circle according to multiple interest points according to an embodiment of the present invention;
[0020] Figure 4 It is a module schematic diagram of an optional machine vision-based part alignment device according to an embodiment of the present invention. DETAILED DESCRIPTION
[0021] In order to enable those skilled in the art to better understand the scheme of the present invention, the technical scheme in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present invention.
[0022] It should be noted that the terms "first", "second", etc. in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0023] According to an embodiment of the present invention, a method embodiment of a part alignment method based on machine vision is provided. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and although a logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that shown here.
[0024] In the prior art, shaft parts that require shaft-hole matching need to be aligned during assembly. The alignment of shaft-hole parts during assembly, usually called shaft-hole centering or shaft-hole positioning, is an important step in the mechanical assembly process. It ensures that the center lines of the shaft and the hole are accurately aligned to ensure the correct fit and operation of the parts.
[0025] The importance of centering when assembling shaft and hole parts:
[0026] 1. Reduce stress: Ensure that parts are evenly stressed during operation to avoid additional stress and deformation caused by misalignment.
[0027] 2. Extend service life: Correct alignment can reduce wear and extend the service life of parts and bearings.
[0028] 3. Improve efficiency: Alignment can reduce energy loss and improve the efficiency of mechanical operation.
[0029] 4. Prevent vibration: Avoid vibration and noise caused by misalignment.
[0030] 5. Ensure accuracy: Alignment is the key to ensuring machining accuracy and equipment performance.
[0031] The alignment steps include: Cleaning surfaces: Clean the contact surfaces of the shaft and the bore to remove dust and impurities.
[0032] S1. Initial positioning: Place the parts in approximate position to prepare for precise alignment.
[0033] S2. Measure the centering error: Use appropriate measuring tools to determine the initial centering error of the shaft and hole.
[0034] S3. Adjust position: According to the measurement results, manually or automatically adjust the position of the part to reduce the centering error.
[0035] S4. Repeat measurement and adjustment: Repeat the measurement and adjustment process several times until the required alignment accuracy is achieved.
[0036] S5. Fix the parts: Once the alignment is completed, use appropriate fixing methods to fix the parts in place.
[0037] S6. Final inspection: Perform a final inspection after alignment to ensure that the assembly meets the design and operation requirements.
[0038] Therefore, for the assembly of shaft holes of different sizes, it is necessary to use measuring tools (such as sensors, lasers, mechanical measuring devices) to find the center position of the shaft parts many times, and then align the center position with the central axis of the hole. The above steps are cumbersome and the accuracy of determining the center position of the shaft parts is also easily affected by the operation.
[0039] Figure 1 is a method according to an embodiment of the present invention, such as Figure 1 As shown, the method comprises the following steps:
[0040] Step S102, acquiring a target image, where the target image is acquired by capturing a target part;
[0041] The target parts include shaft parts. The image acquisition method includes using an image sensor to acquire images: the image sensor includes a CCD (charge coupled device) and a CMOS (complementary metal oxide semiconductor) sensor.
[0042] After the image is acquired, a rectangular coordinate system needs to be established based on the image.
[0043] Step S104, determining a first reference circle based on the target image, where the first reference circle is obtained by fitting at least three interest points on the target image, and the interest points are not on the same straight line;
[0044] First, it is necessary to obtain the coordinate information of the three interest points in the rectangular coordinate system. The method of fitting the three interest points to obtain the first reference circle includes:
[0045] 1. Analysis method:
[0046] Setting the general equation of the first reference circle, the coordinates of the three points of interest can be substituted into the equation to obtain three equations, and solving this system of equations can obtain the coefficients of the circle.
[0047] 2. Least Squares Method:
[0048] The equation of the circle is converted into a general form, and the parameters of the circle are fitted by the least squares method so that the sum of the squares of the perpendicular distances from all points to the circle is minimized.
[0049] 3. Analytical geometry method:
[0050] Using the methods of analytic geometry, find the perpendicular bisector through the two points and the perpendicular bisector of the line from the third point to the center of the circle. The intersection of these two lines is the center of the circle.
[0051] 4. Matrix method:
[0052] Convert the circle equation into matrix form and solve the circle parameters through matrix operations.
[0053] 5. Numerical methods:
[0054] If the analytical method is difficult to solve, numerical methods such as Newton's method, gradient descent and other iterative algorithms can be used to approximate the parameters of the circle.
[0055] 6. Geometric center method:
[0056] If the three points are approximately concentric, you can directly calculate the geometric center of the three points as the center of the circle, and then calculate the radius of the circle.
[0057] For parts of different size ranges, it may be necessary to consider numerical stability and calculation accuracy and select an appropriate method for fitting.
[0058] Step S105, determining a second reference circle based on the target image, where the second reference circle is obtained by fitting at least one arc on the target image;
[0059] Step S106, determining the center position of the part based on the first reference circle and the second reference circle;
[0060] The center position of the part is determined by two reference circles, thereby improving the accuracy of the center position of the part. Optionally, the method further includes: fitting multiple other reference circles, and finally determining the center position of the part based on the multiple reference circles.
[0061] Step S110, centering the target part based on the center position of the part.
[0062] Centering the target part based on the part center position includes: acquiring an image of the shaft part and determining the part center position, and then sending the spatial coordinates of the part center position to an execution device (such as a robotic arm, a drive mechanism) so that it drives the shaft part to move to a position where the part center position is aligned with the center axis of the hole.
[0063] Through the above steps, it is possible to fit at least three points of interest to obtain a first reference circle and fit at least one arc to obtain a second reference circle, and determine the center position of the part through the first reference circle and the second reference circle, thereby achieving the purpose of determining the center position of parts of different sizes, thereby achieving the technical effect of using parts for part centering assembly, and further solving the technical problem in the prior art that the equipment process of shaft holes of different sizes cannot be automatically centered.
[0064] Optionally, multiple part center positions may be obtained by repeating steps S102-S106, and a target center position may be finally determined based on the multiple part center positions obtained.
[0065] The target center position can be finally determined based on the obtained multiple part center positions, including: after filtering out obviously non-compliant data, using a technical idea similar to the least squares method to minimize the absolute value and error (true value - theoretical value) of all target center positions to the target center position, thereby obtaining the optimal target center position.
[0066] Optionally, the target part is a shaft part, and acquiring the target image includes:
[0067] The image of the target part is collected along the axial direction of the target part.
[0068] By capturing an image of the target part along the axial direction of the target part, the center position of the shaft part along the axial direction can be determined and then aligned with the center axis of the hole.
[0069] Optionally, determining the center position of the part based on the first reference circle and the second reference circle includes:
[0070] determining a first reference circle center based on the first reference circle;
[0071] determining a second reference circle center based on the second reference circle;
[0072] The center position of the part is determined based on the first reference circle center and the second reference circle center.
[0073] Optionally, determining the center position of the part based on the first reference circle center and the second reference circle center includes:
[0074] The centroid is calculated based on the coordinates of the first reference circle center and the second reference circle center to obtain the center position of the part.
[0075] The centroid is calculated based on the coordinates of the first reference circle center and the coordinates of the second reference circle center, that is, the center position of the coordinates of the first reference circle center and the coordinates of the second reference circle center is determined.
[0076] The centroid calculation includes: on the axial section of the shaft part, in a rectangular coordinate system, calculating the sum of the coordinates of the first reference circle center and the second reference circle center on the horizontal axis and dividing by two to obtain the horizontal coordinate of the center position of the part. Calculating the sum of the coordinates of the first reference circle center and the second reference circle center on the vertical axis and dividing by two to obtain the vertical coordinate of the center position of the part.
[0077] Alternatively, the position of the midpoint of the line connecting the first reference circle center and the second reference circle center may be determined to determine the center position of the part.
[0078] Optionally, determining a first reference circle based on the target image includes:
[0079] Selecting at least three interest points within a first preset interval of the outer perimeter of the target image to obtain first position information of the plurality of interest points;
[0080] A plurality of interest points are circularly fitted based on the first position information to determine a first reference circle.
[0081] Optionally, before selecting at least three interest points within a first preset interval of the outer perimeter of the target image, determining a first reference circle based on the target image further includes:
[0082] When it is identified that there is a concave section on the outer periphery of the target image that is concave toward the middle of the target part, a portion of the outer periphery other than the concave section is determined as a first preset section.
[0083] Optionally, determining a second reference circle based on the target image includes:
[0084] Selecting a plurality of edge feature points within a second preset interval of the outer perimeter of the target image to obtain second position information of the plurality of edge feature points, wherein the plurality of edge feature points;
[0085] Perform arc fitting on the plurality of edge features based on the second position information to determine a circular arc;
[0086] Fitting a circular arc using multiple points usually involves the following steps and methods:
[0087] Center Estimation: Use the average coordinates of all points as an initial estimate of the circle center.
[0088] Radius estimation: Calculate the distance from each point to the estimated center of the circle, and then take the average as the initial radius.
[0089] Least Squares Method: Use the least squares method to optimize the center and radius of the circle. Construct an objective function that calculates the sum of the squares of the perpendicular distances of all points to the circle.
[0090] Derivative the objective function and set the derivative to zero, then solve the system of equations to find the optimal center and radius.
[0091] Iterative optimization: Through iterative methods such as gradient descent or Newton's method, the center and radius of the circle are gradually adjusted until they converge to a solution that minimizes the objective function.
[0092] Arc parameterization: Determine the start and end angles of the arc, which can be calculated from the center point and two points on the circle.
[0093] Angle Limits: Determine the start and end angles of the arc and parameterize the circle equation.
[0094] A second reference circle is determined by fitting the circumference based on the arc. Specifically, a graphics processing algorithm can be used to calculate the parameters of the arc segment, such as the center, radius and angle, to determine the second reference circle. Alternatively, numerical approximation techniques, such as numerical integration or numerical differentiation, are used to determine the parameters of the arc segment to approximate the circumference. Alternatively, a Bezier curve, especially a cubic or higher order Bezier curve, is used to approximate the circumference. The Bezier curve is defined by control points and can approximate the circumference very smoothly.
[0095] Optionally, before selecting a plurality of edge feature points within a second preset interval of the outer perimeter of the target image, determining a second reference circle based on the target image further includes:
[0096] When it is identified that there is a concave interval on the outer periphery of the target image that is concave toward the middle of the target part, a portion of the outer periphery except the concave interval and having a smooth and continuous curve is determined as a second preset interval.
[0097] Since shaft parts, such as motor shafts, may be provided with spline grooves on the outer circumference of the shaft, the above scheme can avoid the edge feature points being selected on the circumference of the spline groove, thereby affecting the reference value of the second reference circle.
[0098] Edge feature points and interest points can be selected manually or set to be automatically picked.
[0099] Optionally, before selecting a plurality of edge feature points within a second preset interval of the outer perimeter of the target image, determining the second reference circle based on the target image further includes: performing Gaussian filtering on the target image.
[0100] Gaussian filtering is done by convolving a Gaussian function with the image. This process applies a Gaussian kernel at each pixel location and calculates a weighted average of the surrounding pixels.
[0101] The weight of the Gaussian kernel decreases exponentially as the distance from the center pixel increases, which means that the center pixel contributes the most to the output value.
[0102] Gaussian filtering is isotropic, i.e. has the same effect in all directions, which makes it suitable for a variety of image smoothing tasks.
[0103] Implementation steps of Gaussian filtering: Select Gaussian kernel size: Select the appropriate Gaussian kernel size according to the required blur level. The larger the kernel, the stronger the blur effect. Determine the standard deviation: Determine the standard deviation based on the Gaussian kernel size, which affects the shape of the Gaussian function and the smoothness of the filter. Create Gaussian kernel: Create a Gaussian kernel matrix based on the Gaussian function, and ensure that the sum of the elements of the matrix is 1. Apply convolution: Convolve the Gaussian kernel with the image, apply the Gaussian kernel to each pixel and calculate the weighted average. Boundary processing: During the convolution process, special processing is required for the image boundary, such as copying edge pixels or using mirror filling. Result output: Output the image after Gaussian filtering, which has reduced noise and blur effects.
[0104] In an optional embodiment, the present application provides a method for locating the center of a shaft part, comprising: obtaining a shaft part image; obtaining the position information of at least three points of interest in the shaft part image in a rectangular coordinate system; fitting a first reference circle using at least three points of interest, and calculating the first center position of the first reference circle using the position information of at least three points of interest; extracting the edge curvature information of the shaft part image; obtaining a second reference circle by arc fitting according to the edge curvature information, and calculating the second center position of the second reference circle; performing centroid calculation on the first center position and the second center position to obtain the center of the shaft part. Hole parts are pulled out of the constant temperature furnace by an electronic trolley, and according to the center of the shaft part, the electronic trolley automatically searches for the center of the shaft part through signal transmission.
[0105] The beneficial effect of the shaft parts center positioning method provided by the present invention is that: based on the first circle center position calculated by marking points of interest, the coordinates of the image and the motion system in the current state of the device are also obtained, and the arc of the image is calculated by the visual algorithm for circle fitting, so as to obtain the second circle center position. The first circle center position obtained by fitting and the second circle center position obtained by calculating the points of interest are combined, and the centroid of these circle center points is calculated, and the centroid is used as the final center of the shaft parts, which helps to improve the accuracy of the center positioning results of the shaft parts.
[0106] In a possible embodiment, extracting edge curvature information of a shaft part image includes: extracting edge curvature information of the shaft part image by using an image vision algorithm.
[0107] In another possible embodiment, acquiring the image of the shaft part includes: rotating the shaft part with a turntable and acquiring the image of the shaft part along the outer edge of the shaft part;
[0108] The edge curvature information of the shaft part image is extracted by the image vision algorithm, including: processing the collected shaft part image and extracting the edge feature points of the shaft part image; fitting the arc according to the edge feature points to obtain the edge curvature information of the shaft part image. This method helps to accurately extract the feature points of the edge of the shaft part image, thereby obtaining the edge curvature information of the shaft part image.
[0109] In other possible embodiments, before processing the collected shaft part image and extracting edge feature points of the shaft part image, the method further includes: performing Gaussian filtering on the shaft part image.
[0110] In an optional embodiment, the three interest points are selected at unequal intervals.
[0111] See also Figure 2 FIG. 1 is a flow chart of a method for center positioning of shaft parts provided by an embodiment of the present invention. Figure 2 As shown, the method can be performed by an electronic device, and the method includes the following steps:
[0112] S101, acquiring an image of a shaft part.
[0113] The turntable rotates the shaft part and collects the image of the shaft part along the outer edge of the shaft part;
[0114] S102, obtaining position information of at least three points of interest in the shaft part image in a rectangular coordinate system.
[0115] For example, refer to Figure 3 As shown in FIG. 1 , firstly, the local edge image of the shaft part is collected and the physical coordinates are recorded, and then three interest points are manually selected on the local edge image of the shaft part, and the center of the circle is located by the three interest points on non-straight lines. Among them, the selection intervals of the three interest points are not equal.
[0116] S103: obtaining a first reference circle by fitting at least three interest points, and calculating a first center position of the first reference circle by using position information of at least three interest points.
[0117] S104, extracting edge curvature information of the shaft part image; obtaining a second reference circle by arc fitting according to the edge curvature information, and calculating a second center position of the second reference circle.
[0118] Optionally, before processing the collected shaft part images frame by frame and extracting edge feature points of the shaft part images, the method further includes: performing Gaussian filtering on the shaft part images.
[0119] In this step, the collected shaft part images are processed frame by frame and edge feature points of the shaft part images are extracted; arcs are fitted according to the edge feature points to obtain edge curvature information of the shaft part images.
[0120] S105, calculating the centroid of the first circle center position and the second circle center position to obtain the center of the shaft part.
[0121] The shaft parts center obtained in the embodiment of the present invention is mainly used for positioning the shaft parts after the hole parts are heated.
[0122] It can be seen that this embodiment is based on the first circle center position calculated by marking the point of interest, and also obtains the coordinates of the image and the motion system in the current state of the device, and calculates the arc of the image through the visual algorithm for circle fitting, so as to obtain the second circle center position. The first circle center position obtained by fitting and the second circle center position obtained by calculating the point of interest are combined, and the centroid of these circle center points is calculated, and this centroid is used as the final center of the shaft parts, which helps to improve the accuracy of the center positioning results of the shaft parts.
[0123] In summary, compared with the prior art, the method for center positioning of shaft parts proposed in an embodiment of the present invention extracts the curvature information of the edge of the shaft parts by combining it with the image of the selected edge points, obtains the center of the circle by fitting the arc, and performs centroid calculation on the obtained several center positions to obtain the final center of the shaft parts, thereby avoiding the errors caused by traditional manual operations and making the calculation results more accurate.
[0124] In some embodiments of the present application, the present invention also discloses a center positioning device for shaft parts, such as Figure 4 As shown, the device is used to implement the methods described in the above method embodiments, which includes: an acquisition unit 301, used to acquire an image of a shaft part; and to acquire the position information of at least three points of interest in the image of the shaft part in a rectangular coordinate system; a processing unit 302, used to fit a first reference circle using at least three points of interest, and to calculate the first center position of the first reference circle using the position information of at least three points of interest. An extraction unit 303 is used to extract the edge curvature information of the image of the shaft part. The processing unit 302 is also used to obtain a second reference circle by arc fitting according to the edge curvature information, and calculate the second center position of the second reference circle; perform centroid calculation on the first center position and the second center position to obtain the center of the shaft part.
[0125] Optionally, before the extraction unit processes the collected shaft part images frame by frame and extracts edge feature points of the shaft part images, the device further includes a filtering unit 304 for performing Gaussian filtering on the shaft part images.
[0126] According to an embodiment of the present invention, a device embodiment of a part centering device based on machine vision is provided. It should be noted that the device can be used to execute the above-mentioned part centering method based on machine vision.
[0127] The part alignment device includes: an acquisition unit, used to acquire a target image, the target image is obtained by capturing a target part; a first determination unit, used to determine a first reference circle based on the target image, the first reference circle is obtained by fitting at least three interest points on the target image, and the interest points are not on the same straight line; a second determination unit, used to determine a second reference circle based on the target image, the second reference circle is obtained by fitting at least one arc on the target image; a third determination unit, used to determine a part center position based on the first reference circle and the second reference circle; and a control unit, which aligns the target part based on the part center position.
[0128] An embodiment of the present application further provides an electronic device, comprising: a memory storing an executable program; and a processor for running the program, wherein the program executes the methods in various embodiments of the present invention when running.
[0129] An embodiment of the present application further provides a computer-readable storage medium, which includes a stored executable program, wherein when the executable program is running, the device where the computer-readable storage medium is located is controlled to execute the methods in various embodiments of the present invention.
[0130] An embodiment of the present application further provides a computer program product, including a computer program, which implements the methods in various embodiments of the present invention when executed by a processor.
[0131] An embodiment of the present application further provides a computer program product, including a non-volatile computer-readable storage medium, wherein the non-volatile computer-readable storage medium is used to store a computer program, and when the computer program is executed by a processor, the method in each embodiment of the present invention is implemented.
[0132] The embodiments of the present application further provide a computer program, which implements the methods in the above-mentioned embodiments of the present invention when executed by a processor.
[0133] The serial numbers of the above embodiments of the present invention are only for description and do not represent the advantages or disadvantages of the embodiments.
[0134] In the above embodiments of the present invention, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0135] In the several embodiments provided in this application, it should be understood that the disclosed technical content can be implemented in other ways. Among them, the device embodiments described above are only schematic. For example, the division of the units can be a logical function division. There may be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of units or modules, which can be electrical or other forms.
[0136] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple units. Some or all of the units may be selected according to actual needs to achieve the purpose of the present embodiment.
[0137] In addition, each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.
[0138] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions for a computer device (which can be a personal computer, a server or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), mobile hard disk, magnetic disk or optical disk and other media that can store program codes.
[0139] The above is only a preferred embodiment of the present invention. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principle of the present invention. These improvements and modifications should also be regarded as the scope of protection of the present invention.
Claims
1. A part alignment method based on machine vision, characterized in that: include: Acquire a target image, wherein the target image is obtained by capturing a target part; Determine a first reference circle based on the target image, where the first reference circle is obtained by fitting at least three interest points on the target image, and the interest points are not on the same straight line; Determine a second reference circle based on the target image, where the second reference circle is obtained by fitting at least one arc on the target image; Determine the center position of the part based on the first reference circle and the second reference circle; The target part is centered based on the center position of the part.
2. The part alignment method according to claim 1, characterized in that: The target part is a shaft part, and acquiring the target image includes: An image of the target part is acquired along the axial direction of the target part.
3. The part centering method according to claim 1, characterized in that: Determining the center position of the part based on the first reference circle and the second reference circle includes: determining a first reference circle center based on the first reference circle; determining a second reference circle center based on the second reference circle; The part center position is determined based on the first reference circle center and the second reference circle center.
4. The part centering method according to claim 3, characterized in that: Determining the center position of the part based on the first reference circle center and the second reference circle center includes: The centroid is calculated according to the coordinates of the first reference circle center and the coordinates of the second reference circle center to obtain the center position of the part.
5. The part centering method according to claim 1, characterized in that: Determining a first reference circle based on the target image includes: Selecting at least three of the interest points within a first preset interval of the outer perimeter of the target image to obtain first position information of the plurality of interest points; Performing circular fitting on the plurality of interest points based on the first position information to determine the first reference circle.
6. The part centering method according to claim 5, characterized in that: Before selecting at least three interest points within a first preset interval of the outer perimeter of the target image, determining a first reference circle based on the target image further includes: When it is identified that there is a concave section on the outer circumference line of the target image that is concave toward the middle of the target part, the portion of the outer circumference line other than the concave section is determined to be the first preset section.
7. The part centering method according to claim 1, characterized in that: Determining a second reference circle based on the target image includes: Selecting a plurality of edge feature points within a second preset interval of the outer perimeter of the target image to obtain second position information of the plurality of edge feature points, wherein the plurality of edge feature points; Perform arc fitting on the plurality of edge features based on the second position information to determine the circular arc; Circular fitting is performed based on the circular arc to determine the second reference circle.
8. The part centering method according to claim 7, characterized in that: Before selecting a plurality of edge feature points within a second preset interval of the outer perimeter of the target image, determining a second reference circle based on the target image further includes: When it is identified that there is a concave section on the outer periphery of the target image that is concave toward the middle of the target part, a portion of the outer periphery except the concave section and having a smooth and continuous curve is determined as the second preset section.
9. The part centering method according to claim 7, characterized in that: Before selecting a plurality of edge feature points within a second preset interval of the outer perimeter of the target image, determining a second reference circle based on the target image further includes: performing Gaussian filtering on the target image.
10. A part centering device based on machine vision, characterized in that: The part centering device comprises: An acquisition unit, used for acquiring a target image, wherein the target image is obtained by acquiring a target part; A first determining unit is used to determine a first reference circle based on the target image, where the first reference circle is obtained by fitting at least three interest points on the target image, and the interest points are not on the same straight line; A second determining unit is used to determine a second reference circle based on the target image, where the second reference circle is obtained by fitting at least one circular arc on the target image; A third determining unit, configured to determine a center position of a part based on the first reference circle and the second reference circle; A control unit is used to center the target part based on the center position of the part.
Citation Information
Patent Citations
Large part hole and shaft automatic assembling and centering method based on multiple sensors
CN113997065A
Wafer center positioning method, wafer center positioning device, wafer center positioning equipment and medium
CN114975212A
Hole centering detection method and device for part assembly and storage medium
CN115711593A
Method and system for extracting centroid of autocollimator image
CN115760959A
Method and apparatus for identifying pupil in image
WO2017080410A1
Cited By
Double-axis centering error measurement method and system based on monocular multi-line structured light
CN122505179A
