A kind of LED luminescence chip inserts the detection method of inclined defect
Technical field
The invention belongs to computer image processing technology field, particularly relate to a kind of LED luminescence chip and insert the detection of inclined defect
Method.
Background technology
In recent years, under conditions of full-automatic packaging line is comprehensively universal, LED luminescence chip in encapsulation production process to envelope
Packing quality carries out on-line checking, it has also become improve package level, the necessity of guarantee package quality.But due to LED
Chip size is little, packaging technology requires that height, line speed are fast, is difficult in encapsulation process carry out real-time quality detection.
Due to the limitation of existing sorting technology, in the LED after encapsulation sorting, only a small amount of product can meet a certain client (such as height
End LED display manufacturer) requirement, remaining major part will become the stock in warehouse.If after LED encapsulation sorting still
Waste product/the defect rate so existed is 0.1%, it is possible to produce several hundred million and give up in the most national annual trillion LED encapsulating products
Product/substandard products, cause the direct economic loss of nearly hundred million yuan.Therefore, in order to meet, LED encapsulation defect sorting quality is wanted
Asking, the research to LED encapsulation defect sorting technology becomes the important topic that LED industry develops.
The properties of product of LED luminescence chip are mainly reflected in Luminescence Uniformity and brightness characteristics aspect.Luminescence due to LED
The uniformity and brightness characteristics are mainly determined by luminescence chip position in sealing, and luminescence chip would generally be deposited in sealing
In slotting inclined defect, if slotting inclined numerical value is in micron level, it can't be substantially to LED average spectrum intensity and complete spectrum
Irradiance produces impact, but can have a significant impact the equalization of intensity of LED, thus affects LED light performance.
Existing screening installation such as light splitting machine, color scanner, can only be from the average spectrum intensity of the LED luminescence chip after energising
Detect with complete spectral irradiance and classify, it is impossible to distinguishing the light distribution uniformity of LED lamp bead, therefore, make
Go out trickle slotting inclined defect with these equipment None-identifieds, thus cannot ensure that the colour temperature aberration of LED display and luminescence are equal
Evenness (i.e. the discreteness of directional characteristic).It addition, for detecting the integrating sphere of the strong distributing homogeneity of LED light, photoelectricity times
The existing screening installations such as increasing pipe are limited due to Cleaning Principle, it is impossible to realize the strong distributing homogeneity of LED light online the most continuously
Sorting, carries out contact sorting for these defects and is more difficult to realize.
To sum up, study and a kind of can accurately detect that LED luminescence chip inserts the detection method of inclined defect, to ensureing LED
The light distribution uniformity of luminescence chip thus ensure that LED luminescence chip product quality is highly important.
Summary of the invention
For defect or deficiency present in above-mentioned prior art, it is an object of the invention to, it is provided that a kind of LED luminescence core
Sheet inserts the detection method of inclined defect, the method can on a production line LED luminescence chip be detected trickle insert the most scarce
Fall into such that it is able to ensure the light distribution uniformity of LED luminescence chip.This algorithm computational efficiency is high, accuracy of detection is high.
The method efficiently, accurately, is suitable to generate on-the-spot real-time operation.
In order to achieve the above object, the present invention adopts the following technical scheme that and is solved:
A kind of LED luminescence chip inserts the detection method of inclined defect, specifically includes following steps:
Step 1: gather the coloured image I of LED luminescence chip to be measured;Computer reads the coloured silk of LED luminescence chip to be measured
Color image I;The collection direction of image meets two pins of light emitting diode in coloured image I and is vertical direction and two pipes
Foot is overlapping;
Step 2: coloured image I is carried out gray processing process and denoising, obtains image I1;
Step 3: image I1 is carried out binary conversion treatment, obtains the image I2 after binary conversion treatment;
Step 4: the image I2 after binaryzation is carried out micronization processes, obtains the image I3 after micronization processes;
Step 5: the image I3 after micronization processes is carried out fitting a straight line, obtains fitting a straight line;
Step 6: digital simulation straight line and the angle theta of y-axis;
Step 7: try to achieve the inclination angle Φ of this fitting a straight line according to the slope of fitting a straight line;
Step 8: calculate the insertion angle beta of luminescence chip, compares with the angle threshold scope of setting according to inserting angle beta,
In the range of judging whether to fall into angle threshold, it is to think that the luminescence chip of LED does not insert inclined defect, return step 1,
Next luminescence chip to be detected is detected;Otherwise it is assumed that the luminescence chip of LED has slotting inclined defect, perform
Step 9;:
When Φ ∈ [0,1.57], β=Φ+θ;
When Φ ∈ (1.57,3.14] time, β=Φ-θ;
Step 9: the current luminescence chip of Computer display exists to be inserted inclined defect and shows the value of β;Return step 1.
Further, coloured image I is carried out gray processing by described step 2 to use component method, maximum value process, put down
Averaging method or weighted mean method.
Further, image I1 is carried out binary conversion treatment by described step 3 and specifically includes following steps:
1) setting initial segmentation threshold value T1=(fmax+fmin)/2, wherein, fmax and fmin represents image I1 respectively
Maximum gradation value and minimum gradation value;
2) by initial segmentation threshold value T1, image I1 is carried out region segmentation, obtain gray value more than initial segmentation threshold value
Image-region G1 and gray value are not more than the image-region G2 of segmentation threshold;
3) the gray average u1 and image-region G2 that calculate the pixel that image-region G1 comprises and the gray scale of the pixel comprised
Average u2;
4) new segmentation threshold Tm=(u1+u2)/2 is calculated;Judging whether | Tm-T (m-1) | >=1, wherein, m is for dividing
Cut the sequence number of average, for initial segmentation average, m=0;It is then to return step 2) with at the beginning of new segmentation threshold Tm replacement
Beginning, segmentation threshold T1 carried out region segmentation to image I1;Otherwise, using this new segmentation threshold Tm as final segmentation
Threshold value;
5) by step 4) the segmentation threshold Tm that obtains carries out binary conversion treatment to image I1;Then at scanning binaryzation
Image I1 after reason, if (i, j) >=Tm are entered as then to this element for the i-th row jth column element I1 in image I1
255;Otherwise give this pixel assignment 0;Obtain the image I2 after binary conversion treatment.
Further, the image I3 after micronization processes is carried out fitting a straight line by described step 5 and specifically includes following steps:
First, the image I3 after scanning micronization processes, is the pixel of 255 for each gray value, by its abscissa
It is saved in respectively in one-dimensional matrix A and one-dimensional matrix B with vertical coordinate;Secondly, with one-dimensional matrix A as abscissa, one-dimensional
Matrix B is that vertical coordinate carries out fitting a straight line, obtains fitting a straight line, and the coordinate system of this fitting a straight line is with the upper left of image I3
Angle is zero, using zero to the right as x-axis forward, downwards as y-axis forward.
Further, the angle threshold scope in described step 8 is [1.553,1.587].
Compared with prior art, the algorithm of the present invention has the advantage that
1, participate in without artificial, the labor intensity overcoming manual detection is big, inefficiency and detection degree of accuracy relatively low
Shortcoming.Take machine vision technique that the luminescence chip slotting inclined defect in sealing is carried out online detection, sorting, really
Protect the concordance on equalization of intensity of the LED chip after sorting.Through inspection, insert inclined accuracy of detection micro-up to tens
Rice.Compared with existing screening installation, the defect rate of LED luminescence chip is greatly lowered.
2, the shooting caused due to DE Camera Shake or other reasons the most all can affect final accuracy of detection, this algorithm
Obtain fitting a straight line by the image scanning after micronization processes, and the deviation of the both direction of fitting a straight line is comprehensively examined
Consider and obtain inserting angle, it is ensured that detection degree of accuracy.
3, iterative method is used to carry out Threshold segmentation, fast convergence rate, it is possible to distinguish the target and background of image exactly.
Below in conjunction with the drawings and specific embodiments, the present invention is further explained explanation.
Accompanying drawing explanation
Fig. 1 is the general flow chart of the method for the present invention.
The flow chart of step 3 binary image in the method for Fig. 2 present invention.
In the method for Fig. 3 present invention, step 5 carries out the flow chart of fitting a straight line to the image after micronization processes.
Detailed description of the invention
The following is the specific embodiment that inventor provides, it should be noted that the embodiment provided is to enter the present invention
One step illustrate, protection scope of the present invention be not limited to embodiment.
Seeing Fig. 1-Fig. 3, the LED luminescence chip of the present embodiment inserts the detection method of inclined defect, specifically includes following steps:
Step 1: gather the coloured image I of LED luminescence chip to be measured;Computer reads the coloured silk of LED luminescence chip to be measured
Color image I;The collection direction of image meets two pins of light emitting diode in coloured image I and is vertical direction and two pipes
Foot is overlapping;
Step 2: coloured image I is carried out gray processing process and denoising, obtains image I1;
Coloured image is carried out gray processing and can use component method, maximum value process, mean value method or weighted mean method.
Step 3: image I1 is carried out binary conversion treatment, obtains the image I2 after binary conversion treatment;
Step 4: the image I2 after binaryzation is carried out micronization processes, obtains the image I3 after micronization processes;
Step 5: the image I3 after micronization processes is carried out fitting a straight line, obtains fitting a straight line;
As it is shown on figure 3, the image I3 after micronization processes is carried out fitting a straight line specifically include following steps:
First, the image I3 after scanning micronization processes, is the pixel of 255 for each gray value, by its abscissa
It is saved in respectively in one-dimensional matrix A and one-dimensional matrix B with vertical coordinate;Secondly, with one-dimensional matrix A as abscissa, one-dimensional
Matrix B is that vertical coordinate carries out fitting a straight line, obtains fitting a straight line y=ax+b, and the coordinate system of this fitting a straight line is with image I3
The upper left corner be zero, using zero to the right as x-axis forward, downwards as y-axis forward;
Step 6: digital simulation straight line and the angle theta of y-axis;
Step 7: try to achieve the inclination angle Φ of fitting a straight line according to the slope of fitting a straight line;
Step 8: the insertion angle beta of calculating luminescence chip:
When Φ ∈ [0,1.57], β=Φ+θ;
When Φ ∈ (1.57,3.14] time, β=Φ-θ;
If β is ∈ [1.553,1.587], then it is assumed that the luminescence chip of LED does not insert inclined defect, return step 1, right
Next luminescence chip to be detected detects;Otherwise it is assumed that the luminescence chip of LED has slotting inclined defect, perform step
Rapid 9.
Step 9: the current luminescence chip of Computer display exists to be inserted inclined defect and shows the value of β;Return step 1.
The following is the embodiment that inventor provides, the protection domain of the algorithm of the present invention is not limited to this embodiment.
Embodiment:
Step 1: gather the coloured image I of LED luminescence chip to be measured, notice that shooting angle is light emitting diode two
Pin is vertical direction and two pins overlap;
Step 2: use mean value method that coloured image I carries out gray processing process, then use median filtering method to gray scale
Image denoising after change, the size choosing filter window in median filtering method is 3*3, obtains image I1;
Step 3: as in figure 2 it is shown, use iterative method Threshold segmentation that image I1 is carried out binary conversion treatment, obtain two-value
Image I2 after change process;Specifically comprise the following steps that
1) setting initial segmentation threshold value T1=(fmax+fmin)/2, wherein, fmax and fmin represents image I1 respectively
Maximum gradation value and minimum gradation value;
2) by initial segmentation threshold value T1, image I1 is carried out region segmentation, obtain gray value more than initial segmentation threshold value
Image-region G1 and gray value are not more than the image-region G2 of segmentation threshold;
3) the gray average u1 and image-region G2 that calculate the pixel that image-region G1 comprises and the gray scale of the pixel comprised
Average u2;
4) new segmentation threshold Tm=(u1+u2)/2 is calculated;Judging whether | Tm-T (m-1) | >=1, wherein, m is for dividing
Cut the sequence number of average, for initial segmentation average, m=0;It is then to return step 2) with at the beginning of new segmentation threshold Tm replacement
Beginning, segmentation threshold T1 carried out region segmentation to image I1;Otherwise, using this new segmentation threshold Tm as final segmentation
Threshold value;
5) by step 4) the segmentation threshold Tm that obtains carries out binary conversion treatment to image I1;Then at scanning binaryzation
Image I1 after reason, if (i, j) >=Tm are entered as then to this element for the i-th row jth column element I1 in image I1
255;Otherwise give this pixel assignment 0;Obtain the image I2 after binary conversion treatment.
Step 4: use the bwmorph () function in MATLAB workbox that the image I2 after binary conversion treatment is refined
Process, obtain the image I3 after micronization processes, i.e. I3=bwmorth (I2, ' thin ', n).
Step 5: the image I3 after micronization processes is carried out fitting a straight line, obtains fitting a straight line;
As it is shown on figure 3, the image I3 after micronization processes is carried out fitting a straight line specifically include following steps:
First, the image I3 after scanning micronization processes, is the pixel of 255 for each gray value, by its abscissa with vertical
Coordinate is saved in one-dimensional matrix A and one-dimensional matrix B respectively;Secondly, with one-dimensional matrix A as abscissa, one-dimensional matrix
B is that vertical coordinate carries out fitting a straight line, obtains fitting a straight line y=4.75x-3545, and the coordinate system of this fitting a straight line is with image
The upper left corner of I3 is zero, using zero to the right as x-axis forward, downwards as y-axis forward;
Step 6: digital simulation straight line and the angle theta of y-axis, obtains θ=0.087;
Step 7: try to achieve Φ=1.36, inclination angle of this fitting a straight line according to the slope of fitting a straight line;
Step 8: Φ=1.36 ∈ [0,1.57];β=Φ+θ=1.36+0.087=1.447, is not belonging to [1.553,1.587],
It is taken as that this LED luminescence chip exists inserts inclined defect.
Step 9: the current luminescence chip of Computer display exists to be inserted inclined defect and shows the value of β;Return step 1.