Visual positioning method for copper pipe in refrigeration field

By using visual positioning technology on copper tube conveying chains in the refrigeration field, images are collected and preprocessed to obtain adaptive compensation values, the problem of inaccurate placement of copper tubes is solved, and placement accuracy and production quality are improved.

CN120182370APending Publication Date: 2025-06-20QINGDAO HISENSE BOSCH AIR CONDITIONING SYSTEM CO LTD +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510243676.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-03-03
Publication Date
2025-06-20

AI Technical Summary

Technical Problem

During the refrigeration field, due to the poor movement and positioning accuracy of the conveying chain, the copper pipe falls and placement is inaccurate, causing damage and poor outflow, affecting production quality and efficiency.

Method used

Through the calibrated camera set at the head of the PLC gripper for grabbing the copper tube, the visual position image of the copper tube transmission chain is collected, and the image is preprocessed, including image binarization, Hough transformation, Blob detection and area growth algorithm, the optimized pixel feature map is obtained, the adaptive compensation value of the perforation position is calculated, and the placement of the copper tube is guided.

Benefits of technology

It improves the accuracy of the placement of copper pipes on the conveying chain, improves production efficiency and quality, and avoids damage and poor outflow of copper pipes.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120182370A_ABST
    Figure CN120182370A_ABST
Patent Text Reader

Abstract

The invention discloses a copper pipe visual positioning method in the refrigeration field, and the method specifically comprises the steps: S1, collecting and obtaining a visual position image of a copper pipe conveying chain through a calibrated camera disposed at the head of a PLC gripper used for grabbing a copper pipe; s2, preprocessing the visual position image to obtain an optimized pixel feature map; and S3, obtaining a self-adaptive compensation value of the perforation position according to the optimized pixel feature map, so as to guide and place the copper pipe according to the self-adaptive compensation value. By means of the method, the problems that in the copper pipe placing process in the refrigeration field at present, due to the fact that a conveying chain can generate the poor moving and positioning precision, copper pipe gouges and poor outflow are often caused by inaccurate falling and placing of copper pipes, the production quality is seriously affected, and the production efficiency is low are solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of visual positioning, and particularly to a visual positioning method for copper tubes in the refrigeration field. Background Art

[0002] For the copper tube placement device in the refrigeration field, the biggest difficulty is how to accurately place the copper tubes into the conveyor chain. Currently, during the placement process of copper tubes in the refrigeration field, due to the movement of the conveyor chain itself, the positioning accuracy is poor. Therefore, it often causes copper tubes to be bruised due to inaccurate falling and placement, resulting in defective products flowing out, seriously affecting the production quality and low production efficiency. Summary of the Invention

[0003] The present invention provides a visual positioning method for copper tubes in the refrigeration field to overcome the above technical problems.

[0004] To achieve the above object, the technical solution of the present invention is as follows:

[0005] A visual positioning method for copper tubes in the refrigeration field specifically includes the following steps:

[0006] S1: Collect and obtain the visual position image of the copper tube conveyor chain through a calibrated camera set at the head of the PLC gripper for grasping the copper tubes;

[0007] And the visual position image is an image taken along the copper tube perforation direction of the conveyor chain with the copper tube perforation as the center;

[0008] S2: Preprocess the visual position image to obtain an optimized pixel feature map;

[0009] And the preprocessing includes:

[0010] S21: Perform image binarization processing on the visual position image to obtain a binarized image;

[0011] S22: Perform Hough transform on the binarized image to identify the circular spot-shaped pixel points in the binarized image;

[0012] S23: Detect the circular spot-shaped pixel points through a Blob detector, and extract the roundness of the circular spot-shaped pixel points through Open CV technology to obtain a pixel roundness feature map;

[0013] S24: Based on the local threshold segmentation method, adaptively screen the roundness of the circular spot-shaped pixel points that meet the preset roundness threshold according to the pixel roundness feature map to roughly extract the positioning screw hole pixels for copper tube placement position compensation, and obtain a hole pixel feature map;

[0014] S25: Use the edges_sub_pix operator to extract the pixel edge contour of the positioning screw holes in the hole pixel feature map, and use the fit_circle_contour_xld function for circular fitting to obtain a fitting feature map containing the pixel feature circles of the positioning screw holes;

