CN108876768B - Shadow defect detection method for light guide plate - Google Patents

Shadow defect detection method for light guide plate Download PDF

Info

Publication number
CN108876768B
CN108876768B CN201810541338.6A CN201810541338A CN108876768B CN 108876768 B CN108876768 B CN 108876768B CN 201810541338 A CN201810541338 A CN 201810541338A CN 108876768 B CN108876768 B CN 108876768B
Authority
CN
China
Prior art keywords
image
light guide
guide plate
filtering
shadow
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.)
Active
Application number
CN201810541338.6A
Other languages
Chinese (zh)
Other versions
CN108876768A (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.)
Jinmingshan Photoelectric Wujiang Co ltd
Original Assignee
Jinmingshan Photoelectric Wujiang 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 Jinmingshan Photoelectric Wujiang Co ltd filed Critical Jinmingshan Photoelectric Wujiang Co ltd
Priority to CN201810541338.6A priority Critical patent/CN108876768B/en
Publication of CN108876768A publication Critical patent/CN108876768A/en
Application granted granted Critical
Publication of CN108876768B publication Critical patent/CN108876768B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/0002Inspection of images, e.g. flaw detection
    • G06T7/0004Industrial image inspection
    • G06T5/70
    • 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
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/20Special algorithmic details
    • G06T2207/20048Transform domain processing
    • G06T2207/20056Discrete and fast Fourier transform, [DFT, FFT]

Abstract

The invention provides a method for detecting a dark shadow defect of a light guide plate, which is used for enhancing contrast, inhibiting salt and pepper noise, filtering, performing convolution twice, normalizing a gray value, performing mean filtering twice, performing threshold segmentation processing, extracting a connected domain of a foreground image, performing characteristic processing on the connected domain to obtain the dark shadow defect, and displaying the extracted dark shadow defect. The light guide plate self-adaptive detection method provided by the invention has relatively low complexity, and can realize automatic detection and extraction of the light guide plate shadow. The experimental result shows that the detection precision and the detection efficiency of the algorithm are high, the stability is high, and the shadow can be detected in real time.

Description

