Automatic disc changing method and system for precision cylindrical workpieces

Through binary processing and pixel matrix analysis of the pallet and material frame images, the occupancy and deformation of the material frame are detected, fully automatic plate change of precision cylindrical workpieces is realized, and the placement position caused by the deformation of the material frame after heat treatment is solved. Uncertainty issues are eliminated and automated production efficiency is improved.

CN118405441BActive Publication Date: 2024-09-17CHINA RAILWAY CONSTR HEAVY IND
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410852290.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-06-28
Publication Date
2024-09-17
Estimated Expiration
2044-06-28

AI Technical Summary

Technical Problem

The existing automated plate changing method cannot effectively detect and process the deformation of the material frame after heat treatment, resulting in uncertainty in the placement position of the workpiece and affecting automated production efficiency.

Method used

By acquiring binary images of pallets and material frames, we perform workpiece positioning detection and material frame occupancy detection, use the pixel matrix to analyze the availability of material frames, determine the available material frames and obtain their placement positions, and control the manipulator to achieve precision Fully automatic plate changer for cylindrical workpieces.

Benefits of technology

It improves the success rate of plate changing and positioning and grabbing accuracy of workpieces, and improves the efficiency of automated production.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118405441B
    Figure CN118405441B
Patent Text Reader

Abstract

The present invention discloses an automatic tray changing method and system for a precision cylindrical workpiece, which first obtains a tray image and converts it into a tray binary image, then performs workpiece positioning detection based on the tray binary image to accurately obtain the position of the workpiece in the tray, then obtains a heat treatment material frame image and converts it into a material frame binary image, then performs occupancy detection and availability detection of the material frame grid based on the material frame binary image, which can detect which material frame grids are occupied and which material frame grids are not occupied, and can also detect the deformation degree of the unoccupied material frame grids, and use the unoccupied material frame grids with a smaller deformation degree as available material frame grids, and obtain the workpiece placement position in the available material frame grids, and finally, control a manipulator to automatically grab the workpiece from the tray and transfer it to the available material frame grid, thereby realizing fully automatic tray changing of the precision cylindrical workpiece, greatly improving the tray changing success rate and positioning grabbing accuracy of the workpiece, and thus improving the automated production efficiency.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of automatic disc changing, and in particular to an automatic disc changing method and system for precision cylindrical workpieces, electronic equipment, and a computer-readable storage medium. Background Art

[0002] In the tray changing process of the automated production process of precision cylindrical workpieces (such as rollers), when loading, the workpiece needs to be automatically grabbed from the tray and transferred to the material frame by a manipulator under the guidance of machine vision, and the workpiece is heat treated together with the material frame. When unloading, the workpiece is automatically grabbed from the heat-treated material frame and transferred to the tray by a manipulator under the guidance of machine vision. Due to the influence of heat treatment, the material frame will undergo various deformations, and the material frame grid will present an irregular shape, resulting in changes in the placement position of the workpiece in the material frame grid, and even the inability to place the workpiece. However, the existing automatic tray changing method does not detect the placement feasibility and specific placement position of the material frame grid after heat treatment, resulting in the inability to accurately place the workpiece in the appropriate material frame grid, which seriously affects the automated production efficiency. The existing automatic tray changing method can only realize automatic grabbing under the premise that the shape of the tray or material frame is stable. For example, patent CN115026012A discloses a poultry egg tray loading system based on visual recognition, which uses an image detection unit to identify the position of poultry eggs and the position and placement of egg trays, and then uses a manipulator to grab poultry eggs and place them in an empty egg tray. Summary of the invention

[0003] The present invention provides an automatic disc changing method and system for precision cylindrical workpieces, an electronic device, and a computer-readable storage medium, which can detect which material grids are occupied and which are not occupied, and can also detect the degree of deformation of the unoccupied material grids, and use the unoccupied material grids with a smaller degree of deformation as available material grids, and obtain the workpiece placement position in the available material grids, thereby realizing fully automatic disc changing of precision cylindrical workpieces, greatly improving the disc changing success rate and positioning and grasping accuracy of the workpieces, and thus improving the automated production efficiency.

[0004] According to one aspect of the present invention, there is provided a method for automatically changing a disc of a precision cylindrical workpiece, and during heat treatment loading, the method comprises the following contents:

[0005] After acquiring the pallet image, image preprocessing is performed to obtain a pallet binary image;

[0006] Workpiece positioning detection based on the binarized image of the pallet;

[0007] After acquiring the heat-treated material frame image, image preprocessing is performed to obtain a material frame binary image, and occupancy detection and availability detection of the material frame grid are performed based on the material frame binary image;

[0008] Based on the workpiece positioning detection results, the robot is controlled to automatically grab the workpiece from the pallet and transfer it to the available material frame;

[0009] The process of detecting the availability of the material frame based on the binary image of the material frame includes the following contents:

[0010] Positioning and segmenting the binary image of the material frame to obtain multiple material frame grid images;