[0015] S26: Based on the region growing algorithm, perform pixel filling of the pixel feature circles of the positioning screw holes on the fitting feature map to obtain an optimized pixel feature map;

[0016] S3: Obtain the adaptive compensation value of the perforation position according to the optimized pixel feature map, so as to realize the guided placement of the copper tube according to the adaptive compensation value.

[0017] Further, the method for obtaining the adaptive compensation value of the perforation position in S3 is

[0018] S31: Define and obtain the reference position points of two positioning screw holes located on both sides of the copper tube perforation, and obtain the expected center point of the copper tube perforation according to the reference position points;

[0019] And the calculation formula for the expected center point of the copper tube perforation is

[0020] P CEN (X,Y) = [P1(X1,Y1) + P2(X2,Y2)] / 2

[0021] In the formula: P CEN (X,Y) represents the expected center point of the copper tube perforation; X and Y respectively represent the abscissa and ordinate of the expected center point; P1(X1,Y1) represents the reference position point of a positioning screw hole; X1 and Y1 represent the abscissa and ordinate of P1(X1,Y1); P2(X2,Y2) represents the reference position point of another positioning screw hole; X2 and Y2 represent the abscissa and ordinate of P2(X2,Y2);

[0022] S32: Obtain the center coordinates of the pixel feature circles of two positioning screw holes located on both sides of the copper tube perforation in the optimized pixel feature map;

[0023] The center coordinates of the pixel feature circle of the positioning screw hole are the average coordinates of all pixel points within the obtained pixel feature circle of the positioning screw hole;

[0024] And confirm the actual center point of the copper tube perforation according to the center coordinates;

[0025] And the calculation formula for the actual center point of the copper tube perforation is

[0026] P' CEN (X',Y') = [P'1(X'1,Y'1) + P'2(X'2,Y'2)] / 2

[0027] Where: P' CEN (X', Y') represents the actual center point of the copper tube perforation; X' and Y' respectively represent the abscissa and ordinate of the actual center point; P'1(X'1, Y'1) represents the center coordinates of a positioning screw hole pixel feature circle; X'1 and Y'1 represent the abscissa and ordinate of P'1(X'1, Y'1); P'2(X'2, Y'2) represents the center coordinates of another positioning screw hole pixel feature circle; X'2 and Y'2 represent the abscissa and ordinate of P'2(X'2, Y'2).

[0028] S33: Obtain the offset angle of the copper tube perforation according to the expected center point and the actual center point of the copper tube perforation.

[0029] And the calculation formula for the offset angle of the copper tube perforation is

[0030]

[0031] Where: A represents the offset angle of the copper tube perforation.

[0032] S34: Obtain the adaptive compensation value of the perforation position based on steps S31 to S33.

[0033] And the adaptive compensation value is the position abscissa compensation value, the position abscissa compensation value, and the offset angle compensation value of the copper tube perforation.

[0034] Furthermore, the method for obtaining the optimized pixel feature map by pixel filling of the positioning screw hole pixel feature circle for the fitting feature map based on the region growing algorithm in S26 specifically includes the following steps:

[0035] S261: Set the boundary region of the positioning screw hole pixel feature circle.

[0036] According to the preset image coordinate system, divide the positioning screw hole pixel feature circle into several pixel lines along the abscissa direction based on the boundary region, and obtain the disconnection position points of the pixel lines.

[0037] And take the pixel line with the disconnection position point as the target line to be pixel-filled.

[0038] Take the pixel points at the disconnection position points as pixel seed points, and perform region expansion connection on the disconnection position points of the target line to be pixel-filled based on the region growing algorithm, so as to realize pixel filling and obtain the initial filled feature map.

[0039] And the pixel value of the pixel filling is the same as the pixel value of the pixel seed points.

[0040] S262: Based on the boundary area, the positioning screw hole pixel feature circle in the initial completion feature map is divided into a number of pixel lines along the ordinate direction again, and the line break position points of the pixel lines are obtained again;

[0041] Based on the region growing algorithm, the broken line locations are again expanded and connected to obtain an optimized completed feature map with pixel filling.

