CN117437219A - Magnetic glue inductance irregular appearance defect detection method based on computer vision - Google Patents

Magnetic glue inductance irregular appearance defect detection method based on computer vision Download PDF

Info

Publication number
CN117437219A
CN117437219A CN202311733742.0A CN202311733742A CN117437219A CN 117437219 A CN117437219 A CN 117437219A CN 202311733742 A CN202311733742 A CN 202311733742A CN 117437219 A CN117437219 A CN 117437219A
Authority
CN
China
Prior art keywords
pixel point
value
gray
noise
suspected
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.)
Granted
Application number
CN202311733742.0A
Other languages
Chinese (zh)
Other versions
CN117437219B (en
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.)
Huizhou Deli Electronic Co ltd
Original Assignee
Huizhou Deli Electronic 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 Huizhou Deli Electronic Co ltd filed Critical Huizhou Deli Electronic Co ltd
Priority to CN202311733742.0A priority Critical patent/CN117437219B/en
Publication of CN117437219A publication Critical patent/CN117437219A/en
Application granted granted Critical
Publication of CN117437219B publication Critical patent/CN117437219B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

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
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/10Segmentation; Edge detection
    • G06T7/11Region-based segmentation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/10Segmentation; Edge detection
    • G06T7/13Edge detection
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/10Segmentation; Edge detection
    • G06T7/136Segmentation; Edge detection involving thresholding
    • 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

Abstract

The invention relates to the technical field of image data processing, in particular to a magnetic glue inductance irregular appearance defect detection method based on computer vision. The method comprises the steps of obtaining a gray image of the appearance of the magnetic glue inductor; acquiring a noise degree value of the pixel point according to the distribution of the gray values; acquiring a filtering probability value of the pixel point according to the noise degree value, and screening out a reference pixel point; obtaining the similarity degree of the reference pixel points according to the noise degree value and the filtering probability value of the reference pixel points, and screening out suspected noise pixel points; and obtaining the filtering weight of the suspected noise pixel point to denoise according to the similarity degree and gray value of the suspected noise pixel point and the noise degree value of the neighborhood pixel point in a first preset window of the suspected noise pixel point, obtaining the denoised gray image to detect the defect, and determining the defect area. According to the method, the filtering weight of the suspected noise pixel point is obtained, the gray image is accurately denoised, the interference of noise is removed, and the defect area is accurately detected.

Description

