A kind of defect automatic optical detection method of display screenTechnical field
The invention belongs to photoelectric fields, and in particular to the test method of display screen a kind of more particularly to a kind of display screenDefect automatic optical detection method.
Background technique
Understand according to inventor, the resolution ratio of detection method shooting of the tradition based on contrast on border is not high, divides if improvedEach sub-pixel on display panel can then be taken and, so that the texture picture of some pixel distributions is obtained, due to line by resolutionThe edge contrast of picture is managed equally than stronger, traditional algorithm cannot be distinguished at all the high region of edge contrast be specifically texture alsoIt is defect, it is higher so as to cause the probability of erroneous judgement.
In consideration of it, in order to solve this problem, proposing that a kind of defect automatic optical detection method of display screen is the present inventionThe project to be studied.
Summary of the invention
The present invention provides a kind of defect automatic optical detection method of display screen, and its purpose is to solve the prior art to missSentence the high problem of rate.
In order to achieve the above objectives, the technical solution adopted by the present invention is that: a kind of defect automatic optics inspection side of display screenMethod follows the steps below operation:
The first step reads in the automatic optics inspection image of a display screen;
Second step carries out screen body region to the automatic optics inspection image and cuts, obtains image to be checked;
Third step, the subgraph for being S*S at size by the image segmentation to be checked;
Each image subsection is divided into N*N part by the 4th step;
5th step sets current image subsection as Aij, and the calculation formula of the current subgraph characteristic quantity isWherein (i, j) represents the subscript of subgraph, and (m, n) represents the sonThe mobile position subscript of image convolution;
6th step carries out independent convolution to each image subsection, the gradation data after obtaining current image subsection convolution, and calculates convolutionThe maximum value max (Aij) and minimum value min (Aij) of data, and according to formula Bij=max (Aij)-min(Aij) obtain every heightThe statistical characteristics B of image grayscale differenceij;
7th step, according to formulaCalculate the average value of all image subsection gray scale differencesAndAccording to formulaCalculate the standard variance σ of all image subsection gray scale differences;
8th step, according to the average valueWith standard variance σ, according to formula TUB=B+C* σ calculates the image subsection of image to be checkedThe upper limit value of the adaptive threshold of gray scale difference, and according to formula TUB=B-C* σ calculates oneself of the image subsection gray scale difference of image to be checkedAdapt to the lower limit value of threshold value, wherein C is control constant;
The statistical characteristics Bij of the gray scale difference of current subgraph is compared by the 9th step with upper limit value and lower limit value;If currentThe statistical characteristics Bij of the gray scale difference of subgraph image subsection is greater than the upper limit value, or is greater than the lower limit value, then determining shouldCurrent subgraph is defect.
Related content in above-mentioned technical proposal is explained as follows:
1, in above scheme, in the 6th step, convolution operation is done to each subgraph, wherein image subsection size is S*S,Effective subgraph number are as follows:Wherein NshAnd NswRespectively represent image along height, width direction it is effectiveSubgraph number, H are the height of image, and W is the width of image, and convolution window size is N*N, and convolution kernel size is S, convolutionStep-length beGradation data image after obtaining convolution, then calculate maximum value max (A in all subgraph convolved datasij) andMinimum value min (Aij) difference, obtain the statistical characteristics B of current subgraph gray scale differenceij。
2, in above scheme, in the second step, ROI is used when carrying out region cutting to the automatic optics inspection imageIt cuts.
3, in above scheme, the ROI (region of interest), i.e. area-of-interest.At machine vision, imageIn reason, region to be treated is sketched the contours of in a manner of box, circle, ellipse, irregular polygon etc. from processed image, referred to asArea-of-interest.
Due to the above technical solutions, the present invention has the following advantages over the prior art:
Good reliability, judgement accuracy are high compared with the prior art by the present invention, can be shot using high-resolution camera, byIn suitable division parameter by the way of dividing subgraph, is arranged, texture structure can then be shielded by algorithm automatically, and just trueGround defect can be then detected.The present invention, can be effective by the difference ratio of mean square deviation in each sub-image area of solutionAvoid grain background bring interference problem.In addition, can not using the high-resolution low-resolution cameras that can take outThe defect taken improves the customer satisfaction of product to reach better detection effect.
Detailed description of the invention
Attached drawing 1 is the flow chart of the defect automatic optical detection method of the present embodiment display screen.
Specific embodiment
The invention will be further described with reference to the accompanying drawings and embodiments:
A kind of embodiment: test macro for supporting OLED screen multiple-working mode
Referring to attached drawing 1, operation is followed the steps below:
The first step reads in the automatic optics inspection image of a display screen.
Collected AOI (automatic optics inspection) image data is carried out ROI region cutting, obtained to be checked by second stepImage data.
Third step, it is its effective subgraph number of the subgraph of S*S that image to be detected, which is uniformly divided into size, are as follows:Wherein NshAnd NswImage is respectively represented along height, effective subgraph number of width direction, H is figureThe height of picture, W are the width of image.
4th step, by each subgraph it is average be divided into N*N part.
5th step sets current image subsection as Aij, and the calculation formula of the current subgraph characteristic quantity isWherein (i, j) represents the subscript of subgraph, and (m, n) represents the sonThe mobile position subscript of image convolution.
6th step carries out independent convolution operation to subgraph, if currently processed subgraph is Aij, then to each subgraphAs doing local convolution operation, convolution kernel size is S, and the step-length of convolution isGradation data subgraph after obtaining convolution,Size is N*N.Gradation data image after obtaining current subgraph convolution calculates the maximum value max of image data after convolution(Aij) and minimum value min (Aij) difference, obtain the statistical characteristics B of current subgraph gray scale differenceij, wherein Bij=max(Aij)-min(Aij)。
7th step, according to formulaCalculate the average value of all image subsection gray scale differencesAnd according to formulaCalculate the standard variance σ of all image subsection gray scale differences.
8th step, according to the average valueWith standard variance σ, according to formula TUB=B-C* σ calculates the subgraph of image to be checkedAs the upper limit value of the adaptive threshold of gray scale difference, and according to formula TUB=B-C* σ calculates the image subsection gray scale difference of image to be checkedThe lower limit value of adaptive threshold, wherein C is control constant.Wherein, C represents control constant, according to the different comparisons of pictureDegree, is arranged corresponding value.
9th step, by the statistical characteristics B of the gray scale difference of current subgraphijIt is compared with upper limit value and lower limit value;IfThe statistical characteristics B of the gray scale difference of current subgraph image subsectionijGreater than the upper limit value, or it is greater than the lower limit value, then sentencesThe fixed current subgraph is defect.Work as Bij> TUBOr Bij< TLBThen indicate defect.
The above embodiments merely illustrate the technical concept and features of the present invention, and its object is to allow person skilled in the artScholar cans understand the content of the present invention and implement it accordingly, and it is not intended to limit the scope of the present invention.It is all according to the present inventionEquivalent change or modification made by Spirit Essence, should be covered by the protection scope of the present invention.