A quality detection method for electric wires used to protect wild animals
The quality detection method for electric nets used to protect wild animals addresses defects through image processing and algorithmic analysis, enhancing efficiency and accuracy in defect detection.
Patent Information
- Application Number
- CN202210232940.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-03-09
- Publication Date
- 2024-12-10
- Estimated Expiration
- 2042-03-09
AI Technical Summary
Existing electric nets used to protect wild animals suffer from defects such as 'bean shortage' and 'glue overflow' due to production inconsistencies, leading to inefficiencies and potential safety hazards.
A quality detection method that utilizes image preprocessing, BLOB detection, center calibration, and algorithms to identify defects in electric grids, including glue overflow and bean shortage, by analyzing images from a camera and performing real-time defect inspection.
Reduces human errors and improves operating efficiency by accurately detecting defects in electric nets, shortening production time and reducing labor costs.
Smart Images

Figure CN114612426B_ABST
Abstract
Description
Technical Field
[0001] The invention belongs to the technical field of computer vision target detection, and relates to a power grid detection system, in particular to a quality detection method for power grid equipment used to protect wild animals. Background Art
[0002] Electric nets are often used to contain and protect wild animals. When used, a fixed voltage is connected at both ends of the net. During the production process, a machine is required to use plastic to melt and weld the intersection of the net wires to fix them. The volume of the glue points has a relatively stable size. Due to certain reasons during the production process, the glue points may be too small or there are no glue points. This situation is called "bean shortage"; another situation is that due to too much plastic injection, the glue points overflow after the machine is pressurized at high temperature. This situation is called "glue overflow". "Bean shortage" will cause the net to fail to achieve the expected effect; "glue overflow" may cause the energized wire in the net to break.
[0003] The Chinese patent with patent number CN206627450U provides a fishing net quality inspection device, including a net-releasing roller, a transmission roller, a net-collecting roller, a baffle and a base; the net-releasing roller, the transmission roller and the net-collecting roller are arranged on the base; the baffle is located between the net-releasing roller and the net-collecting roller; the surface color of the baffle is black; the transmission roller is located above the baffle; the net-releasing roller, the transmission roller and the net-collecting roller are parallel to each other. The fishing net quality inspection device provided by the utility model provides a black baffle under the transmission roller as the background of the fishing net, so that the fishing net and the baffle form a strong contrast. With the fishing net quality inspection device provided by the utility model, the quality inspector can easily find out whether the fishing net has defects during inspection, reduce the occurrence of missed inspections and false inspections, and improve the quality inspection efficiency; and the baffle can reduce direct light, effectively relieving the eye fatigue of the quality inspector.
[0004] The Chinese patent with patent number CN103901040A discloses a three-dimensional mesh defect online detection system based on machine vision, including a front position sensor, a front light source, a front camera, a back position sensor, a back light source, a back camera, a photoelectric encoder, a first conveyor belt mechanism, a second conveyor belt mechanism, a frame, a control platform, an alarm indication module, a display module, a control button, and a main control system. The front position sensor, the front light source, the front camera, the back position sensor, the back light source, the back camera, and the photoelectric encoder are all fixed on the frame. The position sensor is higher than the upper plane of the first conveyor belt mechanism and the second conveyor belt mechanism. The present invention can solve the problems of the existing three-dimensional mesh defect online detection system that can only scan one side of the workpiece, has low work efficiency, and is prone to workpiece collision and damage due to multiple scans. Summary of the invention
[0005] The purpose of the present invention is to address the above-mentioned shortcomings and propose a quality inspection method for electric grids used to protect wild animals, which inputs images through a camera and performs defect inspection on the electric grids in real time after algorithm processing, thereby reducing human errors and improving operating efficiency.
[0006] The purpose of the present invention can be achieved by the following technical solutions:
[0007] A quality detection method for electric wires used to protect wild animals, comprising the following steps:
[0008] S1. Image preprocessing:
[0009] The original image set SRC of the input electric grid is subjected to grayscale conversion, opening operation, thresholding, and corrosion and dilation preprocessing operations in sequence to obtain the target image set DST;
[0010] S2. Point set extraction:
[0011] Perform BLOB detection on each image DST in the image set DST respectively, and further remove interference points to obtain the grid intersection point set POINTS;
[0012] S3, center calibration:
[0013] Based on the open operation image, the diamond shape fitting algorithm is used to perform center calibration on the point set POINTS, and the center-calibrated point set CaliPoints is obtained;
[0014] S4. Determine the overflow of glue:
[0015] Glue overflow judgment is performed based on the point sets POINTS and CaliPoints before and after calibration;
[0016] S5, column processing:
[0017] The CaliPoints point set is processed into columns to obtain the column set ClasPoints after the columns are divided;
[0018] S6. Bean shortage judgment:
[0019] Based on the target image set DST and the column set ClasPoints, the missing bean recognition algorithm is used to judge the missing bean.
[0020] In the above-mentioned quality detection method for electric wires used to protect wild animals, in step S1, the data preprocessing operation on the input data includes the following process:
[0021] The input image set SRC is grayed, the image set is obtained by opening operation, the image is cut and thresholded, and the preprocessed image set DST is obtained; first, the input image set SRC = {src1, src2, sre3, src4}, the counter is i = 1, the corrosion times t1 and t2, the dividing line coordinates x = {x1, x2, x3, x4}, the threshold balance factor thresh, the threshold T = {t1, t2, t3, t4}, the preprocessed target image set DST; {dst1, dst2, dst3, dst4} variable gay, variable morphology, variable temp, variable threshold, variable left, variable right;
[0022] (1) Convert SRC into a grayscale image gray, use the OpenCV library to perform an open operation on gray to obtain image morphology; traverse all pixel points in the image morphology, calculate the average grayscale value and the minimum grayscale value of the image; then take the average of the two to obtain temp;
[0023] (2) The threshold balancing factor thresh is summed with temp to obtain the threshold t; then the image morphology is thresholded to obtain the image threshold1; the OpenCV library is used to divide the threshold into the left and right images with the horizontal coordinate x1 as the dividing line;
[0024] (3) Perform corrosion operations on et and right for times t1 and t2 respectively, and then perform dilation operations for the same number of times respectively to obtain processed et and right;
[0025] (4) Let and right are horizontally spliced to obtain the preprocessed target image DST, and the target image set DST is output.
[0026] In the above-mentioned quality detection method for electric wires used to protect wild animals, in step S3, the center calibration operation of the pre-processed data includes the following process:
[0027] The specific steps of using the diamond shape fitting algorithm to perform center correction and obtain the corrected point set CaliPoints are as follows:
[0028] (1) First, define the detection radius radius, define the detection end coordinates as (x, y), define the calibrated point as cp, its coordinates as (cpx, cpy), define the point gray value threshold pthresh, and define the calibrated point set as CaliPoints, where CaliPoints = {cp 1 ,cp 2 ,…,cp n}, define counter i=1;
[0029] (2) Define the coordinates (px i -radius,py i ),(px i ,py i -radius),(px i +radius,py i ),(px i ,py i + radius) as the vertex of a rhombus, the set of all the points on its edges is {pt i1 ,pt i2 ,…,pt im}, where the coordinates of the jth point are (ptx ij ,pty ij ), the gray value of this point is grey ptxik,ptyik , define the point counter k=1 on the edge point set;
[0030] (3) Under the joint action of the detector and the diamond fitting algorithm, the calibrated point set CaliPoints is obtained by comparing the counter and gray value features and performing algorithm screening.
[0031] In the above-mentioned quality inspection method for electric wires used to protect wild animals, in step S4, the operation of determining the glue overflow from the data includes the following process:
[0032] The specific steps for judging the overflow of glue based on the point sets POINTS and CaliPoints before and after calibration are as follows:
[0033] (1) Define the overflow threshold overThresh, define the point counter as i=1, and calculate from the point sets before and after correction respectively;
[0034] (cpx i -px i ) 2 +(cpy i -py i ) 2 ≤overThresh
[0035] (2) If the result is less than the threshold, the WrongType is "overflowing glue", otherwise it is considered that there is no "overflowing glue" problem.
[0036] In the above-mentioned quality detection method of electric wires for protecting wild animals, in step S6, the operation of judging the lack of beans on the data includes the following process:
[0037] (1) Define the height of the input image dst as height; define the column set identified in step S3 as ClasPoints = {col 1 ,col 2 ,…,col n}, where col i ={point i1 ,point i2 ,…,point ij}, the total number of points is sum i , point ik The vertical coordinate is py ik ; Define the average distance as average, the total number of points as sum, and the missing bean distance threshold thresh = 1.3*average; define the column counter i = 1;
[0038] (2) Sort all the points in col from small to large based on the ordinate, and the result is still recorded as col;
[0039] (3) Similarly, the missing bean distance threshold is used to determine whether the bean is missing; if empy-py i1 >thresh, WrongType is determined to be "lack of beans", otherwise it is determined that there is no "lack of beans" problem.
[0040] Compared with the prior art, the quality detection method of the electric wire for protecting wild animals has the following beneficial effects:
[0041] The present invention pre-processes the image of the electric net to solve the problem of wire interference in the collected image and the problem of large difference in grayscale value of glue points caused by uneven illumination. Then BLOB detection and interference removal processing are performed, and finally the image is judged for overflow and lack of beans. Through such a quality inspection step of the electric net, the time of the complete process of net making is greatly shortened, the labor cost is significantly reduced, the overflow or lack of beans caused by manual inspection errors is avoided, and the efficiency and accuracy of the enterprise's net making are improved. BRIEF DESCRIPTION OF THE DRAWINGS
[0042] Figure 1 The present invention is a flow chart of the operation of a quality inspection method for electric wires used for protecting wild animals. DETAILED DESCRIPTION
[0043] The specific implementation of the present invention is further described below in conjunction with the accompanying drawings and specific embodiments:
[0044] The present invention provides a comprehensive analysis and detection method for real-time quality detection of power-supply appliances and timely sending information to a production line control system when defects are found.
[0045] like Figure 1As shown, the quality detection method of the electric wire used to protect wild animals includes the following steps:
[0046] S1. Image preprocessing:
[0047] The original image set SRC of the input electric grid is subjected to grayscale conversion, opening operation, thresholding, and corrosion and dilation preprocessing operations in sequence to obtain the target image set DST;
[0048] The data preprocessing operation on the input data includes the following steps:
[0049] The input image set SRC is grayed, the image set is obtained by opening operation, the image is cut and thresholded, and the preprocessed image set DST is obtained; first, the input image set SRC = {src1, src2, sre3, src4}, the counter is i = 1, the corrosion times t1 and t2, the dividing line coordinates x = {x1, x2, x3, x4}, the threshold balance factor thresh, the threshold T = {t1, t2, t3, t4}, the preprocessed target image set DST; {dst1, dst2, dst3, dst4} variable gay, variable morphology, variable temp, variable threshold, variable left, variable right;
[0050] (1) Convert SRC into a grayscale image gray, use the OpenCV library to perform an open operation on gray to obtain image morphology; traverse all pixel points in the image morphology, calculate the average grayscale value and the minimum grayscale value of the image; then take the average of the two to obtain temp;
[0051] (2) The threshold balancing factor thresh is summed with temp to obtain the threshold t; then the image morphology is thresholded to obtain the image threshold1; the OpenCV library is used to divide the threshold into the left and right images with the horizontal coordinate x1 as the dividing line;
[0052] (3) Perform corrosion operations on et and right for times t1 and t2 respectively, and then perform dilation operations for the same number of times respectively to obtain processed et and right;
[0053] (4) Let and right are horizontally spliced to obtain the preprocessed target image DST, and the target image set DST is output.
[0054] S2. Point set extraction:
[0055] BLOB detection is performed on each image DST in the image set DST, and interference points are further removed to obtain a set of intersection points POINTS of the electric network.
[0056] S3, center calibration:
[0057] Based on the open operation image, the diamond shape fitting algorithm is used to perform center calibration on the point set POINTS, and the center-calibrated point set CaliPoints is obtained;
[0058] The center calibration operation for preprocessed data includes the following steps:
[0059] The specific steps of using the diamond shape fitting algorithm to perform center correction and obtain the corrected point set CaliPoints are as follows:
[0060] (1) First, define the detection radius radius, define the detection end coordinates as (x, y), define the calibrated point as cp, its coordinates as (cpx, cpy), define the point gray value threshold pthresh, and define the calibrated point set as CaliPoints, where CaliPoints = {cp 1 ,cp 2 ,…,cp n}, define counter i=1;
[0061] (2) Define the coordinates (px i -radius,py i ),(px i ,py i -radius),(px i +radius,py i ),(px i ,py i + radius) as the vertex of a rhombus, the set of all the points on its edges is {pt i1 ,pt i2 ,…,pt im}, where the coordinates of the jth point are (ptx ij ,pty ij ), the gray value of this point is grey ptxik,ptyik , define the point counter k=1 on the edge point set;
[0062] (3) Under the joint action of the detector and the diamond fitting algorithm, the calibrated point set CaliPoints is obtained by comparing the counter and gray value features and performing algorithm screening.
[0063] S4. Determine the overflow of glue:
[0064] Glue overflow judgment is performed based on the point sets POINTS and CaliPoints before and after calibration;
[0065] The operation of judging the overflow of glue based on the data includes the following processes:
[0066] The specific steps for judging the overflow of glue based on the point sets POINTS and CaliPoints before and after calibration are as follows:
[0067] (1) Define the overflow threshold overThresh, define the point counter as i=1, and calculate from the point sets before and after correction respectively;
[0068] (cpx i -px i ) 2 +(cpy i -py i ) 2 ≤overThresh
[0069] (2) If the result is less than the threshold, the WrongType is "overflowing glue", otherwise it is considered that there is no "overflowing glue" problem.
[0070] S5, column processing:
[0071] The CaliPoints point set is processed into columns to obtain the column set ClasPoints.
[0072] S6. Bean shortage judgment:
[0073] Based on the target image set DST and the column set ClasPoints, the missing bean recognition algorithm is used to judge the missing bean.
[0074] The operation of judging the lack of beans in the data includes the following process:
[0075] (1) Define the height of the input image dst as height; define the column set identified in step S3 as ClasPoints = {col 1 ,col 2 ,…,col n}, where col i ={point i1 ,point i2 ,…,point ij}, the total number of points is sum i , point ik The vertical coordinate is py ik ; Define the average distance as average, the total number of points as sum, and the missing bean distance threshold thresh = 1.3*average; define the column counter i = 1;
[0076] (2) Sort all the points in col from small to large based on the ordinate, and the result is still recorded as col;
[0077] (3) Similarly, the missing bean distance threshold is used to determine whether the bean is missing; if empy-py i1 >thresh
[0078] If the error is too high, WrongType is judged as "lack of beans", otherwise it is judged as no "lack of beans" problem.
[0079] Compared with the prior art, the quality detection method of the electric wire for protecting wild animals has the following beneficial effects:
[0080] The present invention pre-processes the image of the electric net to solve the problem of wire interference in the collected image and the problem of large difference in grayscale value of glue points caused by uneven illumination. Then BLOB detection and interference removal processing are performed, and finally the image is judged for overflow and lack of beans. Through such a quality inspection step of the electric net, the time of the complete process of net making is greatly shortened, the labor cost is significantly reduced, the overflow or lack of beans caused by manual inspection errors is avoided, and the efficiency and accuracy of the enterprise's net making are improved.
[0081] Of course, the above description is not a limitation of the present invention, and the present invention is not limited to the above examples. Changes, modifications, additions or substitutions made by technicians in this technical field within the essential scope of the present invention should also fall within the protection scope of the present invention.
Claims
1. A quality inspection method for electric wires used to protect wild animals, characterized in that: The following steps are involved: S1. Image preprocessing: The original image set SRC of the input electric grid is subjected to grayscale conversion, opening operation, thresholding, and corrosion and dilation preprocessing operations in sequence to obtain the target image set DST; S2. Point set extraction: Perform BLOB detection on each image DST in the image set DST respectively, and further remove interference points to obtain the grid intersection point set POINTS; S3, center calibration: On the basis of the open operation image, the diamond shape fitting algorithm is used to perform center calibration on the point set POINTS, and the center-calibrated point set CaliPoints is obtained; The specific steps of using the diamond shape fitting algorithm to perform center correction and obtain the corrected point set CaliPoints are as follows: (1) First, define the detection radius radius, define the calibrated point as cp, its coordinates as (cpx, cpy), define the point gray value threshold pthresh, and define the set of all calibrated points as CaliPoints, where CaliPoints = {cp1, cp2, …, cp n }, define counter i=1; (2) Define the coordinates (px i -radius,py i ),(px i ,py i -radius),(px i +radius,py i ),(px i ,py i + radius) as the vertex of a rhombus, the set of all the points on its edges is {pt i1 ,pt i2 ,…,pt im }, where the coordinates of the jth point are (ptx ij ,pty ij ), the gray value of this point is Define the point counter k=1 on the edge point set; (3) Under the joint action of the detector and the diamond fitting algorithm, the calibrated point set CaliPoints is obtained by comparing the counter and gray value features and performing algorithm screening; S4. Determine the overflow of glue: Glue overflow judgment is performed based on the point sets POINTS and CaliPoints before and after calibration; In step S4, the operation of determining the glue overflow on the data includes the following process: The specific steps for judging the overflow of glue based on the point sets POINTS and CaliPoints before and after calibration are as follows: (1) Define the overflow threshold overThresh, define the point counter as i=1, and calculate from the point sets before and after correction respectively; (cpx i -px i ) 2 +(cpy i -py i ) 2 ≤overThresh (2) If the result is less than the threshold, the WrongType is "overflowing glue", otherwise it is considered that there is no "overflowing glue" problem; S5, column processing: The CaliPoints point set is processed into columns to obtain the column set ClasPoints after the columns are divided; S6. Bean shortage judgment: Based on the target image set DST and the column set ClasPoints, the missing bean recognition algorithm is used to judge the missing bean; The operation of judging the lack of beans in the data includes the following process: (1) Define the height of the input image dst as height; define the column set identified in step S3 as ClasPoints = {col1,col2,…,col n }, where col i ={point i1 ,point i2 ,…,point ij }, the total number of points is sum i , point ik The vertical coordinate is py i,k ; Define the average distance as average, the total number of points as sum, and the missing bean distance threshold thresh = 1.3*average; define the column counter i = 1; (2) Sort all the points in col from small to large based on the ordinate, and the result is still recorded as col; (3) Similarly, the missing bean distance threshold is used to determine whether the bean is missing; if empy-py i1 >thresh If the error is "bean shortage", WrongType is judged as "bean shortage", otherwise it is judged as no "bean shortage" problem. For col i For every two adjacent points in the equation, if the difference between their ordinates satisfies py i,k+1 -py i,k >thresh, WrongType is determined to be bean shortage.
2. The quality inspection method for electric wires for protecting wild animals according to claim 1, characterized in that: In step S1, the data preprocessing operation on the input data includes the following process: The input image set SRC is grayed, the image set is obtained by opening operation, the image is cut and thresholded, and the preprocessed image set DST is obtained; first, the input image set SRC = {src1, src2, sre3, src4}, the counter is i = 1, the corrosion times t1 and t2, the dividing line coordinates x = {x1, x2, x3, x4}, the threshold balance factor thresh, the threshold T = {t1, t2, t3, t4}, the preprocessed target image set DST; {dst1, dst2, dst3, dst4} variable gay, variable morphology, variable temp, variable threshold, variable left, variable right; (1) Convert SRC into a grayscale image gray, use the OpenCV library to perform an open operation on gray to obtain image morphology; traverse all pixel points in the image morphology, calculate the average grayscale value and the minimum grayscale value of the image; then take the average of the two to obtain temp; (2) The threshold balancing factor thresh is summed with temp to obtain the threshold t; then the image morphology is thresholded to obtain the image threshold1; the OpenCV library is used to divide the threshold into the left and right images with the horizontal coordinate x1 as the dividing line; (3) Perform corrosion operations on left and right for times t1 and t2 respectively, and then perform dilation operations for the same number of times respectively to obtain the processed left and right; (4) Horizontally splice left and right to obtain the preprocessed target image DST, and output the target image set DST.