[0042] Furthermore, before completing the pixel completion of the pixel feature circle of the positioning screw hole on the fitting feature map, it also includes pixel filtering processing of the pixel feature circle of the positioning screw hole as follows:

[0043] Set the filter pixel area threshold;

[0044] The pixel area of ​​each pixel feature circle in the fitting feature map of the pixel feature circle containing the positioning screw hole obtained in step S25 is obtained, and the pixel feature circles whose pixel areas are smaller than the set filtering pixel area threshold are filtered and deleted, and the pixel feature circles whose pixel areas are greater than or equal to the filtering pixel area threshold are retained.

[0045] Furthermore, the local threshold segmentation method described in S24 adaptively screens the roundness of circular spot-shaped pixels that meet a preset roundness threshold according to the pixel roundness feature map, specifically including the following steps:

[0046] By obtaining the roundness of each circular spot pixel in the pixel roundness feature map;

[0047] A roundness threshold is preset, and the circular spot pixels corresponding to the roundness that meets the preset roundness threshold are retained, and the circular spot pixels corresponding to the roundness that does not meet the preset roundness threshold are deleted to obtain a preselected area image including the positioning screw hole pixels.

[0048] Furthermore, the method for guiding the placement of the copper tube according to the adaptive compensation value in S3 is:

[0049] Sending adaptive compensation values ​​to the controller of the PLC gripper through a preset control device;

[0050] The controller sends a movement control instruction to a servo motor of the PLC gripper based on the adaptive compensation value, so as to guide the PLC gripper to place the copper tube on a conveyor chain for conveying the copper tube according to the movement control instruction;

[0051] It also includes stopping the conveyor chain by controlling the device before the PLC gripper places the copper tube on the conveyor chain, and after the conveyor chain stops running, taking a visual position image of the conveyor chain by a calibrated camera copper tube set on the head of the PLC gripper.

[0052] Beneficial effects: The present invention provides a visual positioning method for copper tubes in the refrigeration field. By collecting and obtaining the visual position images of the copper tube conveying chain, preprocessing the visual position images, and obtaining the adaptive compensation value of the perforation position according to the preprocessed visual position images, the placement of the copper tubes is guided according to the adaptive compensation value. It solves the problems that in the process of placing copper tubes in the refrigeration field, due to the movement of the conveying chain itself, the positioning accuracy is poor, resulting in bruises of copper tubes caused by inaccurate falling and placement of copper tubes, resulting in defective outflows, seriously affecting the production quality and low production efficiency. It greatly improves the accuracy of placing copper tubes on the conveying chain and improves the production efficiency and quality. Brief Description of the Drawings

[0053] In order to more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the following will briefly introduce the drawings required for use in the description of the embodiments or the prior art. Obviously, the drawings in the following description are some embodiments of the present invention. For those of ordinary skill in the art, without creative efforts, other drawings can also be obtained according to these drawings.

[0054] Figure 1 It is a flowchart of a visual positioning method for copper tubes in the refrigeration field of the present invention;

[0055] Figure 2 It is a schematic diagram of the image after binaryzation processing in this embodiment;

[0056] Figure 3 It is a schematic diagram of the image after Hough transform on the binary image in this embodiment;

[0057] Figure 4 It is a schematic diagram of the hole pixel feature map obtained in this embodiment;

[0058] Figure 5 It is a schematic diagram of obtaining an optimized pixel feature map by pixel filling of the positioning screw hole pixel feature circle for the fitting feature map in this embodiment;

[0059] Figure 6 It is a schematic diagram of obtaining the coordinates of the perforation position in this embodiment;

[0060] Figure 7 It is a schematic diagram of obtaining the adaptive compensation value of the perforation position in this embodiment. Detailed Embodiments

[0061] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are some, but not all, of the embodiments of the present invention. All other embodiments obtained by those of ordinary skill in the art based on the embodiments of the present invention without creative efforts shall fall within the protection scope of the present invention.

[0062] This embodiment provides a visual positioning method for copper tubes in the refrigeration field. As Figure 1 shown, it specifically includes the following steps:

[0063] S1: Collect and obtain the visual position image of the copper tube conveying chain through a calibrated camera set at the head of the PLC gripper for grasping the copper tube; and the visual position image is an image taken along the direction of the copper tube perforation of the conveying chain with the copper tube perforation as the center.

[0064] S2: Preprocess the visual position image to obtain an optimized pixel feature map.

[0065] And the preprocessing includes:

[0066] S21: Perform image binarization processing on the visual position image to obtain a binarized image.

[0067] Specifically, as Figure 2 shown, the image binarization process is to convert a grayscale image into a binary image containing only black and white colors. Its core is to compare the pixel grayscale value with a threshold by setting the threshold, so as to divide the pixels into two categories. Specifically, it includes grayscale processing: if the image is in color, it needs to be converted into a grayscale image first, and the grayscale value of each pixel is usually obtained by weighted averaging the RGB channels; setting the threshold: select a threshold T to distinguish the foreground and background of the image, and the threshold can be a fixed value or determined by an adaptive method. The adaptive methods are such as the Otsu method, local adaptive threshold, etc., and compare the grayscale value I(x, y) of each pixel with the threshold T. For example, if I(x, y) ≥ T, set the pixel to white (255); if I(x, y) < T, set the pixel to black (0). The finally output image containing only black and white pixels is the binarized image.

[0068] S22: Perform the Hough transform on the binarized image to identify the circular pixel points in the binarized image.

[0069] Specifically, as Figure 3As shown, Hough transform is a feature extraction technology used to identify geometric shapes in an image, and the geometric shapes include straight lines or circles. In this embodiment, Hough transform is used to perform circle detection on the visual position image after the image is binarized. The principle of using Hough transform to perform circle detection is to first perform pixel edge detection on the image, and then determine the center and radius of the circle by an accumulator method, that is, first detect the center of the pixel point. The principle of detecting the center of the pixel point is the intersection of all normals of the circumference of the circle where the center of the circle is located. Therefore, as long as this intersection is found, the center of the circle can be determined, and then the radius of the pixel circle is derived by an accumulator to identify and obtain the circular spot pixel points in the binary image;

[0070] S23: detecting circular spot pixels by using a Blob detector, and extracting the roundness of the circular spot pixels by using Open CV technology to obtain a pixel roundness feature map;

[0071] Specifically, Figure 4 As shown, the circular spot-shaped pixel points in this embodiment can be circles or other connected areas. In Open CV, the Simple Blob Detector class tool provides a parameterized way to detect spots, including filtering according to features such as color, size, roundness, convexity, and moment of inertia. This embodiment can filter out circular spots with a roundness close to 1 by setting the filterByCircularity parameter, and use them as pixel roundness features for positioning screw holes;

[0072] S24: Based on a local threshold segmentation method, the roundness of circular spot-shaped pixels that meet a preset roundness threshold are adaptively screened according to the pixel roundness feature map, so as to roughly extract the positioning screw hole pixels used for copper tube placement compensation and obtain a hole pixel feature map;

[0073] In this embodiment, based on the local threshold segmentation method, the roundness of circular spot-shaped pixels that meet the preset roundness threshold is adaptively screened according to the pixel roundness feature map, specifically including the following steps: by obtaining the roundness of each circular spot-shaped pixel in the pixel roundness feature map; and presetting the roundness threshold, and retaining the circular spot-shaped pixels corresponding to the roundness that meets the preset roundness threshold, and deleting the circular spot-shaped pixels corresponding to the roundness that does not meet the preset roundness threshold, so as to obtain a preselected area image including the positioning screw hole pixels; in this embodiment, due to the large number of impurity noise points in the pixel roundness feature map, the roundness of the circular spot-shaped pixels that meet the preset roundness threshold is adaptively screened, and the roundness of the circular spot-shaped pixels with a roundness value of more than 0.7 is retained, so as to improve the extraction accuracy of the positioning screw hole pixels used for copper tube placement compensation;

[0074] S25: Use the edges_sub_pix operator to extract the pixel edge contour of the positioning screw hole in the hole pixel feature map, and use the fit_circle_contour_xld function for circular fitting to obtain a fitting feature map containing the pixel feature circle of the positioning screw hole;