[0011] Constructing a pixel matrix of the same dimension according to the pixel point dimension of the material frame grid image, and setting the position points corresponding to the non-zero pixel points in the material frame grid image to zero values ​​in the pixel matrix;

[0012] First, traverse all the pixels in the material frame image. When the pixel value of a pixel is non-zero, detect the eight pixels around it. If the pixel value of the surrounding pixels is zero, replace it with 255, and set the value of the corresponding position point in the pixel matrix to 1.

[0013] Continuously iterate and traverse. During the iterative traversal process, if the pixel values ​​around the non-zero pixel are zero, the values ​​of the corresponding position points in the pixel matrix will increase one by one with the number of iterative traversals until there are no zero pixels in the material frame image.

[0014] Find the maximum value position point and the minimum value position point in the pixel matrix after iterative traversal, and obtain the shortest distance value between the maximum value position point and the minimum value position point. If the shortest distance value is less than the sum of the workpiece radius and the material frame margin, the material frame grid is determined to be unusable, otherwise the material frame grid is determined to be usable.

[0015] Furthermore, the process of performing image preprocessing after acquiring the tray image to obtain a tray binary image includes the following:

[0016] grayscale the pallet image to convert the color image into a grayscale image;

[0017] The grayscale image is filtered and binarized, and then outliers are detected and removed to obtain a binarized image of the pallet.

[0018] Furthermore, the process of performing outlier detection includes the following contents:

[0019] Traverse all the pixels in the binary image, take the pixel value of 255 as the valid point, and count the total number of valid points in the image. Draw a circle with each valid point as the center and the preset value as the radius, screen out the number of valid points in the circle, and calculate the ratio based on the number of valid points in the circle and the total number of valid points. If the ratio is less than the preset threshold, the valid point is determined to be an outlier.

[0020] Furthermore, the process of performing workpiece positioning detection based on the binarized image of the pallet includes the following contents:

[0021] Hough transform is used to detect circles in the binarized image of the pallet, and the detected diameter of the circle is obtained. If the deviation between the detected diameter of the circle and the diameter of the workpiece is less than a preset threshold, the circular area is determined to be the workpiece, and the center of the circular area is used as the reference point for the robot to grasp the workpiece.

[0022] Furthermore, the process of detecting the occupancy of the material frame based on the material frame binary image includes the following contents:

[0023] A material frame image that has not been heat-treated is obtained as a reference image, and material frame grid positioning and segmentation is performed on the material frame binary image based on the reference image to obtain a plurality of material frame grid images;

[0024] Based on the material frame image, each material frame is detected for workpiece positioning. If a workpiece is detected in a material frame, the state of the material frame is determined to be occupied.

[0025] Furthermore, when it is determined that the material grid is available, the maximum value position point is used as the placement center of the workpiece.

[0026] Furthermore, the availability test of the material grid also includes the following:

[0027] The available material grid image is photographed again and converted into a grayscale image. A detection circle is made in the available material grid area with the placement center of the available material grid as the center and the workpiece radius. The variance of the pixel values ​​of all pixels in the detection circle is calculated. If the calculated variance value is less than the preset threshold, it is determined that the positioning detection of the available material grid is reasonable.

[0028] In addition, the present invention also provides an automatic disc changing system for precision cylindrical workpieces, which adopts the automatic disc changing method as described above, and comprises:

[0029] The pallet image processing module is used to perform image preprocessing after acquiring the pallet image to obtain a pallet binary image;

[0030] A workpiece positioning detection module is used to perform workpiece positioning detection based on a binarized image of a pallet;

[0031] A material frame image processing module is used to obtain the heat-treated material frame image and then perform image preprocessing to obtain a material frame binary image, and perform occupancy detection and availability detection of the material frame grid based on the material frame binary image;

[0032] The robot control module is used to control the robot to automatically grab the workpiece from the pallet and transfer it to an available material frame based on the workpiece positioning detection result.

[0033] In addition, the present invention also provides an electronic device, including a processor and a memory, wherein the memory stores a computer program, and the processor executes the steps of the above method by calling the computer program stored in the memory.

[0034] In addition, the present invention also provides a computer-readable storage medium for storing a computer program for automatically changing discs for precision cylindrical workpieces, wherein the computer program executes the steps of the method described above when running on a computer.

[0035] The present invention has the following beneficial effects:

[0036] The automatic pallet changing method of the precision cylindrical workpiece of the present invention first obtains the pallet image and converts it into a pallet binary image, then performs workpiece positioning detection based on the pallet binary image to accurately obtain the position of the workpiece in the pallet, then obtains the heat treatment material frame image and converts it into a material frame binary image, then performs material frame grid occupancy detection and availability detection based on the material frame binary image, which can detect which material frame grids are occupied and which material frame grids are not occupied, and can also detect the deformation degree of the unoccupied material frame grids, and use the unoccupied material frame grids with a smaller deformation degree as available material frame grids, and obtain the workpiece placement position in the available material frame grids, and finally, control the manipulator to automatically grab the workpiece from the pallet and transfer it to the available material frame grid, thereby realizing the fully automatic pallet changing of the precision cylindrical workpiece, greatly improving the pallet changing success rate and positioning grabbing accuracy of the workpiece, and thus improving the automated production efficiency.

