Method, electronic device and storage medium for quality inspection of display screen
By acquiring and processing multiple exposure images of the display screen, filtering interference components, and using a deep neural network model, the problem of strabismus scratch defect detection in the existing technology is solved, and the accuracy and efficiency of display screen quality inspection are improved.
Patent Information
- Application Number
- CN202411027400.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-30
- Publication Date
- 2024-10-29
- Estimated Expiration
- 2044-07-30
AI Technical Summary
Existing automatic optical inspection technology is difficult to effectively detect strabismus scratch defects in display screens. Especially when shooting at low angles, image unevenness increases the difficulty of detection, resulting in low detection accuracy and efficiency.
By acquiring the first exposure image and the second exposure image, performing region of interest extraction and boundary extraction operations, obtaining interference image data, filtering interference components, and combining the deep neural network model for defect detection, identifying strabismus scratch defects and their types.
It improves the accuracy and reliability of display screen quality inspection, reduces over-inspection situations, improves detection efficiency, and achieves highly stable strabismus scratch defect detection.
Smart Images

Figure CN118552545B_ABST
Abstract
Description
Technical Field
[0001] The present disclosure generally relates to the field of quality inspection technology. More specifically, the present disclosure relates to a method for quality inspection of a display screen, an electronic device, and a computer-readable storage medium. Background Art
[0002] In the display screen quality inspection industry, Automated Optical Inspection (AOI) technology plays a vital role. This technology detects common defects encountered in display screen production based on optical principles, and has the advantages of high detection stability, low missed detection rate and high detection efficiency. During automatic detection, the machine collects images through the camera, detects defects through image processing, and displays or identifies the defects through the display or automatic annotation, so that maintenance personnel can repair the defects.
[0003] However, the complexity of the squint lighting filter design makes it particularly difficult for AOI to detect squint scratch defects. Especially when taking photos at low angles, the display of the screen where the squint scratch defect is located often appears uneven, which undoubtedly increases the difficulty of detection. In addition, once the squint scratch defect appears, it usually presents a large-scale characteristic, which brings a greater hidden danger to the display screen quality.
[0004] In view of this, there is an urgent need to provide a solution for quality inspection of display screens, so as to achieve effective detection of squint scratch defects, improve the accuracy of quality inspection of display screens, and enhance the quality of display screens. Summary of the invention
[0005] In order to at least solve one or more of the technical problems mentioned above, the present disclosure proposes a solution for quality inspection of a display screen in the following aspects.
[0006] In a first aspect, the present disclosure provides a method for quality inspection of a display screen, comprising: acquiring a first exposure image, a second exposure image, and a first target image containing a strabismus scratch defect; performing a region of interest extraction operation on the first target image to obtain regional information and defect image data of the image region where the strabismus scratch defect is located; obtaining interference image data from the first exposure image and the second exposure image based on the regional information; obtaining a second target image containing an image data difference based on an image data difference between the defect image data and the interference image data; and inputting the second target image into a defect detection model to perform a defect detection operation to perform quality inspection on the display screen.
[0007] In some embodiments, obtaining interference image data from the first exposure image and the second exposure image according to the area information includes: determining the lower half area image of the first exposure image and the upper half area image of the second exposure image according to the area height in the area information; performing boundary extraction operations on the lower half area image and the upper half area image, respectively, to determine a first interference area in the lower half area image and a second interference area in the upper half area image; and obtaining interference image data from the first exposure image and the second exposure image based on the first interference area and the second interference area.
[0008] In some embodiments, performing boundary extraction operations on the lower half area image and the upper half area image respectively includes: taking the lower half area image and the upper half area image as images to be operated respectively, and performing the following boundary extraction operations on the images to be operated: performing a binarization operation on the image to be operated to obtain a binarized image to be operated; performing an opening operation on the binarized image to be operated to obtain an interference detection image; performing a contour detection operation on the interference detection image to obtain an interference contour of an interference object in the interference detection image; and determining an interference area in the interference detection image based on the interference contour.
[0009] In some embodiments, performing a region of interest extraction operation on the first target image to obtain region information and defect image data of the image region where the strabismus scratch defect is located includes: performing a binarization operation on the first target image to obtain a binarized target image; and performing a region of interest extraction operation on the binarized target image to obtain region information and defect image data of the image region where the strabismus scratch defect is located.
[0010] In some embodiments, performing a region of interest extraction operation on a binary target image to obtain region information and defect image data includes: performing a straight line fitting operation on the binary target image to obtain region information of the image region where the strabismus scratch defect is located; and acquiring defect image data from the first target image based on the region information.
[0011] In some embodiments, performing a region of interest extraction operation on a binarized target image to obtain region information and defect image data includes: performing a closing operation on the binarized target image to obtain a defect detection image; performing a contour detection operation on the defect detection image to obtain a defect contour of a strabismus scratch defect in the defect detection image; determining region information based on the defect contour; and acquiring defect image data from the first target image based on the region information.
[0012] In some embodiments, the defect detection model is a model obtained by training with a deep neural network model, and the defect detection model obtained by training with a deep neural network includes: labeling the defect type of a training image containing a strabismus scratch defect to form an image label; and inputting the training image and the image label as training data into the deep neural network model to train the deep neural network model to obtain the defect detection model.
[0013] In some embodiments, defect types include: point scratches, cluster scratches, and irregular scratches, and inputting training images and image labels as training data into a deep neural network model to train the deep neural network model includes: constructing a loss function including multi-classification cross entropy loss and regularization loss; and based on the loss function, inputting training images and image labels as training data into the deep neural network model to train the deep neural network model.
[0014] In a second aspect, the present disclosure provides an electronic device comprising: a processor; and a memory on which program instructions for performing quality inspection on a display screen are stored. When the program instructions are executed by the processor, the method in the aforementioned first aspect and its multiple embodiments are implemented.
[0015] In a third aspect, the present disclosure provides a computer-readable storage medium storing program instructions for quality inspection of a display screen. When the program instructions are executed by a processor, the method in the first aspect and its multiple embodiments are implemented.
[0016] According to the scheme for quality inspection of the display screen provided above, by performing an area of interest extraction operation on the first target image, defect image data including interference image data can be obtained, and by processing the first exposure image and the second exposure image, interference image data of the display screen surface can be obtained. Thereafter, the real defect image data can be obtained by the image data difference between the defect image data and the interference image data. The real defect image data is input into the defect detection model for defect detection operation, and the squint scratch defect and its defect type of the display screen can be effectively detected. The scheme disclosed in this disclosure helps to improve the accuracy of quality inspection of display screens and enhance the quality of display screens.
[0017] Further, in some embodiments, when obtaining interference image data of the display screen surface, a boundary extraction operation may be performed on the lower half area image of the first exposure image and the upper half area image of the second exposure image to obtain the first interference area and the second interference area. Next, interference image data may be obtained from the first exposure image and the second exposure image based on the first interference area and the second interference area. Thereafter, based on the image data difference between the defect image data and the interference image data, the interference components in the defect image data may be well filtered to obtain more realistic defect image data. By inputting more realistic defect image data into the defect detection model for defect detection operations, more realistic and reliable defect detection results may be obtained, which helps to improve the reliability of display screen quality inspection.
[0018] Furthermore, in some embodiments, a deep neural network model is trained using training images and image labels containing strabismus scratch defects to obtain a defect detection model. The trained defect detection model can not only detect the strabismus scratch defects contained in the image, but also determine the defect type of the strabismus scratch defects. In addition, the trained defect detection model has good generalization ability and stability. When used for the quality inspection of display screens, it can achieve high-stability strabismus scratch defect detection, thereby providing reliable guarantee for the quality inspection of display screens. BRIEF DESCRIPTION OF THE DRAWINGS
[0019] By reading the detailed description below with reference to the accompanying drawings, the above and other objects, features and advantages of the exemplary embodiments of the present disclosure will become readily understood. In the accompanying drawings, several embodiments of the present disclosure are shown in an exemplary and non-limiting manner, and the same or corresponding reference numerals represent the same or corresponding parts, wherein:
[0020] Figure 1 is an exemplary flow chart showing a method for quality inspection of a display screen according to an embodiment of the present disclosure;
[0021] Figure 2 is a schematic diagram showing an exemplary structure of a device for quality inspection of a display screen according to an embodiment of the present disclosure;
[0022] Figure 3 is a schematic diagram showing an exemplary structure of a terminal for performing quality inspection on a display screen according to an embodiment of the present disclosure. DETAILED DESCRIPTION
[0023] The following will be combined with the drawings in the embodiments of the present disclosure to clearly and completely describe the technical solutions in the embodiments of the present disclosure. Obviously, the described embodiments are part of the embodiments of the present disclosure, not all of the embodiments. Based on the embodiments in the present disclosure, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of the present disclosure.
[0024] Overview of this Disclosure
[0025] In the process of implementing the present disclosure, the applicant found that for the detection of squint scratch defects, the existing processing methods can be roughly divided into only detecting white defects without squint filtering and squint alone lighting for filtering. In actual operation, the processing method of only detecting white defects without squint filtering often results in over-inspection due to interference such as dust, scratches and bubbles on the surface of the display screen, which are also white. Although the processing method of squint alone lighting for squint filtering is not prone to over-inspection, the increase in light sources has caused an increase in costs. At the same time, the problem of light source interference makes it impossible to illuminate and take photos in parallel at different azimuth angles, resulting in a significant reduction in quality inspection efficiency. In addition, due to squint photography, especially shooting at a lower angle, the image display is uneven, often showing a situation where the brightness of the upper half of the image is lower and the brightness of the lower half of the image is higher, resulting in the inability to uniformly divide the upper and lower half of the image. However, the processing method of performing defect detection on images with multiple sets of different parameters in different regions increases the difficulty of parameter control and reduces the efficiency of defect detection.
[0026] Based on this, the solution for quality inspection of display screens provided by the present disclosure can filter out interference components in defect image data and obtain real defect image data by processing the first exposure image, the second exposure image and the first target image containing the squint scratch defect. Furthermore, the solution disclosed in the present disclosure also inputs the second image data containing the real defect image data into the defect detection model for defect detection operation to realize re-judgment and correction of the second image data, so as to reduce the occurrence of over-inspection and obtain more accurate detection results. Using the solution disclosed in the present disclosure, squint scratch defects and their defect types of display screens can be effectively detected, which helps to improve the accuracy of quality inspection of display screens.
[0027] Exemplary Methods
[0028] Figure 1 1 is an exemplary flow chart showing a method 100 for quality inspection of a display screen according to an embodiment of the present disclosure. It is understood that the method 100 can be executed by any appropriate terminal with data processing capabilities, such as but not limited to a smart phone, a personal computer, a laptop computer, a tablet computer, and a portable wearable device. Therefore, the embodiment of the present disclosure does not limit the specific type of the terminal.
[0029] like Figure 1 As shown, at step S101, method 100 may use an industrial camera to acquire a first exposure image, a second exposure image, and a first target image containing a squint scratch defect.
[0030] In practical applications, a main view light source can be arranged at the quality inspection site, and multiple industrial cameras can be arranged at multiple different positions of the quality inspection site. When it is necessary to obtain an image of the target position, method 100 can use an industrial camera located at the target position to obtain a first exposure image, a second exposure image, and a first target image containing a squint scratch defect at the target position. The target position here can be any position in a plurality of different positions. The first exposure image, the second exposure image, and the first target image obtained by method 100 can be grayscale images, and can have the same image size and shooting position. Using the scheme for obtaining images disclosed in the present invention, there is no need to arrange a squint light source at the quality inspection site, which can save the cost of the light source. At the same time, since only the main view light source is arranged at the quality inspection site, there is no problem of light source interference, and different positions can take pictures in parallel, which helps to improve the quality inspection efficiency.
[0031] As mentioned above, the image obtained by oblique shooting has the problem of low brightness in the upper half and high brightness in the lower half, and uneven image distribution. This problem will make it impossible to uniformly segment the upper and lower halves of the image, making defect detection and interference filtering more difficult and less accurate.
[0032] In one implementation scenario, in order to obtain a uniformly distributed oblique image and improve the accuracy of defect detection and interference filtering, when method 100 obtains the first exposure image and the second exposure image, the target grayscale value of the first exposure image and the second exposure image can be determined first. Then, the light source can be controlled to turn on, and the industrial camera can be controlled to shoot, so as to obtain the first exposure image and the second exposure image.
[0033] In this implementation scenario, the first exposure image and the second exposure image correspond to different exposure values. Additionally or optionally, the exposure value for shooting the second exposure image is greater than the exposure value for shooting the first exposure image. The grayscale value of the first exposure image that satisfies its lower half area is the target grayscale value, and the grayscale value of the second exposure image that satisfies its upper half area is the target grayscale value. Thus, the combination of the lower half area of the first exposure image and the upper half area of the second exposure image can obtain a uniformly distributed oblique image. It is understandable that the specific values of the exposure value for shooting the first exposure image, the exposure value for shooting the second exposure image, and the target grayscale value do not constitute a limitation of the present disclosure. Those skilled in the art can select the exposure value and the target grayscale value for shooting the first exposure image and the second exposure image according to actual needs.
[0034] In the solution disclosed herein, the squint scratch defect is a white defect existing in the squint image of the display screen. The screen where the squint scratch defect is located is usually a white screen. The white screen here is a standard screen for display screen quality inspection. In an implementation scenario, when method 100 obtains the first target image containing the squint scratch defect, after the PG is powered on, it can switch to the white screen where the squint scratch defect is located according to the corresponding instructions, and then control the industrial camera to take a picture to obtain the first target image.
[0035] Next, at step S102, the method 100 may perform an area of interest extraction operation on the first target image to obtain the area information and defect image data of the image area where the squint scratch defect is located. Here, the area of interest is the image area where the squint scratch defect is located, and the defect image data is the grayscale data of the image area where the squint scratch defect is located. It can be understood that there are often interferences such as dust, scratches and bubbles on the surface of the display screen, so the first target image contains the imaging data of the interference. In other words, the defect image data obtained by the method 100 contains the imaging data of the squint scratch defect and the imaging data of interferences such as dust, scratches and bubbles on the surface of the display screen.
[0036] By performing an ROI extraction operation on the first target image, method 100 can determine an image region in the first target image where a squint scratch defect exists. Additionally or optionally, the image region is a rectangular region, and the area of the image region is larger than the surface area of the squint scratch defect. In one embodiment, the region information may include but is not limited to region width, region height, and region vertex coordinates, and the region vertex coordinates may be upper left vertex coordinates, lower left vertex coordinates, lower right vertex coordinates, and / or upper right vertex coordinates.
[0037] Next, at step S103, method 100 can obtain interference image data of interferences such as dust, scratches and bubbles on the surface of the display screen from the first exposure image and the second exposure image according to the regional information. Here, the interference image data can be image data that interferes with the detection of strabismus scratch defects. In one embodiment, the interference image data can include but is not limited to imaging data of interferences such as dust, scratches and bubbles on the surface of the display screen. The regional information disclosed herein establishes a positional correspondence between the defect image data obtained in step S102 and the interference image data here. Method 100 can obtain interference image data of the image area where the strabismus scratch defect is located from the first exposure image and the second exposure image according to the regional information.
[0038] As mentioned above, the defect image data includes the imaging data of the squint scratch defect and the imaging data of the interference on the display screen surface, so the image data difference between the defect image data and the interference image data is the real defect image data. Based on this, at step S104, the method 100 can obtain a second target image including the image data difference based on the image data difference between the defect image data and the interference image data, that is, a second target image including the real defect image data. The image size of the second target image here is smaller than the image size of the first exposure image and the second exposure image.
[0039] Finally, at step S105, the method 100 can input the second target image into the defect detection model to perform defect detection operations, and can not only identify the squint scratch defect in the second target image, but also determine its defect type, thereby realizing quality inspection of the display screen. Here, identifying the squint scratch defect in the second target image can be, for example, obtaining a mask of the squint scratch defect in the second target image, or, for example, obtaining an edge of the squint scratch defect in the second target image. Therefore, the defect detection result output by the defect detection model of the present disclosure may include a mask, an edge, and / or a defect type of the squint scratch defect.
[0040] In one implementation scenario, the method 100 may also output the defect detection results output by the defect detection model, for example, the defect detection results may be output to a handheld device of a quality inspector. Additionally or optionally, the method 100 may also output the quality inspection results in a visual manner so that the quality inspector can respond in a timely manner according to the quality inspection results.
[0041] Combination of the above Figure 1 A method 100 for quality inspection of a display screen is described. The method 100 can obtain second target image data including real defect image data by processing a first exposure image, a second exposure image, and a first target image including a squint scratch defect. The second image data including the real defect image data is input into a defect detection model for defect detection operation, and the squint scratch defect and its defect type of the display screen can be effectively detected. The disclosed solution helps to improve the accuracy of display screen quality inspection and enhance the quality of the display screen.
[0042] Next, continue to refer to Figure 1At the aforementioned step S102, when the method 100 performs an ROI extraction operation on the first target image to obtain the region information and defect image data of the image region where the strabismus scratch defect is located, the method 100 may first perform a binarization operation on the first target image to obtain a binarized target image. Then, the ROI extraction operation may be performed on the binarized target image to obtain the region information and defect image data of the image region where the strabismus scratch defect is located. Further, when the method 100 performs an ROI extraction operation on the binarized target image to obtain the region information and defect image data, the method 100 may perform a straight line fitting operation on the binarized target image to obtain the region information of the image region where the strabismus scratch defect is located. Thereafter, the defect image data may be acquired from the first target image based on the region information.
[0043] In one embodiment, when performing a binarization operation on the first target image, a global threshold method or an adaptive threshold method may be used to convert the first target image into a binary image. The threshold of the global threshold method or the adaptive threshold method should be selected so that the defective area (e.g., white or whitish area) where the strabismus scratch defect exists is clearly distinguished from the background. In one embodiment, the cv2.threshold function may be used to implement the binarization operation on the first target image so as to convert the first target image into a binary image to distinguish the defective area from the background.
[0044] The threshold used for the binarization operation can be automatically determined by the aforementioned maximum inter-class variance method OTSU, or it can be determined by manually setting the threshold. The benefit of using manually set thresholds to separate defect areas is that slightly stricter detection conditions can be set to minimize defect omissions. For the over-detected parts caused by slightly stricter detection conditions, they can be re-judged and corrected through subsequent defect detection models.
[0045] In the scheme disclosed herein, the straight line fitting operation performed on the binarized target image can be implemented by an algorithm such as the least squares method or the population mean method. Here, the least squares method is one of the most common straight line fitting methods, and the basic idea of the method is to determine the best fitting straight line by minimizing the residual square sum of the actual observed data points and the straight line. The basic idea of the population mean method is to calculate two mean points of the data set and then fit the straight line to the straight line passing through the two mean points.
[0046] As known to those skilled in the art, the methods of morphological operations include corrosion, expansion, opening operation, closing operation and top hat operation, etc. The application of morphological operations can eliminate small noise points or fill small defects. In the embodiment of the present disclosure, in order to detect defects to the greatest extent, method 100 can perform a closing operation on the binarized target image to connect adjacent defect areas as much as possible. Based on this, in one embodiment, when method 100 performs a region of interest extraction operation on the binarized target image to obtain region information and defect image data, a closing operation can be first performed on the binarized target image to obtain a defect detection image. Then, a contour detection operation can be performed on the defect detection image to obtain the defect contour of the strabismus scratch defect in the defect detection image. Next, the region information can be determined based on the defect contour, and the defect image data can be obtained from the first target image based on the region information.
[0047] In practical applications, the closing operation cv2.MORPH_CLOSE in the cv2.morphologyEx function can be used to perform a closing operation on the binary target image to obtain a defect detection image. Then, the cv2.findContours function can be used to perform a contour detection operation on the defect detection image to obtain the defect contour of the strabismus scratch defect in the defect detection image, that is, a continuous set of non-zero pixel points. Next, the cv2.boundingRect function can be used to obtain the bounding box of the defect contour, that is, the region information, which may include but is not limited to the region width w, region height h, and region vertex coordinates (x, y). Finally, the defect image data can be obtained from the first target image based on the region information.
[0048] After obtaining the regional information, the method 100 may proceed to step S103, and obtain interference image data from the first exposure image and the second exposure image according to the regional information. Specifically, the lower half regional image of the first exposure image and the upper half regional image of the second exposure image may be determined according to the regional height in the regional information. For example, the lower half regional image of the first exposure image and the upper half regional image of the second exposure image may be determined at half the regional height. Then, the interference image data of the lower half regional image of the first exposure image and the interference image data of the upper half regional image of the second exposure image may be obtained respectively by the threshold method, and the coordinate values of the interference image data may be calculated. Here, the maximum inter-class variance method OTSU may be applied to automatically determine the optimal threshold for the threshold method.
[0049] In one implementation scenario, when obtaining interference image data, method 100 may also perform boundary extraction operations on the lower half region image and the upper half region image, respectively, to determine a first interference region in the lower half region image and a second interference region in the upper half region image. Then, based on the first interference region and the second interference region, interference image data is obtained from the first exposure image and the second exposure image. In this scenario, when boundary extraction operations are performed on the lower half region image and the upper half region image, respectively, the lower half region image and the upper half region image may be used as images to be operated, and boundary extraction operations may be performed on the images to be operated. The boundary extraction operation may specifically include the following operations: performing a binarization operation on the image to be operated to obtain a binarized image to be operated; performing an open operation on the binarized image to be operated to obtain an interference detection image; performing a contour detection operation on the interference detection image to obtain an interference contour of an interference object in the interference detection image; and determining an interference region in the interference detection image based on the interference contour.
[0050] The first exposure image and the second exposure image disclosed in the present invention are images with obvious bimodal histograms. Based on this, in practical applications, the cv2.threshold function can be used to perform binarization processing on the first exposure image and the second exposure image so as to convert the first exposure image and the second exposure image into binary images. Here, the threshold used for the binarization processing can also be automatically determined by applying the aforementioned maximum inter-class variance method OTSU. Then, the opening operation in the morphological operation (for example, the cv2.MORPH_OPEN opening operation type in the cv2.morphologyEx function) can be applied to eliminate small noise points. Next, the cv2.findContours function can be used to find the interfering contour in the binary image, and the cv2.boundingRect function can be used to calculate the minimum vertical boundary rectangle of the interfering contour to obtain the vertical boundary of the interfering contour as the interference area.
[0051] Since the first exposure image and the second exposure image are distinguished by the upper and lower half regions, after obtaining the first interference region in the lower half region image and the second interference region in the upper half region image, the X coordinate of the interference image data in the upper half region and the X coordinate of the interference image data in the lower half region can be fixed to remain unchanged, and the Y coordinate of the interference image data in the lower half region needs to be added with the height of the upper half region, that is, the Y coordinate of the interference image data of the first exposure image needs to be added with the height of the interference image data of the second exposure image as its final Y coordinate. At this point, the interference image data and its coordinates can be obtained from the first exposure image and the second exposure image.
[0052] So far, the method 100 has acquired the defect image data and the interference image data. Next, according to the position correspondence between the defect image data and the interference image data, the interference image data can be subtracted from the defect image data to obtain the image data difference between the defect image data and the interference image data, which is the real defect image data.
[0053] At step S104, method 100 can obtain a second target image containing image data difference, that is, a second target image containing real defect image data. Specifically, the center point of the defect can be determined based on the region information, that is, center_x = (x + w) / 2, center_y = (y + h) / 2, center_x represents the X coordinate of the center point of the defect, x represents the X coordinate of the upper left corner vertex, w represents the region width, center_y represents the Y coordinate of the center of the defect, y represents the Y coordinate of the upper left corner vertex, and h represents the region height. Then, the upper left corner coordinate of the intercepted area can be calculated based on this center point, and the width and height of the intercepted area can be adjusted to ensure that the intercepted area does not exceed the boundary of the first target image.
[0054] In one embodiment, the width and height of the clipped area can be set to 224x224. Further, some operations can be performed to ensure that the clipped area does not exceed the boundary of the first target image: if the coordinate obtained by offsetting half of 224 pixels to the left from the center point (center_x, center_y) is less than 0, the left boundary of the clipped area is set to 0, otherwise, the left boundary of the clipped area is set to the offset coordinate; if the coordinate obtained by offsetting half of 224 pixels upward from the center point (center_x, center_y) is less than 0, the upper boundary of the clipped area is set to 0, otherwise, the upper boundary of the clipped area is set to the offset coordinate; if the coordinate obtained by offsetting 224 pixels to the right from the left boundary of the clipped area exceeds the width of the first target image, the right boundary of the clipped area is set to the width of the first target image, otherwise, the right boundary of the clipped area is set to the offset coordinate; if the coordinate obtained by offsetting 224 pixels downward from the upper boundary exceeds the height of the first target image, the lower boundary of the clipped area is set to the height of the first target image, otherwise, the lower boundary is set to the offset coordinate.
[0055] In practical applications, the cv2.copyMakeBorder function can be used to add a border around the clipped area and fill black pixels where necessary to create a 224x224 pixel image containing the clipped area. Thereafter, the cv2.imwrite function can be used to save the 224x224 pixel image to a specified file to obtain a second target image containing the real defect image data.
[0056] In the scheme disclosed herein, by inputting a second target image containing real defect image data into a defect detection model for defect detection operation, quality inspection of the display screen can be achieved. The defect detection model is a model obtained by training using a deep neural network model. In practical applications, the deep neural network model can use a ResNet model. In order to make the ResNet model more suitable for defect detection, the last few layers of the ResNet model, usually the fully connected layers, can be removed, and new fully connected layers can be added so that the number of its output neurons is the same as the number of defect types. In one embodiment, the defect types may include point scratches, cluster scratches, and irregular scratches. Thus, the number of output neurons can be defined as three.
[0057] In the scheme disclosed herein, the use of a deep neural network for training to obtain a defect detection model may specifically include the following operations: batch collecting training images containing strabismus scratch defects; annotating the defect types of the training images containing strabismus scratch defects to form image labels; and inputting the training images and image labels as training data into the deep neural network model to train the deep neural network model and obtain a defect detection model.
[0058] During the training phase of the defect detection model, the loss function is used to measure the difference between the prediction results of the defect detection model and the true label, and can guide the optimization process of the defect detection model. Therefore, choosing a suitable loss function is crucial to the performance of the defect detection model. Given that the defect detection operation of strabismus scratch defects is a multi-classification problem, a loss function containing multi-classification cross entropy loss and L2 regularization loss can be constructed. Then, based on the loss function, the training images and image labels are input as training data into the deep neural network model to train the deep neural network model. Among them, the multi-classification cross entropy loss is a commonly used loss function in classification tasks, especially suitable for multi-class classification problems. The reference of L2 regularization loss can reduce the overfitting of the defect detection model and improve the generalization ability of defect detection.
[0059] In one embodiment, the loss function for optimizing the defect detection model can be expressed as follows:
[0060] L total = Lcross-entropy +(lambda)L regularization (1)
[0061] Among them, L total represents the total loss, L cross-entropy is the multi-classification cross entropy loss, lambda is a hyperparameter, L regularization is the L2 regularization loss.
[0062] Multi-classification cross entropy loss L cross-entropy Specifically, it can be expressed as:
[0063] (2)
[0064] Where N is the number of samples, C is the number of defect types, is the true label (usually 0 or 1) that the i-th sample belongs to the j-th category, is the predicted probability that the i-th sample belongs to the j-th category.
[0065] L2 regularization loss L regularization Specifically, it can be expressed as:
[0066] (3)
[0067] Among them, w is the model weight, It means to find the square sum of all elements w in the weight vector W. λ is a hyperparameter used to control the strength of regularization. The larger λ is, the greater the impact of regularization and the greater the penalty of the model on the weight.
[0068] During the training process of the defect detection model, the performance of the defect detection model can be optimized by adjusting hyperparameters such as the learning rate and batch size. In an example, when the loss and accuracy meet expectations, the test set can also be used to evaluate the generalization ability of the defect detection model. This cycle is repeated until the performance of the defect detection model reaches the expected target effect, and then the trained defect detection model can be deployed for application. For example, the trained defect detection model can be deployed to actual applications to re-judge the squint scratch defect, and the re-judgement result can be used as the final defect detection result.
[0069] It should be understood that the method 100 for quality inspection of a display screen provided in the embodiment of the present disclosure is applicable to the detection of oblique scratch defects in different directions, and its processing process is combined with the above Figure 1 Steps S101-S105 are the same as described above and will not be repeated here.
[0070] Next, combine Figure 2 The device 200 for quality inspection of a display screen provided by the embodiment of the present disclosure is exemplarily introduced. Figure 2 As shown, the device 200 of the disclosed embodiment includes an image acquisition module 201, an image processing module 202 and a detection module 203, wherein:
[0071] The image acquisition module 201 is configured to acquire a first exposure image, a second exposure image, and a first target image containing a strabismus scratch defect.
[0072] The image processing module 202 is configured to process the first exposure image, the second exposure image and the first target image. Specifically, the image processing module 202 may include a first processing unit 2021, a second processing unit 2022 and a third processing unit 2023. The first processing unit 2021 is configured to perform an area of interest extraction operation on the first target image to obtain the region information and defect image data of the image region where the strabismus scratch defect is located; the second processing unit 2022 is configured to obtain interference image data from the first exposure image and the second exposure image according to the region information; the third processing unit 2023 is configured to obtain the second target image containing the image data difference based on the image data difference between the defect image data and the interference image data.
[0073] The detection module 203 is configured to input the second target image into the defect detection model to perform a defect detection operation so as to perform quality inspection on the display screen.
[0074] In an embodiment of the present disclosure, the second processing unit 2022 is also configured to determine a lower half area image of the first exposure image and an upper half area image of the second exposure image based on the area height in the area information; perform boundary extraction operations on the lower half area image and the upper half area image, respectively, to determine a first interference area in the lower half area image and a second interference area in the upper half area image; and obtain interference image data from the first exposure image and the second exposure image based on the first interference area and the second interference area.
[0075] In the embodiment of the present disclosure, the second processing unit 2022 is also configured to respectively use the lower half area image and the upper half area image as images to be operated, and perform the following boundary extraction operations on the images to be operated: perform a binarization operation on the image to be operated to obtain a binarized image to be operated; perform an opening operation on the binarized image to be operated to obtain an interference detection image; perform a contour detection operation on the interference detection image to obtain the interference contour of the interference object in the interference detection image; and determine the interference area in the interference detection image based on the interference contour.
[0076] In an embodiment of the present disclosure, the first processing unit 2021 is also configured to perform a binarization operation on the first target image to obtain a binarized target image; and perform a region of interest extraction operation on the binarized target image to obtain regional information and defect image data of the image region where the strabismus scratch defect is located.
[0077] In the embodiment of the present disclosure, the first processing unit 2021 is also configured to perform a straight line fitting operation on the binary target image to obtain regional information of the image area where the strabismus scratch defect is located; and obtain defect image data from the first target image based on the regional information.
[0078] In an embodiment of the present disclosure, the first processing unit 2021 is also configured to perform a closing operation on the binary target image to obtain a defect detection image; perform a contour detection operation on the defect detection image to obtain a defect contour of a strabismus scratch defect in the defect detection image; determine region information based on the defect contour; and obtain defect image data from the first target image based on the region information.
[0079] In the embodiment of the present disclosure, the defect detection model is a model obtained by training using a deep neural network model. Further, the apparatus 200 of the embodiment of the present disclosure may also include a training module 204, which is configured to obtain a defect detection model by training using a deep neural network. Specifically, the training module 204 is configured to annotate the defect type of the training image containing the strabismus scratch defect to form an image label; and input the training image and the image label as training data into the deep neural network model to train the deep neural network model to obtain a defect detection model.
[0080] In the embodiment of the present disclosure, the defect types include: point scratches, mass scratches and irregular scratches. The model training module 204 is also configured to construct a loss function including multi-classification cross entropy loss and regularization loss; and based on the loss function, input the training images and image labels as training data into the deep neural network model to train the deep neural network model.
[0081] Those skilled in the art can understand that the operations performed by the modules and units included in the device 200 correspond one-to-one to the steps of the method for quality inspection of the display screen in the aforementioned embodiment, and will not be described in detail here.
[0082] Figure 3 FIG. 3 is a schematic diagram showing an exemplary structure of a terminal 300 for performing quality inspection on a display screen according to an embodiment of the present disclosure. Figure 3 As shown in FIG. 1 , the terminal 300 of the embodiment of the present disclosure includes a processor 301 , a memory 302 and a communication bus 303 .
[0083] In the specific embodiment, the processor 301 may be at least one of an application-specific integrated circuit (ASIC), a digital signal processor (DSP), a digital signal processing image processing device (DSPD), a programmable logic image processing device (PLD), a field programmable gate array (FPGA), a CPU, a controller, a microcontroller, and a microprocessor. It can be understood that for different devices, the electronic device used to implement the above-mentioned processor function can also be other, which is not specifically limited in this embodiment.
[0084] In the embodiment of the present disclosure, the communication bus 303 is used to realize the connection and communication between the processor 301 and the memory 302; the memory 302 stores program instructions for quality inspection of the display screen; when the processor 301 executes the program instructions stored in the memory 302, the present disclosure is realized in combination with the attached Figure 1 A method for quality inspection of a display screen and multiple embodiments thereof are described.
[0085] Combination of the above Figure 3 A terminal for performing quality inspection on a display screen that can be used to perform the present disclosure is described. It should be understood that the terminal structure or architecture here is only exemplary, and the implementation method and implementation entity of the present application are not limited thereto, but can be changed without departing from the spirit of the present application.
[0086] It is understandable that the description of each embodiment in this disclosure emphasizes the differences between the embodiments, and the same or corresponding parts can be referenced to each other. For the purpose of brevity, this disclosure will not repeat them one by one.
[0087] It should be understood that when the terms "first", "second", "third" and "fourth" are used in the claims, the specification and the drawings of the present application, they are only used to distinguish different objects, rather than to describe a specific order. The terms "include" and "comprise" used in the specification and claims of the present application indicate the presence of the described features, wholes, steps, operations, elements and / or components, but do not exclude the presence or addition of one or more other features, wholes, steps, operations, elements, components and / or their collections.
[0088] It should also be understood that the terms used in this disclosure are only for the purpose of describing specific embodiments and are not intended to limit the disclosure. As used in this disclosure and claims, the singular forms of "a", "an", and "the" are intended to include the plural forms unless the context clearly indicates otherwise. It should also be further understood that the term "and / or" used in this disclosure and claims refers to any combination of one or more of the associated listed items and all possible combinations, including these combinations.
[0089] As used in this specification and claims, the term "if" can be interpreted as "when" or "upon" or "in response to determining" or "in response to detecting," depending on the context. Similarly, the phrases "if it is determined" or "if [described condition or event] is detected" can be interpreted as meaning "upon determination" or "in response to determining" or "upon detection of [described condition or event]" or "in response to detecting [described condition or event]," depending on the context.
[0090] According to the above description in combination with the accompanying drawings, those skilled in the art can also understand that the embodiments of the present application can also be implemented by a software program. Therefore, the present application also provides a computer-readable storage medium. The computer-readable storage medium can be used to implement the present application in combination with the accompanying drawings. Figure 1 A method for quality inspection of a display screen is described.
[0091] It should be noted that although the operations of the method of the present application are described in a specific order in the accompanying drawings, this does not require or imply that the operations must be performed in this specific order, or that all the operations shown must be performed to achieve the desired results. On the contrary, the steps depicted in the flow chart can be performed in a different order. Additionally or alternatively, some steps can be omitted, multiple steps can be combined into one step, and / or one step can be decomposed into multiple steps.
[0092] The embodiments of the present disclosure are described in detail above. Specific examples are used herein to illustrate the principles and implementation methods of the present disclosure. The description of the above embodiments is only used to help understand the method and its core idea of the present disclosure. At the same time, changes or deformations made by those skilled in the art based on the ideas of the present disclosure, the specific implementation methods and the scope of application of the present disclosure, all belong to the scope of protection of the present disclosure. In summary, the content of this specification should not be understood as a limitation on the present disclosure.
Claims
1. A method for quality inspection of a display screen, comprising: Acquire a first exposure image, a second exposure image, and a first target image containing a strabismus scratch defect, wherein an exposure value for shooting the second exposure image is greater than an exposure value for shooting the first exposure image, a grayscale value of a lower half area of the first exposure image satisfies a target grayscale value, a grayscale value of an upper half area of the second exposure image satisfies a target grayscale value, and a combination of the lower half area of the first exposure image and the upper half area of the second exposure image is a uniformly distributed strabismus image; Performing an area of interest extraction operation on the first target image to obtain area information and defect image data of the image area where the strabismus scratch defect is located; obtaining interference image data from the first exposure image and the second exposure image according to the area information; Based on an image data difference between the defective image data and the interference image data, obtaining a second target image including the image data difference; and The second target image is input into a defect detection model to perform a defect detection operation, so as to perform a quality inspection on the display screen.
2. The method according to claim 1, wherein obtaining interference image data from the first exposure image and the second exposure image according to the area information comprises: Determining a lower half region image of the first exposure image and an upper half region image of the second exposure image according to the region height in the region information; Performing boundary extraction operations on the lower half region image and the upper half region image respectively to determine a first interference region in the lower half region image and a second interference region in the upper half region image; as well as Interference image data is obtained from the first exposure image and the second exposure image based on the first interference area and the second interference area.
3. The method according to claim 2, wherein the performing boundary extraction operations on the lower half region image and the upper half region image respectively comprises: The lower half region image and the upper half region image are respectively used as images to be operated, and the following boundary extraction operations are performed on the images to be operated: Performing a binarization operation on the image to be operated to obtain a binarized image to be operated; Performing an opening operation on the binary image to be operated to obtain an interference detection image; performing a contour detection operation on the interference detection image to obtain an interference contour of the interference object in the interference detection image; and An interference area in the interference detection image is determined based on the interference contour.
4. The method according to claim 1, wherein the performing an area of interest extraction operation on the first target image to obtain area information and defect image data of the image area where the strabismus scratch defect is located comprises: Performing a binarization operation on the first target image to obtain a binarized target image; as well as An interesting region extraction operation is performed on the binary target image to obtain region information and defect image data of the image region where the strabismus scratch defect is located.
5. The method according to claim 4, wherein the performing an area of interest extraction operation on the binarized target image to obtain the area information and defect image data comprises: Performing a straight line fitting operation on the binary target image to obtain regional information of the image region where the squint scratch defect is located; as well as The defect image data is acquired from the first target image according to the region information.
6. The method according to claim 4, wherein the performing an area of interest extraction operation on the binarized target image to obtain the area information and defect image data comprises: Performing a closing operation on the binary target image to obtain a defect detection image; Performing a contour detection operation on the defect detection image to obtain a defect contour of the squint scratch defect in the defect detection image; Determining the region information based on the defect contour; as well as The defect image data is acquired from the first target image according to the region information.
7. The method according to claim 1, wherein the defect detection model is a model obtained by training with a deep neural network model, and the defect detection model obtained by training with a deep neural network comprises: Annotating the defect type of the training image containing the strabismus scratch defect to form an image label; as well as The training images and the image labels are input into the deep neural network model as training data to train the deep neural network model and obtain the defect detection model.
8. The method according to claim 7, wherein the defect types include: Point scratches, mass scratches and irregular scratches, the inputting the training images and the image labels as training data into the deep neural network model to train the deep neural network model comprises: Construct a loss function that includes multi-class cross entropy loss and regularization loss; and Based on the loss function, the training images and the image labels are input into the deep neural network model as training data to train the deep neural network model.
9. An electronic device comprising: Processor; and A memory having program instructions for performing quality inspection on a display screen stored thereon, wherein when the program instructions are executed by a processor, the method according to any one of claims 1-8 is implemented.
10. A computer-readable storage medium storing program instructions for performing quality inspection on a display screen, wherein when the program instructions are executed by a processor, the method according to any one of claims 1 to 8 is implemented.
Citation Information
Patent Citations
AOI (Automated Optical Inspection)-based macroscopic defect detection device and method
CN106770362A
Display screen defect detection method and device, model training method and device, equipment and medium
CN118229632A
