CN114742788A - Copper bar defect detection method and system based on machine vision - Google Patents

Copper bar defect detection method and system based on machine vision Download PDF

Info

Publication number
CN114742788A
CN114742788A CN202210346885.5A CN202210346885A CN114742788A CN 114742788 A CN114742788 A CN 114742788A CN 202210346885 A CN202210346885 A CN 202210346885A CN 114742788 A CN114742788 A CN 114742788A
Authority
CN
China
Prior art keywords
defect
point
neighborhood
gray
copper bar
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202210346885.5A
Other languages
Chinese (zh)
Inventor
王瑞歌
杨丽丽
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Nantong Gaojingshuke Machinery Co ltd
Original Assignee
Nantong Gaojingshuke Machinery Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Nantong Gaojingshuke Machinery Co ltd filed Critical Nantong Gaojingshuke Machinery Co ltd
Priority to CN202210346885.5A priority Critical patent/CN114742788A/en
Publication of CN114742788A publication Critical patent/CN114742788A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/0002Inspection of images, e.g. flaw detection
    • G06T7/0004Industrial image inspection
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/24Classification techniques
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/90Determination of colour characteristics
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/20Special algorithmic details
    • G06T2207/20081Training; Learning
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/30Subject of image; Context of image processing
    • G06T2207/30108Industrial image inspection
    • G06T2207/30136Metal
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02PCLIMATE CHANGE MITIGATION TECHNOLOGIES IN THE PRODUCTION OR PROCESSING OF GOODS
    • Y02P90/00Enabling technologies with a potential contribution to greenhouse gas [GHG] emissions mitigation
    • Y02P90/30Computing systems specially adapted for manufacturing

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • General Physics & Mathematics (AREA)
  • Data Mining & Analysis (AREA)
  • Artificial Intelligence (AREA)
  • Bioinformatics & Cheminformatics (AREA)
  • Bioinformatics & Computational Biology (AREA)
  • Evolutionary Biology (AREA)
  • Evolutionary Computation (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • General Engineering & Computer Science (AREA)
  • Quality & Reliability (AREA)
  • Investigating Materials By The Use Of Optical Means Adapted For Particular Applications (AREA)

Abstract

The invention relates to the technical field of machine vision, in particular to a copper bar defect detection method and a copper bar defect detection system based on machine vision, which comprise the following steps: according to the gray level image of the surface image of the copper bar to be detected, obtaining each defect point and a surface conversion image of the surface of the copper bar to be detected, determining oxide skin indentation points, metal inclusion points and types of points which cannot be determined according to the gray level values of eight neighborhood pixel points of each defect point in the surface conversion image, and further determining an oxide skin indentation defect combination type prior range and a metal inclusion defect combination type prior range; and corresponding each prior range in the gray level image, thereby determining the defect pointing coefficient of the copper bar to be detected, and further determining the defect category of the copper bar to be detected. The method can accurately identify the scale pressing defect and the metal inclusion defect on the surface of the copper bar, and improves the automation degree of a production line.

Description

Copper bar defect detection method and system based on machine vision
Technical Field
The invention relates to the technical field of machine vision, in particular to a copper bar defect detection method and system based on machine vision.
Background
In the production process of the copper bar, the currently widely applied production process is a continuous extrusion method. Various defects can appear in the continuous extrusion production process of the copper bar, and the oxide skin extrusion defect and the surface metal inclusion defect are used as the second main copper bar production defect, which can both affect the product quality.
The two defects are caused by different reasons, and have different influences on the operation of the copper bar production line. The reason for the extrusion of the oxide scale in the continuous extrusion production is that the hardness of the raw material copper rod is high, the extrusion temperature is too high in the extrusion process, surface oxidation occurs, and the oxide scale is extruded into the surface of the product at the same time, and when the product has the defect, the hardness of the raw material copper rod needs to be checked and the raw material needs to be replaced. The defect of metal surface inclusion is caused by the abrasion or aging iron loss of the surface of a workpiece of a production machine, iron filings are melted on the surface of a product after a raw material copper rod is heated, and the surface of the product is finally cooled. Therefore, in order to ensure the quality of the copper bar product, two defects need to be accurately distinguished, and corresponding production line maintenance measures need to be taken.
In the prior art, the two defect detection methods are usually threshold segmentation, that is, the defect detection is performed by using an artificially set threshold. However, since the two defects are surface bulk defects and are both black in color, the existing threshold detection method can only detect whether the two defects exist, but cannot accurately distinguish the specific types of the defects. Therefore, the corresponding maintenance strategy cannot be quickly determined, and the automation degree of the production line is relatively low.
Disclosure of Invention
The invention aims to provide a copper bar defect detection method and system based on machine vision, which are used for solving the problem that the existing copper bar defect detection mode cannot distinguish two defect types, namely an oxide skin extrusion defect and a metal inclusion defect.
In order to solve the technical problem, the invention provides a copper bar defect detection method based on machine vision, which comprises the following steps:
acquiring a surface image of the copper bar to be detected, and acquiring each defect point and a surface conversion image of the surface of the copper bar to be detected according to a gray level image of the surface image of the copper bar to be detected;
determining neighborhood gray distribution ambiguity and neighborhood gray distribution regularity of each defect point according to the gray values of eight neighborhood pixel points of each defect point in the surface conversion image, and further determining oxide skin pressed into the undetermined defect point, the undetermined defect point of metal inclusion and the undetermined defect point of which the type cannot be determined in each defect point;
determining a merging prior range of each oxide skin pressing defect and a merging prior range of each metal inclusion defect according to the oxide skin pressing undetermined defect point, the undetermined metal inclusion defect point, the undetermined type defect point, the neighborhood gray distribution ambiguity and the neighborhood gray distribution regularity of the undetermined type defect point;
determining that each oxide skin indentation defect merging prior range corresponds to each first corresponding region in the gray level image, determining that each metal inclusion defect merging prior range corresponds to each second corresponding region in the gray level image, determining a defect pointing coefficient of the copper bar to be detected according to the gray level of pixel points in each first corresponding region and each second corresponding region, and determining the defect type of the copper bar to be detected according to the defect pointing coefficient of the copper bar to be detected.
Further, the step of acquiring each defect point on the surface of the copper bar to be detected and the surface conversion image comprises the following steps:
carrying out gray level histogram statistics on the gray level image of the surface image of the copper bar to be detected to obtain a gray level histogram of the gray level image;
performing Gaussian fitting on the gray level histogram of the gray level image to obtain a surface gray level Gaussian distribution function of the copper bar to be detected and the mean value and standard deviation of the surface gray level Gaussian distribution function;
determining a defect threshold according to the mean value and the standard deviation of the surface gray level Gaussian distribution function, taking each pixel point with the gray level value not greater than the defect threshold in the gray level image as a defect point, taking each pixel point with the gray level value greater than the defect threshold in the gray level image as a background point, and setting the gray level value of each background point as the mean value of the surface gray level Gaussian distribution function, thereby obtaining the surface conversion image.
Further, the calculation formula corresponding to the neighborhood gray scale distribution fuzziness of each defect point is as follows:
Figure BDA0003576805150000021
Figure BDA0003576805150000022
Figure BDA0003576805150000023
wherein the content of the first and second substances,
Figure BDA0003576805150000024
normalizing the mean value of the gray difference between eight neighborhood pixels of a defect point positioned at x and y in the surface conversion image and a background point in the surface conversion image, mu is the gray of the background point in the surface conversion image, Ix,y(k) The gray value delta I of the k-th neighborhood pixel point of the defect point with the position of x and y in the surface conversion imagex,y(k) Normalizing the gray difference between the eight neighborhood pixels of the defect point positioned at x and y in the surface conversion image and the background point in the surface conversion image, sigmax,y 2Normalizing the variance, M, of the gray difference between the eight neighborhood pixels of the defect point with x and y positions in the surface conversion image and the background point in the surface conversion imagex,yAnd converting the neighborhood gray distribution fuzziness of the defect point positioned at x and y in the image on the surface.
Further, the step of determining the neighborhood gray scale distribution regularity of each defect point includes:
extracting any two neighborhood pixel points from eight neighborhood pixel points of each defect point in the surface conversion image, and obtaining a corresponding one-group or two-group neighborhood pixel point adjacent sequence every time any two neighborhood pixel points are extracted;
calculating the gray variance of each pixel point of a corresponding group of adjacent sequences of the neighborhood pixels or the mean value of the gray variances of each pixel point of the two groups of adjacent sequences of the neighborhood pixels, which is obtained when any two neighborhood pixels are extracted, and determining a group of adjacent sequences of the neighborhood pixels or two groups of adjacent sequences of the neighborhood pixels corresponding to the minimum value of all the calculated gray variances and the mean values of the gray variances;
when the minimum value corresponds to a group of adjacent sequences of the neighborhood pixels, calculating the neighborhood gray level distribution regularity of the corresponding defect point according to the number of the neighborhood pixels in the group of adjacent sequences of the neighborhood pixels corresponding to the minimum value;
and when the minimum value corresponds to two groups of adjacent sequences of the neighborhood pixels, calculating the neighborhood gray level distribution regularity of the corresponding defect point according to the number of the neighborhood pixels in the two groups of adjacent sequences of the neighborhood pixels corresponding to the minimum value.
Further, when the minimum value corresponds to two groups of adjacent sequences of neighborhood pixels, the corresponding calculation formula of the neighborhood gray scale distribution regularity of the corresponding defect point is as follows:
Figure BDA0003576805150000031
wherein the content of the first and second substances,
Figure BDA0003576805150000032
for the degree of regularity of the distribution of the neighborhood gray scale of the defect point, α is the number of neighborhood pixels in one of the two sets of neighborhood pixel adjacent sequences, and β is the number of neighborhood pixels in the other set of neighborhood pixel adjacent sequences.
Further, the step of determining the scale indentation undetermined defect point, the metal inclusion undetermined defect point and the undetermined type defect point in each defect point further comprises the following steps:
calculating the neighborhood gray characteristic deviation value of each defect point according to the neighborhood gray distribution ambiguity and the neighborhood gray distribution regularity of each defect point;
and if the neighborhood gray characteristic deviation value is within the range of the first set neighborhood gray characteristic deviation value, judging the corresponding defect point as a to-be-determined defect point pressed into the oxide skin, if the neighborhood gray characteristic deviation value is within the range of the second set neighborhood gray characteristic deviation value, judging the corresponding defect point as a to-be-determined defect point of the metal inclusion, and if the neighborhood gray characteristic deviation value is within the range of the third set neighborhood gray characteristic deviation value, judging the corresponding defect point as a to-be-determined defect point of which the type cannot be determined.
Further, the step of determining a combined prior range of each scale indentation defect and a combined prior range of each metal inclusion defect comprises:
determining each common defect point in each point which cannot be determined to be the type defect to be determined according to the neighborhood gray level distribution ambiguity and the neighborhood gray level distribution regularity of the point which cannot be determined to be the type defect to be determined;
combining each oxide skin indentation undetermined defect point and each public defect point into one class, thereby obtaining oxide skin indentation undetermined combined defect points, determining each boundary point of each oxide skin indentation undetermined combined defect point according to the position of each oxide skin indentation undetermined combined defect point, and determining each oxide skin indentation defect combined class prior range according to each boundary point of each oxide skin indentation undetermined combined defect point;
combining each metal inclusion undetermined defect point and each public defect point into one type to obtain a metal inclusion undetermined combined defect point, determining each boundary point in each metal inclusion undetermined combined defect point according to the position of each metal inclusion undetermined combined defect point, and determining each metal inclusion defect combined type prior range according to each boundary point in each metal inclusion undetermined combined defect point.
Further, the step of determining the defect orientation coefficient of the copper bar to be detected according to the gray levels of the pixel points in the corresponding regions comprises the following steps:
calculating the gray distribution entropy of each first corresponding region according to the gray of the pixel points in each first corresponding region, and calculating the gray distribution entropy of each second corresponding region according to the gray of the pixel points in each second corresponding region;
calculating the defect matching degree of each oxide skin indentation defect merging prior range and the defect matching degree of each metal inclusion defect merging prior range according to the gray distribution entropy of each first corresponding region and the gray distribution entropy of each second corresponding region;
and calculating the defect pointing coefficient of the copper bar to be detected according to the number of the pixel points in each oxide skin indentation defect combination prior range, the number of the pixel points in each metal inclusion defect combination prior range, the defect matching degree of each oxide skin indentation defect combination prior range and the defect matching degree of each metal inclusion defect combination prior range.
Further, the step of determining the defect type of the copper bar to be detected according to the defect pointing coefficient comprises the following steps:
if the defect pointing coefficient is located in the first set defect pointing range, the defect type of the copper bar to be detected is judged to be a metal inclusion defect, if the defect pointing coefficient is located in the second set defect pointing range, the defect type of the copper bar to be detected is judged to be an oxide skin pressing-in defect, and if the defect pointing coefficient is located in the third set defect pointing range, the defect type of the copper bar to be detected is judged to be a metal inclusion defect and an oxide skin pressing-in defect.
In order to solve the technical problem, the invention further provides a copper bar defect detection system based on machine vision, which comprises a processor and a memory, wherein the processor is used for processing instructions stored in the memory to realize the copper bar defect detection method based on machine vision.
The invention has the following beneficial effects: according to the method, each defect point on the surface of the copper bar to be detected can be determined through the gray image of the surface image of the copper bar to be detected, the defect points are classified according to the gray values of eight neighborhood pixel points of the defect points, the prior ranges of two defects are determined according to the categories of the defect points, the defect pointing coefficient of the copper bar to be detected is calculated according to the characteristics of the prior ranges on the gray image, and finally the category of the defect of the copper bar to be detected is determined. According to the invention, the corresponding defect orientation coefficient can be constructed according to the characteristics of two defects, namely the oxide skin extrusion defect and the metal inclusion defect, so that the defects of the surface of the copper bar can be accurately identified, the corresponding production line maintenance and measurement strategy can be selected according to the defect types, the automation degree of the production line is effectively improved, and the solution efficiency of the product quality problem is improved.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions and advantages of the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only some embodiments of the present invention, and other drawings can be obtained by those skilled in the art without creative efforts.
Fig. 1 is a flow chart of the copper bar defect detection method based on machine vision.
Detailed Description
To further explain the technical means and effects of the present invention adopted to achieve the predetermined objects, the following detailed description of the embodiments, structures, features and effects of the technical solutions according to the present invention will be given with reference to the accompanying drawings and preferred embodiments. In the following description, different "one embodiment" or "another embodiment" refers to not necessarily the same embodiment. Furthermore, the particular features, structures, or characteristics may be combined in any suitable manner in one or more embodiments.
Unless defined otherwise, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this invention belongs.
In order to distinguish two defect types, namely a scale extrusion defect and a metal inclusion defect, on the surface of a copper bar product, so as to adopt a corresponding maintenance strategy according to a specific defect type, the embodiment provides a copper bar defect detection method based on machine vision, and a corresponding flow chart of the method is shown in fig. 1, and specifically comprises the following steps:
(1) the method comprises the steps of obtaining a surface image of a copper bar to be detected, obtaining each defect point and a surface conversion image of the surface of the copper bar to be detected according to a gray image of the surface image of the copper bar to be detected.
The camera is arranged at the production outlet of the continuous extrusion copper bar product, and in the continuous extrusion production process of the copper bar, the surface image of the continuous extrusion copper bar product is obtained and grayed, so that the grayscale image of the surface image of the copper bar to be detected is obtained. According to the gray image of the surface image of the copper bar to be detected, acquiring each defect point and the surface conversion image of the surface of the copper bar to be detected, and the specific realization process is as follows:
and (1-1) carrying out gray histogram statistics on the gray image of the surface image of the copper bar to be detected to obtain the gray histogram of the gray image.
After the gray level image of the surface image of the copper bar to be detected is obtained, carrying out gray level distribution histogram statistics on the gray level image, namely carrying out statistics on the gray level value of each pixel point in the gray level image, thereby obtaining the gray level histogram of the gray level image. Since the specific implementation process of performing the gray distribution histogram statistics on the gray image belongs to the prior art, it is not described herein again.
And (1-2) carrying out Gaussian fitting on the gray level histogram of the gray level image to obtain a surface gray level Gaussian distribution function of the copper bar to be detected and the mean value and standard deviation of the surface gray level Gaussian distribution function.
According to the priori knowledge, the background points, namely the non-defect points, in the surface image of the copper bar are bright parts in color and the number of the non-defect points is the largest, and the defect points are dark parts in color. Therefore, a single-peak gaussian fitting is performed by taking the gray value with the largest frequency number in the gray histogram as a mean value, so as to obtain a corresponding gaussian distribution function, wherein the mean value is μ and the standard deviation is σ. Since the specific implementation process of performing the unimodal gaussian fitting with the gray value with the largest frequency number in the gray histogram as the mean value belongs to the prior art, it is not described herein again.
(1-3) determining a defect threshold according to the mean value and the standard deviation of the surface gray Gaussian distribution function, taking each pixel point with the gray value not greater than the defect threshold in the gray image as a defect point, taking each pixel point with the gray value greater than the defect threshold in the gray image as a background point, and setting the gray value of each background point as the mean value of the surface gray Gaussian distribution function, thereby obtaining a surface conversion image.
And dividing the gray image by taking the difference value between the mean value mu and the standard deviation sigma, namely mu-sigma as a defect threshold, setting the gray value of the pixel point of which the gray value is greater than the defect threshold in the gray image as mu, and reserving and marking other gray values as defect points so as to obtain each defect point and the surface conversion image.
(2) And determining neighborhood gray distribution ambiguity and neighborhood gray distribution regularity of each defect point according to the gray values of the eight neighborhood pixel points of each defect point in the surface conversion image, and further determining oxide skin pressed into the undetermined defect point, the undetermined defect point of metal inclusion and the undetermined type defect point.
Wherein, for any defect point with x and y positions in the surface conversion image, a neighborhood gray level distribution sequence { I } of the defect point is obtainedx,y(k) It is specifically expressed as follows:
{Ix,y(k)}=Ix,y(0),Ix,y(1),…,Ix,y(7)
wherein, x and y represent the coordinates of the defect point on the surface conversion image, and also represent the coordinates on the gray image and the original surface image, k represents the serial number of the pixel points in the eight neighborhoods around the defect point, k is 0,1, …,7, Ix,y(k) The gray value of the pixel point of the k-th neighborhood in the eight neighborhoods around the defect point is represented.
Note that, in determining the neighborhood gray distribution sequence { I ] of each defect pointx,y(k) And when the pixel values of the adjacent pixels are arranged, any adjacent pixel point corresponding to the defect point can be selected as a starting point, then the adjacent pixel points of each defect point are sequentially marked by 0-7 according to the clockwise or anticlockwise sequence, and the gray values of the adjacent pixel points are arranged according to the marks of 0-7 of the adjacent pixel points, so that the adjacent gray distribution sequence of the defect points is determined.
In the present embodiment, in order to determine the neighborhood gray distribution sequence of each defect point, the surface transformation is first calculated using the sobel operatorGradient g of each defect point in the image in the x and y directionsx,gyThen magnitude of gradient
Figure BDA0003576805150000061
The corresponding gradient direction is θ ═ arctan (g)y/gx). And then, taking the neighborhood pixel points pointed by the gradient direction corresponding to the defect point as starting points, and sequentially labeling 0-7 neighborhood pixel points of the defect point according to a clockwise sequence, thereby determining a neighborhood gray level distribution sequence of the defect point. The neighborhood gray scale distribution sequence determined in this way has a rotation invariant characteristic, that is, the neighborhood gray scale distribution sequence of each defect point is invariant regardless of the rotation of the surface conversion image.
After determining the neighborhood gray scale distribution sequence of each defect point, calculating the neighborhood gray scale distribution ambiguity of each defect point based on the neighborhood gray scale distribution sequence, wherein the neighborhood gray scale distribution ambiguity represents the confusion degree of the neighborhood gray scale values around the defect point and the background point (the pixel point with the gray scale value being mu), the higher the confusion degree is, the larger the ambiguity degree is, and the specific calculation formula is as follows:
Figure BDA0003576805150000071
Figure BDA0003576805150000072
Figure BDA0003576805150000073
wherein the content of the first and second substances,
Figure BDA0003576805150000074
normalizing the mean value of the gray difference between the eight neighborhood pixels of the defect point with the positions of x and y in the surface transformation image and the background point in the surface transformation image, wherein mu is the gray of the background point in the surface transformation image, namely the mean value of the surface gray Gaussian distribution function, Ix,y(k) The gray value of the k-th neighborhood pixel point of the defect point with the position of x and y in the surface conversion image is obtained, that is, the k-th gray value, delta I, in the neighborhood gray distribution sequence of the defect point with the position of x and yx,y(k) Normalizing the gray difference between the eight neighborhood pixel points of the defect point positioned at the x and y positions in the surface conversion image and the background point in the surface conversion image, sigmax,y 2Normalizing the variance, M, of the gray difference between the eight neighborhood pixels of the defect point with x and y positions in the surface conversion image and the background point in the surface conversion imagex,yAnd converting the neighborhood gray distribution fuzziness of the defect point positioned at x and y in the image on the surface.
Meanwhile, after determining the neighborhood gray scale distribution sequence of each defect point, calculating the neighborhood gray scale distribution regularity of each defect point based on the neighborhood gray scale distribution sequence. For a defect point, the more the neighborhood gray scale distribution sequence of the defect point can be evenly divided into two parts, the more regular the neighborhood gray scale distribution sequence is, and based on the logic, the specific calculation process of the neighborhood gray scale distribution regularity of the defect point is as follows:
(2-1) extracting any two neighborhood pixel points from eight neighborhood pixel points of each defect point in the surface conversion image, and obtaining a corresponding one group or two groups of neighborhood pixel point adjacent sequences every time any two neighborhood pixel points are extracted.
After eight neighborhood pixel points of the defect point are marked, eight label sequences are obtained, wherein the label sequences are annular, namely adjacent pixel points of the pixel point 0 are a pixel point 1 and a pixel point 7. Two serial numbers are selected as segmentation serial numbers, one of the two serial numbers can be known to have 28 rejection results by an exhaustion method, and the remaining six pixel points can be divided into two continuous subsequences, so that two groups of adjacent sequences of adjacent pixel points can be obtained. For example, when two serial numbers 0 and 4 are selected as the segmentation serial numbers, the elimination result is to obtain two sets of neighborhood pixel point adjacent sequences, i.e. 1,2, 3, 5, 6, and 7. It should be noted that, when two serial numbers that are removed are adjacent serial numbers, the original label sequence is only divided into one subsequence, and a group of adjacent sequences of neighborhood pixels is obtained. For example, when two serial numbers 0 and 1 are selected as the segmentation serial numbers, the elimination result is to obtain a group of neighbor pixel point adjacent sequences, i.e., 2, 3, 4, 5, 6, and 7.
(2-2) calculating the gray level variance of each pixel point of a group of corresponding adjacent sequences of adjacent pixel points or the mean value of the gray level variances of each pixel point of the two groups of adjacent sequences of adjacent pixel points, which is obtained when any two adjacent pixel points are extracted, and determining a group of adjacent sequences of adjacent pixel points or two groups of adjacent sequences of adjacent pixel points corresponding to the minimum value of all calculated gray level variances and the mean values of the gray level variances.
For 28 types of rejection results, when the rejection results are two groups of adjacent sequences of neighborhood pixels, the gray level variance of the pixels of the two groups of adjacent sequences of neighborhood pixels is calculated respectively based on the neighborhood gray level distribution sequences, and then the mean value of the two variances is calculated. For example, when two serial numbers 0 and 4 are selected as the segmentation serial numbers, the elimination result is to obtain two groups of neighborhood pixel point adjacent sequences, namely 1,2, 3 and 5, 6, 7, at this time, the variance corresponding to the 1 st, 2, 3 rd gray values and the variance corresponding to the 5 th, 6 th, 7 th gray values in the neighborhood gray distribution sequence are respectively calculated, and then the mean value of the two variances is calculated. And when the elimination result is a group of neighborhood pixel point adjacent sequences, calculating the pixel point gray variance of the group of neighborhood pixel point adjacent sequences based on the neighborhood gray distribution sequence. For example, when two serial numbers 0 and 1 are selected as the segmentation serial numbers, the elimination result is to obtain a group of neighborhood pixel point adjacent sequences, namely 2, 3, 4, 5, 6, and 7, and at this time, the variance corresponding to the 2 nd, 3 rd, 4 th, 5 th, 6 th, and 7 th gray values in the neighborhood gray distribution sequence is calculated.
After the mean value or variance of the variances corresponding to the 28 types of elimination results is calculated, the segmentation mode corresponding to the mean value or variance with the minimum value, namely the elimination mode, is selected, so that the corresponding distribution regularity is calculated according to the elimination results.
And (2-3) when the minimum value corresponds to a group of neighborhood pixel point adjacent sequences, calculating the neighborhood gray level distribution regularity of the corresponding defect point according to the number of neighborhood pixel points in the group of neighborhood pixel point adjacent sequences corresponding to the minimum value. And when the minimum value corresponds to two groups of adjacent sequences of the neighborhood pixels, calculating the neighborhood gray level distribution regularity of the corresponding defect point according to the number of the neighborhood pixels in the two groups of adjacent sequences of the neighborhood pixels corresponding to the minimum value.
Since 28 kinds of rejection results may obtain two sets of neighborhood pixel point adjacent sequences and may also obtain one set of neighborhood pixel point adjacent sequences, the rejection result corresponding to the mean or variance with the smallest value of variance may be two sets of neighborhood pixel point adjacent sequences or one set of neighborhood pixel point adjacent sequences. When the elimination result is two groups of adjacent sequences of the neighborhood pixels, the number of the neighborhood pixels in the two groups of adjacent sequences of the neighborhood pixels can be (3, 3), (4, 2), (5, 1); when the elimination result is that one group of adjacent sequences of the neighborhood pixels are empty sequences, the other group of adjacent sequences of the neighborhood pixels can be regarded as empty sequences, and the number of the neighborhood pixels in the two groups of adjacent sequences of the neighborhood pixels is (6, 0). Then, at this time, for any defect point, the neighborhood gray scale distribution regularity of the corresponding defect point is:
Figure BDA0003576805150000081
wherein the content of the first and second substances,
Figure BDA0003576805150000082
for the neighborhood gray level distribution regularity of the defect point, α is the number of neighborhood pixels in one of the two sets of neighborhood pixel adjacent sequences, and β is the number of neighborhood pixels in the other set of neighborhood pixel adjacent sequences.
Through the steps, for any defect point at the position of x and y in the surface conversion image, the corresponding neighborhood gray scale distribution fuzziness and neighborhood gray scale distribution regularity are respectively Mx,y
Figure BDA0003576805150000091
Wherein, for the oxide skin pressed into the spot to be defected, the oxide skin is embedded in the copper bar due to the defectOn the surface of the product, the calculated neighborhood gray scale distribution ambiguity corresponding to the product is very small, the corresponding neighborhood gray scale distribution regularity is very large, the confusion degree of eight neighborhood pixel points of the defect points and the background points is small, and the eight neighborhood pixel points are easily distinguished from the background points. On the contrary, for the metal inclusion undetermined defect point, because the defect is characterized in that metal impurities are better blended into the metal inclusion undetermined defect point, the calculated neighborhood gray scale distribution ambiguity corresponding to the metal inclusion undetermined defect point is very large, the corresponding neighborhood gray scale distribution regularity is very small, the confusion degree of the eight neighborhood pixel points of the defect point and the background point is very large, and the eight neighborhood pixel points are not easy to be distinguished from the background point. Based on the principle, the degree of ambiguity of the neighborhood gray scale distribution and the degree of regularity M of the neighborhood gray scale distribution can be obtainedx,y
Figure BDA0003576805150000092
The deviation of the two characteristics classifies each defect point, and the specific implementation process is as follows:
(2-4) calculating the neighborhood gray characteristic deviation value of each defect point according to the neighborhood gray distribution ambiguity and the neighborhood gray distribution regularity of each defect point, wherein the corresponding calculation formula is as follows:
Figure BDA0003576805150000093
wherein epsilonx,yConverting the neighborhood gray level characteristic deviation value of the defect point with x and y positions in the image on the surface, wherein epsilon isx,y∈[-1,1]。
(2-5) if the neighborhood gray characteristic deviation value is located in the range of the first set neighborhood gray characteristic deviation value, judging the corresponding defect point as a to-be-determined defect point pressed into the oxide skin, if the neighborhood gray characteristic deviation value is located in the range of the second set neighborhood gray characteristic deviation value, judging the corresponding defect point as a to-be-determined defect point of the metal inclusion, and if the neighborhood gray characteristic deviation value is located in the range of the third set neighborhood gray characteristic deviation value, judging the corresponding defect point as a to-be-determined defect point of which the type cannot be determined.
Calculated in the above step (2-4)On the basis of the neighborhood gray level characteristic deviation value of each defect point, judging the size of the neighborhood gray level characteristic deviation value of each defect point: when the neighborhood gray level feature deviation value is within the range of the first set neighborhood gray level feature deviation value, i.e. epsilonx,y∈[-1,-0.3]When the defect points are detected, dividing the corresponding defect points into oxide skin pressing to-be-determined defect points; the neighborhood gray level feature deviation value is within the second set neighborhood gray level feature deviation value range, i.e. epsilonx,y∈[0.3,1]If so, dividing the corresponding defect point into a metal inclusion undetermined defect point; when the adjacent gray level feature deviation value is within the third set adjacent gray level feature deviation value range, i.e. epsilonx,yAnd E (-0.3,0.3), classifying the corresponding defect point as the undetermined defect point of which the type can not be determined.
(3) Determining a merging type prior range of each scale pressing-in defect and a merging type prior range of each metal inclusion defect according to a scale pressing-in undetermined defect point in each defect point, a metal inclusion undetermined defect point, a neighborhood gray scale distribution fuzziness and a neighborhood gray scale distribution regularity of the undetermined type defect point and the undetermined type defect point, and the method comprises the following specific steps:
and (3-1) determining each common defect point in each undeterminable type undetermined defect point according to the neighborhood gray distribution ambiguity and the neighborhood gray distribution rule degree of the undeterminable type undetermined defect point.
Calculating the mean value of the neighborhood gray level distribution ambiguity and the neighborhood gray level distribution regularity corresponding to the undetermined type defect point determined in the step (2):
Figure BDA0003576805150000101
wherein the content of the first and second substances,
Figure BDA0003576805150000102
the average value of the neighborhood gray scale distribution fuzziness and the neighborhood gray scale distribution regularity of the type undetermined defect point cannot be determined.
Calculating each undetermined type undetermined defect pointAfter the average value of the neighborhood gray scale distribution ambiguity and the neighborhood gray scale distribution regularity, the average value is judged, and when the average value is smaller than the threshold value, the average value is judged
Figure BDA0003576805150000103
If so, judging the corresponding undetermined defect point with the undetermined type as a suppression defect point, and discarding the suppression defect point; when in use
Figure BDA0003576805150000104
And judging the corresponding undetermined type undetermined defect point as a common defect point.
(3-2) combining each scale pressing-in point to be determined and each common defect point into one type, thereby obtaining scale pressing-in points to be determined and defective, determining each boundary point of each scale pressing-in point to be determined and defective according to the position of each scale pressing-in point to be determined and defective, and determining a priori range of each scale pressing-in defect combination type according to each boundary point of each scale pressing-in point to be determined and defective.
For the three types of defect points determined in the step (3-1), firstly, pressing the oxide skin into the points to be determined and all the common defect points are merged into one type, and for any point in the merged type, judging whether the point is a boundary point of the merged type point set, wherein the specific process is as follows:
for any defect point Q in the merged class0Finding its nearest neighbor K merged class points Qi(i ═ 1, 2.., K). At the determined defect point Q0Can calculate the defect point Q when the K nearest neighbor merging class points are selected0And selecting K merged class points with the minimum distance from the distances to any other merged class points in the merged class as the K merged class points of the nearest neighbor corresponding to the K merged class points. It should be noted that the specific value of K here can be directly determined empirically, and at this time, any defect point Q in the merged class is considered0The same number of nearest neighbor merging points can be obtained; meanwhile, any defect point Q in the merged class can be used0Is determined by the distribution of the respective distance values, e.g. the K +1 th smallest distance value is much larger than the K-th oneWhen the distance value is the minimum, taking the K merging class points with the minimum distance as any defect point Q in the merging class0K merging class points of the nearest neighbor, and at this time, any defect point Q in the merging class0The number of resulting nearest neighbor merged class points is uncertain.
For any defect point Q in the merged class0At K merging class points Q of which the nearest neighbor is determinediAfter (i ═ 1, 2.. K), vector Q is constructed0QiThen Q is0Qi=(xi-x0,yi-y0) The unit vector of the vector is
Figure BDA0003576805150000111
The calculation is as follows:
Figure BDA0003576805150000112
wherein, | Q0QiIs the vector Q0QiDie length of (2).
Will defect point Q0And superposing the corresponding K unit vectors, and dividing the modulus length of the superposed vectors by K to obtain a boundary point judgment index for judging whether the defect point is a boundary point:
Figure BDA0003576805150000113
wherein, B (Q)0) The index is judged for the boundary point of the defect point.
Meanwhile, calculating the boundary judgment indexes of all defect points in the merged class and calculating the average value
Figure BDA0003576805150000114
Standard deviation sigma corresponding theretoBIn this case, for the j-th defect point in the merged class, the corresponding boundary point determination index is B (Q)j) Then, the following judgment is made:
when in use
Figure BDA0003576805150000115
Judging that the jth defect point in the merged class is a boundary point; otherwise, judging that the jth defect point in the merged class is a non-boundary point.
After the steps are carried out, boundary points in the merging classes can be obtained, and then the boundary points are connected into a closed graph according to the nearest rule, wherein the closed graph is a scale pressing-in defect merging class prior range. Since the specific implementation process of obtaining the closed graph according to the boundary points belongs to the prior art, the detailed description is omitted here. Assuming that m combined scale skin indentation defect prior ranges are obtained from all defect points in the combined type and are respectively marked as Y1,Y2,…,Ym
(3-3) combining each metal inclusion undetermined defect point and each public defect point into one type to obtain a metal inclusion undetermined combined defect point, determining each boundary point in each metal inclusion undetermined combined defect point according to the position of each metal inclusion undetermined combined defect point, and determining each metal inclusion defect combined prior range according to each boundary point in each metal inclusion undetermined combined defect point.
Combining the undetermined defect points of the metal inclusions and the common defect points into one class for the three types of defect points determined in the step (3-1), then referring to the step (3-2), obtaining the combination class prior ranges of all the metal inclusion defects, supposing that n combination class prior ranges of the metal inclusion defects are obtained altogether, and respectively recording the combination class prior ranges as J1,J2,…,Jn
(4) Determining that each oxide skin indentation defect merging prior range corresponds to each first corresponding region in the gray level image, determining that each metal inclusion defect merging prior range corresponds to each second corresponding region in the gray level image, determining a defect pointing coefficient of the copper bar to be detected according to the gray level of pixel points in each first corresponding region and each second corresponding region, and determining the defect type of the copper bar to be detected according to the defect pointing coefficient of the copper bar to be detected.
The specific steps of determining the defect pointing coefficient of the copper bar to be detected according to the gray levels of the pixel points in each first corresponding region and each second corresponding region are as follows:
(4-1) calculating the gray distribution entropy of each first corresponding region according to the gray of the pixel points in each first corresponding region, and calculating the gray distribution entropy of each second corresponding region according to the gray of the pixel points in each second corresponding region.
After obtaining each oxide scale indentation defect combination prior range and each metal inclusion defect combination prior range through the step (3), corresponding each defect combination prior range of the two types to the gray level image, thereby obtaining each first corresponding region corresponding to each oxide scale indentation defect combination prior range and each second corresponding region corresponding to each metal inclusion defect combination prior range. Calculating the normalized distribution entropy corresponding to the defect merging class prior range according to the gray levels of all the pixel points in each first corresponding region and each second corresponding region:
Figure BDA0003576805150000121
wherein < gamma, rho > is a binary group consisting of the gray value gamma of any pixel point in the corresponding region and the gray average value rho of the eight neighborhood pixel points of the pixel point, P < gamma, rho > is the probability of the binary group appearing in the whole corresponding region, and H is the normalized distribution entropy corresponding to the defect merging prior range.
Calculating the merging prior range Y of each scale skin indentation defect according to the mode of calculating the corresponding normalized distribution entropy of the corresponding region1,Y2,…,YmCorresponding m normalized distribution entropies
Figure BDA0003576805150000122
Calculating the merging prior range J of each metal inclusion defect by the same method1,J2,…,JnCorresponding n normalized distribution entropies
Figure BDA0003576805150000123
(4-2) calculating the defect matching degree of each oxide skin indentation defect merging prior range and the defect matching degree of each metal inclusion defect merging prior range according to the gray distribution entropy of each first corresponding region and the gray distribution entropy of each second corresponding region, wherein the specific steps comprise:
merging class prior range Y according to scale pressing defects1,Y2,…,YmCorresponding m normalized distribution entropies
Figure BDA0003576805150000124
And metal inclusion defect merging prior range J1,J2,…,JnCorresponding n normalized distribution entropies
Figure BDA0003576805150000125
Calculating the corresponding defect type matching degree p:
pY=1-HY
pJ=HJ
wherein p isYDegree of defect matching for scale indentation defect merging class prior range, HYNormalized distribution entropy, p, for scale skin indentation defects combined with class prior rangesJMerging the defect matching degrees of class prior ranges for metal inclusion defects, HJThe normalized distribution entropy of the class prior range is combined for metal inclusion defects.
Obtaining the defect matching degree of the m oxide skin indentation defect combination prior ranges after the calculation
Figure BDA0003576805150000126
And defect matching degree of n metal inclusion defect combination prior range
Figure BDA0003576805150000127
(4-3) calculating a defect pointing coefficient of the copper bar to be detected according to the number of pixel points in each oxide skin indentation defect combination prior range, the number of pixel points in each metal inclusion defect combination prior range, the defect matching degree of each oxide skin indentation defect combination prior range and the defect matching degree of each metal inclusion defect combination prior range, wherein the specific steps comprise:
and (4) on the basis of the step (4-2), giving each defect matching degree to each pixel point in the corresponding range of the surface conversion image, so that a label matching degree with the two types of defects is obtained. At this time, for each pixel point in the surface conversion image, the label condition correspondingly obtained by the pixel point may be no label, a single defect type label, or a double defect type label, that is, a certain pixel point in the surface conversion image may have no label or one pYOr pJIf the label or both labels are present, the pixel points without labels are non-defective pixel points. Calculating a defect pointing coefficient epsilon of the copper bar to be detected according to the label condition of each pixel point in the surface conversion image:
Figure BDA0003576805150000131
Figure BDA0003576805150000132
Figure BDA0003576805150000133
wherein, NY、NJRespectively, p is contained in the surface conversion imageY、pJThe number of the pixel points containing the label of the category label, N is the total number of the pixel points containing the label in the surface conversion image,
Figure BDA0003576805150000134
respectively, the a-th one in the surface conversion image contains pYType tag, b-th containing pJThe pixel point of the type tag corresponds to the tag,
Figure BDA0003576805150000135
indicating that all of the surface-converted images contain pYThe defect matching degree of the pixel points of the label and the ratio of the total number of the pixel points containing the label in the surface conversion image,
Figure BDA0003576805150000136
indicating that all of the surface-converted images contain pJThe defect matching degree of the pixel points of the label is compared with the total number of the pixel points containing the label in the surface conversion image.
For the above calculated
Figure BDA0003576805150000137
And
Figure BDA0003576805150000138
when the temperature is higher than the set temperature
Figure BDA0003576805150000139
Far greater than
Figure BDA00035768051500001310
When the defect points are detected to be the scale pressing-in defects, the calculated defect orientation coefficient is larger than 0; when in use
Figure BDA00035768051500001311
Much less than
Figure BDA00035768051500001312
When the defect points are detected to be metal inclusion defects, the calculated defect orientation coefficient is less than 0; when in use
Figure BDA00035768051500001313
Approach to
Figure BDA00035768051500001314
When the calculated defect points are equivalent to each other, the calculated defect points are calculatedThe defect direction coefficient e is close to 0.
Based on the analysis, after the defect pointing coefficient epsilon of the copper bar to be detected is obtained, the defect type of the copper bar to be detected can be determined according to the defect pointing coefficient, and the specific steps comprise:
if the defect pointing coefficient is within a first set defect pointing range, namely belongs to ∈ [ -1, -0.3], judging that the defect type of the copper bar to be detected is a metal inclusion defect, and performing abrasion maintenance on equipment accessories of a production line at the moment; if the defect pointing coefficient is within a second set defect pointing range, namely the defect pointing coefficient belongs to [0.3,1], judging that the defect type of the copper bar to be detected is an oxide skin indentation defect, and performing quality inspection on the raw material copper bar at the moment; if the defect pointing coefficient is located in a third set defect pointing range, namely the element belongs to (-0.3,0.3), judging that the defect type of the copper bar to be detected is a metal inclusion defect and an oxide skin pressing defect, and performing abrasion maintenance on production line equipment accessories and performing quality inspection on a raw material copper rod at the same time.
The embodiment also provides a copper bar defect detection system based on machine vision, which comprises a processor and a memory, wherein the processor is used for processing instructions stored in the memory to realize the copper bar defect detection method based on machine vision. Since the copper bar defect detection method based on machine vision has been described in detail in the above, it is not repeated herein.
It should be noted that: the precedence order of the above embodiments of the present invention is only for description, and does not represent the merits of the embodiments. And that specific embodiments have been described above. Other embodiments are within the scope of the following claims. In some cases, the actions or steps recited in the claims may be performed in a different order than in the embodiments and still achieve desirable results. In addition, the processes depicted in the accompanying figures do not necessarily require the particular order shown, or sequential order, to achieve desirable results. In some embodiments, multitasking and parallel processing may also be possible or may be advantageous.
The embodiments in the present specification are described in a progressive manner, and the same and similar parts among the embodiments are referred to each other, and each embodiment focuses on the differences from the other embodiments.
The above description is only for the purpose of illustrating the preferred embodiments of the present invention and is not to be construed as limiting the invention, and any modifications, equivalents, improvements and the like that fall within the spirit and principle of the present invention are intended to be included therein.