Light guide plate shadow defect detection method
Technical Field
The invention relates to a defect detection method, in particular to light guide plate shadow defect detection.
Background
The Light Guide Plate (LGP) is made of optical acrylic/PC board, and then high-tech material with high reflectivity and no Light absorption is used, and Light Guide points are printed on the bottom surface of the optical acrylic board by laser engraving, V-shaped cross grid engraving and UV screen printing technology. LGP has been used widely in liquid crystal display, advertising lamp, X-ray, flat lamp lighting and other occasions due to its advantages of lightness and thinness, high brightness, uniform light guiding, environmental protection, energy saving, convenient maintenance and the like. In the production process of the light guide plate, the surface of the light guide plate inevitably has defects of scratches, black spots, shadows and the like; compared with other defects, the shadow becomes the difficult point and the key of the defect detection of the light guide plate by the characteristics of higher detection difficulty, more complex detection procedure and the like. If the light guide plate with the shadow is used on a liquid crystal display, an X-ray film viewer and the like, the uniform luminescence, the use efficiency and the like of the equipment are seriously influenced, in addition, the poor light guide plate product can also cause certain damage to the eyesight of human eyes, and the credit and the market competitiveness of enterprises can also cause fatal damage, so that the light guide plate product before leaving a factory must be detected to screen out the poor product with the shadow in order to meet the requirements of high social quality and high reliability.
At present, domestic related enterprises mainly carry out defect detection in a way of manual operation by professionals, but the problem of manual detection is numerous, and the limitation is obvious: (1) the working environment is poor, the eyesight of the staff is damaged by long-term manual operation, and the staff can suffer from occupational diseases; (2) the detection difficulty is high, the procedure is complex, and the staff is difficult to master the related skills; (3) because the manual detection is easily influenced by the external environment, the detection precision and efficiency are difficult to ensure; (4) the staff mainly carries out the discernment and the judgement of defect through the naked eye, and the auxiliary computing tool is difficult for forming the quality standard that can quantify.
There are two main reasons why the light guide plate generates shadows: (1) more gas mixed in the melt in the heating cylinder (screw) is not discharged, more gas is difficult to be completely discharged under the condition of high-speed mold filling, and a certain part in a mold cavity of the mold is violently burned to burn a product black to form a dark space; (2) in order to prevent the wire drawing from being too long, the screw rod loosening distance is often set to be too large, the screw rod loosening distance is completely disconnected with a product stub bar, a space is formed between the screw rod loosening distance and the product stub bar, the molten material can flow back to a gap to be easily cooled due to the rotation speed of the screw rod during metering, and when the screw rod is filled with a mold at a high speed, if the partially cooled molten material is brought into a mold cavity under the condition of filling the mold at a high speed, the partially cooled molten material is difficult to be completely fused with the molten material entering the mold cavity, namely the partially cooled molten material is wrapped by the molten material at the back to form a dark space and the like. At present, shadow detection is mainly finished manually, and under the light of an inspection jig, a detector visually inspects whether a certain part or a plurality of parts of the light guide plate present a dark area or not, and if the dark area exists, the dark area indicates that the light guide plate has a shadow defect. The precision, efficiency, stability and the like of the artificial shadow detection are difficult to adapt to the requirements of enterprises. Due to the particularity of the shadow defect of the light guide plate, the light guide plate needs to be observed from the whole angle, so that the light guide plate needs to be imaged by a high-resolution surface frame camera. The image size of the light guide plate is about 20MB, and the detection speed of each light guide plate of an enterprise is controlled within 5 seconds, which puts a high requirement on the shadow detection efficiency.
Therefore, further improvements in the related art are needed.
Disclosure of Invention
The invention aims to provide an efficient method for detecting the shadow defect of a light guide plate.
In order to solve the above technical problems, the present invention provides a method for detecting a shadow defect of a light guide plate, comprising the following steps:
(1) acquiring a light guide plate image F, and executing the step 2;
(2) acquiring the size, the height and the width of the light guide plate image F, wherein the height and the width are M and N respectively; executing the step 3;
(3) enhancing the contrast of the light guide plate image F to obtain an image with enhanced contrast, and executing the step 4;
(4) suppressing salt and pepper noise of the image after contrast enhancement to obtain an image after salt and pepper noise suppression; executing the step 5;
(5) filtering the image with the salt and pepper noise suppressed to obtain an image with the noise eliminated; executing the step 6;
(6) performing two convolutions of the first-order partial derivative in the y direction and the second-order partial derivative in the xy direction on the image without the noise to obtain a convolved image F1And F2(ii) a Executing the step 7;
(7) FIG. F1Subtracting F2Obtaining a subtracted image; executing the step 8;
(8) adjusting the gray value of the image subjected to subtraction to be between 0 and 255 to obtain an image with normalized gray value; executing the step 9;
(9) performing type conversion on the image with the normalized gray value to obtain a byte image, and executing the step 10;
(10) carrying out self-addition on the byte image to obtain a self-added image; executing the step 11;
(11) continuously carrying out two times of mean filtering on the self-added image to obtain a first filtered image and a second filtered image; executing step 12;
(12) subtracting the image after the second filtering from the image after the first filtering to obtain a result image; executing step 13;
(13) performing threshold segmentation processing on the result image to obtain a background part and a foreground part; step 14 is executed;
(14) the connected domain analysis mainly comprises the steps of calculating components of the foreground image, extracting the connected domain of the foreground image, and taking the area blocks which are not connected together as small areas with different characteristics; step 15 is executed;
(15) performing feature extraction on the connected domain obtained in the step 14 to obtain a shadow defect; step 16 is executed;
(16) and displaying the shadow defects extracted in the step 15.
As an improvement of the light guide plate shadow defect detection method, the step 4 comprises the following steps:
marking points with the gray scale value of 0 or 255 in the light guide plate image F as noise points, and then increasing window filtering to search the minimum window filtering size comprising non-noise points for corresponding filtering calculation;
when the filtering size of the window reaches the upper threshold T of the window and still the minimum filtering window including the non-noise points can not be found, counting the number N of 0 pixel points with the gray value as 0 in the window with the size of T and taking the noise points as the center0Number N of pixels with sum gray value of 255255The following formula is adopted:
Figure GDA0003339691150000031
when the minimum filtering window is found before the window filtering size reaches the window upper limit threshold value T, filtering noise points in the minimum filtering window to obtain a non-noise point set TG, and performing linear weighting by using pixel gray value points in the set TG to obtain a recovery value at a noise point (x, y):
Figure GDA0003339691150000032
in the above formula, (x ', y') represents the non-noise point set TGAny one point of (a); (x, y) is obtained according to the non-noise point (x ', y'),
Figure GDA0003339691150000037
is the Euclidean distance from the pixel point at (x ', y') to the noise point at (x, y) in TG, and W is ωkA normalized value of (d);
Figure GDA0003339691150000033
Figure GDA0003339691150000034
as a further improvement of the method for detecting the shadow defect of the light guide plate, the step 5 comprises the following steps:
5.1) converting the image with salt and pepper noise suppression from the time domain to the frequency domain by two-dimensional discrete Fourier transform, wherein the two-dimensional discrete Fourier transform formula is as follows:
Figure GDA0003339691150000035
in the formula, h (n)1,n2) Is at 0 ≦ n1≤L1-1,0≤n2≤L2Complex function at-1, H (l)1,l2) Is h (n)1,n2) A complex function after Fourier transform; l1And l2Respectively representing the width and height, L, of a rectangular grid of samples1And L2Respectively representing the boundary length of the row and the boundary length of the width of the sampling array;
5.2) according to the window size and the distance between the element in the window and the central point, the selection and distribution of the coefficient weight is realized through a Gaussian function, and the specific formula is as follows:
Figure GDA0003339691150000036
in the formula (I), the compound is shown in the specification,Vx,ya neighborhood representing an element at a central position (x, y) and having a size of M; omegadRepresenting a spatial distance similarity weight factor; f (i, j) is H (l)1,l2);
5.3) carrying out convolution in a frequency domain on the filtered image;
5.4) converting the convolved image from the frequency domain to the time domain by two-dimensional inverse discrete Fourier transform, wherein the two-dimensional inverse discrete Fourier transform formula is as follows:
Figure GDA0003339691150000041
as a further improvement of the method for detecting the shadow defect of the light guide plate, step 8 includes:
f*(x,y)=f(x,y)×Mult+Add
Figure GDA0003339691150000042
in the formula GmaxAnd GminThe maximum and minimum gray values of the image area, respectively, and f (x, y) is the pixel value of the image at (x, y) before normalization.
As a further improvement of the method for detecting the shadow defect of the light guide plate of the present invention, the step 11 includes:
the filtering method comprises the following steps:
Figure GDA0003339691150000043
in the formula
Figure GDA0003339691150000044
Where m and n are the filter window sizes, respectively, m and n are obtained experimentally,
Figure GDA0003339691150000045
as a weighting function, fλ(x + r, y + s) is a noise image before filtering,
Figure GDA0003339691150000046
is a filtered smoothed image.
Self-added image f12+And (x, y) carrying out two times of mean filtering continuously to obtain a first filtered image and a second filtered image.
As a further improvement of the method for detecting the shadow defect of the light guide plate of the present invention, step 13 includes:
the formula for performing threshold segmentation by the OSTU method is as follows:
t=Max[ω1(t)×(u1(t)-u)22(t)×(u2(t)-u)2]
in the formula of omega1(t) and ω2(t) the proportions of the background and foreground portions, respectively, in the resulting image of step 12, and u1(t) and u2And (t) is the average value of the background part and the foreground part respectively, u is the average value of the light guide plate image F, and t is a segmentation threshold value.
As a further improvement of the method for detecting the shadow defect of the light guide plate of the present invention, the step 15 includes the steps of:
firstly, extracting a combined area;
determining the area of a single pixel according to the size of the visual field and the resolution of the image-taking camera, then calculating the number of pixels occupied by the area, and multiplying the number of pixels by the area of the single pixel to obtain the area of the area;
secondly, extracting the contour length of the combined connected domain;
the number of the edge pixels of the shadow area is multiplied by the side length of a single pixel to obtain the outline length of the shadow area;
thirdly, extracting by combining the eccentricity;
the formula for the eccentricity is as follows:
Figure GDA0003339691150000051
in the formula: raAnd RbLength of the major semi-axis and the length of the minor semi-axis which are respectively shadow curvesAnd As is eccentricity.
The method for detecting the shadow of the light guide plate has the advantages that:
compared with other detection methods, the light guide plate self-adaptive detection method provided by the invention is relatively low in complexity, and can realize automatic detection and extraction of the light guide plate shadow. The experimental result shows that the detection precision and the detection efficiency of the algorithm are high, the stability is high, and the shadow can be detected in real time.
The method has the following specific advantages:
1. in practical application, only a proper amount of parameter adjustment is needed, and the rest can realize full-automatic detection;
2. the algorithm of the invention has stronger stability and convenient system maintenance.
3. According to the domestic and foreign patents and the thesis retrieval conditions, no visual detection result of the light guide plate shadow defect exists at present. The existing light guide plate is manually detected, and the patent of the invention provides a stable visual detection method for shadow defects for the first time.
4. The method extracts the shadow defects on the basis of Gaussian filtering, mean filtering and the like of the light guide plate image, can effectively overcome the influence of nonuniform illumination, illumination change and the like on defect detection, and greatly improves the stability and robustness of a detection algorithm;
5. according to the method, the shadow defect is determined by calculating the shadow area, the shadow outline length and the eccentricity, so that the external interference caused in the imaging process can be avoided, and the accuracy of the shadow defect is effectively improved; and different shadow defects can be filtered by setting the shadow area, the shadow outline length, the eccentricity and the like, so that the quality detection requirements of different manufacturers and different grades of products are met, and the adaptability of the algorithm is improved.
Drawings
The following describes embodiments of the present invention in further detail with reference to the accompanying drawings.
FIG. 1 is a flow chart of a method for detecting shadows of a light guide plate according to the present invention;
fig. 2 is a light guide plate image F obtained in step 1;
FIG. 3 is the image obtained in step 3 after enhancement by the PECE method;
FIG. 4 is the image obtained in step 4 after salt and pepper noise suppression;
FIG. 5 is the Gaussian filtered image obtained in step 5;
FIG. 6 is the image after the convolution of the Gaussian derivative 'xy' direction obtained in step 6;
FIG. 7 is the image after convolution of the Gaussian derivative 'y' direction obtained in step 6;
FIG. 8 is a graph of image differentiation analysis obtained in step 7;
FIG. 9 is a graph of the result of normalization of the gray scale values obtained in step 8;
FIG. 10 is a diagram showing the result of image type conversion in step 9;
FIG. 11 is a self-additive map of the image obtained in step 10;
FIG. 12 is a diagram of the first mean filtering result obtained in step 11;
FIG. 13 is a diagram of the second mean filtering result obtained in step 11;
FIG. 14 is a graph of the subtraction result of two mean filtering operations in step 12;
FIG. 15 is a graph of the OSTU threshold segmentation obtained in step 13;
FIG. 16 is a diagram of the connected component analysis obtained in step 14;
fig. 17 is a light guide plate dark image obtained by the feature extraction in step 15.
Detailed Description
The invention will be further described with reference to specific examples, but the scope of the invention is not limited thereto.
Embodiment 1, a method for detecting a dark shadow defect of a light guide plate, as shown in fig. 1 to 17, includes the following steps:
(1) acquiring a light guide plate image F by adopting a surface frame camera of Hikvision company, and executing the step 2;
through observation, the density of the light guide points is different, and the light guide points are different in size, so that the light guide points can emit light uniformly. The light guide plate has high requirement on manufacturing precision, the shadow defect belongs to a surface defect, the integral observation is needed, a very clear image is not needed, and the required image is generally acquired by a surface frame camera.
(2) Acquiring the size of a light guide plate image F, wherein the height and the width are M and N respectively; executing the step 3;
(3) realizing image contrast enhancement by a PECE (positive and negative contrast enhancement method), obtaining an image with enhanced contrast, and executing the step 4;
because the shooting environment is not ideal in the actual process, the contrast of the shot light guide plate image is possibly insufficient, the whole image is fatigued, and the contrast of the image is enhanced by adopting a PECE method.
The PECE method is as follows:
Figure GDA0003339691150000061
Figure GDA0003339691150000062
wherein P (k) is the probability density function of the light guide plate image, obtained by histogram probability density estimation, PPECE(k) As a function of the processed probability density, PbasIs the mean of the sum of the maximum and minimum values of the reference value (P (k)), PhIs PbasTwice the value, α (k) being a constraint function, XmGamma is [ -1, 1 ] for average brightness]And real numbers of bright and dark regions are controlled in between. L is a constant, which is adjusted in practice according to the light guide plate image F.
(4) Through processing the image enhanced by the PECE method obtained in the step 3, salt and pepper noise is inhibited, the smoothness of the image is better, and the image with the salt and pepper noise inhibited is obtained; executing the step 5;
for salt and pepper noise existing in the light guide plate image F, the invention adopts a self-adaptive filtering method to inhibit the salt and pepper noise.
First, the points with gray scale value of 0 or 255 in the light guide plate image F are marked as noise points, and then the window filtering is increased to find the minimum window filtering size including non-noise points for corresponding filtering calculation. Because the size of the filtering window cannot be infinite, the invention sets a window upper limit threshold T which is used for identifying pixel points with the gray value of 0 or 255 in the light guide plate image F, and the value of the window upper limit threshold T is determined according to the joint distribution of the pixel points with the gray value of 0 or 255 in the light guide plate image F and the noise density.
When the window filtering size reaches the upper limit value T, a filtering window comprising non-noise points still cannot be found, namely, the noise coordinate in the light guide plate image F is considered to be in an extreme value area of 0 or 255 or a misjudgment noise point; at this time, in a window with the size of T and taking the noise point as the center, the number N of 0 pixel points with the gray value of 0 is counted0Number N of pixels with sum gray value of 255255. The noise point recovery adopts a principle of partial multiple, because from the visual point of view, if N is in a certain area0Or N255One side is most, the gray value can be considered as the real gray value in the area, and the specific formula is as follows:
Figure GDA0003339691150000071
when the window with the minimum filter size is found before the filter size of the window reaches the window upper limit threshold value T, filtering noise points in the window to obtain a non-noise point set TG, and performing linear weighting by using pixel gray value points in the set TG to obtain a recovery value at a noise point (x, y):
Figure GDA0003339691150000072
in the above formula, (x ', y') represents any one point in the non-noise point set TG; directly extracting from a non-noise point set TG to obtain (x ', y'); (x ', y') is used to repair the noise point (x, y), i.e. the recovered value at (x, y) is obtained by linear weighting the non-noise points (x ', y') in the set TG,
Figure GDA0003339691150000073
is (x) in TG', y') to the noise point at (x, y), i.e.:
Figure GDA0003339691150000074
and W is omegakThe specific formula of (A) is as follows
Figure GDA0003339691150000075
(5) Because the noise in the image not only contains salt and pepper noise but also may have gaussian noise, the image obtained in step 4 after the salt and pepper noise is suppressed needs to be further filtered, so that the smoothness of the image is improved, and the image after the noise is eliminated is obtained; executing the step 6;
firstly, converting the image with salt and pepper noise suppressed from a time domain into a frequency domain by a two-dimensional discrete Fourier transform, wherein the two-dimensional discrete Fourier transform formula is as follows:
Figure GDA0003339691150000081
in the formula, h (n)1,n2) Is at 0 ≦ n1≤L1-1,0≤n2≤L2Complex functions at-1 (analogous to an array obtained by sampling a two-dimensional continuous function with an equally spaced rectangular grid), H (l)1,l2) Is h (n)1,n2) A complex function after Fourier transform; l1And l2Respectively representing the width and height, L, of a rectangular grid of samples1And L2Respectively representing the boundary length and the boundary length of the width of a row of a sampling array, wherein i is an imaginary number in the complex number field and is a common symbol; and l1And l2Then it is decided by the size of the grid used for actual sampling, L1And L2Is determined by the size of the sampled image.
And secondly, generating a Gaussian filter for filtering, so that the linear smoothness of the filter is improved. Essentially, gaussian filtering is a weighted average operation performed on a fourier transformed image, and each pixel value in the image is obtained by weighted averaging of the pixel itself and other pixels in the neighborhood. The invention realizes the selection and distribution of the coefficient weight through the Gaussian function according to the window size and the distance between the element in the window and the central point, and the concrete formula is as follows:
Figure GDA0003339691150000082
in the formula, Vx,yA neighborhood representing an element at the center position (x, y) of size M × M (self-setting); omegadRepresenting a spatial distance similarity weight factor; f (i, j) is H (l)1,l2);
Thirdly, performing convolution in the frequency domain on the filtered image (prior art);
and finally, converting the convolved image from the frequency domain to the time domain through two-dimensional inverse discrete Fourier transform, wherein the two-dimensional inverse discrete Fourier transform formula is as follows:
Figure GDA0003339691150000083
the variable interpretation in the formula is the same as the fourier transform. h (n)1,n2) H (l) is used here to eliminate the noisy image1,l2) Is obtained after convolution.
(6) Convolving the image after eliminating the noise by a Gaussian derivative to obtain a convolved image F1And F2(ii) a Executing the step 7;
considering the actual situation of the light guide plate image, the steps of the invention are mainly divided into first-order partial derivatives in the y direction and second-order partial derivatives in the xy direction, and the specific formula is as follows:
Figure GDA0003339691150000091
Figure GDA0003339691150000092
(7) the image difference analysis mainly comprises the step of obtaining images F with different deviation directions in the step (6)1And F2Are subtracted, graph F1Subtracting F2Obtaining a subtracted image with more obvious shadow defects; executing the step 8;
(8) the gray value normalization mainly comprises the steps of adjusting the gray value of the subtracted image obtained in the step (7) to be between 0 and 255 to obtain an image with the normalized gray value; executing the step 9;
the grey value normalization is mainly divided into two steps: the first step is that the pixels with the gray value less than 0 in the image are converted into nonnegative numbers; and secondly, adjusting the gray value of the image to be between 0 and 255. The grey value normalization operation is mainly performed around the following formula:
f*(x,y)=f(x,y)×Mult+Add
Figure GDA0003339691150000093
in the formula GmaxAnd GminMaximum and minimum gray values of the image area, respectively, f (x, y) being the pixel value of the image at (x, y) before normalization, f*(x, y) is the actual pixel value of the image at (x, y) after the normalization operation;
(9) performing type conversion on the image with the normalized gray value to obtain a byte image; executing the step 10;
for the convenience of subsequent processing, the image with the normalized gray scale value in step 8 is converted into a byte image;
(10) the step is to perform self-addition on the byte image in the step (9); executing the step 11;
self-addition is an operation of processing the pixel gray value of an input image according to a certain rule; the image self-adding pixel gray value processing here mainly follows the following rules:
f12+(x,y)=(f1(x,y)+f2(x,y))×Factor+Value
in the formula f1(x, y) and f2(x, y) are the gray values of the two byte images at (x, y), respectively, where the two byte images are only for formula understanding, f1(x, y) and f2And (x, y) directly extracting the gray value of the image at the (x, y) position. Factor is the adaptive Factor of gray Value, Value is the adaptive range Value of gray Value, f12+(x, y) is the gray value of the added image;
(11) for the self-added image f obtained in the step (10)12+(x, y) performing two mean filtering; executing step 12;
the noise is inevitably introduced in the processes of storing, transmitting and the like of the image, and the processing relation of the image noise is the identification of important information such as detail texture and the like in the image; the mean filtering is a common denoising method, and is widely applied in the field of image filtering denoising processing. The invention adopts mean filtering to remove noise, and the specific steps are mainly to treat the gray level equalization operation as acting on a noise image f by using the spatial domain convolution operationλThe low-pass filter on (x, y) is specifically as follows:
Figure GDA0003339691150000101
in the formula
Figure GDA0003339691150000102
Where m and n are the filter window sizes, respectively, m and n are obtained experimentally,
Figure GDA0003339691150000103
as a weighting function, fλ(x + r, y + s) is a noise image before filtering,
Figure GDA0003339691150000104
the filtered smooth image is obtained;
self-additive image f12+(x, y) obtaining the first time by two times of mean filteringA filtered image and a second filtered image;
(12) here, the filtered image is subtracted, that is, the second filtered image is subtracted from the first filtered image in step (11); executing step 13;
the principle of image addition in the step 10 is the same, and the subtraction of two images is to process the pixel gray value according to a certain rule; the relevant rules are as follows:
f12-(x,y)=(f1(x,y)-f2(x,y))×C1+C2
in the formula f1(x, y) and f2(x, y) represents the first filtered image and the second filtered image, C1And C2Correction factor and correction value in the image subtraction process, respectively, f12-(x, y) is the gray value of the subtracted image;
(13) performing threshold segmentation processing on the result image in the step 12 by using an OSTU (maximum inter-class difference) method, and distinguishing a background image from a light guide point region; step 14 is executed;
according to the gray characteristic of the image, the image is divided into a background image and a foreground image. If the larger the inter-class method between the background image and the foreground image, the larger the difference between the two parts; since the application of the OSTU method to segmentation will minimize the probability of misclassification, since a misclassification of either of the two parts into the other will cause the difference between the two parts to be small. The formula for performing threshold segmentation by the OSTU method is as follows:
t=Max[ω1(t)×(u1(t)-u)22(t)×(u2(t)-u)2]
in the formula of omega1(t) and ω2(t) the proportions of the background and foreground portions, respectively, in the resulting image of step 12, and u1(t) and u2And (t) is the average value of the background part and the foreground part respectively, u is the average value of the light guide plate image F, and t is a segmentation threshold value.
(14) The connected domain analysis mainly comprises the steps of calculating components of the foreground image, extracting the connected domain of the foreground image, and taking the area blocks which are not connected together as small areas with different characteristics; step 15 is executed;
(15) performing feature extraction on the connected domain obtained in the step 14; step 16 is executed;
because the extraction of the light guide plate shadow has certain complexity, in order to avoid false detection, the invention extracts the light guide plate shadow defect according to three characteristics:
firstly, extracting a combined area; since the shadow is also a defect in the light guide plate and occupies a certain range in the image of the light guide plate, it is a correct choice to identify the shadow defect by combining the areas;
firstly, determining the area of a single pixel according to the size of a visual field range and the resolution of a picture taking camera, wherein the area of the single pixel of a shot image is 200/16384(16 multiplied by 1024) which is 0.0122 if the size of the visual field range (the range of the image which can be shot under a camera lens) is 200mm and the resolution of the camera is 16k (1k is 1024B); and then calculating the number of pixels occupied by the region, wherein the area of the region is obtained by multiplying the number of pixels by the area of a single pixel.
Secondly, extracting the contour length of the combined connected domain; in short, the shadow is a special outline in the light guide plate image, so that the effective identification can be carried out by combining the length of the outline;
the pixels have areas and also have side lengths, the side length of a single pixel can be obtained according to the number of pixels contained in the width of a fixed range, for example, if 2000 pixels are contained in the width of 10mm, the side length of the single pixel is 10/2000 ═ 0.005, and the contour length of the shadow region can be obtained by multiplying the number of pixels at the edge of the shadow region by the side length of the single pixel.
Thirdly, extracting by combining the eccentricity; because the shadow curve and the ellipse arc length have similar characteristics, the extraction can be carried out through the eccentricity, and the formula of the eccentricity is as follows:
Figure GDA0003339691150000111
in the formula: raAnd RbRespectively elliptical major semi-axisThe length and the length of the minor semi-axis are smooth like an ellipse by a dark curve, so that the R can be obtained by approximately regarding the dark curve as a section of 'arc length' of the ellipseaAnd RbAs is eccentricity;
the three characteristics are combined for identification and judgment, so that misjudgment can be reduced to the maximum extent, and shadow defects can be successfully extracted. Setting a range of areas, such as minimum and maximum values of areas; and setting the range of the profile length and the range of the eccentricity, and when the area, the profile length and the eccentricity of the shadow defect are all in the range of the set index, the system can automatically extract the shadow.
(16) And displaying the shadow defects extracted in the step 15.
Experiment one:
1. acquiring the image shown in FIG. 2 by using a surface frame camera, and converting the image into a gray scale image;
2. carrying out image enhancement on the gray level image according to the formula in the step 3 to obtain an enhanced image shown in the figure 3;
3. performing salt and pepper noise removal on the enhanced image according to the step 4, wherein the size of the filtering window is selected to be 7 multiplied by 7 (obtained by experiments);
4. performing Gaussian filtering on the image from which the salt and pepper noise is removed;
5. the image is first transformed into the frequency domain according to the following fourier transform formula,
Figure GDA0003339691150000112
6. gaussian noise elimination is then performed, and the formula is as follows
Figure GDA0003339691150000121
Finally, returning the filtered image to a time domain through the following Fourier inverse transformation formula;
Figure GDA0003339691150000122
7. carrying out convolution in different directions on the Gaussian filtered image through Gaussian derivatives;
the deviation in the y direction is shown,
Figure GDA0003339691150000123
the deviation in the xy direction is shown,
Figure GDA0003339691150000124
8. subtracting images in different Gaussian partial derivative directions;
9. gray value normalization by the following formula
f*(x,y)=f(x,y)×Mult+Add
Figure GDA0003339691150000125
Converting the normalized image into a byte form;
10. image self-addition is carried out according to the following formula
f12+(x,y)=(f1(x,y)+f2(x,y))×Factor+Value
And (4) performing two times of mean filtering on the self-added image according to the formula in the step 11, wherein the size of the filter during the first filtering is 35 × 30, and the size of the filter during the second filtering is 70 × 70 (obtained by experiments).
11. Performing difference on the image subjected to the two times of mean filtering according to the following formula;
f12-(x,y)=(f1(x,y)-f2(x,y))×C1+C2
here C1Selection 35, C2Select 0 (experimentally);
12. threshold segmentation is carried out on the difference image after mean filtering, and the formula is as follows
t=Max[ω1(t)×(u1(t)-u)22(t)×(u2(t)-u)2]
13. Analyzing the images after the threshold value by the connected domain;
14. extracting shadows according to features
The shadow is extracted by combining the area, the profile length and the eccentricity, wherein the area range is selected to be 2000-10000, the profile length range is 2000-90000, and the eccentricity is 7-21 (obtained by experiments).
Finally, it is also noted that the above-mentioned lists merely illustrate a few specific embodiments of the invention. It is obvious that the invention is not limited to the above embodiments, but that many variations are possible. All modifications which can be derived or suggested by a person skilled in the art from the disclosure of the present invention are to be considered within the scope of the invention.