Magnetic glue inductance irregular appearance defect detection method based on computer vision
Technical Field
The invention relates to the technical field of image data processing, in particular to a magnetic glue inductance irregular appearance defect detection method based on computer vision.
Background
The magnetic glue inductance refers to an inductance device manufactured by using a magnetic glue material, has good flexibility and magnetic performance, is often used as a coating material of an inductance in the manufacture of electronic components, and consists of a magnetic core, a coil and a packaging material. The shell of the magnetic glue inductor is easy to generate defect problems due to abrasion in the production process, and the quality and sales of the magnetic glue inductor are affected. Therefore, defect detection is required to be carried out on the appearance of the magnetic glue inductor, and the quality of the magnetic glue inductor is determined to be qualified.
In the existing method, defect detection is carried out on the appearance of the magnetic glue inductor through an edge detection algorithm, and a defect area in the appearance of the magnetic glue inductor is obtained. In practical situations, noise with different degrees can appear on the appearance of the magnetic glue inductor, so that the detection of a defect area in the appearance of the magnetic glue inductor is inaccurate, and the quality of the magnetic glue inductor cannot be accurately judged.
Disclosure of Invention
In order to solve the technical problem of inaccurate detection of a defect area of the appearance of the magnetic glue inductor caused by noise, the invention aims to provide a magnetic glue inductor irregular appearance defect detection method based on computer vision, and the adopted technical scheme is as follows:
the invention provides a magnetic glue inductance irregular appearance defect detection method based on computer vision, which comprises the following steps:
acquiring a gray image of the appearance of the magnetic glue inductor;
acquiring a high gray value interval according to the gray value of each pixel point in the gray image; constructing a first preset window of each pixel point in the gray image, and acquiring the noise degree value of each pixel point in the gray image according to the gray value difference between the gray value in the high gray value interval and the gray value of each pixel point in the gray image and the gray value distribution in the first preset window of each pixel point;
acquiring a filtering probability value of each pixel point in the gray level image according to the noise degree value of each pixel point in each first preset window;
screening out reference pixel points according to the filtering probability value; obtaining the similarity degree of each reference pixel point according to the difference of noise degree values between each reference pixel point and the pixel points at the same position in a first preset window corresponding to each other reference pixel point and the filtering probability value of each reference pixel point;
screening out suspected noise pixel points according to the similarity; obtaining the filtering weight of each suspected noise pixel point according to the similarity degree and gray value of each suspected noise pixel point, the noise degree value of the neighborhood pixel point in the first preset window of each suspected noise pixel point and the noise degree value of the neighborhood pixel point in the first preset window of other suspected noise pixel points;
and denoising each suspected noise pixel point according to the filtering weight, obtaining a denoised gray image, performing defect detection, and determining a defect area in the gray image.
Further, the method for acquiring the high gray value interval comprises the following steps:
acquiring a gray histogram according to the sequence from small gray values to large gray values in the gray image; the horizontal axis of the gray level histogram is a gray level value, and the vertical axis of the gray level histogram is the number of pixel points corresponding to each gray level value;
taking a gray value corresponding to the minimum number of pixel points in the gray histogram as a target gray value;
and taking a gray value interval between the target gray value and the maximum gray value in the gray histogram as a high gray value interval.
Further, the method for obtaining the noise level value of each pixel in the gray image according to the gray value difference between the gray value in the high gray value interval and the gray value of each pixel in the gray image and the gray value distribution in the first preset window of each pixel comprises the following steps:
acquiring an average value of gray values in a high gray value interval as a first average value;
for any pixel point in the gray level image, taking the pixel point as a center, and constructing a first preset window of the pixel point;
acquiring the difference between the gray value of the pixel point and the first average value as a first difference;
acquiring gray value differences between each pixel point in a first preset window of the pixel point and the pixel point as second differences;
and acquiring the noise degree value of the pixel point according to the first difference and the second difference.
Further, the calculation formula of the noise level value is as follows:
in the method, in the process of the invention,the noise level value of the j-th pixel point; />The gray value of the j-th pixel point; />Is the mth gray value in the high gray value interval; m is the total number of gray values in the high gray value interval; />The gray value of the ith pixel point in the first preset window of the jth pixel point is obtained; n is the total number of pixel points in the first preset window; />Is the first average value;is the first difference; />Is the second difference; />As a function of absolute value; exp is an exponential function based on a natural constant.
Further, the calculation formula of the filtering probability value is as follows:
in the method, in the process of the invention,a filtering probability value for the j-th pixel point; n is the total number of pixel points in the first preset window; />The noise degree value of the ith pixel point in the first preset window of the jth pixel point is obtained; />The noise level value of the j-th pixel point; />As a function of absolute value; norm is a normalization function.
Further, the method for screening out the reference pixel points according to the filtering probability value comprises the following steps:
and when the filtering probability value is larger than a preset filtering probability value threshold value, the corresponding pixel point is used as a reference pixel point.
Further, the calculation formula of the similarity degree is as follows:
in the method, in the process of the invention,a degree of similarity for the a-th reference pixel point; />A filtering probability value for the a-th reference pixel point; r is the total number of reference pixel points; n is the total number of pixel points in the first preset window; />The noise degree value of the ith pixel point in the first preset window of the (a) th reference pixel point is obtained; />The noise degree value of the ith pixel point in the first preset window of the ith reference pixel point is the noise degree value of the ith pixel point; />As a function of absolute value; exp is an exponential function based on a natural constant.
Further, the method for screening the suspected noise pixel points according to the similarity degree comprises the following steps:
when the similarity is greater than a preset similarity threshold, the corresponding reference pixel point is used as a suspected noise pixel point.
Further, the calculation formula of the filtering weight is as follows:
in the method, in the process of the invention,the filtering weight of the e suspected noise pixel point; k is the total number of suspected noise pixels; n is the total number of pixel points in the first preset window; />The noise degree value of the v neighborhood pixel point in the first preset window of the kth suspected noise pixel point is obtained; />The noise degree value of the v neighborhood pixel point in the first preset window of the e suspected noise pixel point is obtained; />The similarity degree of the e suspected noise pixel points is the similarity degree; />The gray value of the e suspected noise pixel point;for a first predetermined constant value, the first predetermined constant value,greater than 0; />Is a second preset constant, greater than 0; norm is a normalization function.
Further, the method for denoising each suspected noise pixel point according to the filtering weight, performing defect detection on the denoised gray image, and determining the defect area in the gray image comprises the following steps:
for any suspected noise pixel point, acquiring a gray value average value of each pixel point in a first preset window of the suspected noise pixel point as a reference gray value of the suspected noise pixel point;
taking the product of the filtering weight of the suspected noise pixel point and the reference gray value as the denoising gray value of the suspected noise pixel point;
obtaining a denoised gray image according to the denoised gray value of each suspected noise pixel point;
and performing defect detection on the denoised gray image through an edge detection algorithm to determine a defect area in the gray image.
The invention has the following beneficial effects:
according to the gray value of each pixel point in the gray image, a high gray value interval is obtained, and the efficiency of obtaining suspected noise pixel points in the gray image is improved; a first preset window of each pixel point in the gray image is constructed, so that the distribution of each pixel point is conveniently analyzed, the accuracy of obtaining the suspected noise pixel point is improved, further, the noise degree value of each pixel point in the gray image is accurately obtained according to the gray value difference between the gray value in a high gray value interval and the gray value of each pixel point in the gray image and the gray value distribution in the first preset window of each pixel point, the accuracy of screening out the suspected noise pixel point in the gray image is improved, the filtering probability value of each pixel point in the gray image is further obtained according to the noise degree value of each pixel point in the first preset window, the reference pixel point is accurately screened out, and the efficiency and the accuracy of obtaining the suspected noise pixel point are improved; in order to accurately and efficiently denoise the gray image, further obtaining the similarity degree of each reference pixel point according to the difference of noise degree values between each reference pixel point and the pixel points at the same position in a first preset window corresponding to each other reference pixel point and the filtering probability value of each reference pixel point, accurately screening out suspected noise pixel points, and improving the denoising efficiency of the gray image; and accurately acquiring the filtering weight of each suspected noise pixel point according to the similarity degree and gray value of each suspected noise pixel point and the noise degree value of the neighborhood pixel point in the first preset window of other suspected noise pixel points, accurately denoising each suspected noise pixel point, accurately acquiring a denoised gray image, removing noise interference, accurately detecting defects of the denoised gray image, accurately detecting defect areas in the gray image, accurately judging the quality of the magnetic glue inductance, and avoiding the magnetic glue inductance with defects on the surface from flowing into the market.
Drawings
In order to more clearly illustrate the embodiments of the invention or the technical solutions and advantages of the prior art, the following description will briefly explain the drawings used in the embodiments or the description of the prior art, and it is obvious that the drawings in the following description are only some embodiments of the invention, and other drawings can be obtained according to the drawings without inventive effort for a person skilled in the art.
Fig. 1 is a flowchart of a method for detecting irregular appearance defects of a magnetic glue inductance based on computer vision according to an embodiment of the present invention.
Detailed Description
In order to further illustrate the technical means and effects adopted by the invention to achieve the preset aim, the following is a detailed description of specific implementation, structure, characteristics and effects of the magnetic glue inductance irregular appearance defect detection method based on computer vision according to the invention with reference to the accompanying drawings and the preferred embodiment. In the following description, different "one embodiment" or "another embodiment" means that the embodiments are not necessarily the same. Furthermore, the particular features, structures, or characteristics of one or more embodiments may be combined in any suitable manner.
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.
The invention provides a magnetic glue inductance irregular appearance defect detection method based on computer vision.
Referring to fig. 1, a flow chart of a method for detecting irregular appearance defects of a magnetic glue inductance based on computer vision according to an embodiment of the invention is shown, the method comprises the following steps:
step S1: and acquiring a gray image of the appearance of the magnetic glue inductor.
Specifically, in the actual situation, a plurality of areas with different colors exist in the appearance of the magnetic glue inductor, defects caused by abrasion appear differently in the areas with different colors, and in order to avoid interference of the areas with different colors on detection defects, the magnetic glue inductor is divided into areas, and only the magnetic glue inductors of the areas with the same color are detected each time. Therefore, the magnetic glue inductance appearing later is the magnetic glue inductance only containing one color.
In order to better detect a defect area of the appearance of the magnetic glue inductor, the embodiment of the invention carries out graying treatment on the collected appearance image of the magnetic glue inductor to obtain a gray image of the appearance of the magnetic glue inductor. The graying process is the prior art, and will not be described in detail. The defective area after the appearance of the magnetic glue inductor is worn has a larger gray value in the gray image.
The embodiment of the invention has the following specific scene: the magnetic glue induction shell is only aimed at the magnetic glue induction shell with the same color, and meanwhile, the magnetic glue induction shell is not influenced by illumination.
The aim of the embodiment of the invention is as follows: the gray value of the defective area of the magnetic glue inductance after abrasion is larger in the gray level image, and the gray value of the noise pixel point in the gray level image is larger, so that the noise pixel point is easy to be mistaken for the defective pixel point when the defective area in the gray level image is acquired. When the noise in the gray level image is serious, the defect area in the appearance of the magnetic glue inductance cannot be accurately detected, and the quality of the magnetic glue inductance cannot be accurately determined. Therefore, according to the embodiment of the invention, each pixel point in the gray level image is analyzed, the noise degree value of each pixel point is obtained, the suspected noise pixel point is obtained, the filtering weight of each suspected noise pixel point is determined, the influence of noise on the defect detection of the magnetic glue inductance housing is avoided, and the defect region in the magnetic glue inductance housing is accurately detected.
Step S2: acquiring a high gray value interval according to the gray value of each pixel point in the gray image; a first preset window of each pixel point in the gray image is constructed, and the noise degree value of each pixel point in the gray image is obtained according to the gray value difference between the gray value in the high gray value interval and the gray value of each pixel point in the gray image and the gray value distribution in the first preset window of each pixel point.
Specifically, in order to improve the denoising efficiency of the gray image, the embodiment of the invention obtains a high gray value interval, wherein the gray value of the noise pixel point and the gray value of the defect pixel point are certain in the high gray value interval.
Preferably, the method for acquiring the high gray value interval is as follows: acquiring a gray histogram according to the sequence from small gray values to large gray values in the gray image; the horizontal axis of the gray level histogram is a gray level value, and the vertical axis of the gray level histogram is the number of pixel points corresponding to each gray level value; taking a gray value corresponding to the minimum number of pixel points in the gray histogram as a target gray value; and taking a gray value interval between the target gray value and the maximum gray value in the gray histogram as a high gray value interval. The method for obtaining the gray histogram is in the prior art, and will not be described in detail. The reason why the gray value corresponding to the minimum number of pixels in the gray histogram is used as the initial gray value of the high gray value interval is as follows: in the gray image, normal pixels occupy a main part, and noise pixels occupy a smaller proportion, so that a gray value corresponding to the minimum number of pixels in the gray histogram is used as a starting gray value of a high gray value interval. If at least two gray values corresponding to the minimum number of pixel points in the gray histogram exist, the maximum gray value is selected as the target gray value, so that the high gray value interval is more accurate.
When the gray value of a certain pixel point in the gray image is in the high gray value interval, the pixel point may be a noise pixel point or a defect pixel point. Knowing that defective pixels are intensively distributed and noise pixels are discretely distributed, so that a first preset window of each pixel is constructed with each pixel in the gray image as a center, and the size of the first preset window is set as follows in the embodiment of the inventionThe size of the first preset window may be set by the practitioner according to the actual situation, and is not limited herein. And obtaining the noise level value of each pixel point in the gray level image according to the gray level value difference between the gray level value in the high gray level value interval and the gray level value difference of each pixel point in the gray level image and the gray level value distribution in the first preset window of each pixel point.
Preferably, the method for obtaining the noise level value is as follows: acquiring an average value of gray values in a high gray value interval as a first average value; for any pixel point in the gray image, acquiring the difference between the gray value of the pixel point and a first average value as a first difference; acquiring gray value differences between each pixel point in a first preset window of the pixel point and the pixel point as second differences; and acquiring the noise degree value of the pixel point according to the first difference and the second difference.
As an example, taking the jth pixel point in the gray-scale image as an example, a calculation formula for obtaining the noise level value of the jth pixel point is:
in the method, in the process of the invention,the noise level value of the j-th pixel point; />The gray value of the j-th pixel point; />Is the mth gray value in the high gray value interval; m is the total number of gray values in the high gray value interval; />The gray value of the ith pixel point in the first preset window of the jth pixel point is obtained; n is the total number of pixels in the first preset window, and in this embodiment of the present invention +.>;/>As a function of absolute value; exp is an exponential function based on a natural constant; />Is the first average value; />Is the first difference; />The second difference.
The first difference is thatSmaller (less)>And->The more equal the gray value of the jth pixel is, the more likely the jth pixel is to be a normal pixel in the high gray value interval, and the more unlikely the jth pixel is to be a normal pixel, the more likely the jth pixel is to be a normal pixel in the high gray value interval>The bigger the->The larger; to distinguish between noise pixels and defective pixels, calculate +.>Second difference->The larger the difference of gray values between the jth pixel point and the neighborhood pixel point is, the greater the difference of gray values is, the +.>The larger the distribution of the jth pixel is, the more discrete the jth pixel is, the more likely the jth pixel is a noise pixel, and the more likely the jth pixel is a noise pixel>The larger; thus (S)>The larger the j-th pixel is, the more likely it is a noise pixel.
And acquiring the noise degree value of each pixel point in the gray level image according to the method for acquiring the noise degree value of the j-th pixel point.
Step S3: and obtaining a filtering probability value of each pixel point in the gray level image according to the noise degree value of each pixel point in each first preset window.
Specifically, in order to more accurately obtain suspected noise pixel points in a gray image, accurate denoising is performed on the gray image, and according to the noise degree value of each pixel point in a first preset window, a filtering probability value of each pixel point in the gray image is obtained. And (3) primarily screening the pixel points in the gray image according to the filtering probability value, so that the efficiency of acquiring the suspected noise pixel points is improved. The method for obtaining the filtering probability value is as follows:
as an example, taking the jth pixel point in step S2 as an example, the absolute value of the difference between the noise level value of each pixel point in the first preset window of the jth pixel point and the noise level value of the jth pixel point is obtained as the noise level difference. According to the noise degree difference and the noise degree value of the jth pixel point, a calculation formula for obtaining the filtering probability value of the jth pixel point is as follows:
in the method, in the process of the invention,a filtering probability value for the j-th pixel point; n is the total number of pixel points in the first preset window; />The noise degree value of the ith pixel point in the first preset window of the jth pixel point is obtained; />The noise level value of the j-th pixel point; />As a function of absolute value; norm is a normalization function; />Is the difference in noise level.
The difference in noise levelThe bigger the->The larger the difference of the noise degree value between the jth pixel point and the neighborhood pixel point is, the more likely the jth pixel point is a noise pixel point, and the more the jth pixel point is>The larger; />The larger the j-th pixel is, the more likely it is a noise pixel, +.>The larger; thus (S)>The larger the j-th pixel is, the more likely it is to be a noise pixel, and the greater the probability of filtering being required. Wherein (1)>The value of (2) is in the range of 0 to 1.
And acquiring the filter probability value of each pixel point in the gray image according to the method for acquiring the filter probability value of the j-th pixel point.
Step S4: screening out reference pixel points according to the filtering probability value; and obtaining the similarity degree of each reference pixel point according to the difference of noise degree values between each reference pixel point and the pixel points at the same position in the first preset window corresponding to each other reference pixel point and the filtering probability value of each reference pixel point.
Specifically, in order to more efficiently and accurately perform denoising processing on noise pixels in a gray image, the preset filtering probability value threshold is set to 0.5 in the embodiment of the invention, and an implementer can set the magnitude of the preset filtering probability value threshold according to actual conditions, which is not limited herein. And when the filtering probability value is larger than a preset filtering probability value threshold value, the corresponding pixel point is used as a reference pixel point. The reference pixel points are analyzed to obtain the similarity degree between the reference pixel points, and the gray value and the distribution of the known noise pixel points are similar, so that the greater the similarity degree of a certain reference pixel point is, the more likely the screened reference pixel point is the noise pixel point, and the more likely the filtering processing is performed on the reference pixel point. Therefore, the similarity degree between each reference pixel point and other reference pixel points is obtained, wherein the specific method for obtaining the similarity degree is as follows:
taking an a-th reference pixel point as an example, obtaining a difference absolute value of a noise degree value of each pixel point in a first preset window of the a-th reference pixel point and a noise degree value of a pixel point at the same position in a first preset window of each other reference pixel point, and obtaining a calculation formula of the similarity degree of the a-th reference pixel point according to the third difference and a filtering probability value of the a-th reference pixel point as a third difference, wherein the calculation formula comprises the following steps:
in the method, in the process of the invention,a degree of similarity for the a-th reference pixel point; />A filtering probability value for the a-th reference pixel point; r is the total number of reference pixel points; n is the total number of pixel points in the first preset window; />The noise degree value of the ith pixel point in the first preset window of the (a) th reference pixel point is obtained; />The noise degree value of the ith pixel point in the first preset window of the ith reference pixel point is the noise degree value of the ith pixel point; />As a function of absolute value; exp is an exponential function based on a natural constant; />The third difference.
It should be noted that the number of the substrates,the larger the a-th reference pixel point is, the more likely it is to be a noise pixel point, +.>The larger; third difference->Smaller (less)>And->The more equal, the more similar the distribution of the ith pixel point in the first preset window illustrating the ith reference pixel point and the ith pixel point in the first preset window of the nth reference pixel point, & lt/EN & gt>The larger the size of the container,the larger the a-th reference pixel point is, the more similar the r-th reference pixel point is,/-the larger the reference pixel point is>The larger the a-th reference pixel point is, the more similar the a-th reference pixel point is to other reference pixel points, the larger the probability that the a-th reference pixel point is a noise pixel point is, and the more the a-th reference pixel point is, the more the a-th reference pixel point is>The larger; thus (S)>The larger the a-th reference pixel is, the more likely it is a noise pixel, +.>Representative is the degree of similarity between noisy pixels. Wherein (1)>The value of (2) is in the range of 0 to 1, (-)>The value of (2) is in the range of 0 to 1, therefore, ">The value of (2) is in the range of 0 to 1.
And obtaining the similarity degree of each reference pixel point according to the method for obtaining the similarity degree of the a-th reference pixel point.
Step S5: screening out suspected noise pixel points according to the similarity; and obtaining the filtering weight of each suspected noise pixel point according to the similarity degree and gray value of each suspected noise pixel point, the noise degree value of the neighborhood pixel point in the first preset window of each suspected noise pixel point and the noise degree values of the neighborhood pixel points in the first preset windows of other suspected noise pixel points.
Specifically, in order to more accurately screen out noise pixel points, accurate denoising is performed on a gray image, and then a defect area in the gray image is accurately identified. When the similarity is greater than a preset similarity threshold, the corresponding reference pixel point is used as a suspected noise pixel point. The method comprises the steps of determining suspected noise pixel points in a gray level image, and obtaining filtering weights of all the suspected noise pixel points according to the similarity degree and gray level value of all the suspected noise pixel points and the noise degree value of the neighborhood pixel points in a first preset window of each suspected noise pixel point and the noise degree value of the neighborhood pixel points in a first preset window of other suspected noise pixel points.
In practical situations, the neighborhood pixel point of the noise pixel point is a normal pixel point, and the noise degree value corresponding to the normal pixel point is smaller, so that the smaller the noise degree value of the neighborhood pixel point in the first preset window of each suspected noise pixel point is, the more accurate the screened suspected noise pixel point is, the greater the degree of filtering the suspected noise pixel point is, namely the greater the filtering weight of the suspected noise pixel point is.
Taking the e-th suspected noise pixel point as an example, a calculation formula for obtaining the filtering weight of the e-th suspected noise pixel point is as follows:
in the method, in the process of the invention,the filtering weight of the e suspected noise pixel point; k is the total number of suspected noise pixels; n is the total number of pixel points in the first preset window; />The noise degree value of the v neighborhood pixel point in the first preset window of the kth suspected noise pixel point is obtained; />The noise degree value of the v neighborhood pixel point in the first preset window of the e suspected noise pixel point is obtained; />The similarity degree of the e suspected noise pixel points is the similarity degree; />The gray value of the e suspected noise pixel point;is a first preset constant, which is greater than 0; />Is a second preset constant, greater than 0; norm is a normalization function.
Embodiments of the invention willSet to 0.5 @, ->Set to 0.5, the practitioner can set +.>And->Is not limited herein.
It should be noted that the number of the substrates,smaller (less)>And->Smaller (less)>The larger the e-th suspected noise pixel point is, the more likely the e-th suspected noise pixel point is a noise pixel point, the greater the degree to which the e-th suspected noise pixel point needs to be filtered is, and the +.>The larger; />The larger the e-th suspected noise pixel is, the more likely it is a noise pixel,/->The larger; />The larger the e-th suspected noise pixel is, the more likely it is a noise pixel,/->The larger; thus (S)>The larger the e-th suspected noise pixel point is, the greater the filtering degree is required.
And acquiring the filtering weight of each suspected noise pixel point according to the method for acquiring the filtering weight of the e suspected noise pixel point.
Step S6: and denoising each suspected noise pixel point according to the filtering weight, obtaining a denoised gray image, performing defect detection, and determining a defect area in the gray image.
Specifically, in order to perform accurate and efficient denoising processing on a gray image, the embodiment of the invention performs denoising on each suspected noise pixel point according to the filtering weight of each suspected noise pixel point to obtain a denoised gray image.
Preferably, the method for obtaining the denoised gray image comprises the following steps: for any suspected noise pixel point, acquiring a gray value average value of each pixel point in a first preset window of the suspected noise pixel point as a reference gray value of the suspected noise pixel point; taking the product of the filtering weight of the suspected noise pixel point and the reference gray value as the denoising gray value of the suspected noise pixel point; and obtaining a denoised gray image according to the denoised gray value of each suspected noise pixel point. So far, denoising is carried out on each suspected noise pixel point, and a denoised gray image is obtained.
And further, the denoised gray image is processed to accurately obtain a defect area in the gray image, the embodiment of the invention performs defect detection on the denoised gray image through an edge detection algorithm to accurately determine the defect area in the gray image, and in another embodiment, an operator can obtain the defect area in the gray image through other defect detection methods such as threshold segmentation, and the like, and the defect area is not limited. The edge detection algorithm and the threshold segmentation are both in the prior art, and are not described in detail. And judging the magnetic glue inductance with the defect area as the magnetic glue inductance with the quality problem, recovering the magnetic glue inductance with the quality problem, and reprocessing to ensure that the surface of the magnetic glue inductance entering the market has no quality problem.
The present invention has been completed.
In summary, the embodiment of the invention obtains the gray image of the appearance of the magnetic glue inductor; acquiring a noise degree value of the pixel point according to the distribution of the gray values; acquiring a filtering probability value of the pixel point according to the noise degree value, and screening out a reference pixel point; obtaining the similarity degree of the reference pixel points according to the noise degree value and the filtering probability value of the reference pixel points, and screening out suspected noise pixel points; and obtaining the filtering weight of the suspected noise pixel point to denoise according to the similarity degree and gray value of the suspected noise pixel point and the noise degree value of the neighborhood pixel point in a first preset window of the suspected noise pixel point, obtaining the denoised gray image to detect the defect, and determining the defect area. According to the method, the filtering weight of the suspected noise pixel point is obtained, the gray image is accurately denoised, the interference of noise is removed, and the defect area is accurately detected.
It should be noted that: the sequence of the embodiments of the present invention is only for description, and does not represent the advantages and disadvantages of the embodiments. The processes depicted in the accompanying drawings do not necessarily require the particular order shown, or sequential order, to achieve desirable results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.
In this specification, each embodiment is described in a progressive manner, and identical and similar parts of each embodiment are all referred to each other, and each embodiment mainly describes differences from other embodiments.

