Method and device for detecting appearance defects of curved screen and storage medium
By dynamically adjusting the segmentation lines and cutting the image, the problem of information loss in the appearance defect detection of curved screens is solved, achieving more efficient and accurate detection effects.
Patent Information
- Application Number
- CN202510097578.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-01-22
- Publication Date
- 2025-03-04
- Estimated Expiration
- 2045-01-22
AI Technical Summary
When detecting appearance defects of curved screens, the dependence of fixed segmentation lines leads to loss of information during the segmentation process between curved areas and plane areas, affecting the accuracy and efficiency of detection.
By acquiring the first to be detected image and the second to be detected image of the curved screen to be detected, the bright band information and area feature information are extracted, the initial segmentation line is dynamically adjusted until the preset conditions are met, the target shear segmentation line is generated, the clipping image is generated to generate the surface area and planar area images, and stitching is performed for defect analysis.
It reduces information loss in the appearance defect detection of curved screens, improves detection efficiency and accuracy, and can more accurately analyze defects in surface areas and planar areas.
Smart Images

Figure CN119559165A_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present application relate to the field of curved screen detection, and in particular, to a method, device, and storage medium for detecting appearance defects of a curved 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. In the field of display screen manufacturing, display screen defect detection is a key process step. Display screen defects include pixel defects and appearance defects. Appearance defects mainly include foreign matter, dirt, scratches and other defects. General flat display screens can shoot the display screen through a radial perspective to analyze appearance defects, but for curved screens, due to the existence of curved areas, simple radial shooting cannot accurately analyze the appearance defects of the curved areas. In order to solve the above problems, the curved area and the flat area are usually photographed separately and then spliced. This method relies on a fixed dividing line, resulting in information loss in the process of segmenting the curved area and the flat area, affecting the accuracy and efficiency of the detection. In addition, in order to prevent scratches on the display screen during the detection process, in the prior art, a protective film is usually attached to the curved screen, so that scratches will not affect the display screen body. However, this also causes more information loss when using a fixed dividing line for image segmentation and splicing, greatly reducing the detection accuracy of the appearance defects of the curved screen. Summary of the invention
[0004] The present application discloses a method, device and storage medium for detecting appearance defects of a curved screen, which are used to improve the detection accuracy of appearance defects of a curved screen.
[0005] The first aspect of the present application discloses a method for detecting appearance defects of a curved screen, comprising: Acquire a first image to be detected and a second image to be detected of the curved screen to be detected, wherein the first image to be detected and the second image to be detected are images collected when the curved side light source and the radial side light source are started respectively; Extracting bright band information of the first image to be detected; Performing grayscale value analysis on the second image to be detected to extract regional feature information; Determine a candidate segmentation line region of the second image to be detected by using the bright band information and the region feature information; Determine an initial segmentation line according to the candidate segmentation line area; Dynamically adjust the position of the initial segmentation line through the regional features of the candidate segmentation line area until the segmentation line reaches the preset condition to generate the target cutting segmentation line, and the regional features include the regional area and the regional grayscale; Shearing the first image to be detected and the second image to be detected according to the target shearing segmentation line to generate a curved surface area image and a flat surface area image; Splicing the curved area image and the flat area image to generate a spliced image; Perform defect analysis on the stitched images and generate defect feature analysis results.
[0006] Optionally, determining an initial segmentation line according to a candidate segmentation line region includes: Perform connected domain analysis on the candidate segmentation line regions and merge adjacent candidate segmentation line regions that meet the conditions; Generate a continuous initial segmentation line based on the merged candidate segmentation line area.
[0007] Optionally, dynamically adjusting the position of the initial segmentation line according to the regional features of the candidate segmentation line region until the segmentation line meets a preset condition, thereby generating a target cutting segmentation line, including: According to the regional features of the merged candidate segmentation line area, the position and shape of the initial segmentation line are dynamically adjusted to generate an intermediate segmentation line; Perform iterative condition analysis on the middle dividing line and the initial dividing line; When the iteration condition analysis result does not meet the termination condition, the current segmentation line region of the middle segmentation line is determined, and the position and shape of the initial segmentation line are dynamically adjusted according to the regional characteristics of the current segmentation line region; When the iterative condition analysis results meet the termination conditions, the target shearing segmentation line is calculated according to the moving middle segmentation line.
[0008] Optionally, generating a continuous initial segmentation line according to the merged candidate segmentation line regions includes: Determine the candidate region grayscale mean value of each merged candidate segmentation line region; Determine the bright band feature value of each merged candidate segmentation line area according to the bright band information; Calculate the regional weighted value of each merged candidate segmentation line region according to the candidate region grayscale mean and bright band feature value; The candidate segmentation line regions that meet the conditions are determined according to the region weighted values, and morphological operations are used to smooth the region boundaries to generate the initial segmentation lines.
[0009] Optionally, extracting bright band information of the first image to be detected includes: Performing grayscale conversion on the first image to be detected to generate a grayscale converted image; Perform threshold segmentation on the grayscale conversion image according to the preset grayscale mean weight to generate a binary image; The edge area of the binary image is extracted, and the bright band information of the edge area is extracted.
[0010] Optionally, after the first image to be detected and the second image to be detected are sheared according to the target shearing segmentation line to generate the curved surface area image and the flat surface area image, the curved surface area image and the flat surface area image are spliced and before the spliced image is generated, the method includes: The fuzzy logic thinning process is performed on the surface area image and the plane area image.
[0011] The second aspect of the present application discloses a device for detecting appearance defects of a curved screen, comprising: An acquisition unit, used for acquiring a first image to be detected and a second image to be detected of the curved screen to be detected, wherein the first image to be detected and the second image to be detected are images collected when the curved side light source and the radial side light source are started respectively; A first extraction unit, used to extract bright band information of a first image to be detected; A second extraction unit, used for performing grayscale value analysis on the second image to be detected to extract regional feature information; A determination unit, used to determine a candidate segmentation line region of a second image to be detected according to bright band information and region feature information; A first generating unit, configured to determine an initial segmentation line according to a candidate segmentation line region; A dynamic adjustment unit is used to dynamically adjust the position of the initial segmentation line according to the regional features of the candidate segmentation line area until the segmentation line reaches a preset condition to generate a target shear segmentation line, wherein the regional features include the regional area and the regional grayscale; A second generating unit is used to shear the first image to be detected and the second image to be detected according to the target shearing segmentation line to generate a curved surface area image and a flat surface area image; A third generating unit, used for splicing the curved area image and the flat area image to generate a spliced image; The fourth generating unit is used to perform defect analysis on the spliced image and generate defect feature analysis results.
[0012] Optionally, the first generation unit includes: A merging module is used to perform connected domain analysis on the candidate segmentation line regions and merge adjacent candidate segmentation line regions that meet the conditions; The first generating module is used to generate a continuous initial segmentation line according to the merged candidate segmentation line area.
[0013] Optional, dynamically adjustable unit, including: It is used to dynamically adjust the position and shape of the initial segmentation line according to the regional features of the merged candidate segmentation line area to generate an intermediate segmentation line, and the regional features include the regional area and the regional grayscale; Used to perform iterative condition analysis on the intermediate dividing line and the initial dividing line; When the iteration condition analysis result does not meet the termination condition, the current segmentation line area of the middle segmentation line is determined, and the position and shape of the initial segmentation line are dynamically adjusted according to the regional characteristics of the current segmentation line area; It is used to calculate the target shear splitting line based on the moving middle splitting line when the iterative condition analysis results meet the termination conditions of the iteration.
[0014] Optionally, the first generation module includes: Determine the candidate region grayscale mean value of each merged candidate segmentation line region; Determine the bright band feature value of each merged candidate segmentation line area according to the bright band information; Calculate the regional weighted value of each merged candidate segmentation line region according to the candidate region grayscale mean and bright band feature value; The candidate segmentation line regions that meet the conditions are determined according to the region weighted values, and morphological operations are used to smooth the region boundaries to generate the initial segmentation lines.
[0015] Optionally, the first extraction unit includes: Performing grayscale conversion on the first image to be detected to generate a grayscale converted image; Perform threshold segmentation on the grayscale conversion image according to the preset grayscale mean weight to generate a binary image; The edge area of the binary image is extracted, and the bright band information of the edge area is extracted.
[0016] Optionally, after the second generation unit and before the third generation unit, the device includes: The processing unit is used to perform fuzzy logic refinement processing on the curved area image and the flat area image.
[0017] A third aspect of the present application provides a device for detecting appearance defects of a curved screen, comprising: Processor, memory, input-output unit, and bus; The processor is connected to the memory, the input and output unit, and the bus; The memory stores a program, and the processor calls the program to execute the first aspect and any optional method of the first aspect.
[0018] 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.
[0019] It can be seen from the above technical solutions that the embodiments of the present application have the following advantages: In the present application, the first image to be detected and the second image to be detected of the curved screen to be detected are first obtained, and the first image to be detected and the second image to be detected are images collected when the curved side light source and the radial side light source are started, respectively. Sufficient surface data and plane data are extracted from the first image to be detected and the second image to be detected, respectively. Next, the bright band information of the first image to be detected is extracted. The grayscale value of the second image to be detected is then analyzed to extract the regional feature information. The candidate segmentation line area of the second image to be detected is determined by the bright band information and the regional feature information. The initial segmentation line is determined according to the candidate segmentation line area, and the position of the initial segmentation line is dynamically adjusted according to the regional features of the candidate segmentation line area until the segmentation line reaches the preset condition, and the target cutting segmentation line is generated. The first image to be detected and the second image to be detected are cut according to the target cutting segmentation line to generate a curved area image and a plane area image. The curved area image and the plane area image are spliced to generate a spliced image. Defect analysis is performed on the spliced image to generate defect feature analysis results.
[0020] By starting the curved side light source and the radial side light source, and collecting the first image to be detected and the second image to be detected of the curved screen to be detected respectively, sufficient curved surface data is extracted from the first image to be detected, and sufficient plane data is extracted from the second image to be detected. Then, the candidate segmentation line area of the second image to be detected is determined by bright band information and regional feature information, and the positions of the plane area and the curved area are accurately extracted by dynamically calculating the segmentation line, thereby reducing the information loss in the process of splicing the screen area image and the curved area image, and improving the efficiency and accuracy of curved screen appearance defect detection. BRIEF DESCRIPTION OF THE DRAWINGS
[0021] 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.
[0022] Figure 1 A schematic diagram of an embodiment of a method for detecting appearance defects of a curved screen according to the present application; Figure 2 A schematic diagram of an embodiment of a method for generating an initial segmentation line for the present application; Figure 3 A schematic diagram of an embodiment of a method for generating a target cutting segmentation line in the present application; Figure 4A schematic diagram of an embodiment of a method for generating an initial segmentation line for the present application; Figure 5 A schematic diagram of an embodiment of a method for extracting bright band information of a first image to be detected in the present application; Figure 6 A schematic diagram of an embodiment of a method for edge processing of a curved area image and a flat area image according to the present application; Figure 7 A schematic diagram of an embodiment of a device for detecting appearance defects of a curved screen according to the present application; Figure 8 A schematic diagram of an embodiment of a device for detecting appearance defects of a curved screen according to the present application; Fig. 9 This is a schematic diagram of the first image to be detected in this application; Fig.10 This is a schematic diagram of a second image to be detected in this application. DETAILED DESCRIPTION
[0023] 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.
[0024] It should be understood that when used in the present specification and the appended claims, the term "comprising" indicates the presence of described features, integers, steps, operations, elements and / or components, but does not exclude the presence or addition of one or more other features, integers, steps, operations, elements, components and / or combinations thereof.
[0025] 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.
[0026] 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.
[0027] 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.
[0028] 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.
[0029] In the prior art, in the field of display manufacturing, display defect detection is a key process step. Display defects include pixel defects and appearance defects. Appearance defects mainly include defects such as foreign matter, dirt, scratches, etc. For general flat display screens, the display screen can be photographed through a radial perspective to analyze appearance defects, but for curved screens, due to the existence of curved areas, simple radial photography cannot accurately analyze appearance defects in the curved areas. In order to solve the above problems, the curved area and the plane area are usually photographed separately and then spliced. This method relies on a fixed dividing line, resulting in information loss during the segmentation process of the curved area and the plane area, affecting the accuracy and efficiency of the detection. In addition, in order to prevent scratches on the display screen during the detection process, in the prior art, a protective film is usually attached to the curved screen, so that scratches will not affect the display screen body. However, this also causes more information loss when using a fixed dividing line for image segmentation and splicing, greatly reducing the detection accuracy of appearance defects of the curved screen.
[0030] Based on this, the present application discloses a method, device and storage medium for detecting appearance defects of curved screens, which are used to improve the detection accuracy of appearance defects of curved screens.
[0031] 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.
[0032] 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.
[0033] See also Figure 1 The present application provides an embodiment of a method for detecting appearance defects of a curved screen, comprising: 101. Acquire a first image to be detected and a second image to be detected of a curved screen to be detected, where the first image to be detected and the second image to be detected are images captured when a curved side light source and a radial side light source are started respectively; The terminal obtains a first image to be detected and a second image to be detected of the curved screen to be detected, wherein the first image to be detected and the second image to be detected are images collected when the curved side light source and the radial side light source are started, respectively.
[0034] The terminal uses industrial cameras and different types of light sources to shoot the curved screen to be tested to obtain high-quality image data for subsequent defect detection and analysis. The steps are as follows: 1. Start the curved side light sources on both sides. Adjust the brightness and position of the light source according to the curvature characteristics of the curved screen to be tested to ensure uniform lighting. Use an industrial camera to capture the first image to be tested; 2. Turn off the curved side light source and turn on the radial side light source. The radial side light source should be as vertical as possible to the flat area of the curved screen, but it should not affect the shooting of the industrial camera, and ensure that the switching process of the light source is smooth to avoid the image quality degradation caused by lighting differences.
[0035] Keep the positions of the industrial camera and the curved screen to be tested unchanged, re-trigger the camera to capture the second image to be tested. Ensure that the specifications (resolution, exposure time, etc.) of the second image are consistent with the first image.
[0036] Please refer to Fig. 9 and Fig.10 , Fig. 9 : is a schematic diagram of the first image to be detected. Through the illumination of the curved surface light sources on both sides, a bright band of the curved surface area is formed in the figure. The bright band of the curved surface area includes a large area of the curved surface area and part of the flat surface area. Fig.10 It is a schematic diagram of the second image to be detected. By turning on the radial side light source, the plane area and part of the curved surface area in the figure form a plane area bright band.
[0037] 102. Extracting bright band information of the first image to be detected; The terminal needs to extract the bright band information of the edge area (bright band boundary of the curved surface area) in the first image to be detected in order to perform subsequent segmentation line determination.
[0038] 103. Perform grayscale value analysis on the second image to be detected to extract regional feature information; The terminal performs grayscale value analysis on the second image to be detected as a whole or only on the edge area to extract feature information of the area. Specifically, in this embodiment, the grayscale value analysis is performed on the second image to be detected to extract regional features for comparison with the bright band information of the first image to construct a segmentation line model. It mainly includes two steps: using a sliding window method to divide the area and calculating the average grayscale value of each area.
[0039] First, the sliding window method is used. This method is a method that divides the image into multiple small areas (windows) and can be used for local feature extraction. The following are the specific implementation steps: First, select the window size. The size of the window is determined according to the resolution of the display screen and other data, where is the window width and is the window height. The size of the window should be flexibly selected according to the image features and application scenarios.
[0040] Then the window is slid, specifically starting from the upper left corner of the second image to be detected, and the window slides rightward and downward, sliding one pixel or more pixels each time until the entire image is traversed.
[0041] Then, the terminal starts to calculate the average grayscale value of the area. Specifically, it needs to calculate the average grayscale value M of the area in each sliding window. Let I(x, y) be the grayscale value of the second image, and the coordinates of the pixels in the window be , then the calculation formula for the average grayscale value is:
[0042] Where N is the total number of pixels in the window, multiplied by the resolution, N=W*H. R is the set of pixels in the current window.
[0043] 104. Determine a candidate segmentation line region of a second to-be-detected image according to the bright band information and the region feature information; The terminal determines the candidate segmentation line region of the second image to be detected through the bright band information and the regional feature information. Specifically, in this embodiment, regional feature extraction is implemented: 1. Bright band feature extraction: By analyzing the bright band information of the first image to be detected, the average grayscale value of the bright band is extracted and set as .
[0044] 2. Grayscale comparison: The terminal compares the average grayscale value of each window area of the second image to be detected with the average grayscale value of the bright band to construct a feature matrix. Set a threshold (for example, ±10% of the bright band grayscale value) to determine whether each area is a candidate segmentation line area:
[0045] in, is the threshold range, usually 0.1 or 0.2.
[0046] Partition line candidate area: For each window area, determine whether its average grayscale value is within the threshold range, and mark the area that meets the conditions as a candidate segmentation line area.
[0047] 105. Determine an initial segmentation line according to the candidate segmentation line region; 106. Dynamically adjust the position of the initial segmentation line according to the regional features of the candidate segmentation line region until the segmentation line reaches a preset condition, thereby generating a target cutting segmentation line, wherein the regional features include the regional area and the regional grayscale; Next, the terminal determines an initial segmentation line based on the candidate segmentation line area, so that the position of the initial segmentation line can be dynamically adjusted through the regional features of the candidate segmentation line area (regional features include regional area and regional grayscale), that is, whether the characteristics of the segmentation line meet the current characteristic conditions of the region is determined, and the segmentation line is dynamically adjusted by continuous iteration and updating, so that the obtained segmentation line can accurately divide the surface area and the plane area, and will not cause the loss of surface area information and plane area information in the subsequent fusion process.
[0048] 107. Shear the first image to be detected and the second image to be detected according to the target shearing segmentation line to generate a curved surface area image and a flat surface area image; The terminal cuts the first image to be detected and the second image to be detected according to the target cutting segmentation line to generate a curved area image and a flat area image. Specifically: 1. Region segmentation: Cut the segmentation line according to the determined target , extract the area: The first image plane area to be detected is extracted, and the formula is as follows:
[0049] in, is the first image to be detected, are pixel coordinates, It is the function representation of the dividing line.
[0050] Second, the surface area extraction of the image to be detected:
[0051] in, It is the second image to be detected.
[0052] 108. Splicing the curved area image and the flat area image to generate a spliced image; The terminal stitches the curved area image and the flat area image to generate a stitched image. Specifically, it includes: 1. Image stitching: stitch the extracted plane area and curved surface area, and use multiple interpolation algorithms (such as bilinear interpolation) to smooth the stitching area to reduce artifacts and information loss.
[0053] 2. Result output: Perform defect detection analysis on the final processed image and output the detection results.
[0054] 109. Perform defect analysis on the spliced image and generate defect feature analysis results.
[0055] In this embodiment, the terminal performs defect analysis on the spliced image to generate defect feature analysis results. Specifically, the specific process of defect detection is as follows: 1. Image preprocessing: Gaussian filtering can be used to smooth the image while retaining the details of the defects.
[0056]
[0057] In the formula, Represents pixel The result after Gaussian filtering is is the standard deviation.
[0058] 2. Image segmentation: The threshold segmentation algorithm is the simplest image segmentation technology, which is mainly applicable to the situation where the difference between the foreground and background is large and the area to be segmented is obvious. The key to threshold segmentation is to select a suitable threshold T to distinguish the foreground from the background. Its expression is as follows:
[0059] In the formula, represents the gray value of the pixel of the input image, T represents the threshold used to segment the foreground and background, Represents the output image.
[0060] 3. Morphological processing: Perform morphological processing on the segmented image to connect and fill small areas.
[0061] 4. Connected Domain Analysis: Use a connectivity analysis algorithm (such as depth-first search or breadth-first search) to identify and label each connected region in the binary image.
[0062] 5. Feature extraction: Calculate features for each marked blob, find the defect location, and output the results.
[0063] 6. Feature statistics and result output: This module mainly detects defects in the spliced image, summarizes and integrates all detected defects, and extracts defect features such as area, average concentration, aspect ratio, etc. Then, the feature data of all defects are saved in the preset file path, and some data results are displayed.
[0064] In this embodiment, the first image to be detected and the second image to be detected of the curved screen to be detected are first obtained, and the first image to be detected and the second image to be detected are images collected when the curved side light source and the radial side light source are started, respectively. Sufficient surface data and plane data are extracted from the first image to be detected and the second image to be detected, respectively. Next, the bright band information of the first image to be detected is extracted. The grayscale value of the second image to be detected is then analyzed to extract the regional feature information. The candidate segmentation line area of the second image to be detected is determined by the bright band information and the regional feature information. The initial segmentation line is determined according to the candidate segmentation line area, and the position of the initial segmentation line is dynamically adjusted according to the regional features of the candidate segmentation line area until the segmentation line meets the preset conditions, and the target cutting segmentation line is generated. The first image to be detected and the second image to be detected are cut according to the target cutting segmentation line to generate a curved area image and a plane area image. The curved area image and the plane area image are spliced to generate a spliced image. The spliced image is defect analyzed to generate a defect feature analysis result.
[0065] In this embodiment, by starting the curved surface side light source and the radial side light source, and respectively collecting the first image to be detected and the second image to be detected of the curved screen to be detected, sufficient curved surface data is extracted from the first image to be detected, and sufficient plane data is extracted from the second image to be detected. Then, the candidate segmentation line area of the second image to be detected is determined by bright band information and regional feature information, and the position of the plane area and the curved surface area is accurately extracted by dynamically calculating the segmentation line, thereby reducing the information loss in the process of splicing the screen area image and the curved surface area image, and improving the efficiency and accuracy of the curved screen appearance defect detection.
[0066] See also Figure 2 The present application provides an embodiment of a method for generating an initial segmentation line, comprising: 201. Performing connected domain analysis on the candidate segmentation line regions, and merging adjacent candidate segmentation line regions that meet the conditions; The terminal performs a connected domain analysis on the candidate segmentation line area and merges adjacent candidate segmentation line areas that meet the conditions, that is, the dynamic cutting segmentation line is determined: first, a connected domain analysis is performed on the candidate area and adjacent areas that meet the conditions are merged.
[0067] 202. Generate a continuous initial segmentation line according to the merged candidate segmentation line regions.
[0068] The terminal generates a continuous initial segmentation line based on the merged candidate segmentation line area , morphological operations (such as dilation and erosion) can be used to smooth the boundaries and generate continuous segmentation lines, which are not limited here.
[0069] See also Figure 3The present application provides an embodiment of a method for generating a target cutting segmentation line, comprising: 301. Dynamically adjust the position and shape of the initial segmentation line according to the regional features of the merged candidate segmentation line region to generate an intermediate segmentation line; The terminal dynamically adjusts the position and shape of the initial segmentation line according to the regional features of the candidate segmentation line area, so as to best match the boundary between the plane area and the curved surface area.
[0070] 302. Perform iterative condition analysis on the middle dividing line and the initial dividing line; 303. When the iteration condition analysis result does not meet the termination iteration condition, determine the current segmentation line region of the middle segmentation line, and dynamically adjust the position and shape of the initial segmentation line according to the regional characteristics of the current segmentation line region; The terminal performs iterative condition analysis on the middle dividing line and the initial dividing line. When the iterative condition analysis result does not meet the termination condition, the terminal determines the current dividing line area of the middle dividing line, and dynamically adjusts the position and shape of the initial dividing line according to the regional characteristics of the current dividing line area.
[0071] Specifically, a weighted value (iterative adjustment amount) is calculated based on the regional features, and the position of the segmentation line is recalculated and updated based on the weighted value (iterative adjustment amount) to make it more accurately conform to the image features. In this way, the segmentation line can be adaptively adjusted to adapt to changes in the image. Final segmentation line: After several iterations, the final segmentation line position is .
[0072] Iterative adjustment: In order to ensure the real-time optimization of the split line, an iterative algorithm is used for adjustment. Set an upper limit on the number of iterations and convergence threshold : Calculate the current split line position:
[0073] in, The adjustment amount for the nth iteration is calculated based on the current bright band area and grayscale value. The calculation method is mainly to compare the grayscale value and the mean value of the bright band area to determine the offset direction, and then determine the offset amount according to the area of the current segmentation line area (whether there is a merger). The offset of the segmentation line area without a merger is smaller than the offset of the merged area. The displacement size of each merged area or a single area can be determined by multiplying the number of mergers by the unit minimum offset value.
[0074] Convergence judgment: Calculate the difference between the current segmentation line and the previous segmentation line:
[0075] if or reach the number of iterations , the iteration stops.
[0076] 304. When the iterative condition analysis result satisfies the termination condition of the iteration, the target shearing segmentation line is calculated according to the moving middle segmentation line.
[0077] When the iteration condition analysis result meets the termination condition, the terminal calculates the target cutting dividing line according to the moving middle dividing line. ( ).
[0078] The weighted average method is used to weight each candidate region according to its grayscale value, area and similarity with the bright band to calculate the final cutting segmentation line:
[0079] in, is the weight (calculated based on area and grayscale similarity), is the boundary position of the candidate region. The weight algorithm is the product of the area of the current region and the grayscale similarity. The grayscale similarity is the ratio of the grayscale average value of the current region to the grayscale average value of the bright band region.
[0080] Finally, the model is output: the dynamic cutting segmentation line finally calculated is output for the subsequent accurate extraction and splicing of image areas.
[0081] See also Figure 4 The present application provides an embodiment of a method for generating an initial segmentation line, comprising: 401. Determine a candidate region grayscale mean value of each merged candidate segmentation line region; 402. Determine a bright band feature value of each merged candidate segmentation line region according to the bright band information; 403. Calculate the regional weight value of each merged candidate segmentation line region according to the candidate region grayscale mean and bright band feature value; In this embodiment, the terminal determines the candidate area grayscale mean of each merged candidate segmentation line area, determines the bright band feature value of each merged candidate segmentation line area according to the bright band information, and then calculates the area weighted value of each merged candidate segmentation line area according to the candidate area grayscale mean and the bright band feature value.
[0082] Specifically, the weighted algorithm in this embodiment is as follows: the weighted algorithm aims to assign different weights to different features so as to more accurately calculate the position of the shearing segmentation line. The algorithm steps are as follows: Define eigenvalue: Set the eigenvalue of the bright band information to L. The eigenvalue of the bright band can be the product of the grayscale mean and area in the AA area of the bright band area. The average grayscale value of each small area in the second image is (k is the window index).
[0083] Calculate weighted values: Calculate weighted values for each region k , the formula is:
[0084] in, and is the weight coefficient, which reflects the importance of bright band information and grayscale value.
[0085] is the characteristic value of the bright band in region k (such as brightness, area, etc.).
[0086] 404. Determine a candidate segmentation line region that meets the conditions according to the region weight value, and use morphological operations to smooth the region boundary to generate an initial segmentation line.
[0087] The terminal determines the candidate segmentation line area that meets the conditions according to the area weight value, and uses morphological operations to smooth the area boundary to generate the initial segmentation line. Specifically, the terminal determines the initial segmentation line position: according to the weight value Determine the location of the initial split line . Select the area with the largest weighted value as the initial segmentation line position:
[0088] See also Figure 5 The present application provides an embodiment of a method for extracting bright band information of a first image to be detected, comprising: 501. Perform grayscale conversion on a first image to be detected to generate a grayscale converted image; 502. Performing threshold segmentation on the grayscale conversion image according to a preset grayscale mean weight to generate a binary image; 503. Extract edge regions of the binary image and extract bright band information of the edge regions.
[0089] The terminal performs grayscale conversion on the first image to be detected to generate a grayscale conversion image, performs threshold segmentation on the grayscale conversion image according to a preset grayscale mean weight to generate a binary image, and then extracts the edge area of the binary image and extracts the bright band information of the edge area. Specifically, preprocessing is performed on the image: Step 1: Grayscale conversion: Convert the color image to a grayscale image to simplify processing. Indicates the grayscale of the pixel at that point, usually ranging from 0 to 255. , , Respectively represent the color components of the R channel, G channel, and B channel of the pixel. The specific formula is as follows:
[0090] Step 2: Threshold segmentation: 1. Threshold selection: Use Otsu's method to automatically calculate the global threshold TTT and divide the grayscale image into foreground (bright band) and background. Otsu's method selects the optimal threshold by maximizing the between-class variance.
[0091]
[0092] in, and are the weights of pixels below and above the threshold T, respectively. and are the average grayscale values of pixels below and above the threshold T, respectively.
[0093] 2. Apply threshold: Apply threshold T to the grayscale image for binarization to obtain a binary image .
[0094]
[0095] Step 3: Edge detection: extract area edges.
[0096] 1. Gaussian smoothing: Use a Gaussian filter to smooth the image to reduce noise.
[0097] 2. Gradient calculation: Calculate the gradient of the image, usually using the Sobel operator.
[0098]
[0099]
[0100]
[0101]
[0102] 3. Non-maximum suppression: refine the edges by detecting whether each pixel is a local maximum.
[0103] 4. Double threshold processing: Use two thresholds (high and low) to determine strong edges and weak edges.
[0104] 5. Edge connection: Connect weak edges with strong edges to form the final edge image.
[0105] Step 4: Calculate the average grayscale value: Calculate the average grayscale value of the extracted contour area. For each contour area C, its average grayscale value M can be calculated by the following formula:
[0106] Where: N is the number of pixels in the contour area.
[0107] See also Figure 6 The present application provides an embodiment of a method for edge processing of a curved area image and a flat area image, comprising: 601. Perform fuzzy logic refinement processing on the curved area image and the flat area image.
[0108] In this embodiment, the terminal performs fuzzy logic refinement processing on the curved area image and the flat area image, specifically: 1. Fuzzy logic refinement: In the boundary area, fuzzy logic is used to further refine the region extraction. Fuzzy logic allows the boundary ambiguity to be handled, ensuring better information retention.
[0109] 2. Fuzzy set definition: Set the fuzzy set F as the fuzziness of the boundary pixel, which can be defined according to the grayscale value or brightness of the pixel. For example, for the boundary pixel b:
[0110] in, is the gray value of the boundary pixel, It is a membership function, which indicates the degree of membership of the boundary pixel to the bright band.
[0111] 3. Fuzzy rules: Set fuzzy rules to make judgments based on the position and brightness of pixels in the boundary area. For example: if The higher the brightness value, the more likely it is to belong to a flat area.
[0112] if The lower the brightness value, the more likely it is to belong to the curved area.
[0113] 4. Fuzzy decision: Through the fuzzy reasoning system, combined with the weight of the rules, the final category of each boundary pixel is obtained.
[0114] 5. Region integrity check: After the region extraction is completed, perform integrity check: Information integrity assessment: Checks whether the extracted regions meet specific integrity criteria, such as:
[0115] in and are the number of pixels in the plane area and the curved area, and is the number of pixels of the original image, is the preset integrity threshold.
[0116] See also Figure 7 The present application provides an embodiment of a device for detecting appearance defects of a curved screen, comprising: An acquisition unit 701 is used to acquire a first image to be detected and a second image to be detected of the curved screen to be detected, where the first image to be detected and the second image to be detected are images collected when the curved side light source and the radial side light source are started respectively; A first extraction unit 702, used to extract bright band information of a first image to be detected; Optionally, the first extraction unit 702 includes: Performing grayscale conversion on the first image to be detected to generate a grayscale converted image; Perform threshold segmentation on the grayscale conversion image according to the preset grayscale mean weight to generate a binary image; The edge area of the binary image is extracted, and the bright band information of the edge area is extracted.
[0117] The second extraction unit 703 is used to perform grayscale value analysis on the second image to be detected to extract regional feature information; A determination unit 704 is used to determine a candidate segmentation line region of the second image to be detected according to the bright band information and the region feature information; A first generating unit 705, configured to determine an initial segmentation line according to a candidate segmentation line region; Optionally, the first generating unit 705 includes: A merging module 7051 is used to perform connected domain analysis on the candidate segmentation line regions and merge adjacent candidate segmentation line regions that meet the conditions; The first generating module 7052 is used to generate a continuous initial segmentation line according to the merged candidate segmentation line regions.
[0118] Optionally, the first generating module 7052 includes: Determine the candidate region grayscale mean value of each merged candidate segmentation line region; Determine the bright band feature value of each merged candidate segmentation line area according to the bright band information; Calculate the regional weighted value of each merged candidate segmentation line region according to the candidate region grayscale mean and bright band feature value; The candidate segmentation line regions that meet the conditions are determined according to the region weighted values, and morphological operations are used to smooth the region boundaries to generate the initial segmentation lines.
[0119] A dynamic adjustment unit 706 is used to dynamically adjust the position of the initial segmentation line according to the regional features of the candidate segmentation line region until the segmentation line meets the preset conditions to generate a target shear segmentation line, wherein the regional features include the regional area and the regional grayscale; Optionally, the dynamic adjustment unit 706 includes: It is used to dynamically adjust the position and shape of the initial segmentation line according to the regional features of the merged candidate segmentation line area to generate an intermediate segmentation line, and the regional features include the regional area and the regional grayscale; Used to perform iterative condition analysis on the intermediate dividing line and the initial dividing line; When the iteration condition analysis result does not meet the termination condition, the current segmentation line area of the middle segmentation line is determined, and the position and shape of the initial segmentation line are dynamically adjusted according to the regional characteristics of the current segmentation line area; It is used to calculate the target shear splitting line based on the moving middle splitting line when the iterative condition analysis results meet the termination conditions of the iteration.
[0120] The second generating unit 707 is used to shear the first image to be detected and the second image to be detected according to the target shearing segmentation line to generate a curved surface area image and a flat surface area image; A processing unit 708, configured to perform fuzzy logic refinement processing on the curved area image and the flat area image; The third generating unit 709 is used to splice the curved area image and the flat area image to generate a spliced image; The fourth generating unit 710 is used to perform defect analysis on the spliced image and generate defect feature analysis results.
[0121] See also Figure 8 The present application provides a device for detecting appearance defects of a curved screen, comprising: Processor 801 , memory 802 , input-output unit 803 , and bus 804 .
[0122] The processor 801 is connected to the memory 802 , the input and output unit 803 , and the bus 804 .
[0123] 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 The method in .
[0124] 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 The method in .
[0125] 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.
[0126] 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.
[0127] 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.
[0128] 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.
[0129] 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 detecting appearance defects of a curved screen, characterized in that: include: Acquire a first image to be detected and a second image to be detected of the curved screen to be detected, wherein the first image to be detected and the second image to be detected are images collected when the curved side light source and the radial side light source are started respectively; Extracting bright band information of the first image to be detected; Performing grayscale value analysis on the second image to be detected to extract regional feature information; Determine a candidate segmentation line region of the second to-be-detected image according to the bright band information and the region feature information; Determine an initial segmentation line according to the candidate segmentation line area; Dynamically adjusting the position of the initial segmentation line according to the regional features of the candidate segmentation line region until the segmentation line reaches a preset condition, thereby generating a target shear segmentation line, wherein the regional features include regional area and regional grayscale; Shearing the first to-be-detected image and the second to-be-detected image according to the target shearing segmentation line to generate a curved surface area image and a flat surface area image; Splicing the curved surface area image and the planar area image to generate a spliced image; Perform defect analysis on the spliced image to generate defect feature analysis results.
2. The method according to claim 1, characterized in that Determining an initial segmentation line according to the candidate segmentation line region includes: Performing connected domain analysis on the candidate segmentation line regions, and merging adjacent candidate segmentation line regions that meet the conditions; Generate a continuous initial segmentation line based on the merged candidate segmentation line area.
3. The method according to claim 2, characterized in that Dynamically adjusting the position of the initial segmentation line according to the regional features of the candidate segmentation line region until the segmentation line meets a preset condition, and generating a target cutting segmentation line, including: According to the regional features of the merged candidate segmentation line area, the position and shape of the initial segmentation line are dynamically adjusted to generate an intermediate segmentation line; Performing iterative condition analysis on the intermediate dividing line and the initial dividing line; When the iteration condition analysis result does not meet the termination condition, the current segmentation line region of the middle segmentation line is determined, and the position and shape of the initial segmentation line are dynamically adjusted according to the regional characteristics of the current segmentation line region; When the iterative condition analysis results meet the termination conditions, the target shearing segmentation line is calculated according to the moving middle segmentation line.
4. The method according to claim 3, characterized in that Generate a continuous initial segmentation line based on the merged candidate segmentation line area, including: Determine the candidate region grayscale mean value of each merged candidate segmentation line region; Determine a bright band feature value of each merged candidate segmentation line region according to the bright band information; Calculate the regional weighted value of each merged candidate segmentation line region according to the grayscale mean value of the candidate region and the bright band feature value; A candidate segmentation line region that meets the conditions is determined according to the region weighted value, and a morphological operation is used to smooth the region boundary to generate an initial segmentation line.
5. The method according to claim 4, characterized in that Extracting bright band information of the first image to be detected includes: Performing grayscale conversion on the first image to be detected to generate a grayscale converted image; Performing threshold segmentation on the grayscale conversion image according to a preset grayscale mean weight to generate a binary image; The edge region of the binary image is extracted, and the bright band information of the edge region is extracted.
6. The method according to any one of claims 1 to 5, characterized in that After the first to-be-detected image and the second to-be-detected image are sheared according to the target shearing segmentation line to generate a curved surface area image and a flat surface area image, the curved surface area image and the flat surface area image are spliced before the spliced image is generated, the method includes: The fuzzy logic thinning process is performed on the surface area image and the plane area image.
7. A device for detecting appearance defects of a curved screen, characterized in that: include: An acquisition unit, used for acquiring a first image to be detected and a second image to be detected of the curved screen to be detected, wherein the first image to be detected and the second image to be detected are images collected when the curved side light source and the radial side light source are started respectively; A first extraction unit, used to extract bright band information of the first image to be detected; A second extraction unit, used for performing grayscale value analysis on the second image to be detected to extract regional feature information; A determination unit, configured to determine a candidate segmentation line region of the second image to be detected according to the bright band information and the region feature information; A first generating unit, configured to determine an initial segmentation line according to the candidate segmentation line region; A dynamic adjustment unit, configured to dynamically adjust the position of the initial segmentation line according to the regional features of the candidate segmentation line region until the segmentation line reaches a preset condition, thereby generating a target shear segmentation line, wherein the regional features include the regional area and the regional grayscale; A second generating unit, configured to shear the first to-be-detected image and the second to-be-detected image according to the target shearing segmentation line to generate a curved surface area image and a flat surface area image; A third generating unit, configured to splice the curved surface area image and the planar area image to generate a spliced image; The fourth generating unit is used to perform defect analysis on the spliced image and generate defect feature analysis results.
8. The device according to claim 7, characterized in that The first generation unit comprises: A merging module, used to perform connected domain analysis on the candidate segmentation line regions and merge adjacent candidate segmentation line regions that meet the conditions; The first generating module is used to generate a continuous initial segmentation line according to the merged candidate segmentation line area.
9. A device for detecting appearance defects of a curved 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 having a program stored thereon, wherein the program, when executed on a computer, performs the method according to any one of claims 1 to 6.
Citation Information
Patent Citations
Method and system for rapidly detecting appearance defects of curved screen
CN110018167A
Curved surface label splicing detection method based on machine vision
CN112837257A