Claims (7)

1. The method for detecting the shadow defect of the light guide plate is characterized by comprising the following steps of:
(1) acquiring a light guide plate image F, and executing the step 2;
(2) acquiring the size, the height and the width of the light guide plate image F, wherein the height and the width are M and N respectively; executing the step 3;
(3) enhancing the contrast of the light guide plate image F to obtain an image with enhanced contrast, and executing the step 4;
(4) suppressing salt and pepper noise of the image after the contrast enhancement to obtain an image after the salt and pepper noise suppression; executing the step 5;
(5) filtering the image with the salt and pepper noise suppressed to obtain an image with the noise eliminated; executing the step 6;
(6) performing two convolutions of the first-order partial derivative in the y direction and the second-order partial derivative in the xy direction on the image without the noise to obtain a convolved image F1And F2(ii) a Executing the step 7;
(7) FIG. F1Minus F2Obtaining a subtracted image; executing the step 8;
(8) adjusting the gray value of the image subjected to subtraction to be between 0 and 255 to obtain an image with normalized gray value; executing the step 9;
(9) performing type conversion on the image with the normalized gray value to obtain a byte image, and executing the step 10;
(10) carrying out self-addition on the byte image to obtain a self-added image; executing the step 11;
self-addition is to process the pixel gray value of the input image according to the following rule:
Figure DEST_PATH_IMAGE002
in the formula
Figure DEST_PATH_IMAGE004
And
Figure DEST_PATH_IMAGE006
are respectively two byte images
Figure DEST_PATH_IMAGE008
The gray-scale value of (a) is,
Figure DEST_PATH_IMAGE010
is a function of the gray value adaptation factor,
Figure DEST_PATH_IMAGE012
is a gray value adaptive range value,
Figure DEST_PATH_IMAGE014
is the gray value of the added image;
(11) carrying out two times of mean filtering on the self-added image continuously to obtain a first filtered image and a second filtered image; executing step 12;
(12) subtracting the image after the second filtering from the image after the first filtering to obtain a result image; executing step 13;
(13) performing threshold segmentation processing on the result image to obtain a background part and a foreground part; step 14 is executed;
(14) calculating a connected domain of the foreground image through connected domain analysis, and taking the area blocks which are not connected together as small areas with different characteristics; step 15 is executed;
(15) performing feature extraction on the connected domain obtained in the step 14 to obtain a shadow defect; step 16 is executed;
(16) and displaying the shadow defects extracted in the step 15.
2. The method for detecting the shadow defect of the light guide plate according to claim 1, wherein the step 4 comprises the following steps:
marking points with the gray scale value of 0 or 255 in the light guide plate image F as noise points, and then increasing window filtering to search the minimum window filtering size comprising non-noise points for corresponding filtering calculation;
when the filtering size of the window reaches the upper threshold T of the window and still the minimum filtering window including the non-noise points can not be found, counting the number N of 0 pixel points with the gray value as 0 in the window with the size of T and taking the noise points as the center0Number N of pixels with sum gray value of 255255The following formula is adopted:
Figure DEST_PATH_IMAGE016
Figure DEST_PATH_IMAGE018
is the gray value of the area;
when the minimum filtering window is found before the filtering size of the window reaches the upper threshold T of the window, filtering noise points in the minimum filtering window to obtain a non-noise point set TG, and performing linear weighting by using pixel gray value points in the set TG to obtain noise points
Figure DEST_PATH_IMAGE020
The recovery value of (b):
Figure DEST_PATH_IMAGE022
in the above formula
Figure DEST_PATH_IMAGE024
Represents any one point in the non-noise point set TG; according to non-noise points
Figure 383557DEST_PATH_IMAGE024
Can obtain
Figure DEST_PATH_IMAGE025
Figure DEST_PATH_IMAGE027
In TG
Figure DEST_PATH_IMAGE028
To the pixel point of
Figure DEST_PATH_IMAGE029
Euclidean distance of noise point, W is
Figure DEST_PATH_IMAGE031
A normalized value of (d);
Figure DEST_PATH_IMAGE033
Figure DEST_PATH_IMAGE035
3. the method for detecting the shadow defect of the light guide plate according to claim 2, wherein the step 5 comprises the following steps:
5.1) converting the image with the salt and pepper noise suppressed from the time domain into the frequency domain by two-dimensional discrete Fourier transform, wherein the two-dimensional discrete Fourier transform formula is as follows:
Figure DEST_PATH_IMAGE037
in the formula
Figure DEST_PATH_IMAGE039
Is at
Figure DEST_PATH_IMAGE041
The complex function of (a) the above,
Figure DEST_PATH_IMAGE043
is that
Figure 195305DEST_PATH_IMAGE039
A complex function after Fourier transform;
Figure DEST_PATH_IMAGE045
and
Figure DEST_PATH_IMAGE047
respectively representing the width and height of the sampling rectangular grid,
Figure DEST_PATH_IMAGE049
and
Figure DEST_PATH_IMAGE051
respectively representing the boundary length of the row and the boundary length of the width of the sampling array;
5.2) according to the window size and the distance between the element in the window and the central point, the selection and distribution of the coefficient weight is realized through a Gaussian function, and the specific formula is as follows:
Figure DEST_PATH_IMAGE053
in the formula (I), the compound is shown in the specification,
Figure DEST_PATH_IMAGE055
indicating the position of the center
Figure 733297DEST_PATH_IMAGE020
Neighborhood of element of size
Figure DEST_PATH_IMAGE057
Figure DEST_PATH_IMAGE059
Representing a spatial distance similarity weight factor;
Figure DEST_PATH_IMAGE061
is that
Figure DEST_PATH_IMAGE062
5.3) carrying out convolution in a frequency domain on the filtered image;
5.4) converting the convolved image from the frequency domain to the time domain by two-dimensional inverse discrete Fourier transform, wherein the two-dimensional inverse discrete Fourier transform formula is as follows:
Figure DEST_PATH_IMAGE064
4. the method for detecting the shadow defect of the light guide plate according to claim 3, wherein the step 8 comprises:
Figure DEST_PATH_IMAGE066
Figure DEST_PATH_IMAGE068
in the formula
Figure DEST_PATH_IMAGE070
And
Figure DEST_PATH_IMAGE072
respectively the maximum and minimum grey value of the image area,
Figure 486096DEST_PATH_IMAGE018
before normalization of the image
Figure 991813DEST_PATH_IMAGE020
The pixel value of (c).
5. The method for detecting the shadow defect of the light guide plate according to claim 4, wherein the step 11 comprises:
the filtering method comprises the following steps:
Figure DEST_PATH_IMAGE074
in the formula (I), the compound is shown in the specification,
Figure DEST_PATH_IMAGE076
where m and n are the filter window sizes, respectively, and m and n are obtained experimentally,
Figure DEST_PATH_IMAGE078
in order to be a function of the weighting,
Figure DEST_PATH_IMAGE080
in order to be able to filter the noise image before filtering,
Figure DEST_PATH_IMAGE082
the filtered smooth image is obtained;
self-additive images
Figure DEST_PATH_IMAGE083
Obtaining a first filtering through two continuous mean value filteringThe latter image and the second filtered image.
6. The method for detecting the shadow defect of the light guide plate according to claim 5, wherein the step 13 comprises:
the formula for performing threshold segmentation by the OSTU method is as follows:
Figure DEST_PATH_IMAGE085
in the formula
Figure DEST_PATH_IMAGE087
And
Figure DEST_PATH_IMAGE089
the background part and the foreground part respectively account for the proportion of the image obtained in step 12, and
Figure DEST_PATH_IMAGE091
and
Figure DEST_PATH_IMAGE093
then the average values of the background portion and the foreground portion are obtained, u is the average value of the light guide plate image F, and t is the segmentation threshold.
7. The method for detecting the shadow defect of the light guide plate according to claim 6, wherein the step 15 comprises the following steps:
firstly, extracting a combined area;
determining the area of a single pixel according to the size of the visual field and the resolution of the image-taking camera, then calculating the number of pixels occupied by the area, and multiplying the number of pixels by the area of the single pixel to obtain the area of the area;
secondly, extracting the contour length of the combined connected domain;
the number of the edge pixels of the shadow area is multiplied by the side length of a single pixel to obtain the outline length of the shadow area;
thirdly, extracting by combining the eccentricity;
the formula for the eccentricity is as follows:
Figure DEST_PATH_IMAGE095
in the formula:
Figure DEST_PATH_IMAGE097
and
Figure DEST_PATH_IMAGE099
respectively the length of the long half shaft and the length of the short half shaft of the shadow curve,
Figure DEST_PATH_IMAGE101
is the eccentricity.
CN201810541338.6A 2018-05-30 2018-05-30 Shadow defect detection method for light guide plate Active CN108876768B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201810541338.6A CN108876768B (en) 2018-05-30 2018-05-30 Shadow defect detection method for light guide plate

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810541338.6A CN108876768B (en) 2018-05-30 2018-05-30 Shadow defect detection method for light guide plate