[0037] In addition, the automatic disc changing system for precision cylindrical workpieces of the present invention also has the above advantages.

[0038] In addition to the above-described purposes, features and advantages, the present invention has other purposes, features and advantages. The present invention will be further described in detail with reference to the accompanying drawings. BRIEF DESCRIPTION OF THE DRAWINGS

[0039] The drawings constituting a part of this application are used to provide a further understanding of the present invention. The exemplary embodiments of the present invention and their descriptions are used to explain the present invention and do not constitute an improper limitation of the present invention. In the drawings:

[0040] Figure 1 It is a flow chart of an automatic disc changing method for a precision cylindrical workpiece according to a preferred embodiment of the present application;

[0041] Figure 2 yes Figure 1 Schematic diagram of the sub-process of step S1;

[0042] Figure 3 It is a schematic diagram of a part of the tray grids in the preferred embodiment of the present application when a precision cylindrical workpiece is carried;

[0043] Figure 4 yes Figure 1 Schematic diagram of the sub-process of step S3;

[0044] Figure 5 It is a schematic diagram of using the ROI area to perform material frame segmentation and positioning in a standard material frame image in a preferred embodiment of the present application;

[0045] Figure 6 It is a schematic diagram of using the ROI area to perform material frame segmentation and positioning in the heat treatment material frame image in the preferred embodiment of the present application;

[0046] Figure 7 It is a comparative schematic diagram of a material frame with a precision cylindrical workpiece and a material frame without a precision cylindrical workpiece in a preferred embodiment of the present application;

[0047] Figure 8 yes Figure 4 Another sub-process diagram of step S3;

[0048] Fig. 9 is a schematic diagram of a material frame image in a preferred embodiment of the present application;

[0049] Fig.10 In the preferred embodiment of the present application Fig. 9 A schematic diagram of the pixel matrix corresponding to the material frame image in FIG.

[0050] Fig.11 yes Fig. 9 Schematic diagram of the pixel value change process of the pixel point when the material frame image is traversed for the first time;

[0051] Fig.12 yes Fig.10 Schematic diagram of the change process of the position value of the position point when the pixel matrix in is traversed for the first time;

[0052] Fig.13 yes Fig. 9 Schematic diagram of pixel values ​​of the material frame image after the first traversal;

[0053] Fig.14 yes Fig.10 Schematic diagram of the position values ​​of the position points after the first traversal of the pixel matrix in;

[0054] Fig.15 yes Fig.10 Schematic diagram of the position values ​​of the position points after the second traversal of the pixel matrix in;

[0055] Fig.16 yes Fig. 9 Schematic diagram of pixel values ​​of the material frame image after the last traversal;

[0056] Fig.17 yes Fig.10 Schematic diagram of the position values ​​of the position points after the last traversal of the pixel matrix in;

[0057] Fig.18 yes Fig.17 Schematic diagram of the position values ​​of the position points after the pixel matrix in is normalized;

[0058] Fig.19 It is another flow chart of the automatic disc changing method for precision cylindrical workpieces in the preferred embodiment of the present application;

[0059] Fig. 20 It is a schematic diagram of the module structure of the automatic disc changing system for precision cylindrical workpieces according to the preferred embodiment of the present application. DETAILED DESCRIPTION

[0060] It should be noted that, in the absence of conflict, the embodiments and features in the embodiments of the present application can be combined with each other. The present application will be described in detail below with reference to the accompanying drawings and in combination with the embodiments.

[0061] Reference Figure 1 The preferred embodiment of the present application provides an automatic disc changing method for a precision cylindrical workpiece. When the material is loaded during heat treatment, the method includes the following contents:

[0062] Step S1: After acquiring the tray image, image preprocessing is performed to obtain a tray binary image;

[0063] Step S2: Perform workpiece positioning detection based on the binarized image of the pallet;

[0064] Step S3: After acquiring the heat-treated material frame image, image preprocessing is performed to obtain a material frame binary image, and occupancy detection and availability detection of the material frame grid are performed based on the material frame binary image;

[0065] Step S4: Based on the workpiece positioning detection result, the robot is controlled to automatically grab the workpiece from the tray and transfer it to an available material frame.

[0066] It can be understood that the automatic pallet changing method for the precision cylindrical workpiece of the present embodiment first obtains the pallet image and converts it into a pallet binary image, and then performs workpiece positioning detection based on the pallet binary image to accurately obtain the position of the workpiece in the pallet, and then obtains the heat treatment material frame image and converts it into a material frame binary image, and then performs material frame grid occupancy detection and availability detection based on the material frame binary image, which can detect which material frame grids are occupied and which material frame grids are not occupied, and can also detect the degree of deformation of unoccupied material frame grids, and use unoccupied material frame grids with a smaller degree of deformation as available material frame grids, and obtain the workpiece placement position in the available material frame grid, and finally, control the manipulator to automatically grab the workpiece from the pallet and transfer it to the available material frame grid, thereby realizing fully automatic pallet changing of precision cylindrical workpieces, greatly improving the pallet changing success rate and positioning and grabbing accuracy of the workpiece, and thus improving automated production efficiency.

