CN109300127A - Defect inspection method, device, computer equipment and storage medium - Google Patents

Defect inspection method, device, computer equipment and storage medium Download PDF

Info

Publication number
CN109300127A
CN109300127A CN201811110575.3A CN201811110575A CN109300127A CN 109300127 A CN109300127 A CN 109300127A CN 201811110575 A CN201811110575 A CN 201811110575A CN 109300127 A CN109300127 A CN 109300127A
Authority
CN
China
Prior art keywords
gaussian
defect
image
target
difference
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
CN201811110575.3A
Other languages
Chinese (zh)
Other versions
CN109300127B (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.)
Shenzhen Xinshizhi Technology Co., Ltd.
Original Assignee
Zhongxing New Communication 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 Zhongxing New Communication Co Ltd filed Critical Zhongxing New Communication Co Ltd
Priority to CN201811110575.3A priority Critical patent/CN109300127B/en
Publication of CN109300127A publication Critical patent/CN109300127A/en
Application granted granted Critical
Publication of CN109300127B publication Critical patent/CN109300127B/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
    • G06T5/00Image enhancement or restoration
    • G06T5/70Denoising; Smoothing
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/60Analysis of geometric attributes
    • G06T7/62Analysis of geometric attributes of area, perimeter, diameter or volume
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/70Determining position or orientation of objects or cameras

Landscapes

  • Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Quality & Reliability (AREA)
  • Geometry (AREA)
  • Investigating Materials By The Use Of Optical Means Adapted For Particular Applications (AREA)
  • Image Analysis (AREA)
  • Image Processing (AREA)

Abstract

This application involves a kind of defect inspection methods, this method comprises: obtaining the corresponding target image of target subject to be detected, difference of Gaussian is carried out to the target image to handle to obtain difference of Gaussian image, when determining that there are when multiple defects in the target subject according to the difference of Gaussian image, obtain position of each defect in the target image, the registration between defect two-by-two is calculated according to the position of each defect, defect merging is carried out according to the registration, the target defect information after determining merging corresponding with the target subject.Furthermore, it is also proposed that a kind of defect detecting device, computer equipment and storage medium.

Description

