Processing position positioning method, processing method and processing system
By combining two-dimensional images and laser rangefinders, the problem of low efficiency in positioning the crimping position of refrigerator condenser tubes was solved, and efficient and accurate processing position determination and processing were achieved, reducing calculation complexity and labor costs.
Patent Information
- Application Number
- CN202411024414.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-29
- Publication Date
- 2025-09-23
- Estimated Expiration
- 2044-07-29
AI Technical Summary
In the existing technology, feature acquisition based on 3D cameras is inefficient in locating the crimping position of refrigerator condenser tubes, affecting processing efficiency. In addition, traditional 2D positioning algorithms have low accuracy and high labor costs.
The method of combining two-dimensional images with a laser rangefinder is used to obtain the target image and distance of the workpiece to be processed. The processing position is determined by using the conversion relationship between the camera coordinate system and the equipment coordinate system. The processing position is calculated through the edge line, center line and mutation point to simplify the calculation process.
It improves positioning and processing efficiency, reduces calculation difficulty and resource occupation, improves processing accuracy and efficiency, and reduces labor costs.
Smart Images

Figure CN118951877B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of parts processing, and in particular, to a positioning method for a processing position, a processing method and a processing system. Background Art
[0002] With the advancement of technology, parts processing in most fields relies on automated robotics to reduce labor costs and improve processing efficiency. However, for parts processing in certain fields, it is necessary to determine the processing location before processing, and then control the robot to process the processing location. Currently, the main method for determining the processing location involves using 3D cameras to capture part features and then determine the processing location through calculation.
[0003] For example, consider the processing of refrigerator condenser tubes. These tubes are located at the back of the refrigerator and transport refrigerant. In actual production, a connecting ring is required to connect the two condenser tubes. Currently, this is done by crimping the connecting ring onto the two condenser tubes, which requires locating the crimping position. However, the long feature acquisition time of the 3D camera reduces the efficiency of locating the crimping position, affecting processing efficiency. Summary of the Invention
[0004] The embodiments of the present application provide a positioning method for a processing position, a processing method, and a processing system to at least solve the technical problem of low processing efficiency.
[0005] According to a first aspect of an embodiment of the present application, a method for positioning a processing position is provided, comprising:
[0006] Acquire a target image of a workpiece to be processed and a target distance between a processing device and the workpiece to be processed in a first direction, wherein the target image is a two-dimensional image, and the processing device includes a device for processing the workpiece to be processed;
[0007] Determining, based on the target image, a reference point of the workpiece to be processed in a preset camera coordinate system and a first position of the reference point, wherein the camera coordinate system is a two-dimensional coordinate system with the shooting point of the target image as the center, the camera coordinate system includes an x-axis and a y-axis, and the first direction is perpendicular to a plane in which the x-axis and the y-axis are located;
[0008] determining a second position of the reference point in the device coordinate system based on the first position and a preset conversion relationship between the camera coordinate system and a device coordinate system of the processing device, wherein the device coordinate system is a three-dimensional coordinate system including the first direction, a second direction parallel to the x-axis, and a third direction parallel to the y-axis;
[0009] The processing position of the workpiece to be processed is determined based on the target distance, the second position, the starting point position of the preset processing equipment starting point in the equipment coordinate system, and the shooting position of the shooting point in the equipment coordinate system, so that the processing equipment processes the workpiece to be processed after moving in the first direction, the second direction and / or the third direction according to the processing position.
[0010] In this embodiment, since the target image is a two-dimensional image, the feature acquisition time of the target image is shorter than that of a 3D camera, which helps improve positioning efficiency. Furthermore, by directly obtaining the target distance of the workpiece in the first direction and determining the processing position in the first direction based on the target distance, the difficulty and complexity of calculating the processing position in the first direction are reduced, thereby helping to save computing resources, improve positioning efficiency, and ultimately improve processing efficiency.
[0011] In conjunction with the first aspect, in an optional implementation of the embodiment of the present application, determining a reference point of the workpiece to be processed in a preset camera coordinate system and a first position of the reference point according to the target image includes:
[0012] determining the edge of the workpiece to be processed according to the target image;
[0013] Determining the center line of the workpiece to be processed according to the edge line;
[0014] Determine the mutation point according to the angle between the center line and the line connecting two adjacent points on the side line;
[0015] The reference point and the first position are determined according to the mutation point.
[0016] With this implementation, by determining the edge lines and center lines of the workpiece to be processed in the target image, a mutation point is obtained, and the first position is determined based on the mutation point, so that the first position is related to the mutation point. The mutation point can be used as a reference point for the processing position. That is, when the processing position is subsequently determined, the position of the mutation point can be used as a reference, thereby simplifying the calculation process of the processing position, improving the calculation efficiency of the processing position, thereby improving the positioning efficiency, and further improving the processing efficiency.
[0017] In combination with the first aspect, in an optional implementation of the embodiment of the present application, determining the edge of the workpiece to be processed according to the target image includes:
[0018] Performing region of interest processing on the target image to determine edge points of the workpiece to be processed in the target image;
[0019] Linear fitting is performed on the edge points to obtain the edge line.
[0020] This method uses region of interest processing to accurately determine edge points, and then combines straight line fitting to obtain edge lines, which helps to reduce the difficulty of edge line calculation and improve calculation efficiency.
[0021] In conjunction with the first aspect, in an optional implementation of the embodiment of the present application, before performing region of interest processing on the target image to determine edge points of the workpiece to be processed in the target image, the method further includes:
[0022] Retrieving an image template of the workpiece to be processed;
[0023] The contour position of the workpiece to be processed is determined in the target image according to the image template, so as to perform the region of interest processing according to the contour position.
[0024] This method can improve the accuracy of processing the region of interest and reduce the amount of calculation, thereby improving computing efficiency and reducing the occupation of computing resources.
[0025] In combination with the first aspect, in an optional implementation of the embodiment of the present application, the edge line at least includes a first edge line and a second edge line of opposite sides of the workpiece to be processed;
[0026] Determining the center line of the workpiece to be processed according to the edge line includes:
[0027] Determine the coordinates of the midline point according to the pixel coordinates of the edge point in the first sideline in the camera coordinate system and the pixel coordinates of the edge point in the second sideline in the camera coordinate system;
[0028] A straight line fitting is performed on the midline points represented by the midline point coordinates to obtain the center line.
[0029] With this implementation, the center line is obtained by linear fitting, which makes the process of determining the center line simpler and has fewer steps, thereby helping to reduce the difficulty of calculation and improve calculation efficiency.
[0030] In conjunction with the first aspect, in an optional implementation of the embodiment of the present application, determining the mutation point according to the angle between the center line and the line connecting two adjacent points on the sideline includes:
[0031] Traversing the edge points constituting the edge line, calculating an angle between a line connecting adjacent edge points and the center line, wherein the line includes a first line formed by connecting a first edge point and a second edge point, and the angle includes a first angle;
[0032] If the first angle exceeds a preset angle threshold, determining whether a second angle corresponding to a second edge line formed by connecting the first edge point and a third edge point exceeds the angle threshold, wherein the first edge point is adjacent to the second edge point and the third edge point;
[0033] If the second angle exceeds the angle threshold, the first edge point is determined as the mutation point; otherwise, the second edge point is determined as the mutation point.
[0034] This implementation method determines the mutation point by traversing the edge points, which helps to improve the accuracy of determining the mutation point, thereby improving the accuracy of the first position, so that the subsequent determination of the processing position based on the transformed second position is more convenient and quick.
[0035] In combination with the first aspect, in an optional implementation of the embodiment of the present application, the edge line includes at least a first edge line and a second edge line of opposite sides of the workpiece to be processed, and the discontinuity point includes a first discontinuity point located in the first edge line and a second discontinuity point located in the second edge line;
[0036] The determining the reference point and the first position according to the mutation point includes:
[0037] The first position is calculated based on the pixel coordinates of the first mutation point in the camera coordinate system and the pixel coordinates of the second mutation point in the camera coordinate system, wherein the pixel point corresponding to the first position is the reference point.
[0038] By adopting this implementation method and using pixel coordinates to calculate the first position, it helps to improve the calculation efficiency of the first position and reduce the calculation difficulty.
[0039] In conjunction with the first aspect, in an optional implementation of the embodiment of the present application, the workpiece to be machined includes a first workpiece, a second workpiece, and a third workpiece located between the first workpiece and the second workpiece, the third workpiece being configured to be connected to the first workpiece and the second workpiece, and the first workpiece, the second workpiece, and the third workpiece being sequentially arranged along a target direction;
[0040] Determining a reference point of the workpiece to be processed in a preset camera coordinate system and a first position of the reference point according to the target image includes:
[0041] Determining, based on the target image, a sideline L1 of the first workpiece, a sideline L2 of the first workpiece, a sideline L3 of the third workpiece, a sideline L4 of the third workpiece, a sideline L5 of the second workpiece, and a sideline L6 of the second workpiece, wherein the sidelines L1 and L2 are opposite sides of the first workpiece and extend along the target direction, the sidelines L3 and L4 are opposite sides of the third workpiece and extend along the target direction, and the sidelines L5 and L6 are opposite sides of the second workpiece and extend along the target direction;
[0042] Calculate at least one midline point coordinate U1 based on the pixel coordinates of each edge point P1 in the sideline L1 and the pixel coordinates of each edge point Q1 in the sideline L2, and perform straight-line fitting on the midline point M1 represented by the midline point coordinate U1 to obtain the center line K1;
[0043] Calculate at least one midline point coordinate U2 based on the pixel coordinates of each edge point P2 in the sideline L3 and the pixel coordinates of each edge point Q2 in the sideline L4, and perform straight-line fitting on the midline point M2 represented by the midline point coordinate U2 to obtain the center line K2;
[0044] Calculate at least one midline point coordinate U3 based on the pixel coordinates of each edge point P3 in the sideline L5 and the pixel coordinates of each edge point Q3 in the sideline L6, and perform linear fitting on the midline point M3 represented by the midline point coordinate U3 to obtain the center line K3;
[0045] Performing correction processing on at least two center lines among the center lines K1, K2 and K3 to obtain a center line H;
[0046] The mutation point P12 is determined according to the angle between the line connecting the adjacent edge points P1 and the center line H, the mutation point P22 is determined according to the angle between the line connecting the adjacent edge points Q1 and the center line H, the mutation point P11 is determined according to the angle between the line connecting the adjacent edge points P3 and the center line H, and the mutation point P21 is determined according to the angle between the line connecting the adjacent edge points Q3 and the center line H;
[0047] The first position is calculated based on the pixel coordinates of the mutation points P12, P22, P11 and P21, wherein the pixel point corresponding to the first position is the reference point.
[0048] With this implementation, when the workpieces to be processed include three workpieces, the process of determining the first position will be determined based on the edge lines of the three workpieces, which helps to improve the reliability of the first position.
[0049] In conjunction with the first aspect, in an optional implementation of the embodiment of the present application, determining the second position of the reference point in the device coordinate system based on the first position and a preset conversion relationship between the camera coordinate system and the device coordinate system of the processing device includes:
[0050] The second position is obtained by performing an affine transformation based on the first position and the preset conversion relationship, wherein, among the three-dimensional coordinate values represented by the second position, the coordinate value in the first direction is 0.
[0051] By adopting this implementation, the first position is transformed into the second position in the device coordinate system by using an affine transformation, which helps to improve the processing efficiency of the second position.
[0052] In combination with the first aspect, in an optional implementation of the embodiment of the present application, determining the processing position of the workpiece to be processed based on the target distance, the second position, the starting point position of a preset processing equipment starting point in the equipment coordinate system, and the shooting position of the shooting point in the equipment coordinate system includes:
[0053] The target distance is used as the coordinate value z of the processing position in the first direction q ;
[0054] Using the x-axis coordinate value x of the second position r , the coordinate value x of the starting point in the second direction r0 and the coordinate value x of the shooting position in the second direction p0 , calculate the coordinate value x of the processing position in the second direction q ;
[0055] Using the y-axis coordinate value y of the second position r , the coordinate value y of the starting point in the second direction r0 and the coordinate value y of the shooting position in the second direction p0 , calculate the coordinate value y of the processing position in the second direction q , to determine the processing position (x q ,y q , z q ).
[0056] This implementation method directly uses the target distance as the coordinate value in the first direction, eliminating the need to calculate the coordinate value of the processing position in the first direction, which helps improve the positioning efficiency of the processing position. In addition, the coordinate values of the processing position in the second and third directions are calculated using the coordinate values. The calculation process is simple and the calculation difficulty is low, which helps improve the calculation efficiency, thereby improving the positioning efficiency of the processing position and further improving the processing efficiency.
[0057] In conjunction with the first aspect, in an optional implementation of the embodiment of the present application, after determining the processing position of the workpiece to be processed based on the target distance, the second position, the starting point position of a preset processing equipment starting point in the equipment coordinate system, and the shooting position of the shooting point in the equipment coordinate system, the method further includes:
[0058] The processing position is used as the teaching position of the corresponding model of the workpiece to be processed, so that when processing the workpiece to be processed of this model, the processing equipment is controlled to move according to the teaching position to process the workpiece to be processed of this model.
[0059] By adopting this implementation method, when processing the same model of workpiece to be processed, the processing equipment can be directly controlled by using the teaching position, which helps to reduce the calculation steps during processing and improve processing efficiency.
[0060] In combination with the first aspect, in an optional implementation of the embodiment of the present application, the workpiece to be processed includes a first condenser tube, a second condenser tube and a connecting ring for connecting the first condenser tube and the second condenser tube on the back of the refrigerator.
[0061] The implementation method helps to improve the processing efficiency of the condenser tube and the connecting ring on the back of the refrigerator.
[0062] According to a second aspect of an embodiment of the present application, a processing method is provided, which is applied to the positioning method described above, and the processing method includes:
[0063] Calculate the angle between the center line K1 or K3 and the x-axis to obtain the rotation angle;
[0064] The processing part of the processing equipment is controlled to move in the first direction, the second direction and / or the third direction according to the processing position and is controlled to rotate according to the rotation angle so that the processing part reaches the processing position of the workpiece to be processed.
[0065] By adopting this embodiment, the angle of the processing equipment can be adjusted during processing, which helps to improve the processing precision and ensure the accuracy of the processing position.
[0066] In combination with the second aspect, in an optional implementation of the embodiment of the present application, the processing part includes a crimping pliers to crimp the processed part.
[0067] According to a third aspect of an embodiment of the present application, there is provided a processing system, comprising a processing device for performing connection processing on a workpiece to be processed;
[0068] A camera is used to take pictures of the workpiece to be processed to obtain a target image;
[0069] a distance meter, for detecting the distance between the processing equipment and the workpiece to be processed in a first direction;
[0070] The controller is used to control the processing equipment, camera and / or rangefinder to perform corresponding actions, and is also used to determine the processing position using the positioning method described above, and control the processing equipment to process the workpiece to be processed according to the processing position.
[0071] In combination with the third aspect, in an optional implementation of the embodiment of the present application, the rangefinder includes a laser rangefinder.
[0072] In combination with the third aspect, in an optional implementation of the embodiment of the present application, the processing system includes a crimping system for crimping the condenser tube on the back of the refrigerator.
[0073] The technical effects obtained by the third aspect are similar to those obtained by the corresponding technical means in the first and second aspects, and will not be repeated here. BRIEF DESCRIPTION OF THE DRAWINGS
[0074] Figure 1 This is a flow chart of a method for locating a processing position provided in an embodiment of the present application;
[0075] Figure 2 This is a flow chart of determining a first position in a method for positioning a processing position provided in an embodiment of the present application;
[0076] Figure 3 This is a schematic diagram of a workpiece to be processed when a first position is determined in a processing position positioning method provided in an embodiment of the present application;
[0077] Figure 4 It is a structural diagram of a processing system provided in an embodiment of the present application. DETAILED DESCRIPTION
[0078] In order to enable those skilled in the art to better understand the present invention, the following will clearly and completely describe the technical solutions in the embodiments of the present invention 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 in the present invention, all other embodiments obtained by ordinary technicians in this field without making creative efforts should fall within the scope of protection of this application.
[0079] It should be understood that the “plurality” mentioned herein refers to two or more than two. In the description of the embodiments of the present application, unless otherwise specified, “ / ” means or, for example, A / B can mean A or B; “and / or” in this article is merely a description of the association relationship of associated objects, indicating that there can be three relationships, for example, A and / or B can mean: A exists alone, A and B exist at the same time, and B exists alone. In addition, in order to facilitate a clear description of the technical solutions of the embodiments of the present application, in the embodiments of the present application, words such as “first” and “second” are used to distinguish between identical or similar items with substantially the same functions and effects. Those skilled in the art can understand that words such as “first” and “second” do not limit the quantity and execution order, and words such as “first” and “second” do not limit certain different
[0080] In addition, the terms "comprises" and "having" and any variations thereof are intended to cover a non-exclusive inclusion. For example, a process, method, system, product or apparatus that includes a series of steps or elements is not necessarily limited to those steps or elements expressly listed but may include other steps or elements not expressly listed or inherent to such process, method, product or apparatus.
[0081] With the advancement of technology, parts processing in most fields relies on automated robotics to reduce labor costs and improve processing efficiency. However, for parts processing in certain fields, it is necessary to determine the processing location before processing, and then control the robot to process the processing location. Currently, the main method for determining the processing location involves using 3D cameras to capture part features and then determine the processing location through calculation.
[0082] Take the processing of refrigerator condenser tubes as an example. These tubes are located at the back of the refrigerator, where the refrigerant is stored, and are used to transport the refrigerant. In actual production, the two ends of the condenser tubes need to be installed separately and then manually connected. Generally, the connection between the refrigerator condenser tube and the connecting ring is performed by welding or manually crimping with crimping pliers. This is mainly achieved by manually welding the connecting ring between the upper and lower condenser tubes, or manually crimping the upper and lower condenser tubes with crimping pliers and seamlessly connecting the condenser tube and the connecting ring with a specific chemical adhesive. While this method can connect the upper and lower condenser tubes to the connecting rings, each production line requires multiple workers to coordinate the crimping or welding. The efficiency of crimping the condenser tubes is affected by the worker's proficiency, and manual crimping is prone to welding or crimping errors, resulting in high labor costs and low crimping efficiency. Traditional 2D positioning algorithms for 3D feature projection and 2D planar feature positioning are limited by the tilt angle between the imaging plane and the camera plane, which can easily lead to inconsistent tilt angles and affect the accuracy of 2D feature positioning. Feature point positioning based on 3D cameras takes a long time to collect depth position information, affecting the overall efficiency of the algorithm.
[0083] This application solves at least one of the following technical problems:
[0084] 1. When crimping refrigerator condenser tubes, there is a problem of z-axis distance deviation between the robot tool coordinate system and the robot. 2D cameras are limited by the projection plane of 3D points, and 3D cameras cannot quickly process information about the z-axis distance. 3D cameras generally require about 500 milliseconds to perform depth calculations, while laser rangefinders only require less than 50 milliseconds. A 2D camera paired with a laser rangefinder can maintain z-axis distance calculations within about 100 milliseconds. This application uses a laser rangefinder paired with a 2D camera to measure the z-axis distance of the robot tool coordinate system, reducing the robot's crimping adjustment time and improving the robot's crimping efficiency.
[0085] 2. Aiming at the problem that the crimping position cannot be accurately located due to the irregular shape of the condenser tube and the large amount of feature information. This application proposes a fast and accurate crimping positioning method based on the calculation of the direction vector and relative position between points. The direction vector between the feature points on both sides of the condenser tube and the connecting ring is used to screen the jump points above and below the connecting ring, and the pixel coordinates of the center of the connecting ring are further determined. The pixel coordinates of the center of the connecting ring are converted into coordinates in the robot tool coordinate system, and the positioning of the crimping position is completed in sequence. In addition, the point where the crimping is successfully done is used as the teaching point. The next time the same type of condenser tube and the same type of connecting ring are crimped, the position offset and angle offset can be calculated based on the teaching point, so as to achieve the purpose of continuous crimping of the robot, thereby improving the crimping efficiency and the robustness of the algorithm.
[0086] Based on this, the embodiment of the present application provides a method for positioning a processing position, such as Figure 1 As shown, the method includes the following processing steps.
[0087] S100 , acquiring a target image of a workpiece to be processed and a target distance between a processing device and the workpiece to be processed in a first direction.
[0088] The target image is a two-dimensional image, and the processing equipment includes equipment for processing a workpiece to be processed.
[0089] For ease of understanding, the camera that photographs the workpiece to be processed has a camera coordinate system, and the target image obtained by photographing is located in the camera coordinate system, so each pixel point in the target image has corresponding pixel coordinates. Since the target image is a two-dimensional image, the pixel coordinates of the pixel points are also two-dimensional coordinates. At the same time, the processing equipment has an equipment coordinate system, which is a three-dimensional coordinate system, and two of the three coordinate axes of the equipment coordinate system correspond one-to-one to the two coordinate axes of the camera coordinate system, and the remaining coordinate axis corresponds to the first direction. Based on this, the coordinate values of the two coordinate axes of the processing position of the workpiece to be processed in the equipment coordinate system can be determined through the target image, and then combined with the target distance, the coordinate value of the third coordinate axis can be obtained, so that the three coordinate values of the processing position are all determined.
[0090] S102 : Determine a reference point of the workpiece to be processed in a preset camera coordinate system and a first position of the reference point according to the target image.
[0091] The camera coordinate system is a two-dimensional coordinate system with the shooting point of the target image as the center, the camera coordinate system includes an x-axis and a y-axis, and the first direction is perpendicular to the plane where the x-axis and the y-axis are located.
[0092] It should be noted that to determine the processing position in the device coordinate system, the position of each pixel in the target image in the camera coordinate system must be converted to coordinates in the device coordinate system. To do this, a reference point and its first position are first determined. Then, based on the first position, the second position of the reference point in the device coordinate system is determined. This allows the coordinates of each pixel in the target image in the device coordinate system to be determined.
[0093] S104 : Determine a second position of the reference point in the device coordinate system according to the first position and a preset conversion relationship between the camera coordinate system and the device coordinate system of the processing device.
[0094] The device coordinate system is a three-dimensional coordinate system, including a first direction, a second direction parallel to the x-axis, and a third direction parallel to the y-axis.
[0095] S106. Determine the processing position of the workpiece to be processed based on the target distance, the second position, the starting point position of the preset processing equipment starting point in the equipment coordinate system, and the shooting position of the shooting point in the equipment coordinate system, so that the processing equipment processes the workpiece to be processed after moving in the first direction, the second direction and / or the third direction according to the processing position.
[0096] In summary, the present application first finds the processing position of the workpiece to be processed in the target image, and then converts the processing position to the device coordinate system. For example, the first position is (0, 0). After converting the first position to the device coordinate system, the displayed coordinate value is (1, 1, 0). At this time, it can be known that the camera coordinate system is offset by 1 unit on the x-axis and 1 unit on the y-axis compared to the device coordinate system. Since the camera coordinate system is a two-dimensional coordinate system, the value of the z-axis cannot be determined. Based on this, when the processing position of the workpiece to be processed is determined to be (3, 3) using the target image, it can be converted to the device coordinate system to obtain the processing position of (4, 4, target distance). When processing, if the workpiece of the processing equipment is located at the origin of the device coordinate system, the workpiece is controlled to move 4 unit distances in the second direction, 4 unit distances in the third direction, and target distance unit distances in the first direction to reach the actual processing position of the workpiece to be processed, so as to complete the processing of the workpiece to be processed.
[0097] In this embodiment, since the target image is a two-dimensional image, the feature acquisition time of the target image is shorter than that of a 3D camera, which helps improve positioning efficiency. Furthermore, by directly obtaining the target distance of the workpiece in the first direction and determining the processing position in the first direction based on the target distance, the difficulty and complexity of calculating the processing position in the first direction are reduced, thereby helping to save computing resources, improve positioning efficiency, and ultimately improve processing efficiency.
[0098] In a possible embodiment of the present application, Figure 2 As shown, determining a reference point of a workpiece to be processed in a preset camera coordinate system and a first position of the reference point according to a target image includes:
[0099] S200: Determine the edge of the workpiece to be processed according to the target image.
[0100] The edge lines refer to the side lines of the workpiece to be processed in the target image. Specifically, the workpiece to be processed in the target image has a contour, and the lines in the contour are the edge lines.
[0101] It should be noted that when determining the edge lines, all edge lines of the workpiece to be processed may be determined, or the edge lines on any side of the workpiece to be processed may be determined in a direction, which is not specifically limited in this embodiment.
[0102] S202: Determine the center line of the workpiece to be processed according to the edge line.
[0103] The center line refers to the line between the two side lines.
[0104] S204: Determine the mutation point according to the angle between the center line and the line connecting two adjacent points on the side line.
[0105] The centerline and edgeline are actually composed of multiple pixels, each representing a point on the workpiece. Connecting two adjacent points on the edgeline creates a line between them. If the angle between the line and the centerline is too large, it indicates that the position of at least one pixel in the line has deviated, thus identifying it as a mutation point.
[0106] S206: Determine a reference point and a first position according to the mutation point.
[0107] Specifically, the mutation point can be used as a reference point, and the position of the mutation point (the position in the camera coordinate system) can be used as the first position. In addition, when there are multiple mutation points, the midpoint of the closed area surrounded by the multiple mutation points can be used as the reference point, and the position of the reference point (the position in the camera coordinate system) can be used as the first position.
[0108] It should be noted that, since the pixel coordinates of each pixel in the camera coordinate system are used in the process of calculating the mutation point, the first position is obtained first, and then the point corresponding to the first position is determined as the reference point. The specific method depends on the actual calculation process and is not specifically limited in this embodiment.
[0109] According to this embodiment, the edge line and center line of the workpiece to be processed in the target image are determined to obtain a mutation point, and the first position is determined based on the mutation point, so that the first position is related to the mutation point. The mutation point can be used as a reference point for the processing position. That is, when the processing position is subsequently determined, the position of the mutation point can be used as a reference, thereby simplifying the calculation process of the processing position, improving the calculation efficiency of the processing position, improving the positioning efficiency, and further improving the processing efficiency.
[0110] Optionally, in an implementation of this embodiment, determining the edge of the workpiece to be processed according to the target image includes:
[0111] Perform region of interest processing on the target image to determine the edge points of the workpiece to be processed in the target image;
[0112] Perform straight line fitting on the edge points to obtain the edge line.
[0113] An edge point is actually a point set, that is, a set of multiple edge points. By fitting multiple edge points on the same side of the workpiece to be processed, a line can be obtained. In other words, each line corresponds to a point set of pixels.
[0114] In this embodiment, the region of interest processing is used to accurately determine edge points, and then the edge lines are obtained by combining straight line fitting, which helps to reduce the difficulty of edge line calculation and improve calculation efficiency.
[0115] Optionally, in an implementation of this embodiment, before performing region of interest processing on the target image and determining edge points of the workpiece to be processed in the target image, the method further includes:
[0116] Retrieve the image template of the workpiece to be processed.
[0117] In one embodiment, the image template refers to a template containing the image contour of the workpiece to be processed. The approximate position of the workpiece to be processed in the target image can be identified through the image contour in the image template.
[0118] The contour position of the workpiece to be processed is determined in the target image according to the image template, so as to process the region of interest according to the contour position.
[0119] That is, the workpiece to be processed is first roughly positioned using an image template, and then the region of interest is processed to obtain the precise edge points of the workpiece to be processed.
[0120] This embodiment uses an image template to determine the contour position, which helps to improve the accuracy of processing the region of interest and reduce the amount of calculation, thereby improving calculation efficiency and reducing the occupation of computing resources.
[0121] Optionally, in an implementation of this embodiment, the edge line includes at least a first edge line and a second edge line of opposite sides of the workpiece to be processed;
[0122] Determine the center line of the workpiece to be processed based on the edge line, including:
[0123] Determine the coordinates of the midline point according to the pixel coordinates of the edge point in the first sideline in the camera coordinate system and the pixel coordinates of the edge point in the second sideline in the camera coordinate system;
[0124] Perform straight line fitting on the midline points represented by the midline point coordinates to obtain the center line.
[0125] In one embodiment, a first sideline includes multiple edge points, and a second sideline includes multiple edge points. The pixel coordinates of the edge points are averaged to obtain the midline point coordinates of the multiple midline points. Specifically, for example, the abscissa of the midline point coordinates = (x1 + x2) / 2, and the ordinate of the midline point coordinates = (y1 + y2) / 2. During calculation, the edge points of the first sideline and the edge points of the second sideline in the same row can be used to calculate the center point coordinates of the row.
[0126] After obtaining the coordinates of multiple midline points, multiple midline points are obtained, and then a straight line fitting is performed to obtain the center line.
[0127] In this embodiment, the center line is obtained by linear fitting, which makes the process of determining the center line simpler and has fewer steps, thereby helping to reduce the difficulty of calculation and improve calculation efficiency.
[0128] Optionally, in an implementation of this embodiment, determining the mutation point according to the angle between the center line and the line connecting two adjacent points on the side line includes:
[0129] Traversing edge points constituting a sideline, calculating an angle between a line connecting adjacent edge points and the center line, wherein the line includes a first line formed by connecting the first edge point and the second edge point, and the angle includes the first angle;
[0130] If the first angle exceeds a preset angle threshold, determining whether a second angle corresponding to a second edge line formed by connecting the first edge point and the third edge point exceeds the angle threshold, wherein the first edge point is adjacent to the second edge point and the third edge point;
[0131] If the second included angle exceeds the angle threshold, the first edge point is determined as the mutation point; otherwise, the second edge point is determined as the mutation point.
[0132] In one embodiment, the angle threshold may be 0.5°. When determining the mutation point, since each link involves two edge points, if the angle corresponding to link A exceeds the angle threshold, it is first determined whether the angle corresponding to the next link B after link A exceeds the angle threshold. If so, the edge point shared by links A and B is the mutation point. Otherwise, another edge point in link A is the mutation point.
[0133] Specifically, first calculate the direction vector of the connecting line: v1 = (x2-x1, y2-y1); where v1 is the direction vector of the connecting line, x1 is the x-axis coordinate value of the first edge point among the adjacent edge points, y1 is the y-axis coordinate value of the first edge point among the adjacent edge points, x2 is the x-axis coordinate value of the second edge point among the adjacent edge points, and y2 is the y-axis coordinate value of the second edge point among the adjacent edge points.
[0134] Then calculate the center line vector v2 = (x0, y0); where v2 is the center line vector, x0 is the center line x-axis coordinate value, and y0 is the center line y-axis coordinate value.
[0135] Finally, the angle is calculated according to the formula Where θ is the angle.
[0136] By adopting this embodiment, the mutation point is determined by traversing the edge points, which helps to improve the accuracy of determining the mutation point, thereby improving the accuracy of the first position, so that the subsequent determination of the processing position based on the transformed second position is more convenient and quick.
[0137] Optionally, in an implementation of this embodiment, the edge line includes at least a first edge line and a second edge line of opposite sides of the workpiece to be processed, and the mutation point includes a first mutation point located in the first edge line and a second mutation point located in the second edge line;
[0138] Determining a reference point and a first position according to the mutation point includes:
[0139] The first position is calculated according to the pixel coordinates of the first mutation point in the camera coordinate system and the pixel coordinates of the second mutation point in the camera coordinate system, wherein the pixel point corresponding to the first position is the reference point.
[0140] In one embodiment, the first position is a midpoint between the first mutation point and the second mutation point.
[0141] Specifically, the calculation process of the first position includes: Among them, p0 is the first position, x 12 is the x-axis coordinate value of the first mutation point, y 12 is the y-axis coordinate value of the first mutation point, x 22 is the x-axis coordinate value of the second mutation point, y 22 is the y-axis coordinate value of the second mutation point.
[0142] By adopting this implementation method and using pixel coordinates to calculate the first position, it helps to improve the calculation efficiency of the first position and reduce the calculation difficulty.
[0143] Optionally, in an implementation of this embodiment, as Figure 3 As shown, the workpiece to be processed includes a first workpiece, a second workpiece and a third workpiece located between the first workpiece and the second workpiece, the third workpiece is used to connect with the first workpiece and the second workpiece, and the first workpiece, the second workpiece and the third workpiece are arranged in sequence along the target direction;
[0144] Determining a reference point of a workpiece to be processed in a preset camera coordinate system and a first position of the reference point according to a target image includes:
[0145] Determining, based on the target image, a sideline L1 of the first workpiece, a sideline L2 of the first workpiece, a sideline L3 of the third workpiece, a sideline L4 of the third workpiece, a sideline L5 of the second workpiece, and a sideline L6 of the second workpiece, wherein sidelines L1 and L2 are opposite sides of the first workpiece and extend along the target direction, sidelines L3 and L4 are opposite sides of the third workpiece and extend along the target direction, and sidelines L5 and L6 are opposite sides of the second workpiece and extend along the target direction;
[0146] Calculate at least one midline point coordinate U1 based on the pixel coordinates of each edge point P1 in the sideline L1 and the pixel coordinates of each edge point Q1 in the sideline L2, and perform linear fitting on the midline point M1 represented by the midline point coordinate U1 to obtain a center line K1;
[0147] Calculate at least one midline point coordinate U2 based on the pixel coordinates of each edge point P2 in the sideline L3 and the pixel coordinates of each edge point Q2 in the sideline L4, and perform linear fitting on the midline point M2 represented by the midline point coordinate U2 to obtain the center line K2;
[0148] Calculate at least one midline point coordinate U3 based on the pixel coordinates of each edge point P3 in the sideline L5 and the pixel coordinates of each edge point Q3 in the sideline L6, and perform a straight line fitting on the midline point M3 represented by the midline point coordinate U3 to obtain a center line K3;
[0149] Performing correction processing based on at least two center lines among the center lines K1, K2, and K3 to obtain a center line H;
[0150] The mutation point P12 is determined according to the angle between the line connecting the adjacent edge points P1 and the center line H. The mutation point P22 is determined according to the angle between the line connecting the adjacent edge points Q1 and the center line H. The mutation point P11 is determined according to the angle between the line connecting the adjacent edge points P3 and the center line H. The mutation point P21 is determined according to the angle between the line connecting the adjacent edge points Q3 and the center line H.
[0151] The first position is calculated based on the pixel coordinates of the mutation points P12, P22, P11, and P21, wherein the pixel point corresponding to the first position is the reference point P0.
[0152] Among them, the pixel coordinates of the mutation point P12 are (x 12 ,y 12 ), the pixel coordinates of the mutation point P22 are (x 22 ,y 22 ), the pixel coordinates of the mutation point P11 are (x 11 ,y 11 ), the pixel coordinates of the mutation point P21 are (x 21 ,y 21 ), the pixel coordinates of the first position P0 are:
[0153]
[0154] With this implementation, when the workpieces to be processed include three workpieces, the process of determining the first position will be determined based on the edge lines of the three workpieces, which helps to improve the reliability of the first position.
[0155] Optionally, in an implementation of this embodiment, determining the second position of the reference point in the device coordinate system according to the first position and a preset conversion relationship between the camera coordinate system and the device coordinate system of the processing device includes:
[0156] A second position is obtained by performing an affine transformation based on the first position and a preset conversion relationship, wherein, among the three-dimensional coordinate values represented by the second position, the coordinate value in the first direction is 0.
[0157] According to this embodiment, the first position is transformed into the second position in the device coordinate system by using an affine transformation, which helps to improve the processing efficiency of the second position.
[0158] Optionally, in an implementation of this embodiment, determining the processing position of the workpiece to be processed according to the target distance, the second position, the starting point position of a preset processing equipment starting point in the equipment coordinate system, and the shooting position of the shooting point in the equipment coordinate system includes:
[0159] The target distance is taken as the coordinate value z of the processing position in the first direction q ;
[0160] Using the x-axis coordinate value x of the second position r , the coordinate value x of the starting point in the second direction r0 and the coordinate value x of the shooting position in the second direction p0 , calculate the coordinate value x of the processing position in the second direction q ;
[0161] Use the y-axis coordinate value y of the second position r , the coordinate value y of the starting point in the second direction r0 and the coordinate value y of the shooting position in the second direction p0 , calculate the coordinate value y1 of the processing position in the second direction to determine the processing position (x1, y1, z q ).
[0162] This implementation method directly uses the target distance as the coordinate value in the first direction, eliminating the need to calculate the coordinate value of the processing position in the first direction, which helps improve the positioning efficiency of the processing position. In addition, the coordinate values of the processing position in the second and third directions are calculated using the coordinate values. The calculation process is simple and the calculation difficulty is low, which helps improve the calculation efficiency, thereby improving the positioning efficiency of the processing position and further improving the processing efficiency.
[0163] Optionally, in an implementation of this embodiment, after determining the processing position of the workpiece to be processed according to the target distance, the second position, the starting point position of a preset processing equipment starting point in the equipment coordinate system, and the shooting position of the shooting point in the equipment coordinate system, the method further includes:
[0164] The processing position is used as the teaching position of the corresponding model of the workpiece to be processed. When processing the workpiece of the model to be processed, the processing equipment is controlled to move according to the teaching position to process the workpiece of the model to be processed.
[0165] By adopting this implementation method, when processing the same model of workpiece to be processed, the processing equipment can be directly controlled by using the teaching position, which helps to reduce the calculation steps during processing and improve processing efficiency.
[0166] Optionally, in an implementation of this embodiment, the workpiece to be processed includes a first condenser tube, a second condenser tube, and a connecting ring for connecting the first condenser tube and the second condenser tube on the back of the refrigerator.
[0167] The implementation method helps to improve the processing efficiency of the condenser tube and the connecting ring on the back of the refrigerator.
[0168] The present application also provides a processing method applied to the above positioning method, including:
[0169] Calculate the angle between the center line K1 or K3 and the x-axis to obtain the rotation angle;
[0170] The processing part of the processing equipment is controlled to move in the first direction, the second direction and / or the third direction according to the processing position and the processing part is controlled to rotate according to the rotation angle so that the processing part reaches the processing position of the workpiece to be processed.
[0171] By adopting this embodiment, the angle of the processing equipment can be adjusted during processing, which helps to improve the processing precision and ensure the accuracy of the processing position.
[0172] Optionally, in an implementation of this embodiment, the processing piece includes a crimping pliers to crimp the processed portion.
[0173] In the above embodiments of the present application, the descriptions of the various embodiments have their own emphasis. For parts that are not described in detail in a certain embodiment, please refer to the relevant descriptions of other embodiments. The steps shown in the relevant flow charts can be executed in a computer system such as a set of computer-executable instructions, and although a logical order is shown in the flow charts, in some cases, the steps shown or described can be executed in an order different from that shown here. In other words, the order of steps described in the foregoing embodiments is only an example, and reasonable adjustment of the order of steps based on the content of the embodiments of the present application is also within the scope of protection of the embodiments of the present application.
[0174] In a specific implementation of the embodiment of the present application, the processing method includes the following processing steps:
[0175] (1) Move the camera to the photo taking point to collect images (including the connecting ring and the upper and lower condenser tubes), obtain the pre-stored template images of the corresponding model of the connecting ring and the upper and lower condenser tube socket positions, perform feature coarse positioning, and obtain the pixel coordinates of the side feature points (i.e., edge points) of the upper condenser tube, the feature points (i.e., edge points) on both sides of the connecting ring, and the pixel coordinates of the feature points (i.e., edge points) on both sides of the expansion tube of the lower condenser tube.
[0176] (2) The rectangular ROI (full name: Region of Interest) is used to select the edge points on both sides of the condenser, and the fitting straight lines (i.e., edge lines) on both sides of the condenser are fitted. The point sets of the fitting straight lines on both sides of the condenser are P = {p1, p2, p3...p n}, P is the edge point on the left side of the condenser and Q={q1,q2,q3...q n}, Q is the edge point on the right side of the condenser, and n is the number of edge points. According to P and Q, the point set M of the condenser center line is obtained as follows: M = {m1, m2, m3...m n}, m n is a point on the centerline of the condenser tube. Similarly, fit the centerline of the connecting ring. Then fit a straight line between the centerline of the condenser tube and the centerline of the connecting ring to obtain the centerline N; solve the angle δ between the centerline of the condenser tube and the x-axis in the camera coordinate system;
[0177] The center line position is corrected according to the pixel points of the center line N to obtain the corrected center line H. Then, the direction vector of the straight line connecting the two adjacent edge points of the upper condenser tube is obtained, that is, the direction vector of the line connecting the edge point (x1, y1) and the adjacent point (x2, y2).
[0178] v1=(x2-x1,y2-y1) (Formula 1)
[0179] The angle θ with the center line H vector v2 = (x0, y0):
[0180]
[0181] According to the above, when the angle is greater than 1°, it is judged as a mutation point, and when the angle is greater than 0.5° and less than 1°, it is a gradual change point. The two mutation points P1-2 where the direction vector angle mutation occurs are (x 12 ,y 12 ), P2-2 is (x 22 ,y 22 ), similarly, according to the direction vector, the two mutation points P1-1 where the direction of the lower condenser tube begins to change are (x 11 ,y 11 ), P2-1 is (x 21 ,y 21 );
[0182] The center point of the connecting ring (i.e., the reference point) is precisely located, and the coordinates of its center point P0 (i.e., the first position) are fitted based on the two pairs of mutation points;
[0183]
[0184] According to the fitted center point pixel coordinate P0, the coordinate transformation relationship (i.e., affine transformation matrix) from the pixel coordinate system to the robot coordinate system (i.e., device coordinate system) obtained by nine-point calibration is transformed into the robot coordinate system Pr0 to obtain the second position. The position information Pr0 of the second position in the robot coordinate system is (x r ,y r ,z r ), according to Pr0 and the angle δ, the mobile robot performs crimping, wherein Pr0 is used to control the moving direction and moving distance, and the angle δ is used to control the rotation angle;
[0185] (6) The crimping position (i.e. processing position) Qr0 is (x q ,y q ,z q ), where x q and z q The coordinates of the robot starting point are calibrated by the rotation center Rr0 (x r0 ,y r0 ,z r0 ), the robot coordinates Pp0 of the photographing point are (x p0 ,y p0 ,z p0 ) and the robot coordinate Pr0, y q The laser rangefinder readings indicate that Rr0 and Pp0 need to be determined in advance before crimping.
[0186] x q =x r0 +x p0 -x r (Formula 4)
[0187] z q =z r0 +z p0 -z r (Formula 5)
[0188] (7) Perform crimping, and use the crimping position as the coordinate of the registered teaching point r and record it in the document for reading the teaching point. According to steps (1), (2), (3), and (4) in this process, return to the photo point Pp0 to take a photo to determine the pixel position of the center point of the connecting ring of the next refrigerator and the angle between the connecting ring and the x-axis in the pixel coordinate system (i.e., the camera coordinate system). According to step (5), the pixel position of the center point of the connecting ring is converted to the coordinate of the robot coordinate system. According to step (6), determine the crimping position of the condenser tube of this refrigerator when crimping, and calculate the robot's secondary crimping compensation amount.
[0189] Specifically, the coordinates of the registered teaching point r are (x m ,y m ,z m ), according to the center pixel position of the connecting ring of the next refrigerator and the angle γ between the ring and the x-axis in the pixel coordinate system, first convert the center pixel position of the connecting ring to the robot coordinate system coordinate to obtain (x r1 ,y r1 ,z r1 ), calculate the robot crimping compensation ΔPx, ΔPy, ΔPz:
[0190] ΔP x =x r1 -x m
[0191] ΔP y =y r1 -y m
[0192] ΔP z =z r1 -z m
[0193] And the ring rotation offset angle Δθ:
[0194] Δθ=γ-δ
[0195] (8) The crimping deviation of the refrigerator condenser tube is judged based on the crimping offset in (7). When the crimping deviation of the ring center point is less than 1mm, crimping is performed according to the offset and offset angle. When the deviation exceeds the acceptable range, the crimping is abandoned and re-teaching or crimping compensation is considered.
[0196] The above is an illustration of the method embodiment according to the present application. The embodiment of the present invention further provides a processing system. Figure 4 FIG. 1 is a schematic diagram of a processing system according to an embodiment of the present invention. Figure 4 As shown, the processing system includes a processing device 1 for performing connection processing on a workpiece 5 to be processed;
[0197] Camera 2, used to take pictures of the workpiece 5 to obtain a target image;
[0198] a distance meter 3 for detecting the distance between the processing equipment 1 and the workpiece 5 to be processed in a first direction;
[0199] The controller 4 is used to control the processing equipment 1, the camera 2 and / or the rangefinder 3 to perform corresponding actions, and is also used to determine the processing position using the above-mentioned positioning method, and control the processing equipment 1 to process the workpiece 5 according to the processing position.
[0200] In an optional implementation of the embodiment of the present application, the rangefinder 3 includes a laser rangefinder.
[0201] In an optional implementation of an embodiment of the present application, the processing system includes a crimping system for crimping the condenser tube on the back of the refrigerator.
[0202] The above describes the device embodiments of the present application. For detailed descriptions of the specific execution processes of data, terms, nouns, steps, technical issues and effects, alternative methods and combinations, please refer to the descriptions in the method embodiments, which will not be repeated here.
[0203] The sequence of the serial numbers or introduction of the embodiments of this application is for description only and does not represent the superiority or inferiority of the embodiments.
[0204] 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 exemplary. For example, the division of the units can be a logical function division. In actual implementation, there may be other division methods, such as 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.
[0205] The units described as separate components may or may not be physically separate, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed across multiple units. Some or all of the units may be selected according to actual needs to achieve the purpose of the present embodiment.
[0206] In addition, the functional units in the various embodiments of the present application may be integrated into a single processing unit, or each unit may exist physically separately, or two or more units may be integrated into a single unit. The aforementioned integrated units may be implemented in the form of hardware or software functional units.
[0207] In the above embodiments, all or part of the embodiments can be implemented by software, hardware, firmware, or any combination thereof. When implemented using software, all or part of the embodiments can be implemented in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer instructions are loaded and executed on a computer, all or part of the processes or functions described in the embodiments of the present application are generated. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions can be transmitted from one website, computer, server, or data center to another website, computer, server, or data center via a wired (e.g., coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) method. The computer-readable storage medium can be any available medium that can be accessed by a computer, or a data storage device such as a server or data center that includes one or more available media integrated therein. The available medium may be a magnetic medium (e.g., a floppy disk, a hard disk, or a magnetic tape), an optical medium (e.g., a digital versatile disc (DVD)), or a semiconductor medium (e.g., a solid state disk (SSD)). It is worth noting that the computer-readable storage medium mentioned in the embodiments of the present application may be a non-volatile storage medium, in other words, a non-transient storage medium.
[0208] It should be noted that the information (including but not limited to user device information, user personal information, etc.), data (including but not limited to data used for analysis, stored data, displayed data, etc.) and signals involved in the embodiments of this application are all authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with the relevant laws, regulations and standards of the relevant countries and regions. For example, the scene data of the current frame in the three-dimensional virtual scene, the client's device information, and the scene interaction information involved in the embodiments of this application are all obtained with full authorization.
[0209] The above is only a preferred embodiment of the present application. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principles of the present application. These improvements and modifications should also be regarded as the scope of protection of the present application.
Claims
1. A method for positioning a processing position, characterized in that: include: Acquire a target image of a workpiece to be processed and a target distance between a processing device and the workpiece to be processed in a first direction, wherein the target image is a two-dimensional image, and the processing device includes a device for processing the workpiece to be processed; Determining, based on the target image, a reference point of the workpiece to be processed in a preset camera coordinate system and a first position of the reference point, wherein the camera coordinate system is a two-dimensional coordinate system with the shooting point of the target image as the center, the camera coordinate system includes an x-axis and a y-axis, and the first direction is perpendicular to a plane in which the x-axis and the y-axis are located; determining a second position of the reference point in the device coordinate system based on the first position and a preset conversion relationship between the camera coordinate system and a device coordinate system of the processing device, wherein the device coordinate system is a three-dimensional coordinate system including the first direction, a second direction parallel to the x-axis, and a third direction parallel to the y-axis; The processing position of the workpiece to be processed is determined based on the target distance, the second position, the starting point position of the preset processing equipment starting point in the equipment coordinate system, and the shooting position of the shooting point in the equipment coordinate system, so that the processing equipment processes the workpiece to be processed after moving in the first direction, the second direction and / or the third direction according to the processing position.
2. The method for positioning a processing position according to claim 1, wherein: Determining a reference point of the workpiece to be processed in a preset camera coordinate system and a first position of the reference point according to the target image includes: determining the edge of the workpiece to be processed according to the target image; Determining the center line of the workpiece to be processed according to the edge line; Determine the mutation point according to the angle between the center line and the line connecting two adjacent points on the side line; The reference point and the first position are determined according to the mutation point.
3. The method for positioning a processing position according to claim 2, wherein: Determining the edge of the workpiece to be processed according to the target image includes: Performing region of interest processing on the target image to determine edge points of the workpiece to be processed in the target image; Linear fitting is performed on the edge points to obtain the edge line.
4. The method for positioning a processing position according to claim 3, characterized in that: Before performing region of interest processing on the target image to determine edge points of the workpiece to be processed in the target image, the method further includes: Retrieving an image template of the workpiece to be processed; The contour position of the workpiece to be processed is determined in the target image according to the image template, so as to perform the region of interest processing according to the contour position.
5. The method for positioning a processing position according to claim 2, wherein: The edge lines at least include a first edge line and a second edge line of opposite sides of the workpiece to be processed; Determining the center line of the workpiece to be processed according to the edge line includes: Determine the coordinates of the midline point according to the pixel coordinates of the edge point in the first sideline in the camera coordinate system and the pixel coordinates of the edge point in the second sideline in the camera coordinate system; A straight line fitting is performed on the midline points represented by the midline point coordinates to obtain the center line.
6. The method for positioning a processing position according to claim 2, wherein: Determining the mutation point according to the angle between the center line and the line connecting two adjacent points on the side line includes: Traversing the edge points constituting the edge line, calculating an angle between a line connecting adjacent edge points and the center line, wherein the line includes a first line formed by connecting a first edge point and a second edge point, and the angle includes a first angle; If the first angle exceeds a preset angle threshold, determining whether a second angle corresponding to a second edge line formed by connecting the first edge point and a third edge point exceeds the angle threshold, wherein the first edge point is adjacent to the second edge point and the third edge point; If the second angle exceeds the angle threshold, the first edge point is determined as the mutation point; otherwise, the second edge point is determined as the mutation point.
7. The method for positioning a processing position according to claim 2, wherein: The edge lines at least include a first edge line and a second edge line of opposite sides of the workpiece to be processed, and the inflection points include a first inflection point located in the first edge line and a second inflection point located in the second edge line; The determining the reference point and the first position according to the mutation point includes: The first position is calculated based on the pixel coordinates of the first mutation point in the camera coordinate system and the pixel coordinates of the second mutation point in the camera coordinate system, wherein the pixel point corresponding to the first position is the reference point.
8. The method for positioning a processing position according to claim 1, wherein: The workpiece to be processed includes a first workpiece, a second workpiece, and a third workpiece located between the first workpiece and the second workpiece, the third workpiece being used to connect with the first workpiece and the second workpiece, and the first workpiece, the second workpiece, and the third workpiece are arranged in sequence along a target direction; Determining a reference point of the workpiece to be processed in a preset camera coordinate system and a first position of the reference point according to the target image includes: Determining, based on the target image, a sideline L1 of the first workpiece, a sideline L2 of the first workpiece, a sideline L3 of the third workpiece, a sideline L4 of the third workpiece, a sideline L5 of the second workpiece, and a sideline L6 of the second workpiece, wherein the sidelines L1 and L2 are opposite sides of the first workpiece and extend along the target direction, the sidelines L3 and L4 are opposite sides of the third workpiece and extend along the target direction, and the sidelines L5 and L6 are opposite sides of the second workpiece and extend along the target direction; Calculate at least one midline point coordinate U1 based on the pixel coordinates of each edge point P1 in the sideline L1 and the pixel coordinates of each edge point Q1 in the sideline L2, and perform linear fitting on the midline point M1 represented by the midline point coordinate U1 to obtain a center line K1; Calculate at least one midline point coordinate U2 based on the pixel coordinates of each edge point P2 in the sideline L3 and the pixel coordinates of each edge point Q2 in the sideline L4, and perform straight-line fitting on the midline point M2 represented by the midline point coordinate U2 to obtain a center line K2; Calculate at least one midline point coordinate U3 based on the pixel coordinates of each edge point P3 in the sideline L5 and the pixel coordinates of each edge point Q3 in the sideline L6, and perform linear fitting on the midline point M3 represented by the midline point coordinate U3 to obtain a center line K3; Performing correction processing on at least two center lines among the center lines K1, K2 and K3 to obtain a center line H; The mutation point P12 is determined according to the angle between the line connecting the adjacent edge points P1 and the center line H, the mutation point P22 is determined according to the angle between the line connecting the adjacent edge points Q1 and the center line H, the mutation point P11 is determined according to the angle between the line connecting the adjacent edge points P3 and the center line H, and the mutation point P21 is determined according to the angle between the line connecting the adjacent edge points Q3 and the center line H; The first position is calculated based on the pixel coordinates of the mutation points P12, P22, P11 and P21, wherein the pixel point corresponding to the first position is the reference point.
9. The method for positioning a processing position according to claim 1, wherein: Determining the second position of the reference point in the device coordinate system according to the first position and a preset conversion relationship between the camera coordinate system and the device coordinate system of the processing device includes: The second position is obtained by performing an affine transformation based on the first position and the preset conversion relationship, wherein, among the three-dimensional coordinate values represented by the second position, the coordinate value in the first direction is 0.
10. The method for positioning a processing position according to claim 1, characterized in that: Determining the processing position of the workpiece to be processed according to the target distance, the second position, the starting point position of a preset processing equipment starting point in the equipment coordinate system, and the shooting position of the shooting point in the equipment coordinate system includes: The target distance is used as the coordinate value of the processing position in the first direction ; Using the x-axis coordinate value of the second position , the coordinate value of the starting point in the second direction and the coordinate value of the shooting position in the second direction , calculate the coordinate value of the processing position in the second direction ; Using the y-axis coordinate value of the second position , the coordinate value of the starting point in the second direction and the coordinate value of the shooting position in the second direction , calculate the coordinate value of the processing position in the second direction , to determine the processing position ( , , ).
11. The method for positioning a processing position according to claim 1, characterized in that: After determining the processing position of the workpiece to be processed according to the target distance, the second position, the starting point position of a preset processing equipment starting point in the equipment coordinate system, and the shooting position of the shooting point in the equipment coordinate system, the method further includes: The processing position is used as the teaching position of the corresponding model of the workpiece to be processed, so that when processing the workpiece to be processed of this model, the processing equipment is controlled to move according to the teaching position to process the workpiece to be processed of this model.
12. The method for positioning a processing position according to any one of claims 1 to 11, characterized in that: The workpiece to be processed includes a first condenser tube, a second condenser tube and a connecting ring for connecting the first condenser tube and the second condenser tube on the back of the refrigerator.
13. A processing method, characterized in that: Applied to the positioning method according to claim 8, the processing method includes: Calculate the angle between the center line K1 or K3 and the x-axis to obtain the rotation angle; The processing part of the processing equipment is controlled to move in the first direction, the second direction and / or the third direction according to the processing position and is controlled to rotate according to the rotation angle so that the processing part reaches the processing position of the workpiece to be processed.
14. The processing method according to claim 13, characterized in that: The processing part includes a crimping pliers for crimping the processed part.
15. A processing system, characterized in that: Including processing equipment for connecting the workpiece to be processed; A camera is used to take pictures of the workpiece to be processed to obtain a target image; a distance meter, for detecting the distance between the processing equipment and the workpiece to be processed in a first direction; A controller is used to control the processing equipment, camera and / or rangefinder to perform corresponding actions, and is also used to determine the processing position using the positioning method described in any one of claims 1 to 12, and control the processing equipment to process the workpiece to be processed according to the processing position.
16. The processing system according to claim 15, characterized in that The rangefinder comprises a laser rangefinder.
17. The processing system according to claim 15 or 16, characterized in that: The processing system includes a crimping system for crimping the condenser tube at the back of the refrigerator.
Citation Information
Patent Citations
Welding hand-eye calibration system and method based on machine vision
CN115229813A
Three-dimensional finger vein recognition method and system
US20190347461A1