Claims (10)

1. A copper bar defect detection method based on machine vision is characterized by comprising the following steps:
acquiring a surface image of the copper bar to be detected, and acquiring each defect point and a surface conversion image of the surface of the copper bar to be detected according to a gray level image of the surface image of the copper bar to be detected;
determining neighborhood gray distribution ambiguity and neighborhood gray distribution regularity of each defect point according to the gray values of eight neighborhood pixel points of each defect point in the surface conversion image, and further determining oxide skin pressed into the undetermined defect point, the undetermined defect point of metal inclusion and the undetermined defect point of which the type cannot be determined in each defect point;
determining a merging prior range of each oxide skin pressing defect and a merging prior range of each metal inclusion defect according to the oxide skin pressing undetermined defect point, the undetermined metal inclusion defect point, the undetermined type defect point, the neighborhood gray distribution ambiguity and the neighborhood gray distribution regularity of the undetermined type defect point;
determining that each oxide skin indentation defect merging prior range corresponds to each first corresponding region in the gray level image, determining that each metal inclusion defect merging prior range corresponds to each second corresponding region in the gray level image, determining a defect pointing coefficient of the copper bar to be detected according to the gray level of pixel points in each first corresponding region and each second corresponding region, and determining the defect type of the copper bar to be detected according to the defect pointing coefficient of the copper bar to be detected.
2. The copper bar defect detection method based on machine vision as claimed in claim 1, wherein the step of obtaining each defect point and surface conversion image of the surface of the copper bar to be detected comprises:
carrying out gray level histogram statistics on the gray level image of the surface image of the copper bar to be detected to obtain a gray level histogram of the gray level image;
performing Gaussian fitting on the gray level histogram of the gray level image to obtain a surface gray level Gaussian distribution function of the copper bar to be detected and the mean value and standard deviation of the surface gray level Gaussian distribution function;
determining a defect threshold according to the mean value and the standard deviation of the surface gray level Gaussian distribution function, taking each pixel point with the gray level value not greater than the defect threshold in the gray level image as a defect point, taking each pixel point with the gray level value greater than the defect threshold in the gray level image as a background point, and setting the gray level value of each background point as the mean value of the surface gray level Gaussian distribution function, thereby obtaining the surface conversion image.
3. The copper bar defect detection method based on machine vision as claimed in claim 2, wherein the calculation formula corresponding to the neighborhood gray scale distribution ambiguity of each defect point is as follows:
Figure FDA0003576805140000011
Figure FDA0003576805140000012
Figure FDA0003576805140000013
wherein the content of the first and second substances,
Figure FDA0003576805140000014
converting the surface into eight neighborhood pixel points of defect points at the positions of x and y in the imageNormalizing mean value of gray level difference of background points in the normalized image, mu is the gray level of the background points in the surface conversion image, Ix,y(k) The gray value delta I of the k neighborhood pixel point of the defect point with x and y positions in the surface conversion imagex,y(k) Normalizing the gray difference between the eight neighborhood pixels of the defect point positioned at x and y in the surface conversion image and the background point in the surface conversion image, sigmax,y 2Normalizing the variance, M, of the gray difference between the eight neighborhood pixels of the defect point with x and y positions in the surface conversion image and the background point in the surface conversion imagex,yAnd converting the neighborhood gray distribution fuzziness of the defect point positioned at x and y in the image on the surface.
4. The method for detecting the defect of the copper bar based on the machine vision as claimed in claim 2, wherein the step of determining the degree of regularity of the distribution of the gray scale of the neighborhood of each defect point comprises the following steps:
extracting any two neighborhood pixel points from eight neighborhood pixel points of each defect point in the surface conversion image, and obtaining a corresponding one-group or two-group neighborhood pixel point adjacent sequence every time any two neighborhood pixel points are extracted;
calculating the gray variance of each pixel point of a corresponding group of adjacent sequences of the neighborhood pixels or the mean value of the gray variances of each pixel point of the two groups of adjacent sequences of the neighborhood pixels, which is obtained when any two neighborhood pixels are extracted, and determining a group of adjacent sequences of the neighborhood pixels or two groups of adjacent sequences of the neighborhood pixels corresponding to the minimum value of all the calculated gray variances and the mean values of the gray variances;
when the minimum value corresponds to a group of adjacent sequences of the neighborhood pixels, calculating the neighborhood gray level distribution regularity of the corresponding defect point according to the number of the neighborhood pixels in the group of adjacent sequences of the neighborhood pixels corresponding to the minimum value;
and when the minimum value corresponds to two groups of adjacent sequences of the neighborhood pixels, calculating the neighborhood gray level distribution regularity of the corresponding defect point according to the number of the neighborhood pixels in the two groups of adjacent sequences of the neighborhood pixels corresponding to the minimum value.
5. The copper bar defect detection method based on machine vision as claimed in claim 4, wherein when the minimum value corresponds to two sets of neighborhood pixel point adjacent sequences, the corresponding calculation formula of the neighborhood gray scale distribution regularity of the corresponding defect point is:
Figure FDA0003576805140000021
wherein the content of the first and second substances,
Figure FDA0003576805140000022
for the degree of regularity of the distribution of the neighborhood gray scale of the defect point, α is the number of neighborhood pixels in one of the two sets of neighborhood pixel adjacent sequences, and β is the number of neighborhood pixels in the other set of neighborhood pixel adjacent sequences.
6. The machine vision-based copper bar defect detection method as claimed in claim 1, wherein the step of further determining the scale indentation points, the metal inclusion points and the undetermined type points in each defect point comprises:
calculating the neighborhood gray characteristic deviation value of each defect point according to the neighborhood gray distribution ambiguity and the neighborhood gray distribution regularity of each defect point;
and if the neighborhood gray characteristic deviation value is within the range of the first set neighborhood gray characteristic deviation value, judging the corresponding defect point as a to-be-determined defect point pressed into the oxide skin, if the neighborhood gray characteristic deviation value is within the range of the second set neighborhood gray characteristic deviation value, judging the corresponding defect point as a to-be-determined defect point of the metal inclusion, and if the neighborhood gray characteristic deviation value is within the range of the third set neighborhood gray characteristic deviation value, judging the corresponding defect point as a to-be-determined defect point of which the type cannot be determined.
7. The copper bar defect detection method based on machine vision according to claim 1, wherein the step of determining the combined prior range of each scale indentation defect and the combined prior range of each metal inclusion defect comprises:
determining each common defect point in each undeterminable type undetermined defect point according to the neighborhood gray distribution ambiguity and the neighborhood gray distribution rule degree of the undetermined type undetermined defect point;
combining each oxide skin indentation undetermined defect point and each public defect point into one class, thereby obtaining oxide skin indentation undetermined combined defect points, determining each boundary point of each oxide skin indentation undetermined combined defect point according to the position of each oxide skin indentation undetermined combined defect point, and determining each oxide skin indentation defect combined class prior range according to each boundary point of each oxide skin indentation undetermined combined defect point;
combining each metal inclusion undetermined defect point and each common defect point into one type so as to obtain metal inclusion undetermined combination defect points, determining each boundary point in each metal inclusion undetermined combination defect point according to the position of each metal inclusion undetermined combination defect point, and determining each metal inclusion defect combination type prior range according to each boundary point in each metal inclusion undetermined combination defect point.
8. The copper bar defect detection method based on machine vision as claimed in claim 1, wherein the step of determining the defect orientation coefficient of the copper bar to be detected according to the gray levels of the pixel points in each corresponding region comprises:
calculating the gray distribution entropy of each first corresponding region according to the gray of the pixel points in each first corresponding region, and calculating the gray distribution entropy of each second corresponding region according to the gray of the pixel points in each second corresponding region;
calculating the defect matching degree of each oxide skin indentation defect merging prior range and the defect matching degree of each metal inclusion defect merging prior range according to the gray distribution entropy of each first corresponding region and the gray distribution entropy of each second corresponding region;
and calculating the defect pointing coefficient of the copper bar to be detected according to the number of the pixel points in each oxide skin indentation defect combination prior range, the number of the pixel points in each metal inclusion defect combination prior range, the defect matching degree of each oxide skin indentation defect combination prior range and the defect matching degree of each metal inclusion defect combination prior range.
9. The copper bar defect detection method based on machine vision as claimed in claim 1, wherein the step of determining the defect category of the copper bar to be detected according to the defect orientation coefficient comprises:
if the defect pointing coefficient is located in the first set defect pointing range, the defect type of the copper bar to be detected is judged to be a metal inclusion defect, if the defect pointing coefficient is located in the second set defect pointing range, the defect type of the copper bar to be detected is judged to be an oxide skin pressing-in defect, and if the defect pointing coefficient is located in the third set defect pointing range, the defect type of the copper bar to be detected is judged to be a metal inclusion defect and an oxide skin pressing-in defect.
10. A machine vision-based copper bar defect detection system, which comprises a processor and a memory, wherein the processor is used for processing instructions stored in the memory to realize the machine vision-based copper bar defect detection method according to any one of claims 1 to 9.
CN202210346885.5A 2022-04-01 2022-04-01 Copper bar defect detection method and system based on machine vision Pending CN114742788A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210346885.5A CN114742788A (en) 2022-04-01 2022-04-01 Copper bar defect detection method and system based on machine vision

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210346885.5A CN114742788A (en) 2022-04-01 2022-04-01 Copper bar defect detection method and system based on machine vision