Defect inspection method, device, computer equipment and storage medium
Technical field
The present invention relates to field of computer technology, more particularly, to a kind of defect inspection method, device, computer equipment and Storage medium.
Background technique
In the industrial production, it needs to carry out defects detection to the product produced, for example, going out cloth in textile production Afterwards, it needs to detect in cloth and improves cloth quality with the presence or absence of flaw or defect convenient for repairing in time.Traditional defects detection Although there are many kinds of methods, or detection effect is bad or computationally intensive, low efficiency.Therefore, there is an urgent need for propose one kind High-efficient and good effect defect inspection method.
Summary of the invention
Based on this, it is necessary in view of the above-mentioned problems, provide a kind of high-efficient and good effect defect inspection method, device, Computer equipment and storage medium.
In a first aspect, the embodiment of the present invention provides a kind of defect inspection method, which comprises
Obtain the corresponding target image of target subject to be detected;
Difference of Gaussian is carried out to the target image to handle to obtain difference of Gaussian image;
When determining that there are when multiple defects, obtain each defect to exist in the target subject according to the difference of Gaussian image Position in the target image;
The registration between defect two-by-two is calculated according to the position of each defect, defect conjunction is carried out according to the registration And determine the target defect information after merging corresponding with the target subject.
It is described in one of the embodiments, that target image progress difference of Gaussian is handled to obtain Gaussian difference component Picture, comprising: obtain the first Gaussian kernel and the second Gaussian kernel;Place is filtered to the target image using first Gaussian kernel Reason, obtains the first gaussian filtering image;The target image is filtered using second Gaussian kernel, obtains second Gaussian filtering image;Difference, which is carried out, according to the first gaussian filtering image and the second gaussian filtering image obtains the Gaussian difference Partial image.
The registration calculated according to the position of each defect between defect two-by-two in one of the embodiments, root Defect merging is carried out according to the registration, the target defect information after determining merging corresponding with the target subject, comprising: meter Calculate the intersection area between defect and two-by-two the union area between defect two-by-two;According to the intersection face between the defect two-by-two Union areal calculation between long-pending and corresponding defect two-by-two obtains the registration between defect two-by-two;When the defect two-by-two it Between registration be greater than preset threshold when, then corresponding two defects are merged.
The target subject is cloth in one of the embodiments, and the target image is cloth image.
The first Gaussian kernel of the acquisition and the second Gaussian kernel in one of the embodiments, comprising: obtain two initial high This core, using described two initial Gaussian cores as current first Gaussian kernel and current second Gaussian kernel;According to described current First Gaussian kernel and current second Gaussian kernel carry out difference processing to the target image and obtain current difference of Gaussian image; Defect present in the target subject is determined according to the current difference of Gaussian image, and it is corresponding current scarce to calculate each defect Fall into the gross area;When the current defect gross area be less than preset area threshold when, then update current first Gaussian kernel and Current second Gaussian kernel, into according to current first Gaussian kernel and current second Gaussian kernel to the target image into Row difference processing obtains the step of current difference of Gaussian image, when the current defect gross area is not less than preset area threshold Stop, using the current defect gross area not less than preset area threshold as the target defect gross area;By the target defect Corresponding two Gaussian kernels of the gross area are respectively as the second Gaussian kernel of the first Gaussian kernel of target and target.
In one of the embodiments, target image progress difference of Gaussian is handled to obtain Gaussian difference component described Before picture, further includes: carry out gray proces to the target image, obtain gray scale target image;It is described to the target image It carries out difference of Gaussian to handle to obtain difference of Gaussian image, comprising: carry out difference of Gaussian to the gray scale target image and handle to obtain Difference of Gaussian image.
Second aspect, the embodiment of the present invention provide a kind of cloth defect detecting device, and described device includes:
Image collection module, for obtaining the corresponding target image of target subject to be detected;
Differential processing module handles to obtain difference of Gaussian image for carrying out difference of Gaussian to the target image;
Position acquisition module determines that there are multiple defects in the target subject according to the difference of Gaussian image for working as When, obtain position of each defect in the target image;
Defect determining module, for calculating the registration between defect two-by-two according to the position of each defect, according to described Registration carries out defect merging, the target defect information after determining merging corresponding with the target subject.
In one embodiment, differential processing module is also used to obtain the first Gaussian kernel and the second Gaussian kernel, using described First Gaussian kernel is filtered the target image, obtains the first gaussian filtering image, using second Gaussian kernel The target image is filtered, the second gaussian filtering image is obtained, according to the first gaussian filtering image and Two gaussian filtering images carry out difference and obtain the difference of Gaussian image.
In one embodiment, defect determining module, for calculating intersection area between defect two-by-two and two-by-two defect Between union area;According to the intersection area between the defect two-by-two and the union area meter between corresponding defect two-by-two Calculation obtains the registration between defect two-by-two;It, then will be corresponding when the registration between the defect two-by-two is greater than preset threshold Two defects merge.
In one embodiment, the target subject is cloth, and the target image is cloth image.
In one embodiment, differential processing module is also used to obtain two initial Gaussian cores, by described two initial height This core is respectively as current first Gaussian kernel and current second Gaussian kernel;According to current first Gaussian kernel and described current Two Gaussian kernels carry out difference processing to the target image and obtain current difference of Gaussian image;According to the current Gaussian difference component As determining defect present in the target subject, the corresponding current defect gross area of each defect is calculated;When described current scarce When falling into the gross area less than preset area threshold, then current first Gaussian kernel and current second Gaussian kernel are updated, into root Difference processing is carried out to the target image according to current first Gaussian kernel and current second Gaussian kernel and obtains current height The step of this difference image, stops when the current defect gross area is not less than preset area threshold, will be not less than preset The current defect gross area of area threshold is as the target defect gross area;By corresponding two Gausses of the target defect gross area Core is respectively as the second Gaussian kernel of the first Gaussian kernel of target and target.
In one embodiment, drawbacks described above detection device further include: gradation processing module, for the target image Gray proces are carried out, gray scale target image is obtained;The differential processing module is also used to carry out the gray scale target image high This difference processing obtains difference of Gaussian image.
A kind of computer readable storage medium is stored with computer program, when the computer program is executed by processor, So that the processor executes following steps:
Obtain the corresponding target image of target subject to be detected;
Difference of Gaussian is carried out to the target image to handle to obtain difference of Gaussian image;
When determining that there are when multiple defects, obtain each defect to exist in the target subject according to the difference of Gaussian image Position in the target image;
The registration between defect two-by-two is calculated according to the position of each defect, defect conjunction is carried out according to the registration And determine the target defect information after merging corresponding with the target subject.
A kind of computer equipment, including memory and processor, the memory are stored with computer program, the calculating When machine program is executed by the processor, so that the processor executes following steps:
Obtain the corresponding target image of target subject to be detected;
Difference of Gaussian is carried out to the target image to handle to obtain difference of Gaussian image;
When determining that there are when multiple defects, obtain each defect to exist in the target subject according to the difference of Gaussian image Position in the target image;
The registration between defect two-by-two is calculated according to the position of each defect, defect conjunction is carried out according to the registration And determine the target defect information after merging corresponding with the target subject.
Drawbacks described above detection method, device, computer equipment and storage medium, by carrying out difference of Gaussian to target image Processing obtains difference of Gaussian image, is then determined according to difference of Gaussian image every there are obtaining when multiple defects in target subject Then the position of a defect in the target image calculates the registration between defect two-by-two according to the position of each defect, then Defect merging is carried out according to registration, and determines the target defect information after merging corresponding with target subject.Drawbacks described above inspection Survey method first passes through difference of Gaussian and handles image, when determining has multiple defects, is merged, is obtained according to registration Target defect information, this method not only accelerate the time of detection processing, improve efficiency, and can more accurately detect The defect of target subject out.
Detailed description of the invention
In order to more clearly explain the embodiment of the invention or the technical proposal in the existing technology, to embodiment or will show below There is attached drawing needed in technical description to be briefly described, it should be apparent that, the accompanying drawings in the following description is only this Some embodiments of invention for those of ordinary skill in the art without creative efforts, can be with The structure shown according to these attached drawings obtains other attached drawings.
Fig. 1 is the flow chart of defect inspection method in one embodiment;
Fig. 2 is to orient the position of each defect and the schematic diagram of size in one embodiment;
Fig. 3 is the method flow diagram for carrying out difference of Gaussian processing in one embodiment to target image;
Fig. 4 is the schematic three dimensional views of DOG function in one embodiment;
Fig. 5 is the method flow diagram for carrying out defect merging in one embodiment according to registration;
Fig. 6 is the schematic diagram of intersection area and union area in one embodiment;
Fig. 7 A is the schematic diagram of cloth image in one embodiment;
Fig. 7 B is difference of Gaussian treated schematic diagram in one embodiment;
Fig. 7 C is the schematic diagram in one embodiment according to difference of Gaussian framing defect;
Fig. 8 is the flow diagram of defect inspection method in one embodiment;
Fig. 9 is the structural block diagram of defect detecting device in one embodiment;
Figure 10 is the structural block diagram of defect detecting device in another embodiment;
Figure 11 is the internal structure chart of computer equipment in one embodiment.
Specific embodiment
In order to make the objectives, technical solutions, and advantages of the present invention clearer, with reference to the accompanying drawings and embodiments, right The present invention is further elaborated.It should be appreciated that the specific embodiments described herein are merely illustrative of the present invention, and It is not used in the restriction present invention.
As shown in Figure 1, proposing a kind of defect inspection method, this method both can be used for terminal, also can be applied to take Business device, the present embodiment are illustrated with being applied to terminal.The defect inspection method specifically includes the following steps:
Step 102, the corresponding target image of target subject to be detected is obtained.
Wherein, target subject refers to that the object of defect to be detected, target image refer to the image of target subject.Target figure As that can be color image, or gray image can also be binary image.Target subject can be cloth, can also With film, glass etc. can also be.The acquisition of target image can be by calling the camera in terminal in real time to target master What body was shot, it is also possible to obtain from stored photograph album.
Step 104, difference of Gaussian is carried out to target image to handle to obtain difference of Gaussian image.
Wherein, difference of Gaussian (DOG, Difference of Gaussian) refers to using difference of Gaussian to target figure As the algorithm handled.Difference of Gaussian is a kind of enhancing algorithm, by by target image respectively with two various criterions The Gaussian kernel of difference carries out convolution algorithm, obtains two gaussian filtering images, and two gaussian filtering images are then carried out difference and are obtained To difference of Gaussian image.In one embodiment, the high frequency section shown in difference of Gaussian image be exactly detect it is defective Place, low frequency part represent it is normal, without defect, so can be obtained by target subject by obtained difference of Gaussian image In with the presence or absence of defect and defective locations and number.
Step 106, judged according to difference of Gaussian image with the presence or absence of multiple defects in target subject, if so, entering step Rapid 108, if it is not, then terminating.
Wherein, defect refers to flaw present in target subject.Gone out in target subject according to difference of Gaussian framing Defect and defective locations and number.In order to reduce the complexity of subsequent calculating and improve the efficiency of defect classification, if mesh There are when multiple defects, needing further to handle obtained defect in mark main body, if there is no lack in target subject It falls into or only exists a defect, then do not need to be further processed.
Step 108, the position of each defect in the target image is obtained.
Wherein, when in target subject there are when multiple defects, obtaining the position of each defect in the target image, defect Position can be positioned by the coordinate of the marginal point of Defect Edge, can be accurately located out defect by the coordinate of marginal point Size and location.As shown in Fig. 2, in one embodiment, the position for each defect oriented and the schematic diagram of size.
Step 110, the registration between defect two-by-two is calculated according to the position of each defect, defect is carried out according to registration Merge, the target defect information after determining merging corresponding with target subject.
Wherein, registration refers to the coincidence ratio between defect and defect.Defect merging refer to by multiple defect locations at One defect.Target defect information refers to the defect information for including in the target subject finally oriented, including defect number and Position.After being handled by difference of Gaussian, the same defect may be divided into multiple small defects, cause subsequent calculating complicated Degree increases.So in order to reduce the complexity of subsequent calculating, when obtaining multiple defects, by calculating the weight between defect two-by-two It is right, multiple small defects are then merged by a defect according to registration, combined process, which refers to, thinks multiple small defects It is the same defect, that is, thinks that multiple small defects constitute a defect, to greatly reduce the time of subsequent algorithm processing, together When also facilitate positioning or classification processing.
In one embodiment, registration can be according to the ratio of overlapping area and standard overlapping area between defect two-by-two Value determines, for example, tentative standard overlapping area is set as a constant, after obtaining the overlapping area between defect two-by-two, Using the ratio of overlapping area and the constant as registration.In another embodiment, the calculating of registration is also possible to basis Two-by-two the overlapping area between defect and two-by-two between defect the ratio of overlapping area does not determine.
Drawbacks described above detection method handles to obtain difference of Gaussian image, then by carrying out difference of Gaussian to target image It is determined in target subject according to difference of Gaussian image there are when multiple defects, obtaining the position of each defect in the target image, Then the registration between defect two-by-two is calculated according to the position of each defect, defect merging is then carried out according to registration, and Target defect information after determining merging corresponding with target subject.Drawbacks described above detection method first passes through difference of Gaussian to image It is handled, when determining has multiple defects, is merged according to registration, obtain target defect information, this method not only adds The fast time of detection processing, efficiency is improved, and can more accurately detect the defect of target subject.
As shown in figure 3, in one embodiment, difference of Gaussian is carried out to target image and handles to obtain difference of Gaussian image, Include:
Step 104A obtains the first Gaussian kernel and the second Gaussian kernel.
Wherein, the first Gaussian kernel is different from the second Gaussian kernel, i.e. the corresponding standard deviation of the first Gaussian kernel and the second Gaussian kernel Corresponding standard deviation is different.In one embodiment, the first Gaussian kernel and the second Gaussian kernel are preset, it is high convenient for subsequent progress This filtering processing.Different Gaussian kernels corresponds to different Gaussian templates, i.e., different Gaussian parameters.In another embodiment, The first Gaussian kernel and the second Gaussian kernel can be adaptive selected, convenient for preferably carrying out difference of Gaussian calculating.
Step 104B is filtered target image using the first Gaussian kernel, obtains the first gaussian filtering image.
Wherein, filtering processing refers to gaussian filtering process, and gaussian filtering can use low-pass filter, two gaussian filterings The bandpass filter that device subtracts each other only allows the band segment between two gaussian filterings to pass through, and prevents the wave of other frequencies Section passes through.The corresponding Gaussian kernel of different Gaussian filters is different.Target image is filtered using the first Gaussian kernel, The first gaussian filtering image is obtained by the way that target image and the first Gaussian kernel are carried out convolution algorithm.In one embodiment, DOG (difference of Gaussian) algorithm Gaussian function is defined as:
Wherein, σ1Indicate that variance, subscript 1 are used to distinguish different variances, x, y respectively represent abscissa and ordinate.It is high The formula of this filtering indicates are as follows: g1(x, y)=Gσ1(x, y) * f (x, y), wherein g1(x, y) indicates the first gaussian filtering image, f (x, y) indicates target image.
Step 104C is filtered target image using the second Gaussian kernel, obtains the second gaussian filtering image.
Wherein, convolution algorithm (filtering processing) is carried out using the second Gaussian kernel and target image and obtains the second gaussian filtering figure Picture.Corresponding gaussian filtering can indicate are as follows: g2(x, y)=Gσ2(x, y) * f (x, y), σ2Indicate that variance, subscript 2 are used to distinguish Different variances.
Step 104D carries out difference according to the first gaussian filtering image and the second gaussian filtering image and obtains Gaussian difference component Picture.
Wherein, after obtaining the first gaussian filtering image and the second gaussian filtering image, by two panel heights that will obtain this Filtering image subtracts each other to obtain: g1(x,y)-g2(x, y)=Gσ1(x,y)*f(x,y)-Gσ2(x, y) * f (x, y)=DOG*f (x, y). I.e. corresponding DOG is indicated are as follows: DOG=Gσ1(x,y)-Gσ2(x,y).As shown in figure 4, in one embodiment, the three of DOG function Tie up schematic diagram.
As shown in figure 5, in one embodiment, the registration between defect two-by-two is calculated according to the position of each defect, Defect merging is carried out according to registration, the target defect information after determining merging corresponding with target subject, comprising:
Step 110A calculates the intersection area between defect and two-by-two the union area between defect two-by-two.
Wherein, when there are when multiple defects, calculating defect two-by-two according to the position of each defect and size in target subject Between intersection area, and the union area between defect two-by-two.As shown in fig. 6, in one embodiment, intersection area and The schematic diagram of union area, A indicates a defect in figure, and B indicates another defect, intersection area, that is, A ∩ B area, union Area is area-intersection area of the area+B of A.
Step 110B, according to the intersection area between defect two-by-two and the union areal calculation between corresponding defect two-by-two Obtain the registration between defect two-by-two.
Wherein, registration is calculated using the ratio of intersection area and union area.Calculate the intersection between defect two-by-two Union area between area and two-by-two defect makees the intersection area between defect two-by-two with the ratio of corresponding union area For the registration between defect two-by-two.For example, if there is three defects A, B, C, then calculating separately A and B, A and C, B and C Between intersection area and union area, wherein the registration of A and B equal to A and B intersection area and A and B union area Ratio.In one embodiment, it is indicated using following formula: the registration=A ∩ B area/(face of the area+B of A The area of product-A ∩ B).
Step 110C then carries out corresponding two defects when the registration between defect two-by-two is greater than preset threshold Merge.
Wherein, the corresponding preset threshold of registration is preset, after the registration between defect two-by-two is calculated, judgement Whether registration is greater than preset threshold, if so, illustrating that the two may be considered the same defect, then corresponding two are lacked It falls into and merges, if it is not, then terminating.
In one embodiment, target subject is cloth, and target image is cloth image.Cloth image is carried out first high This difference processing obtains the corresponding difference of Gaussian image of cloth, determines defect present in cloth according to difference of Gaussian image, when It when defect has multiple, is merged according to the registration between defect two-by-two, the target defect information after being merged.Such as Fig. 7 A It is shown, it is the schematic diagram of cloth image, as shown in Figure 7 B, for the height obtained after difference of Gaussian is handled in one embodiment The schematic diagram of this difference image, Fig. 7 C are the schematic diagram according to difference of Gaussian framing defect.
In one embodiment, the first Gaussian kernel and the second Gaussian kernel are obtained, comprising: two initial Gaussian cores are obtained, it will Two initial Gaussian cores are respectively as current first Gaussian kernel and current second Gaussian kernel;According to current first Gaussian kernel and currently Second Gaussian kernel carries out difference processing to target image and obtains current difference of Gaussian image;It is determined according to current difference of Gaussian image Defect present in target subject calculates the corresponding current defect gross area of each defect;When the current defect gross area is less than in advance If area threshold when, then update current first Gaussian kernel and current second Gaussian kernel, into according to current first Gaussian kernel and Current second Gaussian kernel carries out the step of difference processing obtains current difference of Gaussian image to target image, until current defect is total Area stops when being not less than preset area threshold, using the current defect gross area not less than preset area threshold as target Defective area;Corresponding two Gaussian kernels of the target defect gross area is high as the first Gaussian kernel of target and target second This core.
Wherein, in order to adaptively choose suitable first Gaussian kernel and the second Gaussian kernel, by obtaining at the beginning of two Beginning Gaussian kernel, initial Gaussian core can be preset, using two initial Gaussian cores as current first Gaussian kernel and currently Then second Gaussian kernel carries out difference processing according to current first Gaussian kernel and the second Gaussian kernel and obtains current Gaussian difference component Then picture determines defect present in target subject according to current difference of Gaussian image, it is corresponding current scarce to calculate all defect The gross area is fallen into, the current defect gross area is compared with preset area threshold, if it is less than preset area threshold value, is then illustrated Current first Gaussian kernel and current second Gaussian kernel are not suitable for, according to preparatory current first Gaussian kernel of Policy Updates and current the Two Gaussian kernels then proceed to calculate the corresponding current defect gross area, when the current defect gross area is not less than preset threshold Stop, and using corresponding two Gaussian kernels as the second Gaussian kernel of the first Gaussian kernel of target and target.
In one embodiment, it before carrying out difference of Gaussian to target image and handling to obtain difference of Gaussian image, also wraps It includes: gray proces being carried out to target image, obtain gray scale target image;Difference of Gaussian is carried out to target image to handle to obtain Gauss Difference image, comprising: difference of Gaussian is carried out to gray scale target image and handles to obtain difference of Gaussian image.
Wherein, before handling target image, it is necessary first to target image be carried out gray proces, obtained corresponding Gray scale target image, then to gray scale target image carry out difference of Gaussian handle to obtain difference of Gaussian image.
As shown in figure 8, in one embodiment, the flow diagram of defect inspection method.Firstly, being carried out to target image Gray proces obtain gray scale target image, then carry out gray scale target image at gaussian filtering with different Gaussian kernels respectively Reason obtains the first Gaussian image and the second Gaussian image, later, carries out difference according to the first Gaussian image and the second Gaussian image Difference of Gaussian image is obtained, after multiple defects have been determined according to difference of Gaussian image, calculates the registration between defect two-by-two, so A defect defect will be merged into two-by-two according to registration afterwards.
As shown in figure 9, in one embodiment it is proposed that a kind of defect detecting device, the device include:
Image collection module 902, for obtaining the corresponding target image of target subject to be detected;
Differential processing module 904 handles to obtain difference of Gaussian image for carrying out difference of Gaussian to the target image;
Position acquisition module 906 determines that there are multiple in the target subject according to the difference of Gaussian image for working as When defect, position of each defect in the target image is obtained;
Defect determining module 908, for calculating the registration between defect two-by-two according to the position of each defect, according to institute It states registration and carries out defect merging, the target defect information after determining merging corresponding with the target subject.
In one embodiment, differential processing module is also used to obtain the first Gaussian kernel and the second Gaussian kernel, using described First Gaussian kernel is filtered the target image, obtains the first gaussian filtering image, using second Gaussian kernel The target image is filtered, the second gaussian filtering image is obtained, according to the first gaussian filtering image and Two gaussian filtering images carry out difference and obtain the difference of Gaussian image.
In one embodiment, defect determining module, for calculating intersection area between defect two-by-two and two-by-two defect Between union area;According to the intersection area between the defect two-by-two and the union area meter between corresponding defect two-by-two Calculation obtains the registration between defect two-by-two;It, then will be corresponding when the registration between the defect two-by-two is greater than preset threshold Two defects merge.
In one embodiment, the target subject is cloth, and the target image is cloth image.
In one embodiment, differential processing module is also used to obtain two initial Gaussian cores, by described two initial height This core is respectively as current first Gaussian kernel and current second Gaussian kernel;According to current first Gaussian kernel and described current Two Gaussian kernels carry out difference processing to the target image and obtain current difference of Gaussian image;According to the current Gaussian difference component As determining defect present in the target subject, the corresponding current defect gross area of each defect is calculated;When described current scarce When falling into the gross area less than preset area threshold, then current first Gaussian kernel and current second Gaussian kernel are updated, into root Difference processing is carried out to the target image according to current first Gaussian kernel and current second Gaussian kernel and obtains current height The step of this difference image, stops when the current defect gross area is not less than preset area threshold, will be not less than preset The current defect gross area of area threshold is as the target defect gross area;By corresponding two Gausses of the target defect gross area Core is respectively as the second Gaussian kernel of the first Gaussian kernel of target and target.
As shown in Figure 10, in one embodiment, drawbacks described above detection device further include:
Gradation processing module 903 obtains gray scale target image for carrying out gray proces to the target image;
The differential processing module is also used to carry out difference of Gaussian to the gray scale target image to handle to obtain difference of Gaussian Image.
Figure 11 shows the internal structure chart of computer equipment in one embodiment.The computer equipment specifically can be clothes Business device, is also possible to terminal.As shown in figure 11, which includes processor, the memory connected by system bus And network interface.Wherein, memory includes non-volatile memory medium and built-in storage.The non-volatile of the computer equipment is deposited Storage media is stored with operating system, can also be stored with computer program, when which is executed by processor, may make place It manages device and realizes defect inspection method.Computer program can also be stored in the built-in storage, which is held by processor When row, processor may make to execute defect inspection method.It will be understood by those skilled in the art that structure shown in Figure 11, only It is only the block diagram of part-structure relevant to application scheme, does not constitute the computer being applied thereon to application scheme The restriction of equipment, specific computer equipment may include than more or fewer components as shown in the figure, or the certain portions of combination Part, or with different component layouts.
In one embodiment, defect inspection method provided by the present application can be implemented as a kind of shape of computer program Formula, computer program can be run in computer equipment as shown in figure 11.Composition can be stored in the memory of computer equipment Each program module of the defect detecting device.For example, image collection module 902, differential processing module 904 and position acquisition mould Block 906.
In one embodiment it is proposed that a kind of computer equipment, including memory and processor, the memory storage There is computer program, when the computer program is executed by the processor, so that the processor executes following steps: obtaining The corresponding target image of target subject to be detected;Difference of Gaussian is carried out to the target image to handle to obtain Gaussian difference component Picture;When determining that there are when multiple defects, obtain each defect described in the target subject according to the difference of Gaussian image Position in target image;Calculate the registration between defect two-by-two according to the position of each defect, according to the registration into Row defect merges, the target defect information after determining merging corresponding with the target subject.
In one embodiment, described that target image progress difference of Gaussian is handled to obtain difference of Gaussian image, it wraps It includes: obtaining the first Gaussian kernel and the second Gaussian kernel;The target image is filtered using first Gaussian kernel, is obtained To the first gaussian filtering image;The target image is filtered using second Gaussian kernel, obtains the second Gauss Filtering image;Difference, which is carried out, according to the first gaussian filtering image and the second gaussian filtering image obtains the Gaussian difference component Picture.
In one embodiment, the registration calculated according to the position of each defect between defect two-by-two, according to institute It states registration and carries out defect merging, the target defect information after determining merging corresponding with the target subject, comprising: calculate two Intersection area between two defects and two-by-two the union area between defect;According between the defect two-by-two intersection area and Union areal calculation between corresponding defect two-by-two obtains the registration between defect two-by-two;When between the defect two-by-two When registration is greater than preset threshold, then corresponding two defects are merged.
In one embodiment, the target subject is cloth, and the target image is cloth image.
In one embodiment, the first Gaussian kernel of the acquisition and the second Gaussian kernel, comprising: obtain two initial Gaussians Core, using described two initial Gaussian cores as current first Gaussian kernel and current second Gaussian kernel;According to described current One Gaussian kernel and current second Gaussian kernel carry out difference processing to the target image and obtain current difference of Gaussian image;Root Defect present in the target subject is determined according to the current difference of Gaussian image, calculates the corresponding current defect of each defect The gross area;When the current defect gross area is less than preset area threshold, then updates current first Gaussian kernel and work as Preceding second Gaussian kernel carries out the target image into according to current first Gaussian kernel and current second Gaussian kernel Difference processing obtains the step of current difference of Gaussian image, stops when the current defect gross area is not less than preset area threshold Only, using the current defect gross area not less than preset area threshold as the target defect gross area;The target defect is total Corresponding two Gaussian kernels of area are respectively as the second Gaussian kernel of the first Gaussian kernel of target and target.
In one embodiment, it is described to the target image carry out difference of Gaussian handle to obtain difference of Gaussian image it Before, the computer program, which is also used to perform the steps of when being executed by the processor, carries out gray scale to the target image Processing, obtains gray scale target image;It is described that target image progress difference of Gaussian is handled to obtain difference of Gaussian image, it wraps It includes: difference of Gaussian being carried out to the gray scale target image and handles to obtain difference of Gaussian image.
In one embodiment it is proposed that a kind of computer readable storage medium, is stored with computer program, the calculating When machine program is executed by processor, so that the processor executes following steps: obtaining the corresponding mesh of target subject to be detected Logo image;Difference of Gaussian is carried out to the target image to handle to obtain difference of Gaussian image;When according to the difference of Gaussian image Determine that there are when multiple defects, obtain position of each defect in the target image in the target subject;According to each The position of defect calculates the registration between defect two-by-two, carries out defect merging, the determining and target according to the registration Target defect information after the corresponding merging of main body.
In one embodiment, described that target image progress difference of Gaussian is handled to obtain difference of Gaussian image, it wraps It includes: obtaining the first Gaussian kernel and the second Gaussian kernel;The target image is filtered using first Gaussian kernel, is obtained To the first gaussian filtering image;The target image is filtered using second Gaussian kernel, obtains the second Gauss Filtering image;Difference, which is carried out, according to the first gaussian filtering image and the second gaussian filtering image obtains the Gaussian difference component Picture.
In one embodiment, the registration calculated according to the position of each defect between defect two-by-two, according to institute It states registration and carries out defect merging, the target defect information after determining merging corresponding with the target subject, comprising: calculate two Intersection area between two defects and two-by-two the union area between defect;According between the defect two-by-two intersection area and Union areal calculation between corresponding defect two-by-two obtains the registration between defect two-by-two;When between the defect two-by-two When registration is greater than preset threshold, then corresponding two defects are merged.
In one embodiment, the target subject is cloth, and the target image is cloth image.
In one embodiment, the first Gaussian kernel of the acquisition and the second Gaussian kernel, comprising: obtain two initial Gaussians Core, using described two initial Gaussian cores as current first Gaussian kernel and current second Gaussian kernel;According to described current One Gaussian kernel and current second Gaussian kernel carry out difference processing to the target image and obtain current difference of Gaussian image;Root Defect present in the target subject is determined according to the current difference of Gaussian image, calculates the corresponding current defect of each defect The gross area;When the current defect gross area is less than preset area threshold, then updates current first Gaussian kernel and work as Preceding second Gaussian kernel carries out the target image into according to current first Gaussian kernel and current second Gaussian kernel Difference processing obtains the step of current difference of Gaussian image, stops when the current defect gross area is not less than preset area threshold Only, using the current defect gross area not less than preset area threshold as the target defect gross area;The target defect is total Corresponding two Gaussian kernels of area are respectively as the second Gaussian kernel of the first Gaussian kernel of target and target.
In one embodiment, it is described to the target image carry out difference of Gaussian handle to obtain difference of Gaussian image it Before, the computer program, which is also used to perform the steps of when being executed by the processor, carries out gray scale to the target image Processing, obtains gray scale target image;It is described that target image progress difference of Gaussian is handled to obtain difference of Gaussian image, it wraps It includes: difference of Gaussian being carried out to the gray scale target image and handles to obtain difference of Gaussian image.
Those of ordinary skill in the art will appreciate that realizing all or part of the process in above-described embodiment method, being can be with Relevant hardware is instructed to complete by computer program, the program can be stored in a non-volatile computer and can be read In storage medium, the program is when being executed, it may include such as the process of the embodiment of above-mentioned each method.Wherein, provided herein Each embodiment used in any reference to memory, storage, database or other media, may each comprise non-volatile And/or volatile memory.Nonvolatile memory may include that read-only memory (ROM), programming ROM (PROM), electricity can be compiled Journey ROM (EPROM), electrically erasable ROM (EEPROM) or flash memory.Volatile memory may include random access memory (RAM) or external cache.By way of illustration and not limitation, RAM is available in many forms, such as static state RAM (SRAM), dynamic ram (DRAM), synchronous dram (SDRAM), double data rate sdram (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronization link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) directly RAM (RDRAM), straight Connect memory bus dynamic ram (DRDRAM) and memory bus dynamic ram (RDRAM) etc..
Each technical characteristic of above embodiments can be combined arbitrarily, for simplicity of description, not to above-described embodiment In each technical characteristic it is all possible combination be all described, as long as however, the combination of these technical characteristics be not present lance Shield all should be considered as described in this specification.
The several embodiments of the application above described embodiment only expresses, the description thereof is more specific and detailed, but simultaneously The limitation to the application the scope of the patents therefore cannot be interpreted as.It should be pointed out that for those of ordinary skill in the art For, without departing from the concept of this application, various modifications and improvements can be made, these belong to the guarantor of the application Protect range.Therefore, the scope of protection shall be subject to the appended claims for the application patent.

