A method, device and storage medium for filtering scratch defects of a display screen
By collecting and processing the images of the display screen, determining and integrating defect areas, the problem of over-checking of display screen defects caused by scratch defects in the protective film is solved, and more accurate detection results are achieved, especially in the detection of curved screens and AR screens.
Patent Information
- Application Number
- CN202510174144.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-02-18
- Publication Date
- 2025-04-25
- Estimated Expiration
- 2045-02-18
AI Technical Summary
During the detection of display defects, scratch defects on the protective film are easily misjudged as defects of the display screen, resulting in an increase in the detection of display screen defects. Especially in the detection of curved screens and AR screens, due to the complexity of scratches in the protective film, it is difficult for the prior art to completely filter out these interferences.
By collecting the scratch filtering auxiliary images and images to be filtered out of the display screen, the scratch defect area and line defect area are determined, the minimum envelope area is determined and matched, the card control area is generated, the minimum contour distance is calculated, the defect area is gradually integrated, and the unrelated defect area is eliminated, so as to achieve accurate filtering of scratch defects of the protective film.
It effectively reduces the detection of display defects and improves the accuracy of detection. Especially in the detection of curved screens and AR screens, it can more completely filter out interference from scratch defects of protective membranes.
Smart Images

Figure CN119648572B_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present application relate to the field of display screen defect detection, and more particularly to a method, device and storage medium for filtering scratch defects of a display screen. Background Art
[0002] With the update and iteration of electronic products, the use of display screens has become more and more frequent, and consumers have higher requirements for product quality. This has led to an increase in the content of display screen inspections and an increase in the accuracy of inspections.
[0003] As the application fields of electronic devices become more and more numerous and the application scenarios become more and more complex, the precision of display screens is getting higher and higher, and the shapes are also changing. During the defect detection process, the display screen needs to be transported and other links. The display screen is easily damaged by the screen body, resulting in damage defects. In order to reduce such damage defects, foreign objects on the surface of the display screen are usually cleaned before detection, and then a layer of special protective film is affixed. However, in the detection environment, scratches may also occur on the protective film. Such non-display defects will affect the detection of display screen defects. During the detection process, the display screen will be lit up with a preset grayscale, and the corresponding display screen image will be collected. At this time, if there is a protective film scratch defect on the protective film, due to the lighting of the display screen, this protective film scratch defect will also appear in the display screen image, and the protective film scratch defect is similar to some linear display screen defects, making it easy for the detection equipment to detect the protective film scratch defect as a display screen defect, resulting in an increase in the number of display screen defects being over-inspected.
[0004] In order to solve the problem of over-inspection caused by scratch defects on the protective film, in the prior art, it is necessary to use an external light source and a collection camera to capture an image of the display screen when it is not lit. At this time, the display screen defects will not be visible, but the protective film scratch defects will be collected. Then, the area of the protective film scratch defects on the protective film is detected, and the linear display screen defects in the corresponding area on the captured image of the display screen are filtered out, so as to prevent the captured image of the display screen from being over-inspected in subsequent inspections. However, for curved screens, AR screens and other display screens with curvature, the depth, continuation length and opening direction of the scratches on the protective film are irregular, which is more complicated than the scratches on the protective film of a flat screen. No matter how many light sources are used or from what angle the scratches are illuminated, there will be varying degrees of discontinuity in the protective film scratches in the image captured by the acquisition camera. This discontinuity will make the area where the protective film scratch defects on the protective film are detected incomplete, and some intermittent protective film scratch defects cannot be successfully associated with linear display screen defects, resulting in incomplete filtering of the protective film scratch defects that are fully displayed on the image captured by the detection display screen. Compared with the flat area, this incomplete filtering is more serious on the curved surface, resulting in an increase in the number of display screen defects that fail inspection. Summary of the invention
[0005] The present application discloses a method, device and storage medium for filtering scratch defects of a display screen, which are used to reduce the situation of over-inspection of display screen defects.
[0006] The first aspect of the present application discloses a method for filtering scratch defects of a display screen, comprising:
[0007] Collecting a scratch filtering auxiliary image and an image to be filtered of the display screen to be tested;
[0008] determining a scratch defect area on the scratch filtering auxiliary image;
[0009] Determining a line defect area on the image to be filtered out;
[0010] The scratch defect area and the line defect area are superimposed and placed in the same defect area object array, and the diagonal coordinate information of the minimum envelope area of all defect areas is determined, and the diagonal coordinate information includes the row and column coordinate information of a group of diagonal coordinate points of the minimum envelope area;
[0011] Select a defect area to be inspected from the defect area object array, and fill the row and column coordinate information of the remaining first defect area into the image grayscale value of the preset image to be filled, wherein the defect area to be inspected is a line defect area;
[0012] The area of the image to be filled is screened according to the row and column coordinates of the defect area to be inspected, and a number of card control areas are generated;
[0013] Determine, according to the plurality of card control areas, a second defect area in the first defect area that meets the basic adjacency requirement;
[0014] Calculating the minimum contour distance between the defect area to be inspected and the second defect area, and taking the defect area whose minimum contour distance is less than a preset threshold as the matching defect area of the defect area to be inspected;
[0015] Repeat the above-mentioned card control area screening and new matching defect area determination for the matching defect area and the remaining area to obtain an integrated defect area, remove the integrated defect area from the first defect area, and reselect a new area to be detected to calculate the matching defect area until there is no defect area in the first defect area, and the remaining area is the area remaining after excluding the defect area to be detected and the matching defect area in the first defect area.
[0016] Optionally, after acquiring the scratch filtering auxiliary image and the image to be filtered of the display screen to be tested, and before determining the scratch defect area on the scratch filtering auxiliary image, the method further includes:
[0017] Calculate the spatial distance between the coordinates of adjacent corner points of the scratch filtering auxiliary image and the image to be filtered out according to the edge corner point information of the scratch filtering auxiliary image and the image to be filtered out;
[0018] Calculate the acquisition environment parameters according to the spatial distance between the scratch filtering auxiliary image and the image to be filtered out, the image resolution size and the magnification;
[0019] When the acquisition environment parameter meets the preset acquisition environment threshold, it is determined that the scratch filtering auxiliary image and the image to be filtered meet the filtering condition;
[0020] When the acquisition environment parameters do not meet the preset acquisition environment threshold, the acquisition device parameters are adjusted according to the acquisition environment parameters, and the scratch filtering auxiliary image and the image to be filtered out are re-acquired through the new acquisition environment.
[0021] Optionally, after determining that the scratch filtering auxiliary image and the image to be filtered meet the filtering condition and before determining the scratch defect area on the scratch filtering auxiliary image, the method further includes:
[0022] Performing multi-point mapping transformation correction on the scratch filtering auxiliary image and the image to be filtered according to the edge corner information of the scratch filtering auxiliary image and the image to be filtered;
[0023] A unity matrix is generated according to the set of images to be filtered out, and the scratch filtering auxiliary image is scaled according to the unity matrix.
[0024] Optionally, after acquiring the scratch filtering auxiliary image and the image to be filtered of the display screen to be tested, and before determining the scratch defect area on the scratch filtering auxiliary image, the method further includes:
[0025] Constructing a contrast enhancement matrix according to screen defect data of the scratch filtering auxiliary image;
[0026] The scratch filter auxiliary image is processed through a contrast enhancement matrix to generate a contrast enhanced image.
[0027] Optionally, determining a scratch defect area on the scratch filtering auxiliary image includes:
[0028] The contrast-enhanced image is segmented into regions by a preset adaptive controllable matrix;
[0029] Generating a gray value projection array for each image area of the contrast enhanced image after the area segmentation;
[0030] Generate an initial detection area according to the gray value projection array;
[0031] The initial detection area is closed in the specified range in the horizontal and vertical directions, and then the endpoints are connected to connect the various segmented scratch defects into a whole to generate a scratch defect area.
[0032] Optionally, the defect area to be inspected also includes a scratch defect area;
[0033] After calculating the minimum contour distance between the defect area to be detected and the second defect area, and taking the defect area whose minimum contour distance is less than a preset threshold as the matching defect area of the defect area to be detected, removing the defect area to be detected and the matching defect area from the first defect area, and reselecting a new defect area to be detected to calculate the matching defect area until there is no defect area in the first defect area, the method further includes:
[0034] determining the matched defect area as an associated defect area of the defect area to be inspected;
[0035] removing the matching defect region from the first defect region to generate a third defect region;
[0036] Filling the image to be filled, generating the second remaining defect area, and determining the matching defect area according to the associated defect area and the third defect area;
[0037] Integrate all matching defect matrices and the current defect area to be inspected.
[0038] The second aspect of the present application discloses a device for filtering scratch defects of a display screen, comprising:
[0039] A first acquisition unit is used to acquire a scratch filtering auxiliary image and an image to be filtered of the display screen to be tested;
[0040] A first determining unit, used to determine a scratch defect area on the scratch filtering auxiliary image;
[0041] A second determining unit, used to determine a line defect area on the image to be filtered out;
[0042] A third determining unit is used to superimpose the scratch defect area and the line defect area into the same defect area object array, and determine the diagonal coordinate information of the minimum envelope area of all defect areas, where the diagonal coordinate information includes row and column coordinate information of a group of diagonal coordinate points of the minimum envelope area;
[0043] A filling unit is used to select a defect area to be inspected from the defect area object array, and fill the row and column coordinate information of the remaining first defect area into the image grayscale value of the preset image to be filled, wherein the defect area to be inspected is a line defect area;
[0044] The first generating unit is used to screen the area of the image to be filled according to the row and column coordinates of the defect area to be inspected, and generate a plurality of card control areas;
[0045] A fourth determining unit, configured to determine, according to the plurality of card control areas, a second defect area in the first defect area that meets a basic adjacency requirement;
[0046] A fifth determination unit, configured to calculate a minimum contour distance between the defect area to be detected and the second defect area, and to use a defect area whose minimum contour distance is less than a preset threshold as a matching defect area of the defect area to be detected;
[0047] The circulation unit is used to repeat the above-mentioned card control area screening and new matching defect area determination for the matching defect area and the remaining area to obtain an integrated defect area, remove the integrated defect area from the first defect area, and reselect a new area to be detected to calculate the matching defect area until there is no defect area in the first defect area, and the remaining area is the area remaining after excluding the defect area to be detected and the matching defect area in the first defect area.
[0048] Optionally, after the first collecting unit and before the first determining unit, the device further includes:
[0049] A first calculation unit is used to calculate the spatial distance between the coordinates of adjacent corner points of the scratch filtering auxiliary image and the image to be filtered out according to the edge corner point information of the scratch filtering auxiliary image and the image to be filtered out;
[0050] A second calculation unit is used to calculate the acquisition environment parameters according to the spatial distance between the scratch filtering auxiliary image and the image to be filtered out, the image resolution size and the magnification;
[0051] A sixth determining unit, configured to determine whether the scratch filtering auxiliary image and the image to be filtered meet the filtering condition when the acquisition environment parameter meets a preset acquisition environment threshold;
[0052] The second acquisition unit is used to adjust the acquisition device parameters according to the acquisition environment parameters when the acquisition environment parameters do not meet the preset acquisition environment threshold, and re-acquire the scratch filtering auxiliary image and the image to be filtered out through the new acquisition environment.
[0053] Optionally, after the sixth determining unit and before the first determining unit, the device further includes:
[0054] A correction unit, used for performing multi-point mapping transformation correction on the scratch filtering auxiliary image and the image to be filtered according to the edge corner point information of the scratch filtering auxiliary image and the image to be filtered;
[0055] The second generating unit is used to generate a unity matrix according to the set of images to be filtered out, and to perform scale transformation on the scratch filtering auxiliary image according to the unity matrix.
[0056] Optionally, after the first collecting unit and before the first determining unit, the device further includes:
[0057] A construction unit, used for constructing a contrast enhancement matrix according to screen defect data of the scratch filtering auxiliary image;
[0058] The third generating unit is used for processing the scratch filtering auxiliary image through a contrast enhancement matrix to generate a contrast enhanced image.
[0059] Optionally, the first determining unit includes:
[0060] The contrast-enhanced image is segmented into regions by a preset adaptive controllable matrix;
[0061] Generating a gray value projection array for each image area of the contrast enhanced image after the area segmentation;
[0062] Generate an initial detection area according to the gray value projection array;
[0063] The initial detection area is closed in the specified range in the horizontal and vertical directions, and then the endpoints are connected to connect the various segmented scratch defects into a whole to generate a scratch defect area.
[0064] Optionally, after the fifth determining unit and before the looping unit, the device further includes:
[0065] A seventh determining unit, configured to determine the matching defect area as an associated defect area of the defect area to be detected;
[0066] A fourth generating unit, configured to remove the matching defect region from the first defect region to generate a third defect region;
[0067] a processing unit, configured to fill the image to be filled, generate the second remaining defect area, and determine the matching defect area according to the associated defect area and the third defect area;
[0068] The integration unit is used to integrate all matching defect matrices and the current defect area to be inspected.
[0069] A third aspect of the present application provides a device for filtering scratch defects of a display screen, comprising:
[0070] Processor, memory, input-output unit, and bus;
[0071] The processor is connected to the memory, the input and output unit, and the bus;
[0072] The memory stores a program, and the processor calls the program to execute the first aspect and any optional method of the first aspect.
[0073] A fourth aspect of the present application provides a computer-readable storage medium, on which a program is stored. When the program is executed on a computer, the program executes the first aspect and any optional method of the first aspect.
[0074] It can be seen from the above technical solutions that the embodiments of the present application have the following advantages:
[0075] In the present application, firstly, the scratch filtering auxiliary image and the image to be filtered of the display screen to be tested are collected. Then, the scratch defect area on the scratch filtering auxiliary image and the line defect area on the image to be filtered are determined respectively. Next, the scratch defect area and the line defect area are superimposed and placed in the same defect area object array, and the diagonal coordinate information of the minimum envelope area of all defect areas is determined. The diagonal coordinate information includes the row and column coordinate information of a set of diagonal coordinate points of the minimum envelope area, and its purpose is to limit the minimum area of each defect area. Then, a defect area to be inspected is randomly selected from the defect area object array. The defect area to be inspected is a line defect area, and the remaining defect areas are set as the first defect areas. An image to be filled is generated according to the number of defects in the first defect area, and then the row and column coordinate information of the remaining first defect areas are respectively filled into the preset image grayscale values of the image to be filled. At this time, the corresponding area in the image to be filled has generated a new grayscale value. According to the row and column coordinates of the defect area to be inspected, the area of the image to be filled is screened to generate several card control areas, that is, according to the two row coordinates and two column coordinates of the defect area to be inspected, four card control areas that meet the two row coordinates and two column coordinates in the area of the image to be filled are preliminarily determined. According to the four card control areas, logical AND processing is performed between rows and columns, and then the areas after logical AND processing are merged to determine the second defect area in the first defect area that meets the basic adjacency requirements. At this time, we have completed the initial screening and removed the defect area that is almost irrelevant to the defect area to be inspected. Next, the minimum contour distance between the defect area to be inspected and the second defect area is calculated, and the defect area with the minimum contour distance less than the preset threshold is used as the matching defect area of the defect area to be inspected, that is, the irrelevant area is screened out again. The remaining matching defect areas are the relevant areas of the defect area to be inspected, and these several related defect areas can be merged to generate areas including line defect areas and scratch defect areas. Finally, the matching defect area and the remaining area repeat the above card control area screening and new matching defect area determination to obtain an integrated defect area, remove the integrated defect area from the first defect area, and reselect a new area to be detected to calculate the matching defect area until there is no defect area in the first defect area, and the remaining area is the area remaining after excluding the defect area to be detected and the matching defect area from the first defect area. In the above method, after the card control area screening, basic adjacency requirement screening, and minimum contour distance screening are performed, if there are still defect areas associated with it, it means that the entire part of the defect area is a protective film scratch defect that needs to be filtered out. The terminal only needs to filter out this part of the defect area and the image to be filtered out to eliminate the interference of the protective film scratch defect and reduce the number of display screen defects that are over-inspected. BRIEF DESCRIPTION OF THE DRAWINGS
[0076] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative labor.
[0077] Figure 1 A schematic diagram of an embodiment of a method for filtering scratch defects on a display screen of the present application;
[0078] Figure 2 A schematic diagram of an embodiment of the image re-capture method of the present application;
[0079] Figure 3 A schematic diagram of an embodiment of the method for image scale transformation of the present application;
[0080] Figure 4 A schematic diagram of an embodiment of a method for generating a contrast-enhanced image for the present application;
[0081] Figure 5 A schematic diagram of an embodiment of a method for generating a scratch defect area for the present application;
[0082] Figure 6 A schematic diagram of an embodiment of a method for integrating defective areas of the present application;
[0083] Figure 7 A schematic diagram of an embodiment of a device for filtering scratch defects of a display screen of the present application;
[0084] Figure 8 A schematic diagram of an embodiment of a device for filtering scratch defects of a display screen of the present application;
[0085] Fig. 9 This is a schematic diagram of grayscale projection in the horizontal direction of this application;
[0086] Fig.10 This is a schematic diagram of grayscale projection in the vertical direction of this application. DETAILED DESCRIPTION
[0087] In the following description, specific details such as specific system structures, technologies, etc. are provided for the purpose of illustration rather than limitation, so as to provide a thorough understanding of the embodiments of the present application. However, it should be clear to those skilled in the art that the present application may also be implemented in other embodiments without these specific details. In other cases, detailed descriptions of well-known systems, devices, circuits, and methods are omitted to prevent unnecessary details from obstructing the description of the present application.
[0088] It should be understood that when used in the present specification and the appended claims, the term "comprising" indicates the presence of described features, wholes, steps, operations, elements and / or components, but does not exclude the presence or addition of one or more other features, wholes, steps, operations, elements, components and / or combinations thereof.
[0089] It should also be understood that the term “and / or” used in the specification and appended claims refers to any and all possible combinations of one or more of the associated listed items, and includes these combinations.
[0090] As used in the specification and appended claims of this application, the term "if" can be interpreted as "when" or "uponce" or "in response to determining" or "in response to detecting", depending on the context. Similarly, the phrase "if it is determined" or "if [described condition or event] is detected" can be interpreted as meaning "uponce it is determined" or "in response to determining" or "uponce [described condition or event] is detected" or "in response to detecting [described condition or event]", depending on the context.
[0091] In addition, in the description of the present application specification and the appended claims, the terms "first", "second", "third", etc. are only used to distinguish the descriptions and cannot be understood as indicating or implying relative importance.
[0092] References to "one embodiment" or "some embodiments" etc. described in the specification of this application mean that one or more embodiments of the present application include specific features, structures or characteristics described in conjunction with the embodiment. Therefore, the statements "in one embodiment", "in some embodiments", "in some other embodiments", "in some other embodiments", etc. that appear in different places in this specification do not necessarily refer to the same embodiment, but mean "one or more but not embodiments", unless otherwise specifically emphasized in other ways. The terms "including", "comprising", "having" and their variations all mean "including but not limited to", unless otherwise specifically emphasized in other ways.
[0093] In the prior art, during the defect detection process, the display screen needs to be transported and other links. The display screen is easily damaged by the screen body, resulting in damage defects. In order to reduce such damage defects, foreign objects on the surface of the display screen are usually cleaned before detection, and then a layer of special protective film is affixed. However, in the detection environment, scratches may also occur on the protective film. Such non-display screen defects will affect the detection of display screen defects. During the detection process, the display screen will be lit up at a preset grayscale, and the corresponding display screen image will be collected. At this time, if there is a protective film scratch defect on the protective film, due to the lighting of the display screen, the protective film scratch defect will also appear in the display screen image. In addition, the protective film scratch defect is similar to some linear display screen defects, making it easy for the detection equipment to detect the protective film scratch defect as a display screen defect, resulting in an increase in the number of display screen defects that are over-inspected. In order to solve the problem of over-inspection caused by scratch defects on the protective film, in the prior art, it is necessary to use an external light source and a collection camera to capture an image of the display screen when it is not lit. At this time, the display screen defects will not be visible, but the protective film scratch defects will be collected. Then, the area of the protective film scratch defects on the protective film is detected, and the linear display screen defects in the corresponding area on the captured image of the display screen are filtered out, so as to prevent the captured image of the display screen from being over-inspected in subsequent inspections. However, for curved screens, AR screens and other display screens with curvature, the depth, continuation length and opening direction of the scratches on the protective film are irregular, which is more complicated than the scratches on the protective film of a flat screen. No matter how many light sources are used or from what angle the scratches are illuminated, there will be varying degrees of discontinuity in the protective film scratches in the image captured by the acquisition camera. This discontinuity will make the area where the protective film scratch defects on the protective film are detected incomplete, and some intermittent protective film scratch defects cannot be successfully associated with linear display screen defects, resulting in incomplete filtering of the protective film scratch defects that are fully displayed on the image captured by the detection display screen. Compared with the flat area, this incomplete filtering is more serious on the curved surface, resulting in an increase in the number of display screen defects that fail inspection.
[0094] Based on this, the present application discloses a method, device and storage medium for filtering scratch defects of a display screen, which are used to reduce the situation of over-inspection of display screen defects.
[0095] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0096] The method of the present application can be applied to a server, a device, a terminal or other devices with logic processing capabilities, and the present application does not limit this. For the convenience of description, the following description is made by taking the execution subject as an example of a terminal.
[0097] See also Figure 1 The present application provides an embodiment of a method for filtering scratch defects of a display screen, comprising:
[0098] 101. Collect a scratch filtering auxiliary image and an image to be filtered of the display screen to be tested;
[0099] In this embodiment, after the stage camera environment and other hardware are installed in the smart manufacturing darkroom, the strip side light source is adjusted to take a picture of the display screen to be tested through an industrial camera to obtain a dust removal image (scratch filtering auxiliary image), and then the strip side light source is turned off, and the display screen to be tested is driven and lit through the PG device (display screen lighting device), and the display screen to be tested is photographed and an image to be filtered is generated.
[0100] In this embodiment, the display screen to be tested with a protective film is first subjected to the acquisition of a scratch filtering auxiliary image, and the display screen to be tested is illuminated laterally by one or more strip light sources, and the display screen to be tested is photographed from directly above to generate a scratch filtering auxiliary image.
[0101] Next, the display screen to be tested is illuminated by the display screen lighting device so that it displays a preset grayscale image, and multiple images from grayscale 0 to grayscale 255 can be directly obtained as images to be filtered out, and each image is processed separately with the scratch filtering auxiliary image.
[0102] 102. Determine a scratch defect area on the scratch filtering auxiliary image;
[0103] The terminal determines the defective area on the scratch filtering auxiliary image, and then screens out the area with dust and foreign matter, retaining the scratch defective area.
[0104] 103. Determine a line defect area on the image to be filtered out;
[0105] The terminal detects scratch defects on the image to be filtered out at a preset grayscale, constructs a corresponding filter kernel matrix, and performs steps similar to the scratch defect detection algorithm to detect all line defect areas. The line defect area is most likely a scratch defect area of the protective film, and may be a real line defect on the display screen. The purpose of this embodiment is to determine the scratch defect area of the protective film so that the scratch defect area of the protective film can be filtered out later.
[0106] 104. Overlay the scratch defect area and the line defect area into the same defect area object array, and determine the diagonal coordinate information of the minimum envelope area of all defect areas, where the diagonal coordinate information includes row and column coordinate information of a group of diagonal coordinate points of the minimum envelope area;
[0107] In this embodiment, the terminal superimposes the above-mentioned line defect and scratch defect areas into a defect area object array (defect area set), screens all defect areas, and defines the defect area set as Si (i=1,2,3,....n).
[0108] Then, the terminal calculates the minimum envelope box of each defect area set Si, and then calculates the row and column coordinates of the upper left and lower right corners of the envelope box. The upper left corner row coordinate is marked as Row1i (i=1,2,3,....n), the upper left corner column coordinate is marked as Col1i (i=1,2,3,....n), the lower right corner row coordinate is marked as Row2i (i=1,2,3,....n), and the lower right corner row coordinate is marked as Col2i (i=1,2,3,....n).
[0109] 105. Select a defect area to be inspected from the defect area object array, and fill the row and column coordinate information of the remaining first defect area into the image grayscale value of the preset image to be filled;
[0110] The terminal selects a defect area to be inspected from the defect area object array and sets it as Si (i=1).
[0111] The terminal generates four completely black images (images to be filled) with a grayscale value of 0, denoted as R1, C1, R2, and C2, whose length and width are both (n-1)*1, where n is the total number of remaining defects after each cycle calculation.
[0112] The terminal obtains the row and column coordinate positions of the above-mentioned images to be filled (R1, C1, R2, C2), and fills the grayscale values of the all-black images at the corresponding coordinate positions with Row1i (i=2,3,....n), Col1i (i=2,3,....n), Row2i (i=2,3,....n), and Col2i (i=2,3,....n). At this time, the grayscale values of all images record the row and column positions of each coordinate point. That is, the grayscale value of the image R1 to be filled is filled with Row1i (i=2,3,....n), the grayscale value of the image R2 to be filled is filled with Row2i (i=2,3,....n), the grayscale value of the image C1 to be filled is filled with Col1i (i=2,3,....n), and the grayscale value of the image C2 to be filled is filled with Col2i (i=2,3,....n).
[0113] 106. Screen the area of the image to be filled according to the row and column coordinates of the defect area to be inspected, and generate a plurality of card control areas;
[0114] The terminal screens the area of the image to be filled according to the row and column coordinates of the defect area to be inspected, and generates several card control areas. Specifically, the terminal first calculates four boundary values respectively:
[0115] R1_th=Row1i(i=1)-Dis_Th
[0116] R2_th=Row2i(i=1)+Dis_Th
[0117] C1_th=Col1i(i=1)-Dis_Th
[0118] C2_th=Col2i(i=1)+Dis_Th
[0119] According to R1_th, R2_th, C1_th and C2_th, filter the card control area that meets the following conditions.
[0120] R1_th <R1<R2_th
[0121] R1_th <R2<R2_th
[0122] C1_th <C1<C2_th
[0123] C1_th <C2<C2_th
[0124] Wherein: Dis_Th is a preset distance range, and the areas among the above R1, R2, C1 and C2 that meet the conditions of R1_th, R2_th, C1_th and C2_th are calculated card control areas. In this embodiment, there are 4 card control areas.
[0125] 107. Determine, according to the plurality of card control areas, a second defect area in the first defect area that meets the basic adjacency requirement;
[0126] The terminal determines a second defective area that meets the basic adjacency requirement in the first defective area according to a number of control areas. Specifically, the terminal calculates the intersection of the control areas obtained after the above steps, then merges the result areas in sequence, and determines whether the merged area is empty. If the area is empty, the algorithm directly skips the subsequent search steps because an empty set indicates that the defective area to be inspected at this time is a line defective area on the actual display screen, indicating that the area to be detected Si (i = 1) does not meet the initial adjacency requirement with the first defective area Si (i = 2, 3,... n). Otherwise, record the subscript index j (j is greater than 1 and less than or equal to n - 1) and the index length that meet the basic adjacency requirement of Si (i = 2, 3, 4... n), that is, determine the second defective area Sj, where Sj is a part of Si (i = 2, 3, 4... n), Sj (j = c,... d), where 。
[0127] 108. Calculate the minimum contour distance between the defective area to be inspected and the second defective area, and regard the defective area with the minimum contour distance less than the preset threshold as the matching defective area of the defective area to be inspected;
[0128] The terminal calculates the minimum contour distance between the defective area to be inspected and the second defective area, and regards the defective area with the minimum contour distance less than the preset threshold as the matching defective area of the defective area to be inspected.
[0129] Calculate the row and column coordinates of all points of the defective area to be inspected Si (i = 1) and the second defective area Sj, and traverse to calculate the minimum contour distance D between the calculation object Si (i = 1) and Sj in the previous step k (k = 1... j).
[0130] The formula is as follows:
[0131]
[0132] Among them, is the shortest distance between the contours, not the central distance between the contours.
[0133] If D k < Dis_Th, Dis_Th is the preset distance threshold, then record the subscript index of Sj at this time (k = 2, 3... n).
[0134] At this time, if the defective area to be inspected is a line defective area, and there is a matching defective area, it means that these line defective areas are protective film scratch defective areas, and the matching defective areas are the corresponding scratch defective areas.
[0135] 109. Repeat the above-mentioned card control area screening and new matching defect area determination for the matching defect area and the remaining area to obtain an integrated defect area, remove the integrated defect area from the first defect area, and reselect a new area to be detected to calculate the matching defect area until there is no defect area in the first defect area, and the remaining area is the area remaining after excluding the defect area to be detected and the matching defect area in the first defect area.
[0136] The terminal removes the defect area to be detected and the matching defect area from the first defect area to obtain the remaining area, and uses the matching defect area as a new defect area to be detected, and compares it with the remaining area in the above steps, in order to find the defect area corresponding to the matching defect area, and finally integrate all defect areas belonging to the same defect.
[0137] Then, a new defect area to be inspected is selected again (the new defect area to be inspected here is a defect area outside the integrated defect area) to calculate the matching defect area until there is no defect area in the first defect area, that is, the next line defect area is inspected. Until all defect areas are inspected.
[0138] In this embodiment, firstly, the scratch filtering auxiliary image and the image to be filtered of the display screen to be tested are collected. Then, the scratch defect area on the scratch filtering auxiliary image and the line defect area on the image to be filtered are determined respectively. Next, the scratch defect area and the line defect area are superimposed and placed in the same defect area object array, and the diagonal coordinate information of the minimum envelope area of all defect areas is determined. The diagonal coordinate information includes the row and column coordinate information of a set of diagonal coordinate points of the minimum envelope area, and its purpose is to limit the minimum area of each defect area. Then, a defect area to be inspected is randomly selected from the defect area object array. The defect area to be inspected is the line defect area, and the remaining defect areas are set as the first defect areas. An image to be filled is generated according to the number of defects in the first defect area, and then the row and column coordinate information of the remaining first defect areas are respectively filled into the preset image grayscale value of the image to be filled. At this time, the corresponding area in the image to be filled has generated a new grayscale value. According to the row and column coordinates of the defect area to be inspected, the area of the image to be filled is screened to generate several card control areas, that is, according to the two row coordinates and two column coordinates of the defect area to be inspected, four card control areas that meet the two row coordinates and two column coordinates in the area of the image to be filled are preliminarily determined. According to the four card control areas, logical AND processing is performed between rows and columns, and then the areas after logical AND processing are merged to determine the second defect area in the first defect area that meets the basic adjacency requirements. At this time, we have completed the initial screening and removed the defect area that is almost irrelevant to the defect area to be inspected. Next, the minimum contour distance between the defect area to be inspected and the second defect area is calculated, and the defect area with the minimum contour distance less than the preset threshold is used as the matching defect area of the defect area to be inspected, that is, the irrelevant area is screened out again. The remaining matching defect areas are the relevant areas of the defect area to be inspected, and these several related defect areas can be merged to generate areas including line defect areas and scratch defect areas. Finally, the matching defect area and the remaining area repeat the above card control area screening and new matching defect area determination to obtain an integrated defect area, remove the integrated defect area from the first defect area, and reselect a new area to be detected to calculate the matching defect area until there is no defect area in the first defect area, and the remaining area is the area remaining after excluding the defect area to be detected and the matching defect area from the first defect area. In the above method, after the card control area screening, basic adjacency requirement screening, and minimum contour distance screening are performed, if there are still defect areas associated with it, it means that the entire part of the defect area is a protective film scratch defect that needs to be filtered out. The terminal only needs to filter out this part of the defect area and the image to be filtered out to eliminate the interference of the protective film scratch defect and reduce the number of display screen defects that are over-inspected.
[0139] See also Figure 2 The present application provides an embodiment of a method for image re-capture, comprising:
[0140] 201. Calculating the spatial distance between the coordinates of adjacent corner points of the scratch filtering auxiliary image and the image to be filtered out according to the edge corner point information of the scratch filtering auxiliary image and the image to be filtered out;
[0141] 202. Calculate acquisition environment parameters according to the spatial distance between the scratch filtering auxiliary image and the image to be filtered out, the image resolution size, and the magnification;
[0142] 203. When the acquisition environment parameter meets the preset acquisition environment threshold, determine that the scratch filtering auxiliary image and the image to be filtered meet the filtering condition;
[0143] 204. When the acquisition environment parameter does not meet the preset acquisition environment threshold, adjust the acquisition device parameter according to the acquisition environment parameter, and re-acquire the scratch filtering auxiliary image and the image to be filtered out through the new acquisition environment.
[0144] The terminal first calculates the spatial distance between the coordinates of adjacent corner points of the scratch filtering auxiliary image and the image to be filtered out according to the edge corner point information of the scratch filtering auxiliary image and the image to be filtered out. In this embodiment, the edges and corner points of the scratch filtering auxiliary image and the image to be filtered out are first located, and the spatial distance between the coordinates of adjacent corner points is calculated and recorded as Di (i=1,2,3,4...).
[0145] Then, the acquisition environment parameters P1 and P2 are calculated according to the spatial distance between the scratch filtering auxiliary image and the image to be filtered, the image resolution size and the magnification.
[0146] Specifically, the terminal needs to detect each grayscale (such as L255, L128...) picture (the image to be filtered out at each grayscale) and the scratch filtering auxiliary image. Due to the movement of the mechanism, the vibration of the machine, etc., the image of the product is tilted. The resolution of the scratch filtering auxiliary image and the image to be filtered out is Re_x, and the product of Re_y and the Mapping value is recorded as Mx, My:
[0147]
[0148]
[0149]
[0150]
[0151] When the acquisition environment parameters meet the preset acquisition environment threshold, it is determined that the scratch filtering auxiliary image and the image to be filtered meet the filtering conditions. When the acquisition environment parameters do not meet the preset acquisition environment threshold, the acquisition device parameters are adjusted according to the acquisition environment parameters, and the scratch filtering auxiliary image and the image to be filtered are re-acquired through the new acquisition environment. The acquisition environment threshold is set to T.
[0152]
[0153]
[0154] Where: T is the acquisition environment threshold (the preset compression image ratio card control threshold).
[0155] If the expression exceeds the proportional card control threshold, the algorithm sends the specified code to the software, first controls the motor shaft to move in the Z-axis direction, and retakes the photo to execute the above process until the above algorithm expression conditions are met. This embodiment mainly detects the image impact of the acquisition environment on the scratch filtering auxiliary image and the image to be filtered out, because the display screen to be tested with a protective film has a slight increase in thickness, and the protective film is dedicated to each type of display screen, and fits different areas of the display screen, including flat areas and curved areas, and even irregular areas. During the shooting process, it is necessary to combine the spatial distance, image resolution size and magnification of the image collected this time to determine whether the group of scratch filtering auxiliary images and the image to be filtered out meet the acquisition environment threshold. If not, the Z-axis direction of the camera will be adjusted to re-acquire. The beneficial effect of this method is that it can eliminate the influence of the thickness of the protective film on the display screen to be tested (image to be filtered out) as much as possible, and also eliminate the influence of the display screen on the reflection of the lighting source on the scratch filtering auxiliary image as much as possible.
[0156] See also Figure 3 The present application provides an embodiment of a method for image scale transformation, comprising:
[0157] 301. Perform multi-point mapping transformation correction on the scratch filtering auxiliary image and the image to be filtered according to edge corner point information of the scratch filtering auxiliary image and the image to be filtered;
[0158] 302. Generate a unity matrix according to the set of images to be filtered out, and perform a scale transformation on the scratch filtering auxiliary image according to the unity matrix.
[0159] In this embodiment, the terminal performs multi-point mapping transformation correction on the scratch filtering auxiliary image and the image to be filtered according to the edge corner point information of the scratch filtering auxiliary image and the image to be filtered. Specifically, the terminal performs multi-point mapping transformation correction on the image according to the obtained image edge corner points:
[0160]
[0161] Where: M is the unity transformation matrix, and The image mapping point pairs before and after correction are B and B is the compensation matrix. The tag terminal records the single transformation matrix and inverse matrix according to the mapping point pairs and stores them in the data set.
[0162] The terminal generates a unity matrix based on the set of images to be filtered out, and scales the scratch filtering auxiliary image based on the unity matrix. Specifically, the terminal references the light-up image (taking the L255 image to be filtered out as an example) data set and parses it to obtain the unity matrix, performs image matrix transformation on the dust removal image (scratch filtering auxiliary image), and obtains an image of the same size as the L255 image.
[0163] See also Figure 4 The present application provides an embodiment of a method for generating a contrast-enhanced image, comprising:
[0164] 401. Constructing a contrast enhancement matrix according to screen defect data of the scratch filtering auxiliary image;
[0165] 402. Process the scratch removal auxiliary image through a contrast enhancement matrix to generate a contrast enhanced image.
[0166] The terminal constructs a contrast enhancement matrix based on the screen defect data of the scratch filtering auxiliary image, and specifically processes the corrected dust removal screen image (scratch filtering auxiliary image) to detect linear scratch defects. First, an adaptive filter kernel matrix is constructed. The matrix is divided into an outer layer, an intermediate layer, and an inner layer. The number of rows, columns, and specific values of each layer can be changed according to the specific scratch filtering auxiliary image. Therefore, it is similar to a "Hui"-shaped matrix with a changeable size and dimension. The purpose is to enhance the position of the area with a large difference in pixel grayscale value with a certain neighborhood. And eliminate the position of the area with similar grayscale value to the neighborhood. The scratch filtering auxiliary image is filtered to obtain a contrast enhanced image.
[0167] According to the specific scratch filtering auxiliary image, the number of rows, columns and specific values of each layer are changed. One of the methods is: first, the defect area of the scratch filtering auxiliary image is counted. First, the inner, middle and outer three layers are determined by the number of defect areas. The number of defect areas in the inner, middle and outer three layers is the same. Next, the inner, middle and outer three layers of the contrast enhancement matrix are determined according to the area of the inner, middle and outer three layers. The inner, middle and outer three layers of the contrast enhancement matrix need to be filled with values. Specifically, the total area of the defect area of the defect area needs to be multiplied by the layer weight of the inner, middle and outer three layers according to the scratch filtering auxiliary image. The layer weight is determined according to different areas of the display screen to be tested. For example, if there is a curved surface in the outermost layer, the weight of the outer layer is greater than that of the plane. If the weight of the plane area is 1, the weight of the curved surface is greater than 1, and the weight of the outer layer is calculated according to the area ratio of the outer curved surface area and the plane area. If the outer layer is all planes, the weight is 1. As the curved surface area increases, the weight gradually increases, and the increase ratio can be preset. In this embodiment, a contrast enhancement matrix can be constructed using the screen defect data of the scratch filtering auxiliary image, and a higher enhancement weight can be set in the corresponding curved surface area to improve the enhancement effect on curved surface scratches. Through the enhancement method in this embodiment, the scratch filtering auxiliary image obtained after enhancement can reduce the weakening of some scratch defects caused by lighting.
[0168] See also Figure 5 The present application provides an embodiment of a method for generating a scratch defect area, comprising:
[0169] 501. Performing regional segmentation on the contrast enhanced image by using a preset adaptive controllable matrix;
[0170] 502. Generate a gray value projection array for each image area of the contrast enhanced image after region segmentation;
[0171] 503. Generate an initial detection area according to the gray value projection array;
[0172] 504. Perform a closing operation on the initial detection area in the horizontal and vertical directions within a specified range, and then perform endpoint connection to connect each segmented scratch defect into a whole to generate a scratch defect area.
[0173] In this embodiment, the terminal performs regional segmentation on the contrast enhanced image through a preset adaptive controllable matrix. A gray value projection array is generated for each image area of the contrast enhanced image after regional segmentation. An initial detection area is generated according to the gray value projection array. A closed operation is performed on the initial detection area in the horizontal and vertical directions within a specified range, and then endpoints are connected to connect the various segmented scratch defects into a whole to generate a scratch defect area.
[0174] The adaptive controllable matrix segments the area after contrast enhancement, and performs grayscale projection array on each image area after segmentation. The grayscale projection array value of the defect location is often much larger than that of the non-defect area. The grayscale projection array value is compared with the set threshold. Assuming that the given threshold is Graythreshold, if HorProjection(r)>Graythreshold, there is a suspected defect in the row, and if VerProjection(c)>Graythreshold, there is a suspected defect in the column. The terminal defines the area as a suspected scratch defect area, and then performs a closed operation on the suspected defects in the horizontal and vertical directions within the specified range, and then connects the endpoints, so that each segmented scratch defect is connected as a whole.
[0175] Please refer to Fig. 9 and Fig.10 , Fig. 9 is a schematic diagram of grayscale projection in the horizontal direction. Fig.10 It is a schematic diagram of grayscale projection in the vertical direction. It can be seen that after the grayscale projection is completed, each segmented scratch defect is connected into a complete whole in the horizontal and vertical directions.
[0176] Grayscale projection array: calculate the grayscale statistics of a column or a row (including but not limited to the mean, standard deviation, covariance, etc.). When the grayscale statistics value is greater than the set threshold, it is retained first. Here, the grayscale projections in the horizontal and vertical directions are HorProjection(r) and VerProjection(c):
[0177]
[0178]
[0179] Among them, c and r are the preset center coordinates, m is the number of suspected scratch defect areas, , is the gray value of the corresponding point, To contrast enhance image areas, and is the displacement distance of the horizontal and vertical axes.
[0180] See also Figure 6 , the defect area to be inspected also includes a scratch defect area. The present application provides an embodiment of a method for integrating defect areas, including:
[0181] 601. Determine the matched defect region as an associated defect region of the defect region to be inspected;
[0182] 602. Remove the matching defect region from the first defect region to generate a third defect region;
[0183] 603. Filling the image to be filled, generating the second remaining defect area, and determining the matching defect area according to the associated defect area and the third defect area;
[0184] 604. Integrate all matching defect matrices and the current defect area to be inspected.
[0185] In this embodiment, the terminal determines the matching defect area as the associated defect area of the defect area to be inspected, removes the matching defect area from the first defect area, generates a third defect area, fills the image to be filled, generates the second remaining defect area, and determines the matching defect area based on the associated defect area and the third defect area. All matching defect matrices and the current defect area to be inspected are integrated.
[0186] Specifically, the terminal removes the matching defect area Sk from the original Si (i=1,2,3,...n), records the remaining area as Sm, and sequentially performs the same steps 104 to 108 and the algorithm of steps 601 to 604 on the Sk area and Sm, obtains the object area that meets the conditions and records it as Sp, and then combines Sp into a large area list object, removes the merged Sp from Si (i=1,2,3,....n), performs the above steps 104 to 108 and the algorithm of steps 601 to 604 on the remaining area, and finally obtains the adjacent area that meets the requirements. Through the above merged area, some line defects have been merged into scratch defects, that is, the scratches that are not filtered out cleanly due to factors such as optical photography, and the line defects that have been inspected are removed at the same time.
[0187] In this embodiment, if the defect area to be inspected is a line defect area, it only needs to be inspected once and usually does not need to enter a loop. If the defect area to be inspected also includes a scratch defect area, a line defect area may be obtained in the first inspection and it is necessary to inspect again to detect other disconnected scratch defects.
[0188] See also Figure 7 The present application provides an embodiment of a device for filtering scratch defects of a display screen, comprising:
[0189] The first acquisition unit 701 is used to acquire the scratch-filtered auxiliary image and the image to be filtered of the display screen to be tested;
[0190] The first calculation unit 702 is used to calculate the spatial distance between the coordinates of adjacent corner points of the scratch filtering auxiliary image and the image to be filtered out according to the edge corner point information of the scratch filtering auxiliary image and the image to be filtered out;
[0191] The second calculation unit 703 is used to calculate the acquisition environment parameters according to the spatial distance between the scratch filtering auxiliary image and the image to be filtered out, the image resolution size and the magnification;
[0192] A sixth determining unit 704, configured to determine whether the scratch filtering auxiliary image and the image to be filtered meet the filtering condition when the acquisition environment parameter meets a preset acquisition environment threshold;
[0193] The second acquisition unit 705 is used to adjust the acquisition device parameters according to the acquisition environment parameters when the acquisition environment parameters do not meet the preset acquisition environment threshold, and re-acquire the scratch filtering auxiliary image and the image to be filtered out through the new acquisition environment;
[0194] A correction unit 706, configured to perform multi-point mapping transformation correction on the scratch filtering auxiliary image and the image to be filtered according to the edge corner information of the scratch filtering auxiliary image and the image to be filtered;
[0195] The second generating unit 707 is used to generate a unity matrix according to the set of images to be filtered out, and to perform a scale transformation on the scratch filtering auxiliary image according to the unity matrix;
[0196] A construction unit 708, configured to construct a contrast enhancement matrix according to the screen defect data of the scratch filtering auxiliary image;
[0197] A third generating unit 709, configured to process the scratch filtering auxiliary image by using a contrast enhancement matrix to generate a contrast enhanced image;
[0198] A first determining unit 710 is used to determine a scratch defect area on the scratch filtering auxiliary image;
[0199] Optionally, the first determining unit 710 includes:
[0200] The contrast-enhanced image is segmented into regions by a preset adaptive controllable matrix;
[0201] Generating a gray value projection array for each image area of the contrast enhanced image after the area segmentation;
[0202] Generate an initial detection area according to the gray value projection array;
[0203] The initial detection area is closed in the specified range in the horizontal and vertical directions, and then the endpoints are connected to connect the various segmented scratch defects into a whole to generate a scratch defect area.
[0204] The second determining unit 711 is used to determine the line defect area on the image to be filtered out;
[0205] The third determining unit 712 is used to superimpose the scratch defect area and the line defect area into the same defect area object array, and determine the diagonal coordinate information of the minimum envelope area of all defect areas, where the diagonal coordinate information includes row and column coordinate information of a group of diagonal coordinate points of the minimum envelope area;
[0206] A filling unit 713 is used to select a defect area to be inspected from the defect area object array, and fill the row and column coordinate information of the remaining first defect area into the image grayscale value of the preset image to be filled, wherein the defect area to be inspected is a line defect area;
[0207] The first generating unit 714 is used to screen the area of the image to be filled according to the row and column coordinates of the defect area to be inspected, and generate a plurality of card control areas;
[0208] A fourth determining unit 715 is used to determine a second defect area in the first defect area that meets the basic adjacency requirement according to the plurality of card control areas;
[0209] A fifth determining unit 716 is used to calculate the minimum contour distance between the defect area to be detected and the second defect area, and to use the defect area whose minimum contour distance is less than a preset threshold as a matching defect area of the defect area to be detected;
[0210] A seventh determining unit 717, configured to determine the matching defect region as an associated defect region of the defect region to be detected, wherein the defect region to be detected also includes a scratch defect region;
[0211] A fourth generating unit 718, configured to remove the matching defect region from the first defect region to generate a third defect region;
[0212] A processing unit 719, configured to fill the image to be filled, generate the second remaining defect area, and determine the matching defect area according to the associated defect area and the third defect area;
[0213] An integration unit 720, used to integrate all matching defect matrices and the current defect area to be inspected;
[0214] The loop unit 721 is used to repeat the above-mentioned card control area screening and new matching defect area determination for the matching defect area and the remaining area to obtain an integrated defect area, remove the integrated defect area from the first defect area, and reselect a new area to be detected to calculate the matching defect area until there is no defect area in the first defect area, and the remaining area is the area remaining after excluding the defect area to be detected and the matching defect area in the first defect area.
[0215] See also Figure 8 The present application provides a device for filtering scratch defects of a display screen, comprising:
[0216] Processor 801 , memory 802 , input-output unit 803 , and bus 804 .
[0217] The processor 801 is connected to the memory 802 , the input and output unit 803 , and the bus 804 .
[0218] The memory 802 stores a program, and the processor 801 calls the program to execute the following steps: Figure 1 , Figure 2 and Figure 3 , Figure 4 , Figure 5 and Figure 6 The method in .
[0219] The present application provides a computer-readable storage medium, on which a program is stored, and when the program is executed on a computer, the program performs the following steps: Figure 1 , Figure 2 and Figure 3 , Figure 4 , Figure 5 and Figure 6 The method in .
[0220] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and units described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.
[0221] In the several embodiments provided in the present application, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be an indirect coupling or communication connection through some interfaces, devices or units, which can be electrical, mechanical or other forms.
[0222] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0223] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.
[0224] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product. The computer software product is stored in a storage medium, including several instructions to enable a computer device (which can be a personal computer, server, or network device, etc.) to execute all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, read-only memory), random access memory (RAM, random access memory), disk or optical disk and other media that can store program code.
Claims
1. A method for filtering scratch defects of a display screen, characterized in that: include: Collecting a scratch filtering auxiliary image and an image to be filtered of the display screen to be tested; Determining a scratch defect area on the scratch filtering auxiliary image; Determining a line defect area on the image to be filtered out; The scratch defect area and the line defect area are superimposed and placed in the same defect area object array, and the diagonal coordinate information of the minimum envelope area of all defect areas is determined, wherein the diagonal coordinate information includes row and column coordinate information of a group of diagonal coordinate points of the minimum envelope area; Select a defect area to be inspected from the defect area object array, and fill the row and column coordinate information of the remaining first defect area into the image grayscale value of the preset image to be filled, wherein the defect area to be inspected is a line defect area; Screening the area of the image to be filled according to the row and column coordinates of the defect area to be inspected to generate a plurality of card control areas; Determine, according to a plurality of card control areas, a second defect area in the first defect area that meets basic adjacency requirements; Calculating the minimum contour distance between the defect area to be inspected and the second defect area, and taking the defect area whose minimum contour distance is less than a preset threshold as the matching defect area of the defect area to be inspected; The matching defect area and the remaining area are repeated with the above-mentioned card control area screening and new matching defect area determination to obtain an integrated defect area, the integrated defect area is removed from the first defect area, and a new area to be detected is reselected to calculate the matching defect area until there is no defect area in the first defect area, and the remaining area is the area remaining in the first defect area after excluding the defect area to be detected and the matching defect area.
2. The method according to claim 1, characterized in that After acquiring the scratch filtering auxiliary image and the image to be filtered of the display screen to be tested, and before determining the scratch defect area on the scratch filtering auxiliary image, the method further includes: Calculating the spatial distance between the coordinates of adjacent corner points of the scratch filtering auxiliary image and the image to be filtered out according to the edge corner point information of the scratch filtering auxiliary image and the image to be filtered out; Calculating acquisition environment parameters according to the spatial distance, image resolution and magnification of the scratch filtering auxiliary image and the image to be filtered out; When the acquisition environment parameter meets a preset acquisition environment threshold, determining that the scratch filtering auxiliary image and the image to be filtered meet the filtering condition; When the acquisition environment parameters do not meet the preset acquisition environment threshold, the acquisition device parameters are adjusted according to the acquisition environment parameters, and the scratch filtering auxiliary image and the image to be filtered out are re-acquired through the new acquisition environment.
3. The method according to claim 2, characterized in that After determining that the scratch filtering auxiliary image and the image to be filtered meet the filtering condition and before determining the scratch defect area on the scratch filtering auxiliary image, the method further includes: Performing multi-point mapping transformation correction on the scratch filtering auxiliary image and the image to be filtered according to edge corner point information of the scratch filtering auxiliary image and the image to be filtered; A unity matrix is generated according to the set of images to be filtered out, and the scratch filtering auxiliary image is scaled according to the unity matrix.
4. The method according to claim 1, characterized in that: After acquiring the scratch filtering auxiliary image and the image to be filtered of the display screen to be tested, and before determining the scratch defect area on the scratch filtering auxiliary image, the method further includes: Constructing a contrast enhancement matrix according to the screen defect data of the scratch filtering auxiliary image; The scratch-filtered auxiliary image is processed by the contrast-enhanced matrix to generate a contrast-enhanced image.
5. The method according to claim 4, characterized in that Determining a scratch defect area on the scratch filtering auxiliary image includes: Performing regional segmentation on the contrast-enhanced image by using a preset adaptive controllable matrix; Generating a gray value projection array for each image area of the contrast enhanced image after area segmentation; Generate an initial detection area according to the gray value projection array; The initial detection area is closed in the specified range in the horizontal and vertical directions, and then the endpoints are connected to connect the various segmented scratch defects into a whole to generate a scratch defect area.
6. The method according to any one of claims 1 to 5, characterized in that The defect area to be inspected also includes a scratch defect area; After calculating the minimum contour distance between the defect area to be detected and the second defect area, and taking the defect area whose minimum contour distance is less than a preset threshold as the matching defect area of the defect area to be detected, removing the defect area to be detected and the matching defect area from the first defect area, and reselecting a new defect area to be detected to calculate the matching defect area, until there is no defect area in the first defect area, the method further includes: Determining the matching defect area as an associated defect area of the defect area to be detected; removing the matching defect region from the first defect region to generate a third defect region; Filling the image to be filled, generating the second remaining defect area and determining the matching defect area according to the associated defect area and the third defect area; Integrate all matching defect matrices and the current defect area to be inspected.
7. A device for filtering scratch defects of a display screen, characterized in that: include: A first acquisition unit is used to acquire a scratch filtering auxiliary image and an image to be filtered of the display screen to be tested; A first determining unit, configured to determine a scratch defect area on the scratch filtering auxiliary image; A second determining unit, configured to determine a line defect area on the image to be filtered out; a third determining unit, configured to superimpose the scratch defect area and the line defect area into a same defect area object array, and determine diagonal coordinate information of a minimum envelope area of all defect areas, wherein the diagonal coordinate information includes row and column coordinate information of a group of diagonal coordinate points of the minimum envelope area; A filling unit, used to select a defect area to be inspected from the defect area object array, and fill the row and column coordinate information of the remaining first defect area into the image grayscale value of the preset image to be filled, wherein the defect area to be inspected is a line defect area; A first generating unit, configured to screen the area of the image to be filled according to the row and column coordinates of the defect area to be inspected, and generate a plurality of card control areas; A fourth determining unit, configured to determine, according to a plurality of card control areas, a second defect area in the first defect area that meets a basic adjacency requirement; A fifth determining unit, configured to calculate a minimum contour distance between the defect area to be detected and the second defect area, and to use a defect area whose minimum contour distance is less than a preset threshold as a matching defect area of the defect area to be detected; The circulation unit is used to repeat the above-mentioned card control area screening and new matching defect area determination for the matching defect area and the remaining area to obtain an integrated defect area, remove the integrated defect area from the first defect area, and reselect a new area to be detected to calculate the matching defect area until there is no defect area in the first defect area, and the remaining area is the area remaining after excluding the defect area to be detected and the matching defect area from the first defect area.
8. The device according to claim 7, characterized in that The device also includes: A first calculation unit, configured to calculate the spatial distance between the coordinates of adjacent corner points of the scratch filtering auxiliary image and the image to be filtered out according to the edge corner point information of the scratch filtering auxiliary image and the image to be filtered out; A second calculation unit is used to calculate the acquisition environment parameters according to the spatial distance, image resolution and magnification of the scratch filtering auxiliary image and the image to be filtered out; a sixth determining unit, configured to determine that the scratch filtering auxiliary image and the image to be filtered meet a filtering condition when the acquisition environment parameter meets a preset acquisition environment threshold; The first acquisition unit is used to adjust acquisition device parameters according to the acquisition environment parameters when the acquisition environment parameters do not meet a preset acquisition environment threshold, and re-acquire the scratch filtering auxiliary image and the image to be filtered out through a new acquisition environment.
9. A device for filtering scratch defects of a display screen, characterized in that: include: A processor, a memory, an input-output unit and a bus, wherein the processor is connected to the memory, the input-output unit and the bus, the memory stores a program, and the processor calls the program to execute the method as claimed in any one of claims 1 to 6.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a program, and when the program is executed on a computer, the method according to any one of claims 1 to 6 is performed.
Citation Information
Patent Citations
Defect detection method, device, equipment and medium
CN118610115A
Image processing method and defect inspection method
JP2019008739A