[0067] It can be understood that in step S1, the camera is mounted on the truss manipulator, and the camera is moved to the top of the pallet by the truss manipulator to take pictures to obtain the pallet image. Since the pallet image taken by the camera is an original image, which contains interference factors such as image noise and image anomalies, in order to improve the accuracy of image analysis, it is necessary to perform image preprocessing on the pallet image and convert it into a pallet binary image. Figure 2 As shown, the process of performing image preprocessing after acquiring the tray image to obtain the tray binary image includes the following:

[0068] Step S11: grayscale processing is performed on the tray image to convert the color image into a grayscale image;

[0069] Step S12: filtering and binarizing the grayscale image, and then performing outlier detection and removing outliers to obtain a binarized image of the tray.

[0070] Specifically, the original image of the pallet taken by the camera is a color image, so the color image is first converted into a grayscale image. The image conversion formula is:

[0071]

[0072] in, Represents the grayscale value of the pixel (x, y) in the image. , , Respectively represent the R, G, and B color values ​​of the pixel (x, y).

[0073] Then, in order to remove the noise in the image, the grayscale image is first subjected to Gaussian filtering, and then the filtered image is threshold segmented according to the maximum inter-class variance algorithm to obtain a binary image. Since the binary image still contains many outliers, which will interfere with subsequent analysis, it is necessary to detect outliers in the binary image and remove them. The process of outlier detection includes the following:

[0074] Traverse all the pixels in the binary image, take the pixels with a value of 255 as valid points, and count the total number of valid points in the image , with each valid point as the center and the preset value r as the radius, a detection circle is made. r is generally 10~20pix, which can be set according to actual needs. The number of valid points n in the circle is screened out. Based on the number of valid points n in the circle and the total number of valid points The ratio is calculated using the following formula: , if the ratio k is less than the preset threshold , then the valid point is determined to be an abnormal point and needs to be removed.

[0075] It can be understood that the present invention uses the pixel points with a pixel value of 255 in the image after binarization as valid points, takes each valid point as the center and a preset radius value as a detection circle, and respectively counts the total number of valid points and the number of valid points in the detection circle. If the ratio of the number of valid points in the detection circle to the total number of valid points is less than the preset threshold, it means that the current valid points are discrete points that still exist after threshold segmentation, and are characterized by a small number and a large degree of deviation, which is generally caused by reflection of various types of light, surface roughness and the like. The existence of these discrete points will affect the accuracy of subsequent feature extraction, so they are removed as abnormal points, thereby greatly improving the positioning accuracy of the workpiece and the accuracy of the analysis of the degree of deformation of the material frame.

[0076] It can be understood that in step S2, the process of performing workpiece positioning detection based on the binarized image of the pallet includes the following contents:

[0077] Hough transform is used to detect circles in the binarized image of the pallet, and the detected diameter of the circle is obtained. If the deviation between the detected diameter of the circle and the diameter of the workpiece is less than a preset threshold, the circular area is determined to be the workpiece, and the center of the circular area is used as the reference point for the robot to grasp the workpiece.

[0078] Specifically, the Hough transform is used to detect circles in the binarized image of the tray after removing abnormal points and obtain the detected diameter R of the circle. 1 The specific detection process and principle belong to the prior art and will not be described here. Then, the detection diameter R of the circle is calculated. 1 and precision cylindrical workpiece diameter R0 The deviation between d , R d =|R 1 -R 0 |, if the deviation R d Less than the deviation threshold R t , the detected circle is determined to be a precision cylindrical workpiece, and the center of the detected circle is used as the reference point for the manipulator to grasp the workpiece. The subsequent truss manipulator moves to the appropriate position according to the center reference point to automatically grasp the workpiece. Figure 3 As shown, A in the figure is a pallet grid without a precision cylindrical workpiece, and B is a pallet grid with a precision cylindrical workpiece.

[0079] It can be understood that the present invention uses Hough transform to obtain the diameter of the detection circle. If the deviation between the diameter of the detection circle and the diameter of the workpiece is less than a preset threshold, the detected circle is determined to be a precision cylindrical workpiece, and the center of the detection circle is used as the center of the workpiece, which is used as a reference point for the subsequent robot to automatically grasp the workpiece, thereby realizing precise positioning detection of the workpiece in the pallet.