Claims (10)

1. a kind of defect inspection method, which is characterized in that the described method includes:
Obtain the corresponding target image of target subject to be detected;
Difference of Gaussian is carried out to the target image to handle to obtain difference of Gaussian image;
When determining that there are when multiple defects, obtain each defect described in the target subject according to the difference of Gaussian image Position in target image;
The registration between defect two-by-two is calculated according to the position of each defect, defect merging is carried out according to the registration, really Target defect information after fixed merging corresponding with the target subject.
2. the method according to claim 1, wherein described handle target image progress difference of Gaussian To difference of Gaussian image, comprising:
Obtain the first Gaussian kernel and the second Gaussian kernel;
The target image is filtered using first Gaussian kernel, obtains the first gaussian filtering image;
The target image is filtered using second Gaussian kernel, obtains the second gaussian filtering image;
Difference, which is carried out, according to the first gaussian filtering image and the second gaussian filtering image obtains the difference of Gaussian image.
3. the method according to claim 1, wherein it is described according to the position of each defect calculate two-by-two defect it Between registration, defect merging is carried out according to the registration, the target after determining corresponding with target subject merging is scarce Fall into information, comprising:
Calculate the intersection area between defect and two-by-two the union area between defect two-by-two;
It is obtained two-by-two according to the intersection area between the defect two-by-two and the union areal calculation between corresponding defect two-by-two Registration between defect;
When the registration between the defect two-by-two is greater than preset threshold, then corresponding two defects are merged.
4. the target image is cloth the method according to claim 1, wherein the target subject is cloth Image.
5. according to the method described in claim 2, it is characterized in that, the first Gaussian kernel of the acquisition and the second Gaussian kernel, comprising:
Two initial Gaussian cores are obtained, using described two initial Gaussian cores as current first Gaussian kernel and current second high This core;
Difference processing is carried out to the target image according to current first Gaussian kernel and current second Gaussian kernel to obtain Current difference of Gaussian image;
Defect present in the target subject is determined according to the current difference of Gaussian image, calculates that each defect is corresponding to be worked as Preceding defective area;
When the current defect gross area is less than preset area threshold, then current first Gaussian kernel and current the are updated Two Gaussian kernels carry out difference to the target image into according to current first Gaussian kernel and current second Gaussian kernel The step of processing obtains current difference of Gaussian image stops when the current defect gross area is not less than preset area threshold, Using the current defect gross area not less than preset area threshold as the target defect gross area;
Using corresponding two Gaussian kernels of the target defect gross area as the second Gauss of the first Gaussian kernel of target and target Core.
6. the method according to claim 1, wherein carrying out difference of Gaussian processing to the target image described Before obtaining difference of Gaussian image, further includes:
Gray proces are carried out to the target image, obtain gray scale target image;
It is described that target image progress difference of Gaussian is handled to obtain difference of Gaussian image, comprising:
Difference of Gaussian is carried out to the gray scale target image to handle to obtain difference of Gaussian image.
7. a kind of defect detecting device, which is characterized in that described device includes:
Image collection module, for obtaining the corresponding target image of target subject to be detected;
Differential processing module handles to obtain difference of Gaussian image for carrying out difference of Gaussian to the target image;
Position acquisition module, for determining in the target subject when according to the difference of Gaussian image there are when multiple defects, Obtain position of each defect in the target image;
Defect determining module, for calculating the registration between defect two-by-two according to the position of each defect, according to the coincidence Degree carries out defect merging, the target defect information after determining merging corresponding with the target subject.
8. device according to claim 7, which is characterized in that the differential processing module is also used to obtain the first Gaussian kernel With the second Gaussian kernel, the target image is filtered using the first Gaussian kernel, the first gaussian filtering image is obtained, adopts The target image is filtered with the second Gaussian kernel, obtains the second gaussian filtering image, according to first Gauss Filtering image and the second gaussian filtering image carry out difference and obtain the difference of Gaussian image.
9. a kind of computer readable storage medium, be stored with computer program makes when the computer program is executed by processor The processor is obtained to execute such as the step of any one of claims 1 to 6 the method.
10. a kind of computer equipment, including memory and processor, the memory is stored with computer program, the calculating When machine program is executed by the processor, so that the processor executes the step such as any one of claims 1 to 6 the method Suddenly.
CN201811110575.3A 2018-09-21 2018-09-21 Defect detection method, defect detection device, computer equipment and storage medium Active CN109300127B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201811110575.3A CN109300127B (en) 2018-09-21 2018-09-21 Defect detection method, defect detection device, computer equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201811110575.3A CN109300127B (en) 2018-09-21 2018-09-21 Defect detection method, defect detection device, computer equipment and storage medium