Publications (2)

Publication Number Publication Date
CN108876768A CN108876768A (en) 2018-11-23
CN108876768B true CN108876768B (en) 2022-05-06

Family

ID=64335615

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810541338.6A Active CN108876768B (en) 2018-05-30 2018-05-30 Shadow defect detection method for light guide plate

Country Status (1)

Country Link
CN (1) CN108876768B (en)

Families Citing this family (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109785290B (en) * 2018-12-19 2020-01-24 湖南长达检测股份有限公司 Steel plate defect detection method based on local illumination normalization
CN110084768B (en) * 2019-05-10 2023-06-20 江南大学 Defect detection method of LCD light guide plate based on background filtering
CN110298825B (en) * 2019-06-17 2021-07-02 杭州舜浩科技有限公司 Method for detecting black spot defect of light guide plate
CN110361400A (en) * 2019-07-01 2019-10-22 创新奇智(合肥)科技有限公司 A kind of bubble detecting method and electronic equipment of cast iron part
CN110530883B (en) * 2019-09-30 2022-08-02 凌云光技术股份有限公司 Defect detection method
CN111598847A (en) * 2020-04-28 2020-08-28 浙江华睿科技有限公司 Glass surface defect detection method, device and computer readable storage medium
CN112070095A (en) * 2020-09-14 2020-12-11 衢州学院 Grapefruit disease and insect pest monitoring method based on Internet of things technology
CN112710632A (en) * 2021-03-23 2021-04-27 四川京炜交通工程技术有限公司 Method and system for detecting high and low refractive indexes of glass beads
CN113262495B (en) * 2021-05-27 2022-01-18 南京比夫网络科技有限公司 AI electricity contest operation robot based on artificial intelligence
CN113804693A (en) * 2021-09-10 2021-12-17 杭州衡眺科技有限公司 Visual detection device for defects of light guide plate of mobile phone

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN205229061U (en) * 2015-11-23 2016-05-11 苏州鼎纳自动化技术有限公司 LCD light guide plate defect detecting system based on line sweep camera
CN106353324A (en) * 2016-08-10 2017-01-25 浙江理工大学 Magnet ring surface defect extraction method
CN107103811A (en) * 2017-05-23 2017-08-29 常州工学院 A kind of virtual detection teaching platform and its application method with industrial ultra-thin materials production detection device
CN108072701A (en) * 2018-01-16 2018-05-25 滁州佳宏光电有限公司 A kind of light guide plate characterization processes

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN205229061U (en) * 2015-11-23 2016-05-11 苏州鼎纳自动化技术有限公司 LCD light guide plate defect detecting system based on line sweep camera
CN106353324A (en) * 2016-08-10 2017-01-25 浙江理工大学 Magnet ring surface defect extraction method
CN107103811A (en) * 2017-05-23 2017-08-29 常州工学院 A kind of virtual detection teaching platform and its application method with industrial ultra-thin materials production detection device
CN108072701A (en) * 2018-01-16 2018-05-25 滁州佳宏光电有限公司 A kind of light guide plate characterization processes

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
Surface defect inspection of light guided plates with the computer‐vision assisted detection method;Ming‐Shyan Huang 等;《Journal of the Chinese Institute of Engineers》;20110304;全文 *
液晶显示屏背光源模组表面缺陷自动光学检测系统设计;史艳琼 等;《传感技术学报》;20151231;全文 *

Also Published As

Publication number Publication date
CN108876768A (en) 2018-11-23

Similar Documents

Publication Publication Date Title
CN108876768B (en) Shadow defect detection method for light guide plate
CN108460757B (en) Mobile phone TFT-LCD screen Mura defect online automatic detection method
CN111563889B (en) Liquid crystal screen Mura defect detection method based on computer vision
CN108346141B (en) Method for extracting defects of single-side light-entering type light guide plate
CN107490582B (en) Assembly line workpiece detection system
CN109064439B (en) Partition-based single-side light-entering type light guide plate shadow defect extraction method
CN109102497B (en) High-resolution light guide plate image defect detection method
CN114881915A (en) Symmetry-based mobile phone glass cover plate window area defect detection method
CN113686869A (en) Micro-defect recognition device for insulating blanket
CN113706461A (en) Micro-defect identification system of insulating blanket based on image identification
US9258460B2 (en) Image processing method and apparatus for correcting an image
CN112308843A (en) Camera overexposure abnormity adjusting method and system for photovoltaic cell panel image acquisition
Ma et al. An automatic detection method of Mura defects for liquid crystal display
CN115272256A (en) Sub-pixel level sensing optical fiber path Gaussian extraction method and system
CN112801891B (en) Display screen picture detection method and display screen picture detection system
CN110186929A (en) A kind of real-time product defect localization method
CN108230334B (en) High-concentration wind-blown sand image segmentation method based on gray threshold
CN117011291A (en) Watch shell quality visual detection method
Han et al. Automatic illumination and color compensation using mean shift and sigma filter
CN110530894B (en) Light guide plate bright spot defect detection method
CN111563869B (en) Stain test method for quality inspection of camera module
CN117197108A (en) Optical zoom image quality evaluation method, system, computer device and medium
Tabatabaei et al. A novel method for binarization of badly illuminated document images
CN114972084A (en) Image focusing accuracy evaluation method and system
Prabha et al. Defect detection of industrial products using image segmentation and saliency

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

Effective date of registration: 20211118

Address after: No. 568, Jiangxing East Road, Wujiang Economic and Technological Development Zone, Suzhou, Jiangsu 215217

Applicant after: Jinmingshan photoelectric (Wujiang) Co.,Ltd.

Address before: Room c-703-2, 198 Qidi Road, Xiaoshan Economic and Technological Development Zone, Xiaoshan District, Hangzhou City, Zhejiang Province

Applicant before: HANGZHOU SHUNHAO TECHNOLOGY Co.,Ltd.

GR01 Patent grant
GR01 Patent grant