[0080] It can be understood that in the step S3, the camera is moved to the top of the material frame after heat treatment by using a truss manipulator to capture the image of the material frame after heat treatment. Since the material frame will undergo unpredictable thermal deformation due to the influence of heat treatment, the straight border of the material frame grid will become an irregular curve. If the positioning detection is directly performed on the image of the material frame after heat treatment, it will lead to low detection accuracy, and even the workpiece and the material frame grid do not match, resulting in the problem that the workpiece cannot be placed. Therefore, the present invention can detect which material frame grids are occupied and which material frame grids are not occupied by performing occupancy detection and availability detection on the image of the heat-treated material frame. At the same time, it can also detect the deformation degree of the unoccupied material frame grids, and use the unoccupied material frame grids with a smaller deformation degree as available material frame grids, and obtain the workpiece placement position in the available material frame grid. In addition, the process of image preprocessing the heat-treated material frame image is the same as the image preprocessing process of the tray image. For details, please refer to steps S11~S12. Among them, Figure 4 As shown, the process of detecting the occupancy of the material frame based on the binary image of the material frame includes the following contents:

[0081] Step S31: obtaining a material frame image that has not been heat-treated as a reference image, and performing material frame grid positioning and segmentation on the material frame binary image based on the reference image to obtain a plurality of material frame grid images;

[0082] Step S32: performing workpiece location detection on each material grid based on the material grid image, and if a workpiece is detected in a material grid, determining that the state of the material grid is occupied.

[0083] It can be understood that since the material frame is automatically loaded and unloaded, and there are corresponding clamps to limit it, it is ensured that the overall deviation of each loading and unloading is not large. At the same time, since thermal deformation is limited, the ROI area during image detection can be expanded so that the material frame grid after thermal deformation will still remain in the ROI area. Therefore, first obtain the material frame image that has not been heat-treated as the reference image, and then perform material frame grid positioning and segmentation on the material frame binary image based on the reference image to obtain multiple material frame grid images. Specifically, Figure 5 The standard material frame image is shown in the figure. First, use Hough transform to detect straight lines in the standard material frame image, obtain the length of each straight line, and then sort all the straight line lengths, and select the two largest straight lines as the length and width of the standard material frame, so as to obtain the positioning reference of the standard material frame image. Then, locate the lower left corner of the standard material frame image as (x 0 ,y 0 ), assuming the width of the standard material frame is L 1 , the ROI area used is a square area with a length of L 3 , L 3 = L 1 +2L 2 , L 2 The unilateral margin of the ROI area from the material frame is used to segment the material frame. Since the thermal deformation of the material frame is limited, the material frame after thermal deformation still remains within the expanded ROI area. Figure 6 Therefore, each material frame is divided into 20 material frame grids. When using the ROI area to segment and locate the material frame grid, the lower left coordinate of the ROI area is (x 0 -L 2 +kL 1 ,y 0 -L 2 +jL 2 ), k=1,2,3,4,5, j=1,2,3,4, so that the heat treatment material frame image can be divided into multiple material frame grid images.

[0084] Then, for each material frame image, the workpiece positioning detection is performed. The specific detection process is the same as step S2. When a precision cylindrical workpiece is detected in a material frame, the state of the material frame is determined to be occupied and no workpiece can be placed, and the next material frame image is detected. For example, Figure 7 C represents an unoccupied material grid, and D represents an occupied material grid.

[0085] Next, the unoccupied material frame images are tested for availability to evaluate the degree of thermal deformation of the unoccupied material frame, thereby determining whether the unoccupied material frame is available and obtaining the placement center of the available material frame. Figure 8As shown, the process of detecting the availability of the material frame based on the binary image of the material frame includes the following contents:

[0086] Step S310: Positioning and segmenting the binary image of the material frame to obtain a plurality of material frame grid images;

[0087] Step S320: constructing a pixel matrix of the same dimension according to the pixel dimension of the material frame grid image, and setting the position points corresponding to the non-zero pixel points in the material frame grid image to zero in the pixel matrix;

[0088] Step S330: traverse all the pixels in the material frame image for the first time. When the pixel value of a pixel is non-zero, detect the eight pixels around it. If the pixel value of the surrounding pixels is zero, replace it with 255, and set the value of the corresponding position point in the pixel matrix to 1;

[0089] Step S340: Continuously iterate and traverse. During the iterative traversal process, if the pixel values ​​of the pixels around the non-zero pixel are zero, the values ​​of the corresponding position points in the pixel matrix are increased one by one with the number of iterative traversals until there are no zero pixels in the material frame image.

[0090] Step S350: Find the maximum value position point and the minimum value position point in the pixel matrix after iterative traversal, and obtain the shortest distance value between the maximum value position point and the minimum value position point. If the shortest distance value is less than the sum of the workpiece radius and the material frame margin, it is determined that the material frame grid is unusable, otherwise it is determined that the material frame grid is available.

[0091] Specifically, the binary image of the material frame is first segmented and divided into multiple material frame grid images, wherein the specific segmentation process is the same as the above step S31, and will not be described in detail here. In addition, if the occupancy detection of the material grid is performed first and then the availability detection is performed, step S310 can be omitted.

[0092] Assume that a material frame image X obtained by segmentation is shown in Figure 9. Since the heat treatment material frame image has been converted into a binary image after image preprocessing, the material frame image is also a binary image. Assume that the pixel dimension of the material frame image X is m×n, construct a pixel matrix of the same dimension m×n, and set the position points corresponding to the non-zero pixel points in the material frame image to zero in the pixel matrix, as shown in Figure 9. Fig.10 It can be understood that the pixel matrix and the material frame grid image have the same size and corresponding positions.