Publications (2)

Publication Number Publication Date
CN109300127A true CN109300127A (en) 2019-02-01
CN109300127B CN109300127B (en) 2021-02-05

Family

ID=65163875

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201811110575.3A Active CN109300127B (en) 2018-09-21 2018-09-21 Defect detection method, defect detection device, computer equipment and storage medium

Country Status (1)

Country Link
CN (1) CN109300127B (en)

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110161045A (en) * 2019-05-17 2019-08-23 深圳新视智科技术有限公司 Surface defects detection system and method
CN110208284A (en) * 2019-05-27 2019-09-06 武汉中导光电设备有限公司 A kind of method and system of multichannel defect combined analysis
CN111768357A (en) * 2019-03-29 2020-10-13 银河水滴科技(北京)有限公司 Image detection method and device
CN112801930A (en) * 2019-10-28 2021-05-14 上海铼钠克数控科技股份有限公司 Method and equipment for detecting warp and weft defects of fabric in backlight based on machine vision
CN114387248A (en) * 2022-01-12 2022-04-22 苏州天准科技股份有限公司 Silicon material melting degree monitoring method, storage medium, terminal and crystal pulling equipment
CN117351011A (en) * 2023-12-04 2024-01-05 歌尔股份有限公司 Screen defect detection method, apparatus, and readable storage medium

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104134211A (en) * 2014-07-23 2014-11-05 西安工程大学 Band steel defect detection method based on multi-resolution filtering of Gaussian filter
CN104463232A (en) * 2014-12-30 2015-03-25 中山大学 Density crowd counting method based on HOG characteristic and color histogram characteristic
CN105184777A (en) * 2015-08-18 2015-12-23 西安工程大学 Painted design fabric defect detection method based on image decomposition
CN103871053B (en) * 2014-02-25 2017-02-01 苏州大学 Vision conspicuousness-based cloth flaw detection method

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103871053B (en) * 2014-02-25 2017-02-01 苏州大学 Vision conspicuousness-based cloth flaw detection method
CN104134211A (en) * 2014-07-23 2014-11-05 西安工程大学 Band steel defect detection method based on multi-resolution filtering of Gaussian filter
CN104463232A (en) * 2014-12-30 2015-03-25 中山大学 Density crowd counting method based on HOG characteristic and color histogram characteristic
CN105184777A (en) * 2015-08-18 2015-12-23 西安工程大学 Painted design fabric defect detection method based on image decomposition

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
梦游太空2000: "Halcon学习笔记之缺陷检测(二)", 《HTTPS://WWW.CNBLOGS.COM/SLEEPWALKER/P/3625449.HTML》 *