[0075] Among them, the edges_sub_pix operator in this embodiment is an operator in Halcon for sub-pixel edge extraction, which can extract the edge contour in the image and return contour data (XLD contour) with sub-pixel accuracy; the fit_circle_contour_xld function is an operator in Halcon for fitting circular contours, which can fit the optimal circular parameters according to the extracted XLD contour, and after the fitting is completed, it can draw the fitted circle on the image according to the fitted circular parameters, that is, the center coordinates and radius, to generate a fitting feature map containing the pixel feature circle of the positioning screw hole;

[0076] S26: Based on the region growing algorithm, perform pixel completion of the pixel feature circle of the positioning screw hole on the fitting feature map to obtain an optimized pixel feature map;

[0077] In this embodiment, the method of performing pixel completion of the pixel feature circle of the positioning screw hole on the fitting feature map based on the region growing algorithm to obtain an optimized pixel feature map is as Figure 5 shown, and specifically includes the following steps:

[0078] Specifically, before performing pixel completion of the pixel feature circle of the positioning screw hole on the fitting feature map, it also includes pixel filtering processing of the pixel feature circle of the positioning screw hole as

[0079] Set the filtering pixel area threshold;

[0080] Obtain the pixel area of each pixel feature circle in the fitting feature map containing the pixel feature circle of the positioning screw hole obtained through step S25, and filter and delete the pixel feature circles with the obtained pixel area less than the set filtering pixel area threshold, and retain the pixel feature circles with the pixel area greater than or equal to the filtering pixel area threshold;

[0081] S261: Set the boundary region of the pixel feature circle of the positioning screw hole;

[0082] According to the preset image coordinate system, divide the pixel feature circle of the positioning screw hole along the abscissa direction into several pixel lines based on the boundary region, and obtain the break point positions of the pixel lines;

[0083] The method for obtaining the disconnection position points of the pixel lines is as follows: When processing the disconnection position points of the pixel lines, the edge detection algorithm (such as Canny edge detection) is used to identify the line edges of each pixel line in the image; the contour detection algorithm (such as the findContours function in OpenCV) is used to obtain the contours of the pixel lines to obtain the end points of the pixel lines and the gaps between the pixel lines; and the pixel points at both ends of the pixel line gap are defined as the disconnection position points of the pixel lines;

[0084] And the pixel lines with disconnection position points are used as the target lines to be pixel-complemented;

[0085] The pixel points at the disconnection position points are used as pixel seed points, and based on the region growing algorithm, the disconnection position points in the target lines to be pixel-complemented are regionally extended and connected, so as to realize pixel filling and obtain the initial complemented feature map;

[0086] And the pixel value of the pixel filling is the same as the pixel value of the pixel seed points;

[0087] S262: Based on the boundary region, the positioning screw hole pixel feature circles in the initial complemented feature map are further divided into several pixel lines along the vertical coordinate direction, and the disconnection position points of the pixel lines are obtained again;

[0088] Based on the region growing algorithm, the disconnection position points are regionally extended and connected again, so as to obtain the optimized complemented feature map of pixel filling; in this embodiment, through pixel complementation in two different directions, the improvement of the positioning screw hole pixel features is effectively realized, so as to improve the recognition accuracy of the positioning screw hole pixels, and further improve the calculation accuracy of the subsequent adaptive compensation value;

[0089] S3: Obtain the adaptive compensation value of the perforation position according to the optimized pixel feature map, so as to realize the guided placement of the copper tube according to the adaptive compensation value; as Figures 6 to 7 shown, the method for obtaining the adaptive compensation value of the perforation position in this embodiment includes:

[0090] S31: Define and obtain the reference position points of two positioning screw holes located on both sides of the copper tube perforation, and obtain the expected center point of the copper tube perforation according to the reference position points;

[0091] And the calculation formula for the expected center point of the copper tube perforation is

[0092] P CEN (X,Y)=[P1(X1,Y1)+,P2(X2,Y2)] / 2