[0093] Then, all pixels in image X are traversed for the first time. When a pixel is non-zero, the eight pixels around it are detected. When the pixel value of a surrounding pixel is zero, its pixel value is replaced with 255. Fig.11 As shown, at the same time, the value of the same position point in the pixel matrix is ​​set to 1, such as Fig.12 After the first traversal, the material frame image X is as follows Fig.13 As shown, the pixel matrix is ​​as Fig.14 shown.

[0094] Next, all pixels are traversed for the second time. When the pixel value of a pixel is non-zero, the eight pixels around it are detected. If the pixel value of the surrounding pixels is zero, it is replaced with 255, and the value of the corresponding position point in the pixel matrix is ​​set to 2. The pixel matrix after the second traversal is as follows: Fig.15 shown.

[0095] Iterate continuously, and in the process of iterative traversal, if the pixel values ​​around the non-zero pixel are zero, the value of the corresponding position point in the pixel matrix increases one by one with the number of iterative traversal, until there are no zero pixels in the material frame image, then the final material frame image X is as follows Fig.16 As shown, the pixel matrix is ​​as Fig.17 shown.

[0096] Then, find the maximum value position point and the minimum value position point in the pixel matrix after iterative traversal, and obtain the shortest distance value between the maximum value position point and the minimum value position point. If the shortest distance value is less than the sum of the workpiece radius and the material frame margin, the material frame grid is determined to be unusable, otherwise the material frame grid is determined to be usable. Among them, if there are multiple maximum value position points in the pixel matrix, one of the points can be arbitrarily selected, and then the selected maximum value position point is used as the center of the circle P, and the shortest distance value between the maximum value position point and the minimum value position point (because there may be multiple minimum value position points, the shortest distance value between the maximum value position point and the minimum value position point is selected) is used as the radius L 4 , if L 4 <R 0 +t,R 0 represents the workpiece diameter, t represents the material frame margin, then the material frame is judged to be unusable. If L 4 ≥R 0 +t, then the material grid is determined to be available. In addition, the placement center of the workpiece in the available material grid is the center P.

[0097] Optionally, after obtaining the pixel matrix obtained by iterative traversal, the values ​​in the pixel matrix are first normalized, and the processing formula is: , represents the value after normalization, and p represents the value before normalization. and Represents the minimum and maximum values ​​in the pixel matrix. The normalized pixel matrix is ​​as follows: Fig.18As shown. Then, find the maximum value position point and the minimum value position point in the normalized pixel matrix, and obtain the shortest distance value between the maximum value position point and the minimum value position point. At this time, if there are multiple maximum value position points in the normalized pixel matrix, you can arbitrarily select one of them. Then use the selected maximum value position point as the center P of the circle, and the shortest distance value between the maximum value position point and the minimum value position point (because there may be multiple minimum value position points, so the shortest distance value between the maximum value position point and the minimum value position point is selected) as the radius L 4 , if L 4 <R 0 +t,R 0 represents the workpiece diameter, t represents the material frame margin, then the material frame is judged to be unusable. If L 4 ≥R 0 +t, it is determined that the material grid is available, and the placement center of the workpiece in the material grid is the circle center P.

[0098] Optionally, in step S3, after the availability detection of the material grid is performed, the following steps are also included:

[0099] The available material grid image is photographed again and converted into a grayscale image. A detection circle is made in the available material grid area with the placement center of the available material grid as the center and the workpiece radius. The variance of the pixel values ​​of all pixels in the detection circle is calculated. If the calculated variance value is less than the preset threshold, it is determined that the positioning detection of the available material grid is reasonable.

[0100] Specifically, the camera is used again to capture the available material frame image and convert it into a grayscale image. The above point P is used as the center of the circle and the radius of the workpiece is used as the detection circle. The pixel value variance of all pixel points in the detection circle is calculated. The calculation formula is: , V represents the pixel value variance, represents the pixel value of the i-th pixel, represents the mean pixel value of all pixels in the detection circle, and n represents the number of pixels in the detection circle. t , V t If the prediction threshold is exceeded, the positioning detection of the available material grid is judged to be reasonable and material can be released. Otherwise, the available material grid is judged to be an abnormal area and a signal is triggered for manual judgment, thereby further improving the positioning detection accuracy of the available material grid.

[0101] It can be understood that in step S4, since step S2 has accurately located the position of the workpiece in the tray, and step S3 has accurately detected the available material grid and its workpiece placement center in the heat treatment material frame, the truss manipulator can be controlled to automatically grab the workpiece from the tray and transfer it to the placement center of the available material grid, thereby realizing automatic tray change in the loading process. Of course, in other embodiments of the present invention, the manipulator can be controlled to grab the workpiece after completing the workpiece positioning detection in step S2, and after the workpiece placement center of the available material grid is detected in step S3, the workpiece is directly transferred to the available material grid, so as to improve the tray change efficiency.

