Visual control method for quickly sorting magnets
By collecting images on the flexible vibrating disk and performing grayscale processing and binarization, the pixel profile that conforms to the magnet profile shape is screened, and then using deep learning algorithms to identify good-quality magnets in a predetermined posture, solving the problem of low recognition efficiency when there are many magnets in the vibrating disk and different postures, and achieving efficient magnet recognition and sorting.
Patent Information
- Application Number
- CN202411925867.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-25
- Publication Date
- 2025-05-13
AI Technical Summary
In the case where the number of magnets in the vibrating disk is large and the postures are different, it is difficult for the image recognition algorithm based on deep learning to efficiently identify and sort magnets, resulting in low recognition efficiency and high computational complexity.
By collecting images on the flexible vibration disk, performing grayscale processing and binarization, the pixel profile that conforms to the magnet profile shape is selected, and then using a deep learning algorithm to identify good-quality magnets in a predetermined posture, reducing the computational complexity and improving the recognition efficiency.
It significantly improves the recognition efficiency, reduces the requirements for computer computing capabilities, reduces the consumption of computing resources, and avoids the problem of long recognition waiting time in traditional methods.
Smart Images

Figure CN119972581A_ABST
Abstract
Description
Technical Field
[0001] The invention relates to the technical field of industrial control, and in particular to a visual control method for quickly sorting magnets. Background Art
[0002] Image recognition algorithms based on deep learning have been widely used in industrial production processes. Currently, there is a technical solution that uses deep learning-based image recognition algorithms to identify magnets in a vibration disk, and then uses the recognition results to control a robot to grab magnets that meet the requirements from the vibration disk. However, when there are a large number of magnets in the vibration disk and the magnets have different postures, using deep learning-based image recognition algorithms to identify these magnets requires a large workload, extremely high computer computing power, and a long recognition waiting time, resulting in low recognition and sorting efficiency. Summary of the invention
[0003] The purpose of the present invention is to provide a visual control method for quickly sorting magnets. The technical problem to be solved is how to improve the recognition efficiency while ensuring the recognition accuracy when automatically sorting magnets in a flexible vibration disk by a robot.
[0004] To achieve the above object, the solution of the present invention is: a visual control method for quickly sorting magnets, which is used to control a manipulator to grab the magnets in a flexible vibration plate, comprising the following steps: S10, stopping the vibration of the flexible vibration plate; S20, collecting an image inside the flexible vibration plate by placing a camera above the flexible vibration plate; S30, image recognition, including the following steps in sequence: S31, converting the image into a grayscale image, using grayscale recognition to identify the magnet in the image; S32, binarizing the grayscale image, extracting edge pixels from the binarized image, and then screening out pixel contours that conform to the shape of the magnet contour; S33, then using an image recognition algorithm based on deep learning to perform image recognition on the location of the pixel contours screened out in step S32 to identify a good magnet in a predetermined posture; S40, converting the image coordinates into world coordinates, and determining the position of the good magnet in a predetermined posture within the robot coordinates; S50, the manipulator arrives at the position of each good magnet in a predetermined posture in turn, and grabs each magnet respectively; S60, after starting the flexible vibration plate to vibrate for a period of time, return to step S10.
[0005] Furthermore, in step S31, when grayscale recognition is performed, magnet images with fewer surrounding magnets are preferentially screened and marked as objects for edge pixel extraction in step S32.
[0006] Furthermore, in step S40, the coordinate value of the pixel at the geometric midpoint of the magnet shape in the image is determined as the grasping coordinate of the robot.
[0007] Furthermore, the coordinate value of the geometric center point of the magnet shape is determined by the coordinate value of each pixel in the pixel outline that conforms to the magnet outline shape.
[0008] Further, the predetermined posture includes the front side of the magnet facing upward.
[0009] Furthermore, the flexible vibration disk emits light by itself, radiating light from the side of the magnet facing away from the camera toward the camera.
[0010] Furthermore, in step S33, the edge shape of the magnet is also identified to screen out good quality magnets with complete edge shapes.
[0011] After adopting the above scheme, the beneficial effects of the present invention are: (1) By stopping the vibration of the flexible vibration disk to stabilize the position of each magnet inside the flexible vibration disk, the camera is used to collect the image inside the flexible vibration disk, and then the image is gray-processed. Then, according to the difference in brightness between the magnet and the flexible vibration disk in the image, the position of each magnet in the image is roughly identified by gray-scale recognition. Then, the gray-scale image is binarized, and edge pixel extraction is performed at the approximate magnet position obtained by gray-scale recognition, and the pixel contour that conforms to the magnet contour shape is screened out. Finally, the deep learning image recognition algorithm is used to perform image recognition only at the position where the pixel contour screened out in the previous step is located, so as to identify the good magnet in the predetermined posture. Thus, the gray-scale recognition, binarization and edge pixel extraction steps are sequentially performed, which effectively narrows the processing scope of the deep learning algorithm, reduces the computational complexity, and significantly improves the recognition efficiency. This avoids the problem that the traditional deep learning-based image recognition algorithm may face a large computational burden when there are a large number of magnets in the vibration disk with different postures, resulting in a long recognition waiting time. (2) By first screening out pixel contours that match the shape of the magnet outline and then performing deep learning recognition on these contours, complex deep learning calculations on the entire image are avoided, thereby reducing the requirements on computer computing power, reducing the consumption of computing resources, and reducing the cost of use. BRIEF DESCRIPTION OF THE DRAWINGS
[0012] Figure 1 It is a schematic diagram of the process of the present invention. DETAILED DESCRIPTION
[0013] The present invention is described in detail below with reference to the accompanying drawings and specific embodiments.
[0014] The following is a comprehensive description of embodiments of the present invention with reference to the accompanying drawings. It should be noted that the present invention can be implemented in different forms and is not limited to the embodiments illustrated herein. These embodiments are provided to make the present disclosure thorough and complete and to fully convey the scope of the present invention to those skilled in the art. The present invention provides a visual control method for quickly sorting magnets, such as Figure 1 As shown, the method for controlling the manipulator to grab the magnet in the flexible vibration plate includes the following steps: S10, placing a plurality of magnets in the flexible vibration disk, causing the flexible vibration disk to vibrate, thereby driving the magnets therein to displace and roll, so that the magnets are dispersed and the postures are adjusted. After vibrating for a period of time, the flexible vibration disk stops vibrating to stabilize the positions of the magnets inside the flexible vibration disk, ensuring that the positions of the magnets remain unchanged during the subsequent image acquisition and robot grasping process; S20, collecting an image inside the flexible vibration disk by placing a camera above the flexible vibration disk; preferably, in order to make it easy to clearly distinguish the magnet and the vibration disk in the subsequent recognition process to ensure recognition accuracy, at least in step S20, when collecting the image by the camera, the flexible vibration disk itself emits light, and radiates light from the side of the magnet away from the camera toward the camera; S30, image recognition, includes the following steps in sequence: S31, converting the image into a grayscale image. The algorithm for converting the RGB color image into a grayscale image is a conventional technical means in this field. Common methods such as the mean method and the weighted average method can be used without specific limitation. Then, grayscale recognition is used to identify the magnet in the image. In a preferred embodiment, since the flexible vibration disk is self-luminous when the image is collected, the brightness difference between the vibration disk and the magnet in the grayscale image is large. Therefore, in order to simplify the calculation, it is preferred to use a threshold segmentation algorithm for grayscale recognition, that is, to set a grayscale threshold, and then compare the grayscale value of each pixel in the image with the grayscale threshold, and distinguish the magnet and the vibration disk in the image according to the comparison result. S32. Since the grayscale threshold has been determined in step S31, the grayscale image is binarized according to the recovery threshold, and edge pixels are extracted from the binarized image, and then the pixel contour that conforms to the shape of the magnet contour is screened out. The edge extracted by the edge pixel is the position where the grayscale value in the image changes significantly (i.e., the boundary between the magnet and the vibration disk in the image, that is, the contour of the magnet). Specifically, it can be identified by calculating the first-order or second-order derivative of the image. When the pixel value changes significantly in a certain direction, the position is identified as the edge position. By calculating each pixel in the image area, The gradient or Laplace operator value of the pixel is used to identify the edge, which is a conventional technical means in the art and will not be further described in detail in this embodiment. After this step, the magnets that meet the predetermined contour can be identified, and then some magnets that do not meet the grasping posture or are close to each other are screened out; even if the magnets are not close to each other, if the distance between the two magnets is too close, it may still cause the subsequent grasping failure of the manipulator. Preferably, in step S31, when performing grayscale recognition, the magnet image with fewer surrounding magnets is preferentially screened and marked as the object of edge pixel extraction in step S32; S33, and then use the image recognition algorithm based on deep learning to perform image recognition on the position of the pixel contour screened out in step S32 to identify the qualified magnet in a predetermined posture. The image recognition algorithm based on deep learning is obtained by inputting the image of the qualified magnet in the predetermined posture for training, so as to automatically identify the qualified magnet in the predetermined posture. Specifically, any existing image recognition algorithm based on deep learning, such as a convolutional neural network, can be used, without specific limitation; specifically in this embodiment, the predetermined posture includes the front side of the magnet facing up. Due to edge pixel extraction and then screening the pixel contour that conforms to the magnet contour shape, it is difficult to accurately identify the missing corners and other features of the magnet. Therefore, it is preferred that in step S33, the edge shape of the magnet is also identified to screen out qualified magnets with complete edge shapes; S40, converting the image coordinates to the world coordinates, and determining the position of the good magnet in the predetermined posture in the robot coordinates, is a conventional technical means in the art, and will not be described here; for simplicity, in step S40, the coordinate value of the geometric midpoint pixel of the magnet shape in the image is determined as the grabbing coordinate of the robot; the coordinate value of the geometric center point of the magnet shape is determined by mathematical calculation through the coordinate value of each pixel in the pixel contour that conforms to the magnet contour shape; S50, the manipulator arrives at the position of each good magnet in a predetermined posture in turn, and grabs each magnet respectively. The manipulator can be any existing manipulator that can be used for grabbing or vacuum adsorbing magnets and can perform at least three-axis linear displacement and horizontal rotation of the grabbed magnets; S60, after the flexible vibration plate is started to vibrate for a period of time, the process returns to step S10, and when the number of good magnets in a predetermined posture identified after multiple vibrations is less than a predetermined number, the flexible vibration plate is replenished with magnets.
[0015] The above description is only a preferred embodiment of the present invention and is not a limitation on the design of this case. Any equivalent changes made based on the design key of this case shall fall within the protection scope of this case.
Claims
1. A visual control method for quickly sorting magnets, characterized in that: The method is used to control the manipulator to grab the magnet in the flexible vibration plate, including the following steps: S10, stopping the vibration of the flexible vibration plate; S20, collecting an image inside the flexible vibration plate by placing a camera above the flexible vibration plate; S30, image recognition, including the following steps in sequence: S31, converting the image into a grayscale image, using grayscale recognition to identify the magnet in the image; S32, binarizing the grayscale image, extracting edge pixels from the binarized image, and then screening out pixel contours that conform to the shape of the magnet contour; S33, then using an image recognition algorithm based on deep learning to perform image recognition on the location of the pixel contours screened out in step S32 to identify a good magnet in a predetermined posture; S40, converting the image coordinates into world coordinates, and determining the position of the good magnet in a predetermined posture within the robot coordinates; S50, the manipulator arrives at the position of each good magnet in a predetermined posture in turn, and grabs each magnet respectively; S60, after starting the flexible vibration plate to vibrate for a period of time, return to step S10.
2. A visual control method for quickly sorting magnets as claimed in claim 1, characterized in that: In step S31, when grayscale recognition is performed, magnet images with fewer surrounding magnets are preferentially screened and marked as objects for edge pixel extraction in step S32.
3. A visual control method for rapid sorting of magnets as claimed in claim 1, characterized in that: In step S40, the coordinate value of the pixel at the geometric midpoint of the magnet shape in the image is determined as the grasping coordinate of the robot.
4. A visual control method for rapid sorting of magnets as claimed in claim 3, characterized in that: The coordinate value of the geometric center point of the magnet shape is determined by the coordinate value of each pixel in the pixel outline that conforms to the magnet outline shape.
5. A visual control method for rapid sorting of magnets as claimed in claim 1, characterized in that: The predetermined posture includes the front side of the magnet facing upward.
6. A visual control method for rapid sorting of magnets as claimed in claim 1, characterized in that: The flexible vibrating disk is self-luminous, radiating light from the side of the magnet facing away from the camera toward the camera.
7. A visual control method for rapid sorting of magnets as claimed in claim 1, characterized in that: In step S33, the edge shape of the magnet is also identified to screen out good quality magnets with complete edge shapes.
Citation Information
Cited By
Method for mounting magnet
CN120809473A
High-speed arrangement mechanism for inductance coils
CN121180708A
High speed collating mechanism for inductor coils
CN121180708B