[0093] In the formula: P CEN(X, Y) represents the expected center point of the copper tube perforation; X and Y respectively represent the abscissa and ordinate of the expected center point; P1(X1, Y1) represents the reference position point of a positioning screw hole; X1 and Y1 represent the abscissa and ordinate of P1(X1, Y1); P2(X2, Y2) represents the reference position point of another positioning screw hole; X2 and Y2 represent the abscissa and ordinate of P2(X2, Y2).

[0094] S32: Obtain the center coordinates of the two positioning screw hole pixel feature circles located on both sides of the copper tube perforation in the optimized pixel feature map;

[0095] The center coordinates of the positioning screw hole pixel feature circle are the average coordinates of all pixel points within the obtained positioning screw hole pixel feature circle;

[0096] And confirm the actual center point of the copper tube perforation based on the center coordinates;

[0097] And the calculation formula for the actual center point of the copper tube perforation is

[0098] P' CEN (X', Y') = [P'1(X'1, Y'1) + P'2(X'2, Y'2)] / 2

[0099] In the formula: P' CEN (X', Y') represents the actual center point of the copper tube perforation; X' and Y' respectively represent the abscissa and ordinate of the actual center point; P'1(X'1, Y'1) represents the center coordinates of a positioning screw hole pixel feature circle; X'1 and Y'1 represent the abscissa and ordinate of P'1(X'1, Y'1); P'2(X'2, Y'2) represents the center coordinates of another positioning screw hole pixel feature circle; X'2 and Y'2 represent the abscissa and ordinate of P'2(X'2, Y'2).

[0100] This embodiment also includes a method for converting pixel coordinates to physical coordinates, specifically including the following steps:

[0101] S001: Determine the conversion relationship: clarify the conversion relationship between pixel coordinates and physical coordinates, and usually determine it through calibration or known parameters;

[0102] S002: Obtain the conversion parameters: Common conversion parameters include

[0103] Pixel ratio: The physical size corresponding to each pixel (such as millimeters / pixel);

[0104] Rotation angle: The rotation angle between the image coordinate system and the physical coordinate system;

[0105] Translation amount: The offset between the origin of the image coordinate system and the origin of the physical coordinate system;

[0106] S003: Construct the transformation matrix:

[0107] Construct the transformation matrix according to the transformation parameters, and the expression of the transformation matrix is

[0108]

[0109] In the formula: s x , s y represents the pixel ratio along the x - direction and y - direction of the pixel coordinates; θ represents the rotation angle; t x , t y represents the translation amounts in the x - direction and y - direction between the origin of the image coordinate system and the origin of the physical coordinate system; x 像素 , y 像素 respectively represent the abscissa and ordinate of the pixel point; x 物理 , y 物理 respectively represent the physical abscissa and ordinate of the pixel point;

[0110] S33: Obtain the offset angle of the copper tube perforation according to the expected center point and the actual center point of the copper tube perforation;

[0111] And the calculation formula of the offset angle of the copper tube perforation is

[0112]

[0113] In the formula: A represents the offset angle of the copper tube perforation;

[0114] S34: Obtain the adaptive compensation value of the perforation position based on steps S31 to S33;

[0115] And the adaptive compensation value is the position abscissa compensation value, position abscissa compensation value and offset angle compensation value of the copper tube perforation;

[0116] The method for guiding the placement of the copper tube according to the adaptive compensation value in this embodiment is

[0117] Send the adaptive compensation value to the controller of the PLC gripper through a preset control device;

[0118] The controller sends a movement control instruction to the servo motor of the PLC gripper based on the adaptive compensation value, so as to guide the PLC gripper to place the copper tube on the conveyor chain for transporting the copper tube according to the movement control instruction; and it also includes that before the PLC gripper places the copper tube on the conveyor chain, the control device stops the operation of the conveyor chain, and after the conveyor chain stops running, a calibrated camera set at the head of the PLC gripper takes a visual position image of the copper tube conveyor chain. In this embodiment, the deviation of the perforation position of the copper tube is obtained according to the image processing to obtain the adaptive compensation value for guiding the placement of the copper tube, and the controller of the PLC control system generates a corresponding movement control instruction to drive the head of the gripper to move to the target position. The servo motor of the head of the gripper can accurately adjust the grasping position according to the movement control instruction, ensuring that the gripper can accurately grasp the copper tube and place it on the conveyor chain;