[0102] In addition, when the automatic tray changing method receives the heat treatment unloading signal, the unloading tray changing process is exactly the opposite of the loading tray changing process, and it is necessary to grab the workpiece from the heat-treated material frame and store it in the tray. Fig.19 As shown, during the material unloading process, the automatic disc changing method specifically includes the following contents:

[0103] Step S100: After acquiring the heat treatment material frame image, image preprocessing is performed to obtain a material frame binary image, and workpiece positioning detection is performed based on the material frame binary image;

[0104] Step S200: After acquiring the pallet image, image preprocessing is performed to obtain a pallet binary image, and occupancy detection of the pallet grid is performed based on the pallet binary image;

[0105] Step S300: According to the workpiece positioning detection result, the robot is controlled to automatically grab the workpiece from the heat treatment material frame and transfer it to an unoccupied tray grid.

[0106] The image preprocessing process in steps S100 and S200 is the same as step S1, the workpiece positioning detection process in step S100 is similar to step S2, and the pallet grid occupancy detection process in step S200 is similar to step S32, which will not be described in detail here.

[0107] In addition, if Fig. 20 As shown, another embodiment of the present invention further provides an automatic disc changing system for precision cylindrical workpieces, preferably using the method as described above, including:

[0108] The pallet image processing module is used to perform image preprocessing after acquiring the pallet image to obtain a pallet binary image;

[0109] A workpiece positioning detection module is used to perform workpiece positioning detection based on a binarized image of a pallet;

[0110] A material frame image processing module is used to obtain the heat-treated material frame image and then perform image preprocessing to obtain a material frame binary image, and perform occupancy detection and availability detection of the material frame grid based on the material frame binary image;

[0111] The robot control module is used to control the robot to automatically grab the workpiece from the pallet and transfer it to an available material frame based on the workpiece positioning detection result.

[0112] It can be understood that the automatic pallet changing system for the precision cylindrical workpiece of the present embodiment first obtains the pallet image and converts it into a pallet binary image, and then performs workpiece positioning detection based on the pallet binary image to accurately obtain the position of the workpiece in the pallet, and then obtains the heat treatment material frame image and converts it into a material frame binary image, and then performs material frame grid occupancy detection and availability detection based on the material frame binary image, which can detect which material frame grids are occupied and which material frame grids are not occupied, and can also detect the degree of deformation of unoccupied material frame grids, and use unoccupied material frame grids with a smaller degree of deformation as available material frame grids, and obtain the workpiece placement position in the available material frame grid, and finally, control the robot arm to automatically grab the workpiece from the pallet and transfer it to the available material frame grid, thereby realizing fully automatic pallet changing of precision cylindrical workpieces, greatly improving the workpiece pallet changing success rate and positioning and grabbing accuracy, thereby improving automated production efficiency.

[0113] In addition, another embodiment of the present invention further provides an electronic device, including a processor and a memory, wherein the memory stores a computer program, and the processor executes the steps of the above method by calling the computer program stored in the memory.

[0114] In addition, another embodiment of the present invention further provides a computer-readable storage medium for storing a computer program for automatically changing discs for precision cylindrical workpieces, wherein the computer program executes the steps of the method described above when running on a computer.

[0115] Common computer-readable storage media include: floppy disks, flexible disks, hard disks, magnetic tapes, any other magnetic media, CD-ROMs, any other optical media, punch cards, paper tapes, any other physical media with patterns of holes, random access memory (RAM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), flash-erasable programmable read-only memory (FLASH-EPROM), any other memory chip or cartridge, or any other medium that can be read by a computer. Instructions can further be transmitted or received by a transmission medium. The term transmission medium may include any tangible or intangible medium that can be used to store, encode or carry instructions for execution by a machine, and includes digital or analog communication signals or intangible media that facilitate communication of the above instructions. Transmission media include coaxial cables, copper wire, and optical fiber, including the wires of a bus used to transmit a computer data signal.

[0116] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the present application may adopt the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program codes. The schemes in the embodiments of the present application may be implemented in various computer languages, for example, object-oriented programming language Java and literal scripting language JavaScript, etc.

[0117] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0118] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.

[0119] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 A step that specifies a function in one or more boxes.

[0120] Although the preferred embodiments of the present application have been described, those skilled in the art may make other changes and modifications to these embodiments once they have learned the basic creative concept. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments and all changes and modifications falling within the scope of the present application.

[0121] Obviously, those skilled in the art can make various changes and modifications to the present application without departing from the spirit and scope of the present application. Thus, if these modifications and variations of the present application fall within the scope of the claims of the present application and their equivalents, the present application is also intended to include these modifications and variations.

[0122] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. For those skilled in the art, the present invention may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention shall be included in the protection scope of the present invention.

Claims