Claims (10)

1. The method for detecting the irregular appearance defect of the magnetic glue inductance based on computer vision is characterized by comprising the following steps of:
acquiring a gray image of the appearance of the magnetic glue inductor;
acquiring a high gray value interval according to the gray value of each pixel point in the gray image; constructing a first preset window of each pixel point in the gray image, and acquiring the noise degree value of each pixel point in the gray image according to the gray value difference between the gray value in the high gray value interval and the gray value of each pixel point in the gray image and the gray value distribution in the first preset window of each pixel point;
acquiring a filtering probability value of each pixel point in the gray level image according to the noise degree value of each pixel point in each first preset window;
screening out reference pixel points according to the filtering probability value; obtaining the similarity degree of each reference pixel point according to the difference of noise degree values between each reference pixel point and the pixel points at the same position in a first preset window corresponding to each other reference pixel point and the filtering probability value of each reference pixel point;
screening out suspected noise pixel points according to the similarity; obtaining the filtering weight of each suspected noise pixel point according to the similarity degree and gray value of each suspected noise pixel point, the noise degree value of the neighborhood pixel point in the first preset window of each suspected noise pixel point and the noise degree value of the neighborhood pixel point in the first preset window of other suspected noise pixel points;
and denoising each suspected noise pixel point according to the filtering weight, obtaining a denoised gray image, performing defect detection, and determining a defect area in the gray image.
2. The method for detecting irregular appearance defects of a magnetic glue inductor based on computer vision as claimed in claim 1, wherein the method for obtaining the high gray value interval is as follows:
acquiring a gray histogram according to the sequence from small gray values to large gray values in the gray image; the horizontal axis of the gray level histogram is a gray level value, and the vertical axis of the gray level histogram is the number of pixel points corresponding to each gray level value;
taking a gray value corresponding to the minimum number of pixel points in the gray histogram as a target gray value;
and taking a gray value interval between the target gray value and the maximum gray value in the gray histogram as a high gray value interval.
3. The method for detecting irregular appearance defects of magnetic glue inductance based on computer vision according to claim 1, wherein the method for constructing the first preset window of each pixel in the gray image and obtaining the noise level value of each pixel in the gray image according to the gray value difference between the gray value in the high gray value interval and the gray value of each pixel in the gray image and the gray value distribution in the first preset window of each pixel comprises the following steps:
acquiring an average value of gray values in a high gray value interval as a first average value;
for any pixel point in the gray level image, taking the pixel point as a center, and constructing a first preset window of the pixel point;
acquiring the difference between the gray value of the pixel point and the first average value as a first difference;
acquiring gray value differences between each pixel point in a first preset window of the pixel point and the pixel point as second differences;
and acquiring the noise degree value of the pixel point according to the first difference and the second difference.
4. The method for detecting irregular appearance defects of magnetic glue inductance based on computer vision as claimed in claim 3, wherein the calculation formula of the noise level value is as follows:
in the method, in the process of the invention,the noise level value of the j-th pixel point; />The gray value of the j-th pixel point; />Is the mth gray value in the high gray value interval; m is the total number of gray values in the high gray value interval; />The gray value of the ith pixel point in the first preset window of the jth pixel point is obtained; n is the total number of pixel points in the first preset window; />Is the first average value; />Is the first difference; />Is the second difference; />As a function of absolute value; exp is an exponential function based on a natural constant.
5. The method for detecting irregular appearance defects of magnetic glue inductance based on computer vision as claimed in claim 1, wherein the calculation formula of the filtering probability value is as follows:
in the method, in the process of the invention,a filtering probability value for the j-th pixel point; n is the total number of pixel points in the first preset window; />The noise degree value of the ith pixel point in the first preset window of the jth pixel point is obtained; />The noise level value of the j-th pixel point; />As a function of absolute value; norm is a normalization function.
6. The method for detecting irregular appearance defects of magnetic glue inductance based on computer vision as claimed in claim 1, wherein the method for screening out reference pixel points according to the filtering probability value is as follows:
and when the filtering probability value is larger than a preset filtering probability value threshold value, the corresponding pixel point is used as a reference pixel point.
7. The method for detecting irregular appearance defects of magnetic glue inductance based on computer vision as claimed in claim 1, wherein the calculation formula of the similarity degree is as follows:
in the method, in the process of the invention,a degree of similarity for the a-th reference pixel point; />A filtering probability value for the a-th reference pixel point; r is the total number of reference pixel points; n is the total number of pixel points in the first preset window; />The noise degree value of the ith pixel point in the first preset window of the (a) th reference pixel point is obtained; />The noise degree value of the ith pixel point in the first preset window of the ith reference pixel point is the noise degree value of the ith pixel point; />As a function of absolute value; exp is an exponential function based on a natural constant.
8. The method for detecting irregular appearance defects of magnetic glue inductance based on computer vision as claimed in claim 1, wherein the method for screening out suspected noise pixels according to the similarity degree is as follows:
when the similarity is greater than a preset similarity threshold, the corresponding reference pixel point is used as a suspected noise pixel point.
9. The method for detecting irregular appearance defects of magnetic glue inductance based on computer vision as claimed in claim 1, wherein the calculation formula of the filtering weight is as follows:
in the method, in the process of the invention,the filtering weight of the e suspected noise pixel point; k is the total number of suspected noise pixels; n is the total number of pixel points in the first preset window; />The noise degree value of the v neighborhood pixel point in the first preset window of the kth suspected noise pixel point is obtained; />The noise degree value of the v neighborhood pixel point in the first preset window of the e suspected noise pixel point is obtained; />The similarity degree of the e suspected noise pixel points is the similarity degree; />The gray value of the e suspected noise pixel point; />Is a first preset constant, which is greater than 0; />Is a second preset constant, greater than 0; norm is a normalization function.
10. The method for detecting irregular appearance defects of magnetic glue inductance based on computer vision according to claim 1, wherein the method for denoising each suspected noise pixel point according to the filtering weight to obtain a denoised gray image, performing defect detection, and determining a defect area in the gray image comprises the following steps:
for any suspected noise pixel point, acquiring a gray value average value of each pixel point in a first preset window of the suspected noise pixel point as a reference gray value of the suspected noise pixel point;
taking the product of the filtering weight of the suspected noise pixel point and the reference gray value as the denoising gray value of the suspected noise pixel point;
obtaining a denoised gray image according to the denoised gray value of each suspected noise pixel point;
and performing defect detection on the denoised gray image through an edge detection algorithm to determine a defect area in the gray image.
CN202311733742.0A 2023-12-18 2023-12-18 Magnetic glue inductance irregular appearance defect detection method based on computer vision Active CN117437219B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202311733742.0A CN117437219B (en) 2023-12-18 2023-12-18 Magnetic glue inductance irregular appearance defect detection method based on computer vision

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202311733742.0A CN117437219B (en) 2023-12-18 2023-12-18 Magnetic glue inductance irregular appearance defect detection method based on computer vision