[0119] In this embodiment, by collecting and obtaining the visual position image of the copper tube conveyor chain, preprocessing the visual position image, and obtaining the adaptive compensation value of the perforation position according to the preprocessed visual position image, the placement of the copper tube is guided according to the adaptive compensation value. It solves the problems that in the process of placing copper tubes in the refrigeration field, due to the poor moving positioning accuracy of the conveyor chain itself, the copper tubes are bruised because of inaccurate falling and placement, resulting in defective outflows, seriously affecting the production quality and low production efficiency. It greatly improves the accuracy of placing the copper tubes on the conveyor chain and improves the production efficiency and quality.

[0120] Finally, it should be noted that: the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those of ordinary skill in the art should understand that: they can still modify the technical solutions recorded in the foregoing embodiments, or perform equivalent replacements on some or all of the technical features; and these modifications or replacements do not make the essence of the corresponding technical solutions deviate from the scope of the technical solutions of the embodiments of the present invention.

Claims

1. A visual positioning method for copper tubes in the refrigeration field, characterized in that: The specific steps include: S1: The visual position image of the copper tube conveyor chain is collected and acquired through the calibrated camera set on the head of the PLC gripper used to grab the copper tube; The visual position image is an image taken along the copper tube perforation direction of the conveyor chain with the copper tube perforation as the center; S2: preprocess the visual position image to obtain an optimized pixel feature map; And the pre-processing includes: S21: performing image binarization processing on the visual position image to obtain a binary image; S22: performing Hough transform on the binary image to identify circular spot pixels in the binary image; S23: detecting circular spot pixels by using a Blob detector, and extracting the roundness of the circular spot pixels by using Open CV technology to obtain a pixel roundness feature map; S24: Based on a local threshold segmentation method, the roundness of circular spot-shaped pixels that meet a preset roundness threshold are adaptively screened according to the pixel roundness feature map, so as to roughly extract the positioning screw hole pixels used for copper tube placement compensation and obtain a hole pixel feature map; S25: using the edges_sub_pix operator to extract the pixel edge contour of the positioning screw hole in the hole pixel feature map, and using the fit_circle_contour_xld function to perform circular fitting to obtain a fitting feature map containing the pixel feature circle of the positioning screw hole; S26: Based on the region growing algorithm, the pixel completion of the pixel feature circle of the positioning screw hole is performed on the fitting feature map to obtain an optimized pixel feature map; S3: Obtaining an adaptive compensation value of the perforation position according to the optimized pixel feature map, so as to guide the placement of the copper tube according to the adaptive compensation value.

2. A visual positioning method for copper tubes in the refrigeration field according to claim 1, characterized in that: The method for obtaining the adaptive compensation value of the perforation position in S3 is as follows: S31: define and obtain reference position points of two positioning screw holes located on both sides of the copper tube perforation, and obtain a desired center point of the copper tube perforation according to the reference position points; And the calculation formula for the expected center point of copper tube perforation is P CEN (X,Y)=[P1(X1,Y1)+,P2(X2,Y2)] / 2 Where: P CEN (X, Y) represents the expected center point of the copper tube perforation; X, Y represent the horizontal coordinate and vertical coordinate of the expected center point respectively; P1 (X1, Y1) represents the reference position point of a positioning screw hole; X1, Y1 represent the horizontal coordinate and vertical coordinate of P1 (X1, Y1); P2 (X2, Y2) represents the reference position point of another positioning screw hole; X2, Y2 represent the horizontal coordinate and vertical coordinate of P2 (X2, Y2); S32: Obtaining the center coordinates of two positioning screw hole pixel feature circles located on both sides of the copper tube perforation in the optimized pixel feature map; The center coordinates of the positioning screw hole pixel characteristic circle are the average coordinates of all pixel points in the positioning screw hole pixel characteristic circle; And confirm the actual center point of the copper tube perforation according to the circle center coordinates; And the actual center point calculation formula of the copper tube perforation is P' CEN (X',Y')=[P'1(X'1,Y'1)+P'2(X'2,Y'2)] / 2 Where: P' CEN (X', Y') represents the actual center point of the copper tube perforation; X', Y' represent the horizontal and vertical coordinates of the actual center point respectively; P'1 (X'1, Y'1) represents the center coordinates of a pixel feature circle of a positioning screw hole; X'1, Y'1 represent the horizontal and vertical coordinates of P'1 (X'1, Y'1); P'2 (X'2, Y'2) represents the center coordinates of another pixel feature circle of a positioning screw hole; X'2, Y'2 represent the horizontal and vertical coordinates of P'2 (X'2, Y'2); S33: obtaining an offset angle of the copper tube perforation according to an expected center point and an actual center point of the copper tube perforation; And the calculation formula for the offset angle of copper tube perforation is Where: A represents the offset angle of the copper tube perforation; S34: Obtaining an adaptive compensation value of the perforation position based on steps S31 to S33; The adaptive compensation value is the position horizontal coordinate compensation value, the position horizontal coordinate compensation value and the offset angle compensation value of the copper tube perforation.

