Visual inspection system and method for automatic buzzer winding support feeding equipment
By combining machine vision and image recognition technology, the buzzer winding bracket is realized in all aspects and automatic loading, which solves the problems of high error detection rate and low adaptability in traditional methods, and improves the accuracy and efficiency of detection and loading.
Patent Information
- Application Number
- CN202411944327.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-27
- Publication Date
- 2025-05-16
AI Technical Summary
The automatic loading method of traditional buzzer winding bracket has high error detection rate and low adaptability, and cannot achieve all-round and multi-angle detection, resulting in limited detection accuracy and automatic loading integrity.
By combining machine vision and image recognition technology, all-round detection and automatic loading of the buzzer winding bracket is achieved by building an image acquisition environment, image preprocessing, edge detection, circle detection, anti-adhesion processing, front and back recognition, hole filling and morphological operation, notch recognition and robotic arm grabbing.
It improves the accuracy and efficiency of automatic loading, reduces the false detection rate, enhances the adaptability to screws of different specifications and materials, and ensures the integrity and accuracy of inspection and loading.
Smart Images

Figure CN120013864A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of visual detection, and in particular to a visual detection system and method for automatic feeding equipment of a buzzer winding bracket. Background Art
[0002] Machine vision inspection technology converts the target object into an image signal and transmits it to a dedicated image processing system, which then operates on these signals to extract the target's features. By identifying and judging these features, the system can obtain the inspection results. Visual inspection technology plays a huge role in identifying the buzzer winding bracket and using a robotic arm to grab it after the inspection is completed.
[0003] In the current technical framework and current technical practice, the feeding of buzzer winding brackets usually adopts the mechanical method of automatic feeding. The automatic feeding machines of traditional mechanical methods include vibration disc type, step type, knife and fork type, roller type and other feeding methods; because the traditional feeding adopts the method of embedding the feeding machine after random vibration to detect the front and back sides and the gap of the winding bracket and automatically feed, this leads to low feeding accuracy and the need to repeat the feeding of the same batch of winding brackets many times. In addition, since the traditional feeding method does not use machine vision and image recognition technology, it is impossible to achieve comprehensive detection of the winding bracket in all directions and angles, which leads to the problem of insufficient adaptability when processing screws of different specifications and materials, limiting the accuracy and completeness of detection and subsequent automatic feeding. Summary of the invention
[0004] In response to the technical problems of high false detection rate and low adaptability of the above-mentioned traditional automatic feeding methods, the present technical solution provides a visual inspection system and method for automatic feeding equipment of buzzer winding brackets, which improves the accuracy and efficiency of feeding through the combination of machine vision and image recognition technology, and can effectively solve the above-mentioned problems.
[0005] The present invention is achieved through the following technical solutions: A visual inspection method for an automatic feeding device for a buzzer winding bracket comprises the following steps: Step 1: Build the image acquisition environment; Select multiple buzzer winding brackets and install them into the vibration plate, and perform pre-detection processing on the buzzer winding bracket to be tested, obtain an image acquisition environment suitable for the buzzer winding bracket to be tested according to the result of the pre-detection processing, and adjust the parameters in the visual detection module at the same time; Step 2: Image acquisition and preprocessing; Under the image acquisition environment adjusted in step 1, an image of the buzzer winding bracket to be tested is acquired, and the acquired image is preprocessed by removing noise, grayscale image, and binarization; Step 3: edge detection and circle detection; Perform edge detection and circle detection on the image preprocessed in step 2, mark the detected circles, mark the original circumference and center, and record the center coordinates and radius; Step 4: Anti-adhesion treatment; Use the contour area algorithm to calculate the area of the circle detected in step 3, ignoring the overlapping or stuck winding brackets; Step 5: Identify the front and back sides of the buzzer winding bracket; Taking advantage of the inconsistency between the front and back images of the buzzer winding bracket, combined with the coordinates of the circle center obtained in step 3, the number of edges in the neighborhood around the circle center is detected to screen out the buzzer winding bracket with the front side facing up; Step 6: Hole filling and morphological operations; In step 5, select the buzzer winding bracket with the front side facing up, and perform hole filling and morphological operations on the circle on the front side; Step 7: Identify the notch of the buzzer winding bracket; By traversing the pixel points on the circumference of the outer contour of the buzzer winding bracket, the gap on the circumference of the buzzer winding bracket is identified, the average pixel coordinates of the gap are printed out, and the gap angle is calculated according to the gap coordinates; Step 8: Operate the robotic arm to grasp; According to the notch coordinates and notch angles obtained in step seven, the buzzer winding bracket with the notch identified is grabbed to realize automatic loading; Step 9: Check and grab the remaining buzzer winding brackets; Turn on the vibration plate to vibrate, adjust the positions of the remaining buzzer winding brackets to be tested in the vibration plate, and repeat steps 2 to 8 until all the buzzer winding brackets in the vibration plate are captured.
[0006] Furthermore, the acquisition of the image acquisition environment described in step 1 includes acquiring the pre-inspection position result, pre-inspection image result and special light source point corresponding to the winding bracket of the buzzer to be tested.
[0007] Furthermore, the specific operation method of step one is: Step 1.1: Place multiple buzzer winding brackets to be tested into the vibration plate, adjust the height and position of the camera, and determine the y-axis coordinate and x-axis coordinate of the camera; the camera collects images, obtains the position information of the vibration plate according to the image, and converts the camera and the vibration plate into two-dimensional coordinates in the visual detection module to determine whether the vibration plate exceeds the preset shooting coordinate range. If not, the currently obtained two-dimensional coordinates, camera shooting position, and camera shooting angle are used as the pre-inspection position results corresponding to the buzzer winding bracket to be tested, and proceed to the next step; if so, adjust the position of the camera and the vibration plate so that the two-dimensional coordinates of the vibration plate fall within the preset shooting coordinate range of the camera, and then use the currently obtained two-dimensional coordinates, camera shooting position, and camera shooting angle as the pre-inspection position results corresponding to the buzzer winding bracket to be tested, and proceed to the next step; Step 1.2: The camera takes an image of the buzzer winding bracket to be tested and uploads it to the visual inspection module. The visual inspection module uses the image as the initial image and determines whether the clarity of the initial image is not lower than the preset clarity range requirement. If so, the information of the initial image is directly used as the pre-inspection image result corresponding to the buzzer winding bracket to be tested, and proceeds to the next step; if not, the image frame rate, image resolution, exposure, and gain parameters in the visual inspection module are adjusted so that the information of the initial image is not lower than the preset clarity range requirement, and the information of the initial image is used as the pre-inspection image result corresponding to the buzzer winding bracket to be tested, and then proceeds to the next step; Step 1.3: Set a hemispherical diffuser on the top of the original shooting bracket, and set a long strip light source with adjustable brightness on both sides of the vibration plate. Adjust the brightness and irradiation angle of the light source so that the light reflected by the diffuser can evenly illuminate all areas of the vibration plate; Step 1.4: Based on the pre-inspection position result obtained in step 1.1, the pre-inspection image result obtained in step 1.2, and the position of the light source added in step 1.3, record the position of the vibration plate that matches the winding bracket of the buzzer to be tested, the camera shooting position, the camera shooting height, the initial parameters of the visual inspection module, the position and brightness of the added light source, and use it as the image acquisition environment.
[0008] Furthermore, the specific operation method of step 2 is: Step 2.1: Operate the vibration plate to vibrate, so that the buzzer winding bracket in the vibration plate is displaced, and use the camera to capture an image of the buzzer winding bracket in the vibration plate; Step 2.2: Transfer the image collected in step 2.1 to pycharm for Gaussian blur preprocessing to remove noise and smooth the image, convert the denoised image into a grayscale image, and then use an adaptive threshold binarization algorithm to convert the grayscale image into a binary image.
[0009] Furthermore, the specific operation method of step three is: Step 3.1: Perform the Canny edge detection algorithm on the binary image obtained in step 2, and adjust the high threshold and low threshold in the algorithm so that the edge in the image after edge detection is consistent with the actual image collected in step 2; Step 3.2: Perform Hough ring transform on the image after edge detection, adjust the resolution of the accumulator image in the Hough ring transform, and use the image preprocessed in step 2 as the input image; adjust the resolution of the input image, the inverse of the ratio, the minimum distance between the centers of circles, edge detection, the thresholds param1 and param2 of the center accumulator, the minimum radius and the maximum radius of the detected circle, so that the winding bracket in the original image can be roughly detected by the Hough circle detection algorithm, and save the information of each detected circle in the output parameter circles, each circle is represented by the center coordinates (x, y) and the radius r.
[0010] Furthermore, the specific operation method of step 4 is: Set the contour area threshold in the software; perform contour detection algorithm operation on the edge detection image in step 3.1, and calculate the contour area of the area within the detected contour; compare the calculated contour area with the set contour area threshold, if it is higher than the set threshold, it is judged as adhesion and excluded, thereby realizing the screening of contour area, so that a large number of buzzer winding brackets that are adhered and overlapped are screened out and cannot be identified.
[0011] Furthermore, the center of the buzzer winding bracket described in step five is smooth and has no edge lines in the front image; there is a nail at the center of the back image, and the nail will form an edge line. The number of edge lines in the neighborhood of the center of the circle can be detected to determine whether the buzzer winding bracket in the captured image is on the front or back.
[0012] Furthermore, the specific operation method of step five is: Step 5.1: Create a black mask with the same pixel size as the acquired image. According to the center coordinates of the circle detected in step 3.2, draw a white solid circle at the coordinates corresponding to the black mask. Perform an AND operation on the black mask and the image of the buzzer winding bracket that is not bonded in step 4. The center neighborhood of the buzzer winding bracket that is not bonded is displayed in the white solid circle of the black mask. Step 5.2: Set a threshold for the number of edge lines in the neighborhood of the circle center, and detect the number of edge lines in the neighborhood of the circle center of each buzzer winding bracket. If it is higher than the set threshold, it is recorded as the reverse side; if it is lower than the set threshold, it is recorded as the positive side.
[0013] Furthermore, the specific operation method of step six is: Step 6.1: Define a hole filling function. When the hole needs to be filled, call the hole filling function to fill the circle. Fill the circular hole on the buzzer winding bracket in the image to avoid the circular hole on the buzzer winding bracket being mistakenly recognized as a gap. Step 6.2: Create a black mask with the same pixel size as the original captured image again, draw a white solid circle on the black mask, the center coordinates of the white solid circle correspond to the center coordinates of each buzzer winding bracket facing up, and use AND operation on the black mask and the binary image to display the binary images of all winding brackets facing up in the white solid circle; Step 6.3: Call the hole filling function in step 6.1 to fill the holes of the image after the AND operation in step 6.2, and perform dilation processing in the morphological operation on the hole-filled image to make the gap detection more accurate.
[0014] Furthermore, the specific operation method of step seven is: Step 7.1: Initialize a Boolean variable to mark whether a gap is found on the circumference, and then initialize a list to store the coordinates and angles of the gap; Step 7.2: Traverse all circles in the image after hole filling and morphological operation in step 6.3, and then traverse all points on the circumference of each circle to determine whether the pixels are continuous. If the pixels are continuous, it is determined that there is no gap; if the pixels are discontinuous, the discontinuous part is determined to be a gap; S73: Mark all the gaps found in step 7.2 with green solid lines, calculate the average pixel at each gap as the gap coordinates at that location, and calculate the gap angle based on the gap coordinates; the calculation formula for the gap angle is: ; In the above formula, is the notch angle; (a, b) are the average pixel coordinates at the notch, and (x, y) are the center coordinates of the buzzer winding bracket.
[0015] A visual inspection system for an automatic feeding device for a buzzer winding bracket can realize the visual inspection method for the automatic feeding device for a buzzer winding bracket, including establishing a communication relationship: Visual inspection module: including an adapted industrial camera and its software, which can control the camera to shoot and adjust the camera parameters on the software side to collect images of the buzzer winding bracket to be tested; Vibration plate: a square plate-shaped container for placing the buzzer winding bracket, which is arranged on the adjustment device and can vibrate to adjust the position and front and back sides of the buzzer winding bracket; Pre-inspection module: It is set on the positioning device. When the buzzer winding bracket to be tested is placed in the vibration plate, the image captured by the camera and the position information of the buzzer winding bracket to be tested are collected, and the information adapted to the buzzer winding bracket to be tested is found to form a pre-inspection result. Control module: According to the part adjustment point information output by the point setting module, the adjustment device is controlled to adjust the position of the vibration plate, and the height and position of the camera are adjusted by adjusting the shooting bracket to achieve full-range image acquisition; Image processing and analysis module: after the control module completes the operation, it collects the acquired images output by the visual detection module and is used to perform grayscale, binarization, denoising, open operation, and AND operation on the acquired images; Comparison and judgment module: After the image processing and analysis module completes the operation, the front and back sides of the buzzer winding bracket and the gap of the buzzer winding bracket in the collected image are identified and marked through loop traversal, function definition and calling, and machine vision algorithm operation, and finally the detection result is obtained through analysis.
[0016] Furthermore, the visual inspection system further comprises: Security processing module: used to perform security processing on the detection results output by the comparison and judgment module; Display module: used to analyze the output of the security processing module and visualize the analysis results; Among them, the security processing module communicates with the comparison and judgment module, and the display module communicates with the comparison and judgment module. Beneficial Effects
[0017] Compared with the prior art, the visual inspection system and method of the buzzer winding bracket automatic feeding equipment proposed by the present invention has the following beneficial effects: When setting up the image acquisition environment in step one of the technical solution, a hemispherical diffusion plate is arranged on the top of the original shooting bracket, and a long strip light source with adjustable brightness is arranged on both sides of the vibration disk. The brightness and irradiation angle of the light source can be adjusted so that the light reflected by the diffusion plate can evenly illuminate all areas of the vibration disk, which can effectively avoid the influence of external light on the camera collecting the buzzer winding bracket in the vibration disk, and can realize image acquisition of the detection system in any different scenes, so as to facilitate later experimental operations, exhibitions and displays.
[0018] The technical solution sets an anti-adhesion processing operation step in step four, and this step performs anti-adhesion processing through a contour area algorithm; by setting the maximum area threshold method, a large number of adhered and overlapping winding brackets can be made impossible to be identified; it can be achieved that when the number of buzzer winding brackets is too large, there will be no feeding jam.
[0019] This technical solution performs an AND operation in step five to screen out the buzzer winding brackets that are not adhered, and only detects the front and back sides of the buzzer winding brackets that are not adhered, which reduces the number of detections, directly reduces the amount of calculations, and can effectively increase the detection speed. At the same time, the center of the front image of the buzzer winding bracket is smooth and has no edge lines; there is a nail at the center of the back image, and the nail will form the characteristics of the edge line. Combined with the method of detecting the front and back sides of the winding bracket by judging the number of edge lines in the neighborhood of the center of the circle, the detection accuracy is increased. Compared with traditional detection methods, this solution is more efficient in screening winding brackets with the front side facing up.
[0020] Step six of the present technical solution includes a hole filling algorithm and a morphological operation step. The hole filling algorithm is used to fill the circular holes on both sides of the winding bracket in the image, and the morphological operation is used to make the boundary of the winding bracket in the image smoother and reduce the jaggedness of the boundary. This can eliminate interference with gap detection to the greatest extent and minimize the probability of misdetecting gaps.
[0021] This technical solution uses the steps of traversing the circumferential pixel points and judging the position of the gap by judging whether the pixel points are continuous, which can achieve accurate detection of the gap of the winding bracket; and the coordinates of the gap grasped by the robot arm are obtained by calculating the average pixels of the gap, making the obtained gap coordinates more accurate and easier for the robot arm to grasp. Compared with the traditional feeding method, this solution can accurately judge the angle of the gap of the winding bracket, thereby achieving accurate grasping of the robot arm. BRIEF DESCRIPTION OF THE DRAWINGS
[0022] Figure 1 It is a schematic diagram of the overall process of the present invention.
[0023] Figure 2 This is a schematic diagram of the image acquisition environment constructed in step one of the present invention.
[0024] Figure 3 It is the image after grayscale conversion in step 2 of the present invention.
[0025] Figure 4 It is the image after binarization in step 2 of the present invention.
[0026] Figure 5 This is the image after edge detection in step three of the present invention.
[0027] Figure 6 This is the Hough circle detection image in step three of the present invention.
[0028] Figure 7 This is a schematic diagram of selecting the winding bracket facing upward in step five of the present invention.
[0029] Figure 8 This is the image after the binary image and the black mask are operated in step 6 of the present invention.
[0030] Fig. 9 This is the image after hole filling and morphological operation in step six of the present invention.
[0031] Fig.10 It is a schematic diagram of identifying the gap of the winding bracket in step seven of the present invention.
[0032] The numbers in the accompanying drawings are: 1-diffuser plate bracket, 2-camera bracket, 3-light source bracket, 4-vibration plate, 5-position adjustment knob, 6-additional light source. DETAILED DESCRIPTION
[0033] The following will be combined with the accompanying drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. The described embodiments are only part of the embodiments of the present invention, rather than all the embodiments. Under the premise of not departing from the design concept of the present invention, various modifications and improvements made by ordinary persons in the art to the technical solutions of the present invention should all fall within the protection scope of the present invention. Example 1
[0034] A visual inspection method for an automatic feeding device for a buzzer winding bracket is mainly divided into nine parts: building an image acquisition environment, image acquisition and preprocessing, edge detection and circle detection, anti-adhesion processing, identifying the front and back sides of the winding bracket, hole filling and morphological operation, identifying the gap of the winding bracket, manipulating a mechanical arm to grasp, and detecting and grasping the remaining winding brackets. Figure 1 As shown, the specific operation method includes the following steps: Step 1: Build the image acquisition environment; Select multiple buzzer winding brackets and install them into the vibration plate, and perform pre-detection processing on the buzzer winding bracket to be tested. According to the results of the pre-detection processing, an image acquisition environment suitable for the buzzer winding bracket to be tested is obtained, including obtaining the pre-detection position results, pre-detection image results and special light source points corresponding to the buzzer winding bracket to be tested; at the same time, the parameters in the visual inspection module are adjusted. The specific operation method is: Step 1.1: Install and calibrate the camera; Step 1: Build a Figure 2 The shooting bracket shown is used to install the camera on the shooting bracket. The camera adopts Hikvision's MVS industrial camera.
[0035] Step 2: Place multiple buzzer winding brackets to be tested into a vibration plate, and vibrate the vibration plate so that the winding brackets to be tested are randomly and evenly distributed in the vibration plate.
[0036] Step 3: Place the vibration plate directly below the camera, adjust the height and position of the camera, and determine the y-axis and x-axis coordinates of the camera.
[0037] Step 4: Use the camera to capture images, obtain the position information of the vibration disk based on the image, and convert the camera and the vibration disk into two-dimensional coordinates in the visual inspection module to determine whether the vibration disk exceeds the preset shooting coordinate range. If not, the currently obtained two-dimensional coordinates, camera shooting position, and camera shooting angle are used as the pre-inspection position results corresponding to the buzzer winding bracket to be tested, and proceed to the next step; if so, adjust the position of the camera and the vibration disk so that the two-dimensional coordinates of the vibration disk fall within the preset shooting coordinate range of the camera, and then use the currently obtained two-dimensional coordinates, camera shooting position, and camera shooting angle as the pre-inspection position results corresponding to the buzzer winding bracket to be tested, and proceed to the next step.
[0038] Step 1.2: Adjust the parameters in the visual inspection module; The camera takes an image of the buzzer winding bracket to be tested and uploads it to the visual inspection module. The visual inspection module takes the image as the initial image and determines whether the clarity of the initial image is not lower than the preset clarity range requirement. If so, the information of the initial image is directly used as the pre-inspection image result corresponding to the buzzer winding bracket to be tested, and proceeds to the next step; if not, the image frame rate, image resolution, exposure, and gain parameters in the visual inspection module are adjusted. In this embodiment, the image frame rate is set to 30fps, the image resolution is set to 3072×2048, the exposure is set to 45000ms, and the gain is set to gain; so that the information of the initial image is not lower than the preset clarity range requirement, and the information of the initial image is used as the pre-inspection image result corresponding to the buzzer winding bracket to be tested, and then proceeds to the next step.
[0039] Step 1.3: Install the diffuser and add light source; A 60×60cm hemispherical diffuser is set on the top of the original shooting bracket, and a long strip light source with adjustable brightness is set on both sides of the vibration disk, and the brightness is set to 85-100; the position and irradiation angle of the light source are adjusted so that the light can be reflected by the diffuser to illuminate all areas of the vibration disk to the greatest extent possible, so as to avoid the influence of indoor and outdoor light.
[0040] Step 1.4: Obtain image acquisition environment; According to the pre-inspection position result obtained in step 1.1, the pre-inspection image result obtained in step 1.2, and the position of the light source added in step 1.3, record the position of the vibration plate matched with the winding bracket of the buzzer to be tested, the camera shooting position, the camera shooting height, the initial parameters of the visual inspection module, the position and brightness of the added light source, and use it as the image acquisition environment.
[0041] Step 2: Image acquisition and preprocessing; Under the image acquisition environment adjusted in step 1, the image of the buzzer winding bracket to be tested is acquired, and the acquired image is preprocessed by removing noise, grayscale, and binarization; the specific operation method is as follows: Step 2.1: Collect images; The vibration plate is manipulated to vibrate so that the buzzer winding brackets in the vibration plate are evenly and randomly distributed in the area inside the vibration plate, and in the adjusted image acquisition environment, a camera is used to acquire an image of the buzzer winding bracket in the vibration plate.
[0042] Step 2.2: Display the image; Transfer the image collected in step 2.1 to pycharm, read the collected image in pycharm software, and use the namedWindow function to create a resizable window to avoid the problem that the image is too large to be fully displayed in the window.
[0043] Step 2.3: Preprocess the image; Step 1: Use a 5×5 Gaussian kernel to perform Gaussian blur preprocessing on the collected image to remove noise and smooth the image.
[0044] Step 2: Convert the denoised image to grayscale.
[0045] Step 3: Perform adaptive threshold processing on the input grayscale image, use Gaussian window and binarization method, constant C is 125, neighborhood window size is 3x3, and convert the grayscale image into a binary image.
[0046] Step 3: edge detection and circle detection; Perform edge detection and circle detection on the image preprocessed in step 2, mark the detected circles, mark the original circumference and center, and record the center coordinates and radius; the specific operation method is: Step 3.1: Perform the Canny edge detection algorithm on the binary image obtained in step 2. First, calculate the gradient amplitude and direction of the image, and then determine the strong edge and weak edge according to the gradient amplitude and the high and low thresholds; adjust the high and low thresholds in the algorithm, set the low threshold to 160-170 and the high threshold to 190-200, so that the edge in the image after edge detection is roughly consistent with the original image collected in step 2;
[0047] Step 3.2: Perform Hough ring transform on the image after edge detection, adjust the resolution of the accumulator image in the Hough ring transform, and use the image preprocessed in step 2 as the input image; set the inverse dp of the ratio of the resolution of the accumulator image to the resolution of the input image to 1.2, set the minimum distance minDist between the centers of the circles to 95, set the thresholds param1 and param2 of the Canny edge detection and the center accumulator to 50 and 30 respectively, set the minimum and maximum radii minRadius and maxRadius of the detected circle to 50 and 65 respectively, so that the winding bracket in the original image can be roughly detected by the Hough circle detection algorithm, and save the information of each detected circle in the output parameter circles. Each circle is represented by the center coordinates (x, y) and the radius r. Draw a complete ring on the circumference of the detected Hough circle on the original image with a red solid line and fill the center of the detected Hough circle with a blue solid circle with a radius of 5 for marking.
[0048] Step 4: Anti-adhesion treatment; Use the contour area algorithm to calculate the area of the circle detected in step 3, ignoring the overlapping or stuck winding brackets; the specific operation method is: Set the contour area threshold in the software, and set the maximum contour area threshold to 15000; perform contour detection algorithm operation on the edge detection image in step 3.1, and calculate the contour area of the area within the detected contour; compare the calculated contour area with the set contour area threshold of 15000. If it is higher than the set threshold, it is judged as adhesion and excluded and cannot be identified. The contour area is screened, so that a large number of buzzer winding brackets that are adhered and overlapped are screened out.
[0049] Step 5: Identify the front and back sides of the buzzer winding bracket; The center of the buzzer winding bracket in the front image is smooth and has no edge lines; there is a nail in the center of the circle in the back image, and the nail will form an edge line. The number of edge lines in the neighborhood of the center of the circle can be detected to determine whether the buzzer winding bracket in the captured image is on the front or back.
[0050] Therefore, the front and back images of the buzzer winding bracket are inconsistent, and combined with the coordinates of the circle center obtained in step 3, the number of edges in the neighborhood around the circle center is detected to screen out the buzzer winding bracket with the front side facing up; the specific operation method is: Step 5.1: Create a black mask with the same pixel size as the acquired image. Draw a white solid circle with a radius of 20 on the black mask according to the center coordinates of the circle detected in step 3.2. The center coordinates of the white solid circle correspond to the center coordinates of each Hough circle detected in the original image. Perform an AND operation on the black mask and the image of the buzzer winding bracket that is not bonded in step 4. The neighborhood around the center of the buzzer winding bracket that is not bonded is displayed in the white solid circle of the black mask. Step 5.2: Set the threshold for the number of edge lines in the neighborhood of the circle center, and set the minimum edge number threshold to 15; detect the number of edge lines in the neighborhood of the circle center of each buzzer winding bracket, and compare it with the set threshold. If it is higher than the set threshold, it is recorded as the reverse side; if it is lower than the set threshold, it is recorded as the front side, marked with a red solid line, and the coordinates and radius of the Hough circle facing up are stored in a list; in this way, the winding brackets facing up are screened out.
[0051] Step 6: Hole filling and morphological operations; In step 5, select the buzzer winding bracket with the front side facing up, and perform hole filling and morphological operations on the circle on the front side; the specific operation method is: Step 6.1: Use the flood filling algorithm to define a hole filling function to fill the circular holes on the winding bracket in the original image; when the holes need to be filled, call the hole filling function to fill the circle; in this way, the circular holes on the buzzer winding bracket in the image are filled to avoid the circular holes on the buzzer winding bracket being mistakenly identified as gaps.
[0052] Step 6.2: Create a black mask with the same pixel size as the original captured image again, draw a white solid circle with a radius of r+5 of the Hough circle on the black mask, and the center coordinates of the white solid circle correspond to the center coordinates of each buzzer winding bracket facing up. Use AND operation on the black mask and the binary image, and the binary images of all winding brackets facing up are displayed in the white solid circle.
[0053] Step 6.3: Call the hole filling function in step 6.1 to fill the holes of the image after the AND operation in step 6.2, create a 6×6 pixel matrix for the element structure of the dilation operation, and call the structure element to perform the dilation processing in the morphological operation on the image after the hole filling, so that the gap detection is more accurate.
[0054] Step 7: Identify the notch of the buzzer winding bracket; By traversing the pixel points on the outer contour of the buzzer winding bracket, the gap on the circumference of the buzzer winding bracket is identified, the average pixel coordinates of the gap are printed out, and the gap angle is calculated based on the gap coordinates; the specific operation method is: Step 7.1: Initialize a Boolean variable to mark whether a gap is found on the circumference, and then initialize a list to store the coordinates and angles of the gap.
[0055] Step 7.2: Traverse all circles in the image after hole filling and morphological operations in step 6.3, and then traverse all points on each circle in turn to determine whether the pixels are continuous. If the pixels are continuous, it is determined that there is no gap; if the pixels are discontinuous, the discontinuous part is determined to be a gap.
[0056] S73: Mark all the gaps found in step 7.2 with green solid lines, calculate the average pixel at each gap as the gap coordinates at that location, and calculate the gap angle based on the gap coordinates; the calculation formula for the gap angle is: ; In the above formula, is the notch angle; (a, b) are the average pixel coordinates at the notch, and (x, y) are the center coordinates of the buzzer winding bracket.
[0057] Step 8: Operate the robotic arm to grasp; According to the notch coordinates and notch angles obtained in step seven, the buzzer winding bracket with the notch identified is grabbed to achieve automatic loading.
[0058] Step 9: Check and grab the remaining buzzer winding brackets; Turn on the vibration plate to vibrate, adjust the positions of the remaining buzzer winding brackets to be tested in the vibration plate, and repeat steps 2 to 8 until all the buzzer winding brackets in the vibration plate are captured.
[0059] Embodiment 2: A visual inspection system for an automatic feeding device for a buzzer winding bracket can implement a visual inspection method for an automatic feeding device for a buzzer winding bracket described in Example 1, including establishing a communication relationship: Visual inspection module: includes an adapted industrial camera and its software, which can control the camera to take pictures and adjust the camera parameters on the software side to collect images of the buzzer winding bracket to be tested.
[0060] Vibration plate: A square plate-shaped container for placing the buzzer winding bracket, which is arranged on the adjustment device and can vibrate to adjust the position and front and back sides of the buzzer winding bracket.
[0061] Pre-inspection module: It is set on the positioning device. After the buzzer winding bracket to be tested is placed in the vibration plate, the image captured by the camera and the position information of the buzzer winding bracket to be tested are collected, and the information compatible with the buzzer winding bracket to be tested is found to form a pre-inspection result.
[0062] Control module: According to the part adjustment point information output by the point setting module, the adjustment device is controlled to adjust the position of the vibration plate, and the height and position of the camera are adjusted by adjusting the shooting bracket to achieve all-round image acquisition.
[0063] Image processing and analysis module: After the control module completes the operation, it collects the acquired images output by the visual detection module and is used to perform grayscale, binarization, denoising, open operation, and AND operation on the acquired images.
[0064] Comparison and judgment module: After the image processing and analysis module completes the operation, the front and back sides of the buzzer winding bracket and the gap of the buzzer winding bracket in the collected image are identified and marked through loop traversal, function definition and calling, and machine vision algorithm operation, and finally the detection result is obtained through analysis.
[0065] The visual inspection system also includes: Security processing module: used to perform security processing on the detection results output by the comparison and judgment module.
[0066] Display module: used to parse the output of the security processing module and visualize the parsing results.
[0067] Among them, the security processing module communicates with the comparison and judgment module, and the display module communicates with the comparison and judgment module.
Claims
1. A visual inspection method for an automatic feeding device for a buzzer winding bracket, characterized in that: Includes steps: Step 1: Build the image acquisition environment; A certain number of buzzer winding brackets are selected and loaded into the vibration plate, and the buzzer winding brackets to be tested are pre-detected and processed, and an image acquisition environment adapted to the buzzer winding brackets to be tested is obtained according to the results of the pre-detection processing, and the parameters in the visual detection module are adjusted at the same time; Step 2: Image acquisition and preprocessing; Under the image acquisition environment adjusted in step 1, an image of the buzzer winding bracket to be tested is acquired, and the acquired image is preprocessed by removing noise, grayscale image, and binarization; Step 3: edge detection and circle detection; Perform edge detection and circle detection on the image preprocessed in step 2, mark the detected circles, mark the original circumference and center, and record the center coordinates and radius; Step 4: Anti-adhesion treatment; Use the contour area algorithm to calculate the area of the circle detected in step 3, ignoring the overlapping or stuck winding brackets; Step 5: Identify the front and back sides of the buzzer winding bracket; Taking advantage of the inconsistency between the front and back images of the buzzer winding bracket, combined with the coordinates of the circle center obtained in step 3, the number of edges in the neighborhood around the circle center is detected to screen out the buzzer winding bracket with the front side facing up; Step 6: Hole filling and morphological operations; In step 5, select the buzzer winding bracket with the front side facing up, and perform hole filling and morphological operations on the circle on the front side; Step 7: Identify the notch of the buzzer winding bracket; By traversing the pixel points on the circumference of the outer contour of the buzzer winding bracket, the gap on the circumference of the buzzer winding bracket is identified, the average pixel coordinates of the gap are printed out, and the gap angle is calculated according to the gap coordinates; Step 8: Operate the robotic arm to grasp; According to the notch coordinates and notch angles obtained in step seven, the buzzer winding bracket with the notch identified is grabbed to realize automatic loading; Step 9: Check and grab the remaining buzzer winding brackets; Turn on the vibration plate to vibrate, adjust the positions of the remaining buzzer winding brackets to be tested in the vibration plate, and repeat steps 2 to 8 until all the buzzer winding brackets in the vibration plate are captured.
2. The visual inspection method for the automatic feeding equipment of the buzzer winding bracket according to claim 1 is characterized by: The specific operation method of step one is: Step 1.1: Place multiple buzzer winding brackets to be tested into the vibration plate, adjust the height and position of the camera, and determine the y-axis coordinate and x-axis coordinate of the camera; the camera collects images, obtains the position information of the vibration plate according to the image, and converts the camera and the vibration plate into two-dimensional coordinates in the visual inspection module to determine whether the vibration plate exceeds the preset shooting coordinate range. If not, the currently obtained two-dimensional coordinates, camera shooting position, and camera shooting angle are used as the pre-inspection position results corresponding to the buzzer winding bracket to be tested, and then proceed to the next step; If yes, adjust the position of the camera and the vibration plate so that the two-dimensional coordinates of the vibration plate fall within the preset shooting coordinate range of the camera, and then use the currently obtained two-dimensional coordinates, camera shooting position, and camera shooting angle as the pre-inspection position result corresponding to the buzzer winding bracket to be tested, and proceed to the next step; Step 1.2: The camera takes an image of the buzzer winding bracket to be tested and uploads it to the visual inspection module. The visual inspection module uses the image as the initial image and determines whether the clarity of the initial image is not lower than the preset clarity range requirement. If so, the information of the initial image is directly used as the pre-inspection image result corresponding to the buzzer winding bracket to be tested, and proceeds to the next step; if not, the image frame rate, image resolution, exposure, and gain parameters in the visual inspection module are adjusted so that the information of the initial image is not lower than the preset clarity range requirement, and the information of the initial image is used as the pre-inspection image result corresponding to the buzzer winding bracket to be tested, and then proceeds to the next step; Step 1.3: Set a hemispherical diffuser on the top of the original shooting bracket, and set a long strip light source with adjustable brightness on both sides of the vibration plate. Adjust the brightness and irradiation angle of the light source so that the light reflected by the diffuser can evenly illuminate all areas of the vibration plate; Step 1.4: Based on the pre-inspection position result obtained in step 1.1, the pre-inspection image result obtained in step 1.2, and the position of the light source added in step 1.3, record the position of the vibration plate that matches the winding bracket of the buzzer to be tested, the camera shooting position, the camera shooting height, the initial parameters of the visual inspection module, the position and brightness of the added light source, and use it as the image acquisition environment.
3. The visual inspection method of the buzzer winding bracket automatic feeding equipment according to claim 1 is characterized by: The specific operation method of step three is: Step 3.1: Perform the Canny edge detection algorithm on the binary image obtained in step 2, and adjust the high threshold and low threshold in the algorithm so that the edge in the image after edge detection is consistent with the actual image collected in step 2; Step 3.2: Perform Hough ring transform on the image after edge detection, adjust the resolution of the accumulator image in the Hough ring transform, and use the image preprocessed in step 2 as the input image. Adjust the resolution of the input image, the inverse of the ratio, the minimum distance between the centers of circles, edge detection, the thresholds param1 and param2 of the center accumulator, and the minimum and maximum radius of the detected circle, so that the winding bracket in the original image can be roughly detected by the Hough circle detection algorithm. Save the information of each detected circle in the output parameter circles. Each circle is represented by the center coordinates (x, y) and the radius r.
4. The visual inspection method for the automatic feeding equipment of the buzzer winding bracket according to claim 1 is characterized by: The buzzer winding bracket described in step five has a smooth center without edge lines in the front image; there is a nail in the center of the back image, and the nail forms an edge line. The number of edge lines in the neighborhood of the center of the circle can be detected to determine whether the buzzer winding bracket in the captured image is on the front or back.
5. The visual inspection method for the automatic feeding equipment of the buzzer winding bracket according to claim 4 is characterized by: The specific operation method of step five is: Step 5.1: Create a black mask with the same pixel size as the acquired image. According to the center coordinates of the circle detected in step 3.2, draw a white solid circle at the coordinates corresponding to the black mask. Perform an AND operation on the black mask and the image of the buzzer winding bracket that is not bonded in step 4. The center neighborhood of the buzzer winding bracket that is not bonded is displayed in the white solid circle of the black mask. Step 5.2: Set a threshold for the number of edge lines in the neighborhood of the circle center, and detect the number of edge lines in the neighborhood of the circle center of each buzzer winding bracket. If it is higher than the set threshold, it is recorded as the reverse side; if it is lower than the set threshold, it is recorded as the positive side.
6. The visual inspection method for the automatic feeding equipment of the buzzer winding bracket according to claim 5 is characterized by: The specific operation method of step six is: Step 6.1: Define a hole filling function. When the hole needs to be filled, call the hole filling function to fill the circle. Fill the circular hole on the buzzer winding bracket in the image to avoid the circular hole on the buzzer winding bracket being mistakenly recognized as a gap. Step 6.2: Create a black mask with the same pixel size as the original captured image again, draw a white solid circle on the black mask, the center coordinates of the white solid circle correspond to the center coordinates of each buzzer winding bracket facing up, and use AND operation on the black mask and the binary image to display the binary images of all winding brackets facing up in the white solid circle; Step 6.3: Call the hole filling function in step 6.1 to fill the holes of the image after the AND operation in step 6.2, and perform dilation processing in the morphological operation on the hole-filled image to make the gap detection more accurate.
7. The visual inspection method of the buzzer winding bracket automatic feeding equipment according to claim 6 is characterized by: The specific operation method of step seven is: Step 7.1: Initialize a Boolean variable to mark whether a gap is found on the circumference, and then initialize a list to store the coordinates and angles of the gap; Step 7.2: Traverse all circles in the image after hole filling and morphological operation in step 6.3, and then traverse all points on the circumference of each circle to determine whether the pixels are continuous. If the pixels are continuous, it is determined that there is no gap; If the pixels are discontinuous, the discontinuous part is judged as a gap; S73: Mark all the gaps found in step 7.2 with green solid lines, calculate the average pixel at each gap as the gap coordinates at that location, and calculate the gap angle according to the gap coordinates; The calculation formula for the notch angle is: ; In the above formula, is the notch angle; (a, b) are the average pixel coordinates at the notch, and (x, y) are the center coordinates of the buzzer winding bracket.
8. A visual inspection system for an automatic feeding device for a buzzer winding bracket, which can implement any visual inspection method for an automatic feeding device for a buzzer winding bracket according to claim 1 to claim 7, characterized in that: Including establishing a communication relationship: Visual inspection module: including an adapted industrial camera and its software, which can control the camera to shoot and adjust the camera parameters on the software side to collect images of the buzzer winding bracket to be tested; Vibration plate: a square plate-shaped container for placing the buzzer winding bracket, which is arranged on the adjustment device and can vibrate to adjust the position and front and back sides of the buzzer winding bracket; Pre-inspection module: It is set on the positioning device. When the buzzer winding bracket to be tested is placed in the vibration plate, the image captured by the camera and the position information of the buzzer winding bracket to be tested are collected, and the information adapted to the buzzer winding bracket to be tested is found to form a pre-inspection result. Control module: According to the part adjustment point information output by the point setting module, the adjustment device is controlled to adjust the position of the vibration plate, and the height and position of the camera are adjusted by adjusting the shooting bracket to achieve full-range image acquisition; Image processing and analysis module: after the control module completes the operation, it collects the acquired images output by the visual detection module and is used to perform grayscale, binarization, denoising, open operation, and AND operation on the acquired images; Comparison and judgment module: After the image processing and analysis module completes the operation, the front and back sides of the buzzer winding bracket and the gap of the buzzer winding bracket in the collected image are identified and marked through loop traversal, function definition and calling, and machine vision algorithm operation, and finally the detection result is obtained through analysis.
9. The visual inspection system for the automatic feeding equipment of the buzzer winding bracket according to claim 8 is characterized by: The visual inspection system further comprises: Security processing module: used to perform security processing on the detection results output by the comparison and judgment module; Display module: used to parse the output of the security processing module and visualize the parsing results: Among them, the security processing module communicates with the comparison and judgment module, and the display module communicates with the comparison and judgment module.