Publications (2)

Publication Number Publication Date
CN117437219A true CN117437219A (en) 2024-01-23
CN117437219B CN117437219B (en) 2024-04-19

Family

ID=89551823

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202311733742.0A Active CN117437219B (en) 2023-12-18 2023-12-18 Magnetic glue inductance irregular appearance defect detection method based on computer vision

Country Status (1)

Country Link
CN (1) CN117437219B (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117764990A (en) * 2024-02-22 2024-03-26 苏州悦昇精密机械制造有限公司 method for detecting stamping quality of chassis
CN117788459A (en) * 2024-02-23 2024-03-29 青岛正大正电力环保设备有限公司 Chain abrasion detection method based on image characteristics
CN117764990B (en) * 2024-02-22 2024-05-17 苏州悦昇精密机械制造有限公司 Method for detecting stamping quality of chassis

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115222741A (en) * 2022-09-20 2022-10-21 江苏昱恒电气有限公司 Cable surface defect detection method
CN115272347A (en) * 2022-09-30 2022-11-01 中威泵业(江苏)有限公司 Bearing defect identification method
CN116309579A (en) * 2023-05-19 2023-06-23 惠州市宝惠电子科技有限公司 Transformer welding seam quality detection method using image processing
CN116363133A (en) * 2023-06-01 2023-06-30 无锡斯达新能源科技股份有限公司 Illuminator accessory defect detection method based on machine vision

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115222741A (en) * 2022-09-20 2022-10-21 江苏昱恒电气有限公司 Cable surface defect detection method
CN115272347A (en) * 2022-09-30 2022-11-01 中威泵业(江苏)有限公司 Bearing defect identification method
CN116309579A (en) * 2023-05-19 2023-06-23 惠州市宝惠电子科技有限公司 Transformer welding seam quality detection method using image processing
CN116363133A (en) * 2023-06-01 2023-06-30 无锡斯达新能源科技股份有限公司 Illuminator accessory defect detection method based on machine vision

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117764990A (en) * 2024-02-22 2024-03-26 苏州悦昇精密机械制造有限公司 method for detecting stamping quality of chassis
CN117764990B (en) * 2024-02-22 2024-05-17 苏州悦昇精密机械制造有限公司 Method for detecting stamping quality of chassis
CN117788459A (en) * 2024-02-23 2024-03-29 青岛正大正电力环保设备有限公司 Chain abrasion detection method based on image characteristics
CN117788459B (en) * 2024-02-23 2024-04-30 青岛正大正电力环保设备有限公司 Chain abrasion detection method based on image characteristics

Also Published As

Publication number Publication date
CN117437219B (en) 2024-04-19

Similar Documents

Publication Publication Date Title
CN111815630B (en) Defect detection method and device for LCD screen
CN109870461B (en) Electronic components quality detection system
CN116721106B (en) Profile flaw visual detection method based on image processing
CN109410230B (en) Improved Canny image edge detection method capable of resisting noise
CN116309570A (en) Titanium alloy bar quality detection method and system
CN117437219B (en) Magnetic glue inductance irregular appearance defect detection method based on computer vision
CN115829883A (en) Surface image denoising method for dissimilar metal structural member
CN105139391B (en) A kind of haze weather traffic image edge detection method
CN115100206B (en) Printing defect identification method for textile with periodic pattern
CN111047556B (en) Strip steel surface defect detection method and device
CN110648330B (en) Defect detection method for camera glass
CN116758083A (en) Quick detection method for metal wash basin defects based on computer vision
CN116740061B (en) Visual detection method for production quality of explosive beads
CN117372432B (en) Electronic cigarette surface defect detection method and system based on image segmentation
CN109239073A (en) A kind of detection method of surface flaw for body of a motor car
CN116363126B (en) Welding quality detection method for data line USB plug
CN115018835B (en) Automobile starter gear detection method
CN114332081B (en) Textile surface abnormity determination method based on image processing
CN117011291B (en) Watch shell quality visual detection method
CN116934746B (en) Scratch defect detection method, system, equipment and medium thereof
CN116883408B (en) Integrating instrument shell defect detection method based on artificial intelligence
CN113673396A (en) Spore germination rate calculation method and device and storage medium
CN110378271B (en) Gait recognition equipment screening method based on quality dimension evaluation parameters
CN114693543B (en) Image noise reduction method and device, image processing chip and image acquisition equipment
CN110378270B (en) Screening method of face recognition equipment based on quality dimension evaluation parameters

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
GR01 Patent grant
GR01 Patent grant