1. A method for automatically changing discs for precision cylindrical workpieces, characterized in that: When heat treating the material, the method includes the following: After acquiring the pallet image, image preprocessing is performed to obtain a pallet binary image; Workpiece positioning detection based on the binarized image of the pallet; After acquiring the heat-treated material frame image, image preprocessing is performed to obtain a material frame binary image, and occupancy detection and availability detection of the material frame grid are performed based on the material frame binary image; Based on the workpiece positioning detection results, the robot is controlled to automatically grab the workpiece from the pallet and transfer it to the available material frame; The process of detecting the availability of the material frame based on the binary image of the material frame includes the following contents: Positioning and segmenting the binary image of the material frame to obtain multiple material frame grid images; Constructing a pixel matrix of the same dimension according to the pixel point dimension of the material frame grid image, and setting the position points corresponding to the non-zero pixel points in the material frame grid image to zero values ​​in the pixel matrix; First, traverse all the pixels in the material frame image. When the pixel value of a pixel is non-zero, detect the eight pixels around it. If the pixel value of the surrounding pixels is zero, replace it with 255, and set the value of the corresponding position point in the pixel matrix to 1. Continuously iterate and traverse. During the iterative traversal process, if the pixel values ​​around the non-zero pixel are zero, the values ​​of the corresponding position points in the pixel matrix will increase one by one with the number of iterative traversals until there are no zero pixels in the material frame image. Find the maximum value position point and the minimum value position point in the pixel matrix after iterative traversal, and obtain the shortest distance value between the maximum value position point and the minimum value position point. If the shortest distance value is less than the sum of the workpiece radius and the material frame margin, the material frame grid is determined to be unusable, otherwise the material frame grid is determined to be usable.

2. The automatic disc changing method for a precision cylindrical workpiece according to claim 1, characterized in that: The process of performing image preprocessing after acquiring the pallet image to obtain the pallet binary image includes the following: grayscale the pallet image to convert the color image into a grayscale image; The grayscale image is filtered and binarized, and then outliers are detected and removed to obtain a binarized image of the pallet.

3. The automatic disc changing method for precision cylindrical workpieces according to claim 2, characterized in that: The process of performing outlier detection includes the following contents: Traverse all the pixels in the binary image, take the pixel value of 255 as the valid point, and count the total number of valid points in the image. Draw a circle with each valid point as the center and the preset value as the radius, screen out the number of valid points in the circle, and calculate the ratio based on the number of valid points in the circle and the total number of valid points. If the ratio is less than the preset threshold, the valid point is determined to be an outlier.

4. The automatic disc changing method for precision cylindrical workpieces according to claim 1, characterized in that: The process of workpiece positioning detection based on the pallet binary image includes the following contents: Hough transform is used to detect circles in the binarized image of the pallet, and the detected diameter of the circle is obtained. If the deviation between the detected diameter of the circle and the diameter of the workpiece is less than a preset threshold, the circular area is determined to be the workpiece, and the center of the circular area is used as the reference point for the robot to grasp the workpiece.

5. The automatic disc changing method for precision cylindrical workpieces according to claim 1, characterized in that: The process of detecting the occupancy of the material frame based on the binary image of the material frame includes the following contents: A material frame image that has not been heat-treated is obtained as a reference image, and material frame grid positioning and segmentation is performed on the material frame binary image based on the reference image to obtain a plurality of material frame grid images; Based on the material frame image, each material frame is detected for workpiece positioning. If a workpiece is detected in a material frame, the state of the material frame is determined to be occupied.

6. The automatic disc changing method for a precision cylindrical workpiece according to claim 1, characterized in that: When it is determined that the material grid is available, the maximum value position point is used as the placement center of the workpiece.

7. The automatic disc changing method for a precision cylindrical workpiece according to claim 6, characterized in that: The availability test of the material frame also includes the following: The available material grid image is photographed again and converted into a grayscale image. A detection circle is made in the available material grid area with the placement center of the available material grid as the center and the workpiece radius. The variance of the pixel values ​​of all pixels in the detection circle is calculated. If the calculated variance value is less than the preset threshold, it is determined that the positioning detection of the available material grid is reasonable.

8. An automatic disc changing system for precision cylindrical workpieces, using the automatic disc changing method as claimed in any one of claims 1 to 7, characterized in that: include: The pallet image processing module is used to perform image preprocessing after acquiring the pallet image to obtain a pallet binary image; A workpiece positioning detection module is used to perform workpiece positioning detection based on a binarized image of a pallet; A material frame image processing module is used to obtain the heat-treated material frame image and then perform image preprocessing to obtain a material frame binary image, and perform occupancy detection and availability detection of the material frame grid based on the material frame binary image; The robot control module is used to control the robot to automatically grab the workpiece from the pallet and transfer it to an available material frame based on the workpiece positioning detection result.

9. An electronic device, characterized in that: The method comprises a processor and a memory, wherein a computer program is stored in the memory, and the processor is used to execute the steps of the method according to any one of claims 1 to 7 by calling the computer program stored in the memory.

10. A computer-readable storage medium for storing a computer program for automatically changing discs for precision cylindrical workpieces, characterized in that: When the computer program is run on a computer, the steps of the method according to any one of claims 1 to 7 are executed.