3. A visual positioning method for copper tubes in the refrigeration field according to claim 1, characterized in that: The method for performing pixel completion of the pixel feature circle of the positioning screw hole on the fitting feature map based on the region growing algorithm in S26 to obtain the optimized pixel feature map specifically comprises the following steps: S261: Setting the boundary area of ​​the pixel characteristic circle of the positioning screw hole; According to a preset image coordinate system, the pixel characteristic circle of the positioning screw hole is divided into a number of pixel lines along the horizontal axis direction based on the boundary area, and the break position points of the pixel lines are obtained; The pixel line with the broken line position point is used as the target line to be completed by pixels; The pixel point at the broken line position point is used as the pixel seed point, and the broken line position point in the pixel completion target line is extended and connected based on the region growing algorithm, so as to achieve pixel filling to obtain the initial completion feature map; The pixel value of the pixel filling is the same as the pixel value of the pixel seed point; S262: Based on the boundary area, the positioning screw hole pixel feature circle in the initial completion feature map is divided into a number of pixel lines along the ordinate direction again, and the line break position points of the pixel lines are obtained again; Based on the region growing algorithm, the broken line locations are again expanded and connected to obtain an optimized completed feature map with pixel filling.

4. A method for visually positioning copper tubes in the refrigeration field according to claim 3, characterized in that: Before completing the pixel completion of the pixel feature circle of the positioning screw hole on the fitting feature map, the pixel filtering process of the pixel feature circle of the positioning screw hole is also included: Set the filter pixel area threshold; The pixel area of ​​each pixel feature circle in the fitting feature map of the pixel feature circle containing the positioning screw hole obtained in step S25 is obtained, and the pixel feature circles whose pixel areas are smaller than the set filtering pixel area threshold are filtered and deleted, and the pixel feature circles whose pixel areas are greater than or equal to the filtering pixel area threshold are retained.

5. The visual positioning method for copper tubes in the refrigeration field according to claim 1 is characterized in that: The local threshold segmentation method described in S24 is to adaptively select the roundness of circular spot-shaped pixels that meet a preset roundness threshold according to the pixel roundness feature map, which specifically includes the following steps: By obtaining the roundness of each circular spot pixel in the pixel roundness feature map; A roundness threshold is preset, and the circular spot pixel points corresponding to the roundness that meets the preset roundness threshold are retained, and the circular spot pixel points corresponding to the roundness that does not meet the preset roundness threshold are deleted to obtain a preselected area image including the positioning screw hole pixels.

6. A visual positioning method for copper tubes in the refrigeration field according to claim 1, characterized in that: The method for guiding the placement of copper tubes according to the adaptive compensation value in S3 is as follows: Sending adaptive compensation values ​​to the controller of the PLC gripper through a preset control device; The controller sends a movement control instruction to a servo motor of the PLC gripper based on the adaptive compensation value, so as to guide the PLC gripper to place the copper tube on a conveyor chain for conveying the copper tube according to the movement control instruction; It also includes stopping the conveyor chain by controlling the device before the PLC gripper places the copper tube on the conveyor chain, and after the conveyor chain stops running, taking a visual position image of the conveyor chain by a calibrated camera copper tube set on the head of the PLC gripper.