Publications (1)

Publication Number Publication Date
CN114742788A true CN114742788A (en) 2022-07-12

Family

ID=82278899

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210346885.5A Pending CN114742788A (en) 2022-04-01 2022-04-01 Copper bar defect detection method and system based on machine vision

Country Status (1)

Country Link
CN (1) CN114742788A (en)

Cited By (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115049672A (en) * 2022-08-17 2022-09-13 南通源钰新材料科技有限公司 Computer vision-based method for detecting defects of phosphating film on surface of metal aluminum
CN115222741A (en) * 2022-09-20 2022-10-21 江苏昱恒电气有限公司 Cable surface defect detection method
CN115330766A (en) * 2022-10-12 2022-11-11 南通新诚电子有限公司 Method for identifying formation quality defects of capacitor anode aluminum foil
CN115439476A (en) * 2022-11-07 2022-12-06 成都博视广达科技有限责任公司 Silk-screen defect detection method and device based on image analysis
CN115601368A (en) * 2022-12-16 2023-01-13 山东天意高科技有限公司(Cn) Method for detecting defects of sheet metal parts of building material equipment
CN117011304A (en) * 2023-10-08 2023-11-07 深圳思谋信息科技有限公司 Defect detection method, defect detection device, computer equipment and computer readable storage medium
CN118115499A (en) * 2024-04-29 2024-05-31 深圳市金利源绝缘材料有限公司 Visual detection method for production quality of electric power copper bar

Citations (15)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101216437A (en) * 2008-01-16 2008-07-09 中国电子科技集团公司第四十五研究所 Printed circuit boards detection method based on FPGA
JP2011069742A (en) * 2009-09-25 2011-04-07 Panasonic Electric Works Co Ltd Defect detector and defect detection method
CN103175839A (en) * 2011-12-21 2013-06-26 北京兆维电子(集团)有限责任公司 Processing method and system for detection of offset plate surface
CN106778595A (en) * 2016-12-12 2017-05-31 河北工业大学 The detection method of abnormal behaviour in crowd based on gauss hybrid models
CN107248159A (en) * 2017-08-04 2017-10-13 河海大学常州校区 A kind of metal works defect inspection method based on binocular vision
CN107610119A (en) * 2017-09-26 2018-01-19 河北工业大学 The accurate detection method of steel strip surface defect decomposed based on histogram
CN109239076A (en) * 2018-08-29 2019-01-18 西安理工大学 A kind of sewing thread trace defect inspection method based on machine vision
CN109377485A (en) * 2018-10-12 2019-02-22 龙口味美思环保科技有限公司 A kind of instant noodles packaging defect machine vision detection method
CN112233133A (en) * 2020-10-29 2021-01-15 上海电力大学 Power plant high-temperature pipeline defect detection and segmentation method based on OTSU and region growing method
CN112697803A (en) * 2020-12-16 2021-04-23 沈阳建筑大学 Plate strip steel surface defect detection method and device based on machine vision
CN112712512A (en) * 2021-01-05 2021-04-27 余波 Hot-rolled strip steel scab defect detection method and system based on artificial intelligence
US20210248734A1 (en) * 2018-05-31 2021-08-12 Goertek Inc. Method and apparatus for detecting pixel defect of optical module, and device
CN113808138A (en) * 2021-11-22 2021-12-17 山东鹰联光电科技股份有限公司 Artificial intelligence-based wire and cable surface defect detection method
CN113850808A (en) * 2021-12-01 2021-12-28 武汉泰盛包装材料有限公司 Multilayer corrugated paper arrangement defect detection method and device based on image processing
CN114240942A (en) * 2022-02-25 2022-03-25 武汉市雷成龙液压机械有限公司 Metal part surface quality control method and system based on image processing

Patent Citations (15)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101216437A (en) * 2008-01-16 2008-07-09 中国电子科技集团公司第四十五研究所 Printed circuit boards detection method based on FPGA
JP2011069742A (en) * 2009-09-25 2011-04-07 Panasonic Electric Works Co Ltd Defect detector and defect detection method
CN103175839A (en) * 2011-12-21 2013-06-26 北京兆维电子(集团)有限责任公司 Processing method and system for detection of offset plate surface
CN106778595A (en) * 2016-12-12 2017-05-31 河北工业大学 The detection method of abnormal behaviour in crowd based on gauss hybrid models
CN107248159A (en) * 2017-08-04 2017-10-13 河海大学常州校区 A kind of metal works defect inspection method based on binocular vision
CN107610119A (en) * 2017-09-26 2018-01-19 河北工业大学 The accurate detection method of steel strip surface defect decomposed based on histogram
US20210248734A1 (en) * 2018-05-31 2021-08-12 Goertek Inc. Method and apparatus for detecting pixel defect of optical module, and device
CN109239076A (en) * 2018-08-29 2019-01-18 西安理工大学 A kind of sewing thread trace defect inspection method based on machine vision
CN109377485A (en) * 2018-10-12 2019-02-22 龙口味美思环保科技有限公司 A kind of instant noodles packaging defect machine vision detection method
CN112233133A (en) * 2020-10-29 2021-01-15 上海电力大学 Power plant high-temperature pipeline defect detection and segmentation method based on OTSU and region growing method
CN112697803A (en) * 2020-12-16 2021-04-23 沈阳建筑大学 Plate strip steel surface defect detection method and device based on machine vision
CN112712512A (en) * 2021-01-05 2021-04-27 余波 Hot-rolled strip steel scab defect detection method and system based on artificial intelligence
CN113808138A (en) * 2021-11-22 2021-12-17 山东鹰联光电科技股份有限公司 Artificial intelligence-based wire and cable surface defect detection method
CN113850808A (en) * 2021-12-01 2021-12-28 武汉泰盛包装材料有限公司 Multilayer corrugated paper arrangement defect detection method and device based on image processing
CN114240942A (en) * 2022-02-25 2022-03-25 武汉市雷成龙液压机械有限公司 Metal part surface quality control method and system based on image processing

Non-Patent Citations (7)

* Cited by examiner, † Cited by third party
Title
MENGKUN LI等: "A Method of Surface Defect Detection of Irregular Industrial Products Based on Machine Vision", 《WIRELESS COMMUNICATIONS AND MOBILE COMPUTING》 *
YUNPENG MA等: "A surface defects inspection method based on multidirectional gray-level fluctuation", 《INTERNATIONAL JOURNAL OF ADVANCED ROBOTIC SYSTEMS》 *
令狐蓉: "基于机器视觉的橡胶减震垫缺陷检测***的设计", 《中国优秀硕士学位论文全文数据库 信息科技辑》 *
刘力源: "电机铜排表面毛刺缺陷检测技术研究", 《中国优秀硕士学位论文全文数据库 工程科技II辑》 *
王妍玮: "工业X射线图像处理技术研究", 《中国博士学位论文全文数据库 信息科技辑》 *
王路等: "基于局部信息熵迭代的带钢表面缺陷分割", 《微计算机信息》 *
陆盼盼: "基于机器视觉的小型环状电镀零件表面缺陷检测", 《中国优秀硕士学位论文全文数据库 工程科技I辑》 *

Cited By (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115049672A (en) * 2022-08-17 2022-09-13 南通源钰新材料科技有限公司 Computer vision-based method for detecting defects of phosphating film on surface of metal aluminum
CN115222741A (en) * 2022-09-20 2022-10-21 江苏昱恒电气有限公司 Cable surface defect detection method
CN115222741B (en) * 2022-09-20 2023-02-28 江苏昱恒电气有限公司 Cable surface defect detection method
CN115330766A (en) * 2022-10-12 2022-11-11 南通新诚电子有限公司 Method for identifying formation quality defects of capacitor anode aluminum foil
CN115330766B (en) * 2022-10-12 2023-04-11 南通新诚电子有限公司 Method for identifying formation quality defects of capacitor anode aluminum foil
CN115439476A (en) * 2022-11-07 2022-12-06 成都博视广达科技有限责任公司 Silk-screen defect detection method and device based on image analysis
CN115439476B (en) * 2022-11-07 2023-03-14 成都博视广达科技有限责任公司 Silk-screen defect detection method and device based on image analysis
CN115601368A (en) * 2022-12-16 2023-01-13 山东天意高科技有限公司(Cn) Method for detecting defects of sheet metal parts of building material equipment
CN117011304A (en) * 2023-10-08 2023-11-07 深圳思谋信息科技有限公司 Defect detection method, defect detection device, computer equipment and computer readable storage medium
CN117011304B (en) * 2023-10-08 2024-03-26 深圳思谋信息科技有限公司 Defect detection method, defect detection device, computer equipment and computer readable storage medium
CN118115499A (en) * 2024-04-29 2024-05-31 深圳市金利源绝缘材料有限公司 Visual detection method for production quality of electric power copper bar

Similar Documents

Publication Publication Date Title
CN114742788A (en) Copper bar defect detection method and system based on machine vision
CN115345885B (en) Appearance quality detection method for metal fitness equipment
CN111179251B (en) Defect detection system and method based on twin neural network and by utilizing template comparison
CN114359270B (en) Computer vision-based automobile engine oil way copper sleeve defect detection method
CN114937055B (en) Image self-adaptive segmentation method and system based on artificial intelligence
CN115351598A (en) Numerical control machine tool bearing detection method
CN116703907B (en) Machine vision-based method for detecting surface defects of automobile castings
CN110648310B (en) Weak supervision casting defect identification method based on attention mechanism
CN113724231B (en) Industrial defect detection method based on semantic segmentation and target detection fusion model
JP2013167596A (en) Defect inspection device, defect inspection method, and program
CN113554629A (en) Strip steel red rust defect detection method based on artificial intelligence
CN113177924A (en) Industrial production line product flaw detection method
CN114187289B (en) Plastic product shrinkage pit detection method and system based on computer vision
CN116385450B (en) PS sheet wear resistance detection method based on image processing
CN111242185A (en) Defect rapid preliminary screening method and system based on deep learning
CN110334760B (en) Optical component damage detection method and system based on RESUnet
CN115115637B (en) Cloth defect detection method based on image pyramid thought
CN116152242B (en) Visual detection system of natural leather defect for basketball
CN116523923B (en) Battery case defect identification method
CN113516619B (en) Product surface flaw identification method based on image processing technology
CN114841938A (en) Fabric snagging defect detection method
CN111487192A (en) Machine vision surface defect detection device and method based on artificial intelligence
CN108921172B (en) Image processing device and method based on support vector machine
CN116012291A (en) Industrial part image defect detection method and system, electronic equipment and storage medium
CN114926441A (en) Defect detection method and system for machining and molding injection molding part

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
AD01 Patent right deemed abandoned
AD01 Patent right deemed abandoned

Effective date of abandoning: 20231208