Cited By (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111768357A (en) * 2019-03-29 2020-10-13 银河水滴科技(北京)有限公司 Image detection method and device
CN111768357B (en) * 2019-03-29 2024-03-01 银河水滴科技(北京)有限公司 Image detection method and device
CN110161045A (en) * 2019-05-17 2019-08-23 深圳新视智科技术有限公司 Surface defects detection system and method
CN110208284A (en) * 2019-05-27 2019-09-06 武汉中导光电设备有限公司 A kind of method and system of multichannel defect combined analysis
CN110208284B (en) * 2019-05-27 2021-09-17 武汉中导光电设备有限公司 Method and system for multi-channel defect merging analysis
CN112801930A (en) * 2019-10-28 2021-05-14 上海铼钠克数控科技股份有限公司 Method and equipment for detecting warp and weft defects of fabric in backlight based on machine vision
CN114387248A (en) * 2022-01-12 2022-04-22 苏州天准科技股份有限公司 Silicon material melting degree monitoring method, storage medium, terminal and crystal pulling equipment
CN114387248B (en) * 2022-01-12 2022-11-25 苏州天准科技股份有限公司 Silicon material melting degree monitoring method, storage medium, terminal and crystal pulling equipment
CN117351011A (en) * 2023-12-04 2024-01-05 歌尔股份有限公司 Screen defect detection method, apparatus, and readable storage medium
CN117351011B (en) * 2023-12-04 2024-03-12 歌尔股份有限公司 Screen defect detection method, apparatus, and readable storage medium

Also Published As

Publication number Publication date
CN109300127B (en) 2021-02-05

Similar Documents

Publication Publication Date Title
CN109300127A (en) Defect inspection method, device, computer equipment and storage medium
CN111815630B (en) Defect detection method and device for LCD screen
CN111325713B (en) Neural network-based wood defect detection method, system and storage medium
CN110414507B (en) License plate recognition method and device, computer equipment and storage medium
CN109632808B (en) Edge defect detection method and device, electronic equipment and storage medium
CN108416789A (en) Method for detecting image edge and system
CN109671058B (en) Defect detection method and system for large-resolution image
CN108022233A (en) A kind of edge of work extracting method based on modified Canny operators
CN109671078B (en) Method and device for detecting product surface image abnormity
CN108896278A (en) A kind of optical filter silk-screen defect inspection method, device and terminal device
CN110458301A (en) A kind of damage identification method of vehicle part, device, computer equipment and storage medium
CN115908415B (en) Edge-based defect detection method, device, equipment and storage medium
CN109949227A (en) Image split-joint method, system and electronic equipment
CN110378313A (en) Cell mass recognition methods, device and electronic equipment
CN113012157B (en) Visual detection method and system for equipment defects
CN104880389A (en) Mixed crystal degree automatic measurement and fine classification method for steel crystal grains, and system thereof
CN109101976B (en) Method for detecting surface defects of arc-extinguishing grid plate
CN113554649B (en) Defect detection method and device, computer equipment and storage medium
CN110378254B (en) Method and system for identifying vehicle damage image modification trace, electronic device and storage medium
CN110599453A (en) Panel defect detection method and device based on image fusion and equipment terminal
CN112750104B (en) Method and device for automatically matching optimal camera by monitoring ship through multiple cameras
CN107194393A (en) A kind of method and device for detecting Provisional Number Plate
CN117392042A (en) Defect detection method, defect detection apparatus, and storage medium
CN112669295A (en) Lithium battery pole piece defect detection method based on secondary threshold segmentation theory
CN115829995A (en) Cloth flaw detection method and system based on pixel-level multi-scale feature fusion

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
TA01 Transfer of patent application right

Effective date of registration: 20190628

Address after: 518000 Shenzhen City, Guangdong Province, Luohu District, Liantang Street, Pengxing Community, Pengxing Road, No. 2 Pengji Industrial Zone, 710 buildings, six floors

Applicant after: Shenzhen Xinshizhi Technology Co., Ltd.

Address before: 518000 6th Floor, 710 Building, Liantang Pengji Industrial Zone, Luohu District, Shenzhen City, Guangdong Province

Applicant before: Zhongxing new Communication Co., Ltd.

TA01 Transfer of patent application right
GR01 Patent grant
GR01 Patent grant