Backlight panel defect detection method and system
By calculating the Euclidean distance and the Canny algorithm to fit the defect profile in YCbCr space, the problem of micro defect recognition in the defect detection of backlight boards is solved, and efficient and accurate defect type recognition is achieved.
Patent Information
- Application Number
- CN202510409899.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-02
- Publication Date
- 2025-09-02
- Estimated Expiration
- 2045-04-02
AI Technical Summary
The existing backlight board defect detection technology has high accuracy for detection of large defects, but low accuracy for detection of small defects, and it is difficult to determine the defect type, resulting in missed detection and misjudgment and low detection efficiency.
Image processing technology is used to calculate the Euclidean distance between the area to be detected and the standard sample in the YCbCr space, and the defect area is positioned through rectangular frame segmentation and opening operations, and the defect contour coordinates are extracted in combination with the Canny algorithm for circular or line fitting to determine the defect type.
It improves the accuracy and efficiency of defect detection of backlight boards, can accurately identify scratches and dirt, and reduces missed detection and misjudgment.
Smart Images

Figure CN119919417B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of pattern recognition technology, and in particular to a backlight plate defect detection method and system. Background Art
[0002] Backlight panels are components used to increase display brightness. Installed behind the screen, they provide light, enabling clear images to appear on the screen. With the advancement of display technology, backlight panels are widely used in mobile devices such as mobile phones, tablets, and laptops, as well as high-end displays such as televisions, playing a vital role in improving the display quality of these devices.
[0003] Before installation, the backlight panel's appearance needs to be inspected. However, existing backlight panel defect detection methods offer high accuracy for larger defects but low accuracy for smaller defects. Furthermore, it's difficult to determine the specific defects detected, such as scratches or dirt picked up during production and handling. When multiple minor defects are present, manual detection is required, leading to missed detections and misjudgments, resulting in low accuracy and efficiency. Summary of the Invention
[0004] The purpose of the present invention is to provide a backlight panel defect detection method and system. The present invention performs a first defect detection on the backlight panel surface, preliminarily extracts the area where the defect exists, locates the defect in the extracted first defect area to obtain a second defect area, further determines the specific location of the defect, performs a second defect detection on the second defect area, and determines that the type of defect is a scratch or dirt, thereby improving the accuracy and efficiency of backlight panel defect detection.
[0005] The purpose of the present invention is achieved by the following technical means:
[0006] In a first aspect, the present invention provides a backlight panel defect detection method, comprising the following steps:
[0007] acquiring a surface image of the backlight panel;
[0008] Performing a first defect detection on the surface image to obtain a first defect area;
[0009] performing defect location on the first defect area to obtain a second defect area;
[0010] performing a second defect detection on the second defect area to obtain a defect type;
[0011] Outputting the second defect area and the defect type to obtain a defect detection result;
[0012] The defect types include scratches and dirt.
[0013] Preferably, performing a first defect detection on the surface image to obtain a first defect area comprises the following steps:
[0014] Converting the surface image to YCbCr space;
[0015] Using a rectangular frame to segment the surface image to obtain a plurality of areas to be detected;
[0016] Calculating a component histogram of the area to be detected;
[0017] Calculating the Euclidean distance between the area to be detected and the standard sample according to the component histogram;
[0018] Performing image stitching on the areas to be detected whose Euclidean distance is greater than a color difference threshold to obtain the first defect area;
[0019] The calculation formula of the Euclidean distance is expressed as follows:
[0020] , ,
[0021] in, is the Euclidean distance, for The Euclidean distance of the components, for The Euclidean distance of the components, for The Euclidean distance of the components, , and is the component weight coefficient, for The Euclidean distance of the components, For the area to be detected The histogram data of the components, For standard samples The histogram data of the components, is the number of histogram data, .
[0022] Preferably, the defect location of the first defect area to obtain the second defect area includes the following steps:
[0023] replicating the first defective area to obtain a first area sample image;
[0024] performing an opening operation on the first defect region to obtain a first region processed image;
[0025] Subtracting the first region processed image from the first region sample image to obtain a first difference image;
[0026] Performing image convolution on the first difference image to obtain a convolved image;
[0027] Subtracting the convolution image from the first difference image to obtain a second difference image;
[0028] Pixels whose pixel values in the second difference image are greater than a change threshold are extracted to obtain the second defect area.
[0029] Preferably, performing a second defect detection on the second defect area to obtain a defect type includes the following steps:
[0030] Using the Canny algorithm to extract the edge of the second defect area to obtain the defect contour coordinates;
[0031] Performing circle fitting on the defect contour coordinates to obtain a fitting circle;
[0032] Obtaining the center coordinates and radius of the fitted circle;
[0033] The defect type is determined according to the coordinates of the circle center and the radius.
[0034] Preferably, judging the defect type according to the coordinates of the circle center and the radius comprises the following steps:
[0035] When the radius is greater than a radius threshold, the defect type is a scratch;
[0036] When the radius is less than the radius threshold, performing line fitting on the defect contour coordinates to obtain a fitting curve;
[0037] Calculate the coordinate error based on the defect contour coordinates and the circle center coordinates to obtain a first error;
[0038] Calculating a coordinate error between the defect contour coordinates and the fitting curve to obtain a second error;
[0039] The defect type is determined according to the first error and the second error.
[0040] Preferably, the calculation formula of the first error is expressed as follows:
[0041] ;
[0042] in, is the first error, For the The horizontal coordinate of the defect contour coordinate, is the horizontal coordinate of the center of the fitted circle, For the The ordinate of the defect contour coordinate, is the ordinate of the center of the fitted circle, is the radius of the fitted circle, is the number of defect contour coordinates; the calculation formula of the second error is expressed as follows:
[0043] ,
[0044] in, is the second error, For the The distance from the defect contour coordinates to the fitting curve, is the number of defect contour coordinates.
[0045] Preferably, judging the defect type according to the first error and the second error comprises the following steps:
[0046] Subtracting the first error from the second error to obtain an error difference;
[0047] When the error difference is greater than zero, the defect type is a scratch;
[0048] When the error difference is less than zero, the defect type is dirt.
[0049] In a second aspect, the present invention provides a backlight panel defect detection system, which applies the above-mentioned backlight panel defect detection method, including: a surface image acquisition module, a first defect detection module, a second defect positioning module, a second defect detection module and a detection result output module;
[0050] The surface image acquisition module is used to acquire the surface image of the backlight panel;
[0051] The first defect detection module is configured to perform a first defect detection on the surface image to obtain a first defect area;
[0052] The second defect location module is configured to locate the defect in the first defect area to obtain a second defect area;
[0053] The second defect detection module is configured to perform a second defect detection on the second defect area to obtain a defect type;
[0054] The detection result output module is used to output the second defect area and the defect type to obtain a defect detection result.
[0055] In a third aspect, the present invention provides an electronic device comprising a processor and a memory, wherein the memory is used to store computer program code, and the computer program code comprises computer instructions. When the processor executes the computer instructions, the electronic device executes the above-mentioned backlight panel defect detection method.
[0056] In a fourth aspect, the present invention provides a computer-readable storage medium, in which a computer program is stored. The computer program includes program instructions, and when the program instructions are executed by a processor of an electronic device, the processor executes the above-mentioned backlight panel defect detection method.
[0057] Compared with the prior art, the present invention has the following beneficial effects:
[0058] The present invention performs a first defect detection on the surface of the backlight panel, preliminarily extracts the area where the defect exists, locates the defect in the extracted first defect area to obtain a second defect area, further determines the specific location of the defect, performs a second defect detection on the second defect area, and determines the type of the defect as a scratch or dirt, thereby improving the accuracy and efficiency of backlight panel defect detection.
[0059] The present invention calculates the color consistency between the area to be detected and the standard sample in the YCbCr space, obtains the area to be detected with inconsistent colors to obtain the first defect area, and improves the efficiency of backlight panel defect detection;
[0060] The present invention performs an opening operation on the first defect area, calculates the difference between the image after the opening operation and the sample image, obtains the pixel points where the difference change is greater than the change threshold, and obtains the second defect area, thereby improving the accuracy of backlight plate defect detection;
[0061] The present invention uses the Canny algorithm to extract the defect contour coordinates, performs circle fitting and line fitting based on the defect contour coordinates, and determines the shape of the defect contour coordinates according to the degree of fitting, thereby judging the defect type and improving the accuracy of backlight panel defect detection. BRIEF DESCRIPTION OF THE DRAWINGS
[0062] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the invention and, together with the description, serve to explain the principles of the invention.
[0063] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.
[0064] Figure 1A schematic flow chart of a backlight panel defect detection method provided in this embodiment;
[0065] Figure 2 A schematic diagram of the process of performing a first defect detection on a surface image to obtain a first defect area in step S2 provided in this embodiment;
[0066] Figure 3 This is a flow chart of step S3 provided in this embodiment, wherein the defect is located in the first defect area to obtain the second defect area;
[0067] Figure 4 A schematic flow chart of step S4 provided in this embodiment, performing a second defect detection on the second defect area to obtain a defect type;
[0068] Figure 5 This is a flow chart of step S44 provided in this embodiment, which is a flow chart of determining the defect type based on the coordinates of the circle center and the radius;
[0069] Figure 6 This is a flow chart of step S445 provided in this embodiment, which is a flow chart of determining the defect type based on the first error and the second error;
[0070] Figure 7 A schematic structural diagram of a backlight panel defect detection system provided in this embodiment;
[0071] Figure 8 This is a schematic structural diagram of an electronic device provided in this embodiment. DETAILED DESCRIPTION
[0072] The following will clearly and completely describe the technical solutions in the embodiments of the present invention in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. All other embodiments obtained by ordinary technicians in this field based on the embodiments of the present invention without making any creative efforts shall fall within the scope of protection of the present invention.
[0073] It should be noted that all directional indications (such as up, down, left, right, front, back, etc.) in the embodiments of the present invention are only used to explain the relative position relationship and movement status of various components in a certain specific posture. If the specific posture changes, the directional indication will also change accordingly.
[0074] In addition, the descriptions of "first", "second", etc. in the present invention are for descriptive purposes only and should not be understood as indicating or implying their relative importance or implicitly indicating the number of the indicated technical features. Therefore, the features defined as "first" or "second" may explicitly or implicitly include at least one of such features. In addition, the technical solutions between the various embodiments can be combined with each other, but this must be based on the fact that they can be implemented by ordinary technicians in this field. When the combination of technical solutions is contradictory or cannot be implemented, it should be deemed that such combination of technical solutions does not exist and is not within the scope of protection required by the present invention.
[0075] Example 1
[0076] This embodiment provides a backlight panel defect detection method, such as Figure 1 As shown, the following steps are included:
[0077] S1, acquiring the surface image of the backlight panel;
[0078] S2, performing a first defect detection on the surface image to obtain a first defect area;
[0079] S3, performing defect location on the first defect area to obtain a second defect area;
[0080] S4, performing a second defect detection on the second defect area to obtain a defect type;
[0081] S5, outputting the second defect area and defect type to obtain a defect detection result;
[0082] The defect types include scratches and dirt.
[0083] It should be noted that this embodiment obtains a surface image of the backlight panel through photography or other means, and then performs image recognition on the surface image to identify the location and type of defects. Specifically, the first defect detection process is used to detect whether the backlight panel has defects. If the backlight panel does not have defects, the first defect detection result is "no," and defect detection can be stopped. If the backlight panel does have defects, the first defect detection process can detect the presence of defects and, based on the detection result, provide the location of the defects, i.e., the first defect area. The first defect detection process can quickly and efficiently identify the locations of defects in the backlight panel, but the accuracy of the defect location is low, and only the first defect area containing the defects can be provided. To improve the accuracy of backlight panel defect detection, the first defect area is used to locate the defects, obtaining a more accurate defect location, i.e., the second defect area. The second defect detection process is used to detect the type of defects in the backlight panel. By identifying the second defect area, it can be determined whether the defect is a scratch or dirt. When the detection is completed, the detected defect location and defect type are output.
[0084] In this embodiment, a first defect detection is performed on the surface of the backlight panel, a preliminary extraction is performed on the area where the defect exists, the defect is located on the extracted first defect area to obtain a second defect area, the specific location of the defect is further determined, a second defect detection is performed on the second defect area, and the type of defect is determined to be a scratch or dirt, thereby improving the accuracy and efficiency of the backlight panel defect detection.
[0085] In some embodiments, step S2, a first defect detection is performed on the surface image to obtain a first defect area, such as Figure 2 As shown, the following steps are included:
[0086] S21, converting the surface image into YCbCr space;
[0087] S22, using a rectangular frame to segment the surface image to obtain multiple areas to be detected;
[0088] S23, calculating a component histogram of the area to be detected;
[0089] S24, calculating the Euclidean distance between the area to be detected and the standard sample according to the component histogram;
[0090] S25, performing image stitching on the areas to be inspected whose Euclidean distance is greater than the color difference threshold to obtain a first defect area;
[0091] The calculation formula of Euclidean distance is as follows:
[0092] , ,
[0093] in, is the Euclidean distance, for The Euclidean distance of the components, for The Euclidean distance of the components, for The Euclidean distance of the components, , and is the component weight coefficient, for The Euclidean distance of the components, For the area to be detected The histogram data of the components, For standard samples The histogram data of the components, is the number of histogram data, .
[0094] It should be noted that the first defect detection needs to quickly and efficiently detect the approximate area where the defect is located. Compared with the traditional RGB color space, the YCbCr color space has a smaller amount of image data and does not affect the color detection of the surface. Therefore, this embodiment determines and obtains the position of the defect by obtaining the YCbCr space histogram data and performing Euclidean distance calculation. Specifically, a rectangular frame is used to segment the converted surface image to obtain multiple areas to be detected, and the areas to be detected are detected separately. During the detection process, by performing consistency detection on the surface of the area to be detected, when there are defects in the area to be detected, they can be quickly detected. The detection process calculates the histogram data of the three components of Y, Cb and Cr, selects the Euclidean distance with less calculation amount and simple calculation process, calculates the Euclidean distance of the three components and the background plate standard sample respectively, and weights them to calculate the overall Euclidean distance. The weight of each component is set according to the background plate standard sample, and the background plate standard sample can be obtained before detection. When the Euclidean distance is greater than the color difference threshold, it indicates that there is a defect in the area to be detected. By splicing adjacent areas whose Euclidean distance is greater than the color difference threshold, multiple splicing areas are obtained, that is, multiple first defect areas, each of which contains a backlight defect.
[0095] In this embodiment, by calculating the color consistency between the area to be detected and the standard sample in the YCbCr space, the area to be detected with inconsistent colors is obtained to obtain the first defect area, thereby improving the efficiency of backlight panel defect detection.
[0096] In some embodiments, in step S3, the first defect area is defect-located to obtain a second defect area, such as Figure 3 As shown, the following steps are included:
[0097] S31, replicating the first defective area to obtain a first area sample image;
[0098] S32, performing an opening operation on the first defect area to obtain a first area processed image;
[0099] S33, performing a subtraction between the first region processed image and the first region sample image to obtain a first difference image;
[0100] S34, performing image convolution on the first difference image to obtain a convolved image;
[0101] S35, subtracting the convolution image from the first difference image to obtain a second difference image;
[0102] S36 , extracting pixel points whose pixel values of the second difference image are greater than the change threshold to obtain a second defect area.
[0103] It should be noted that defect localization is to further locate the position of the defect based on the acquisition of the first defect area. The acquired first defect area is copied as the first area sample image. The first defect area is opened, and the first defect area is corroded and expanded during the opening operation to remove the disconnected parts in the image. At this time, the defects in the first defect area are eliminated. When the image size is large or there are many elements in the image, the opening operation takes a lot of time, which affects the detection speed of the backlight defect detection. Therefore, it is necessary to first perform the first defect area detection on the surface image to obtain the first defect area. The first area processed image obtained after the opening operation is subtracted from the first area sample image to obtain a difference image. In the difference image, the difference of the position where the defect exists is large, and the difference of the position without the defect is almost zero. By obtaining the pixel points whose difference change is greater than the change threshold, the specific position of the backlight defect, that is, the second defect area, is obtained.
[0104] In this embodiment, by performing an opening operation on the first defect area, calculating the difference between the image after the opening operation and the sample image, and obtaining pixel points whose difference change is greater than the change threshold, the second defect area is obtained, thereby improving the accuracy of backlight panel defect detection.
[0105] In some embodiments, in step S4, a second defect detection is performed on the second defect area to obtain a defect type, such as Figure 4 As shown, the following steps are included:
[0106] S41, using the Canny algorithm to extract the edge of the second defect area to obtain the defect contour coordinates;
[0107] S42, performing circle fitting on the defect contour coordinates to obtain a fitting circle;
[0108] S43, obtaining the center coordinates and radius of the fitting circle;
[0109] S44, judging the defect type according to the coordinates of the circle center and the radius.
[0110] It should be noted that before using the Canny algorithm to extract the edge of the second defect area, it is necessary to first perform denoising and grayscale conversion on the second defect area. Denoising and grayscale processing use existing technical means and are not described in detail here. The Canny algorithm extracts the contour coordinates of the defect, which are then fitted using a circle model to obtain the center coordinates and radius of the fitted circle.
[0111] In some embodiments, step S44 determines the defect type based on the coordinates of the circle center and the radius, such as Figure 5 As shown, the following steps are included:
[0112] S441, when the radius is greater than the radius threshold, the defect type is a scratch;
[0113] S442, when the radius is less than the radius threshold, performing line fitting on the defect contour coordinates to obtain a fitting curve;
[0114] S443, calculating a coordinate error based on the defect contour coordinates and the circle center coordinates to obtain a first error;
[0115] S444, calculating the coordinate error between the defect contour coordinates and the fitting curve to obtain a second error;
[0116] S445 , determining the defect type based on the first error and the second error.
[0117] The calculation formula of the first error is as follows:
[0118] ;
[0119] in, is the first error, For the The horizontal coordinate of the defect contour coordinate, is the horizontal coordinate of the center of the fitted circle, For the The ordinate of the defect contour coordinate, is the ordinate of the center of the fitted circle, is the radius of the fitted circle, is the number of defect contour coordinates; the calculation formula of the second error is expressed as follows:
[0120] ,
[0121] in, is the second error, For the The distance from the defect contour coordinates to the fitting curve, is the number of defect contour coordinates.
[0122] In some embodiments, in step S445, the defect type is determined based on the first error and the second error, such as Figure 6 As shown, the following steps are included:
[0123] S4451, subtracting the first error from the second error to obtain an error difference;
[0124] S4452, when the error difference is greater than zero, the defect type is scratch;
[0125] S4453, when the error difference is less than zero, the defect type is dirt.
[0126] It should be noted that the fitting circle obtained by fitting the defect contour coordinates using the circle model needs to minimize the sum of the distances from the defect contour coordinate points to the fitting circle. When the defect type of the backlight panel is a scratch, fitting using the circle model will result in a circle with a large radius. Therefore, the defect contour coordinates are first fitted with a circle to determine whether the radius of the fitting circle is greater than the set radius threshold. When the radius is greater than the set radius threshold, the defect type can be directly determined to be a scratch. When the radius of the fitting circle is less than the set radius threshold, the defect type needs to be further judged. Specifically, the curve model is used to perform line fitting on the defect contour coordinates to obtain a fitting curve. The sum of the distances from the defect contour coordinate points to the fitting circle and the sum of the distances from the defect contour coordinate points to the fitting curve are calculated, namely the first error and the second error. The defect type is determined based on the relationship between the first error and the second error. When the error difference is greater than zero, the first error is greater than the second error, that is, the sum of the distances from the defect contour coordinate points to the fitting curve is smaller, so the defect type is a scratch; similarly, when the error difference is less than zero, the first error is less than the second error, that is, the sum of the distances from the defect contour coordinate points to the fitting circle is smaller, so the defect type is dirt.
[0127] In this embodiment, the defect contour coordinates are extracted by using the Canny algorithm, circle fitting and line fitting are performed based on the defect contour coordinates, and the shape of the defect contour coordinates is determined based on the degree of fitting, thereby judging the defect type and improving the accuracy of backlight panel defect detection.
[0128] Example 2
[0129] This embodiment provides a backlight panel defect detection system, which applies the above-mentioned backlight panel defect detection method. Figure 7 As shown, it includes: a surface image acquisition module, a first defect detection module, a second defect positioning module, a second defect detection module and a detection result output module;
[0130] A surface image acquisition module, used for acquiring a surface image of the backlight panel;
[0131] A first defect detection module, configured to perform a first defect detection on the surface image to obtain a first defect area;
[0132] A second defect location module is used to locate the defect in the first defect area to obtain a second defect area;
[0133] A second defect detection module, configured to perform a second defect detection on a second defect area to obtain a defect type;
[0134] The detection result output module is used to output the second defect area and defect type to obtain a defect detection result.
[0135] In this embodiment, a first defect detection is performed on the surface of the backlight panel, a preliminary extraction is performed on the area where the defect exists, the defect is located on the extracted first defect area to obtain a second defect area, the specific location of the defect is further determined, a second defect detection is performed on the second defect area, and the type of defect is determined to be a scratch or dirt, thereby improving the accuracy and efficiency of the backlight panel defect detection.
[0136] It should be understood that the disclosed system can be implemented in other ways. For example, the system embodiments described above are merely illustrative. For example, the division of the above modules is merely a logical functional division. In actual implementation, there may be other division methods. For example, multiple modules or components may be combined or integrated into another system, or some features may be ignored or not executed. In addition, each functional module may be integrated into a processing module, or each module may exist physically separately, or two or more modules may be integrated into one module. The above-mentioned integrated modules may be implemented in the form of hardware or in the form of software functional modules.
[0137] Example 3
[0138] This embodiment provides an electronic device 2, such as Figure 8 As shown, a processor 21 and a memory 22 are provided. The memory 22 is used to store computer program codes. The computer program codes include computer instructions. When the processor 21 executes the computer instructions, the electronic device executes the above-mentioned backlight panel defect detection method.
[0139] The electronic device 2 includes a processor 21, a memory 22, an output device 23, and an input device 24. The processor 21, memory 22, output device 23, and input device 24 are coupled via a connector, which may include various interfaces, transmission lines, or buses, etc., although this is not limited in the present embodiment. It should be understood that in various embodiments of the present invention, coupling refers to interconnection in a specific manner, including direct connection or indirect connection through other devices, such as various interfaces, transmission lines, buses, etc.
[0140] The processor 21 may be one or more graphics processing units (GPUs). If the processor 21 is a GPU, the GPU may be a single-core GPU or a multi-core GPU. Alternatively, the processor 21 may be a processor group consisting of multiple GPUs, with the multiple processors coupled to each other via one or more buses. Alternatively, the processor 21 may be other types of processors, and the embodiments of the present invention are not limited thereto.
[0141] The memory 22 can be used to store computer program instructions and various computer program codes, including program codes for executing the solutions of the present invention. Optionally, the memory 22 includes, but is not limited to, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM), or compact disc read-only memory (CD-ROM). The memory 22 is used for related instructions and data.
[0142] The input device 24 is used to input data and / or signals, and the output device 23 is used to output data and / or signals. The output device 23 and the input device 24 can be independent devices or an integrated device.
[0143] This embodiment provides a computer-readable storage medium, in which a computer program is stored. The computer program includes program instructions. When the program instructions are executed by a processor of an electronic device, the processor executes the above-mentioned backlight panel defect detection method.
[0144] The foregoing description is intended only to provide specific embodiments of the present invention, which will enable those skilled in the art to understand and implement the present invention. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present invention. Therefore, the present invention is not intended to be limited to the embodiments shown herein, but is intended to be accorded the widest scope consistent with the principles and novel features claimed herein.
Claims
1. A backlight panel defect detection method, characterized in that: The following steps are involved: acquiring a surface image of the backlight panel; Performing a first defect detection on the surface image to obtain a first defect area; performing defect location on the first defect area to obtain a second defect area; performing a second defect detection on the second defect area to obtain a defect type; Outputting the second defect area and the defect type to obtain a defect detection result; The defect types include: scratches and dirt; The performing of a first defect detection on the surface image to obtain a first defect area comprises the following steps: Converting the surface image to YCbCr space; Using a rectangular frame to segment the surface image to obtain a plurality of areas to be detected; Calculating a component histogram of the area to be detected; Calculating the Euclidean distance between the area to be detected and the standard sample according to the component histogram; Performing image stitching on the areas to be detected whose Euclidean distance is greater than a color difference threshold to obtain the first defect area; The performing of a second defect detection on the second defect area to obtain a defect type includes the following steps: Using the Canny algorithm to extract the edge of the second defect area to obtain the defect contour coordinates; Performing circle fitting on the defect contour coordinates to obtain a fitting circle; Obtaining the center coordinates and radius of the fitted circle; Determining the defect type according to the center coordinates and the radius specifically includes the following steps: When the radius is greater than a radius threshold, the defect type is a scratch; When the radius is less than the radius threshold, performing line fitting on the defect contour coordinates to obtain a fitting curve; Calculate the coordinate error based on the defect contour coordinates and the circle center coordinates to obtain a first error; Calculating a coordinate error between the defect contour coordinates and the fitting curve to obtain a second error; determining the defect type according to the first error and the second error; The method of locating the first defect area to obtain the second defect area includes the following steps: replicating the first defective area to obtain a first area sample image; performing an opening operation on the first defect region to obtain a first region processed image; Subtracting the first region processed image from the first region sample image to obtain a first difference image; The calculation formula of the first error is expressed as follows: ; in, is the first error, For the The horizontal coordinate of the defect contour coordinate, is the horizontal coordinate of the center of the fitted circle, For the The ordinate of the defect contour coordinate, is the ordinate of the center of the fitted circle, is the radius of the fitted circle, is the number of defect contour coordinates; the calculation formula of the second error is expressed as follows: , in, is the second error, For the The distance from the defect contour coordinates to the fitting curve, is the number of defect contour coordinates; The step of determining the defect type based on the first error and the second error includes the following steps: Subtracting the first error from the second error to obtain an error difference; When the error difference is greater than zero, the defect type is a scratch; When the error difference is less than zero, the defect type is dirt.
2. The backlight panel defect detection method according to claim 1, wherein: The calculation formula of the Euclidean distance is expressed as follows: , , in, is the Euclidean distance, for The Euclidean distance of the components, for The Euclidean distance of the components, for The Euclidean distance of the components, , and is the component weight coefficient, for The Euclidean distance of the components, For the area to be detected The histogram data of the components, For standard samples The histogram data of the components, is the number of histogram data, .
3. The backlight panel defect detection method according to claim 1, wherein: The defect location of the first defect area to obtain the second defect area further includes the following steps: Performing image convolution on the first difference image to obtain a convolved image; Subtracting the convolution image from the first difference image to obtain a second difference image; Pixels whose pixel values in the second difference image are greater than a change threshold are extracted to obtain the second defect area.
4. A backlight panel defect detection system, applying a backlight panel defect detection method according to any one of claims 1 to 3, characterized in that: include: Surface image acquisition module, first defect detection module, second defect location module, second defect detection module and detection result output module; The surface image acquisition module is used to acquire the surface image of the backlight panel; The first defect detection module is configured to perform a first defect detection on the surface image to obtain a first defect area; The second defect location module is configured to locate the defect in the first defect area to obtain a second defect area; The second defect detection module is configured to perform a second defect detection on the second defect area to obtain a defect type; The detection result output module is used to output the second defect area and the defect type to obtain a defect detection result.
5. An electronic device, characterized in that: The electronic device comprises a processor and a memory, wherein the memory is used to store computer program code, and the computer program code comprises computer instructions. When the processor executes the computer instructions, the electronic device executes a backlight panel defect detection method as described in any one of claims 1 to 3.
6. A computer-readable storage medium, characterized in that The computer-readable storage medium stores a computer program, which includes program instructions. When the program instructions are executed by a processor of an electronic device, the processor executes a backlight panel defect detection method according to any one of claims 1 to 3.
Citation Information
Patent Citations
Defect detection method and device, electronic equipment and storage medium
CN115294025A
In-hole defect detection method, system and device
CN115953376A