Mobile phone screen uniformity detection method based on image analysis

Through multi-directional grayscale sequence slope extraction and reverse grayscale change starting point positioning, combined with pixel center of gravity analysis, the problem of insufficient brightness fluctuation recognition in traditional methods is solved, and high-precision mobile phone screen brightness uniformity detection is achieved.

CN120451130AActive Publication Date: 2025-08-08SHENZHEN ANFEIKE TOUCH TECHNOLOGY CO LTD

Patent Information

Application Number
CN202510634811.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-05-16
Publication Date
2025-08-08
Estimated Expiration
2045-05-16

AI Technical Summary

Technical Problem

When detecting the brightness uniformity of mobile phone screens, it is difficult to accurately identify the brightness changes of small amplitude but continuous fluctuations, resulting in insufficient detection sensitivity and robustness. Especially in OLED screens, local brightness offsets are subtle but significant impacts, and traditional methods are difficult to capture and quantify.

Method used

Through the multi-directional grayscale sequence slope extraction and fluctuation aggregation feature construction, combining the positioning of the starting point of the reverse grayscale change and coordinate offset, the positioning accuracy of the abnormal area is improved, the local transition zone and the jump segment are extracted, and the grayscale fluctuation partition enhancement is achieved. Combined with the analysis of the center of gravity and local fluctuation differences between the high-grain pixel collection, the brightness abnormal points are accurately identified.

Benefits of technology

It improves the sensitivity and judgment accuracy of mobile phone screen brightness detection, adapts to the micro-difference detection needs under complex display structures, and enhances the ability to identify brightness abnormal areas.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120451130A_ABST
    Figure CN120451130A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of image analysis, in particular to a mobile phone screen uniformity detection method based on image analysis, which comprises the following steps: extracting a central region gray sequence, calculating a slope to generate a trend chart, positioning a change starting point to adjust coordinates, extracting gray difference to enhance comparison, and analyzing a bright-dark span to generate a map. And extracting a gravity center gray level judgment difference and outputting a detection scheme. According to the method, through multi-direction gray scale sequence slope extraction and fluctuation aggregation feature construction, detail capture of a brightness trend is enhanced, reverse gray scale change starting point positioning and coordinate offset are combined, abnormal region positioning precision is improved, a local transition zone and a jump section are extracted, and gray scale fluctuation partition enhancement is realized. Through high-gray pixel set gravity center and local fluctuation difference analysis, brightness abnormal points are accurately recognized, the whole process is fused with the links of gray trend extraction, change track adjustment, contrast enhancement, gravity center analysis and the like, the detection sensitivity and the judgment precision are enhanced, and the screen brightness differential detection requirement is met.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of image analysis, and in particular to a method for detecting uniformity of a mobile phone screen based on image analysis. Background Art

[0002] The field of image analysis technology encompasses computational methods and operational processes for automatically identifying and interpreting image data, with the goal of extracting meaningful information or features from images. The core of this technical field primarily encompasses key steps such as image preprocessing, feature extraction, image segmentation, target recognition, and classification, and is widely used in a variety of areas, including medical imaging, industrial inspection, security monitoring, intelligent transportation, and mobile terminal image quality testing. In its implementation, image analysis relies on statistical analysis based on image pixel distribution, structural pattern recognition, and image matrix-based transformation calculations to accurately describe and quantitatively evaluate target characteristics in images. It boasts a high degree of automation and processing efficiency.

[0003] Among them, the mobile phone screen uniformity detection method based on image analysis refers to using an image acquisition device to image the mobile phone screen in the illuminated state, and then evaluating the brightness differences in different areas of the image through the pixel grayscale value distribution analysis method in the image processing process. The technical matters involved in this method include key steps such as the construction of screen uniformity evaluation standards, regional division of captured images, extraction and normalization of image grayscale values, brightness gradient analysis methods, and setting of uniformity judgment rules. The entire detection process is based on the actual captured image as input, and the brightness consistency of the screen display area is quantitatively judged through the numerical calculation of the grayscale levels of pixels in the image matrix.

[0004] Traditional analysis methods based on image pixel grayscale distribution often present grayscale data in a static statistical form, lacking a dynamic response mechanism for directional changes in the grayscale sequence. This makes it difficult to identify small but continuous fluctuations in the image. In particular, when slight brightness shifts occur locally on the screen, global grayscale normalization can mask the local variations and reduce the significance of the abnormal region. In practice, image region division is often performed using a regular grid, ignoring the spatial continuity of the grayscale variation path. This can blur grayscale boundaries or confuse interference regions with true abnormal regions, leading to misjudgment. In brightness difference assessment, due to a lack of in-depth analysis of grayscale gradient distribution patterns, consistency is assessed solely by the difference between extreme bright and dark values. This fails to capture intermediate grayscale variations in complex structures, resulting in delayed response to brightness fluctuations. For example, in OLED screens, the difference between grayscale variation bands at the edges and uniformity in the center is subtle but significantly impacts display quality. This subtle difference is difficult to accurately capture and quantify using traditional grayscale statistical methods, compromising the sensitivity and robustness of detection, limiting the technology's broad application and precision control capabilities for complex display structures. Summary of the Invention

[0005] The purpose of the present invention is to solve the shortcomings of the prior art and to propose a method for detecting uniformity of a mobile phone screen based on image analysis.

[0006] In order to achieve the above object, the present invention adopts the following technical solution: a method for detecting uniformity of a mobile phone screen based on image analysis, comprising the following steps:

[0007] S1: Collect the uniformly distributed central area of the screen image, extract the four-directional grayscale sequence, calculate the grayscale difference and change slope of adjacent pixels, extract the direction change position, calculate the slope amplitude distribution, construct the concentration ratio, and combine them to generate a grayscale trend distribution image;

[0008] S2: Based on the change direction of the grayscale trend distribution image, extract the slope sequence, obtain the change starting point in the reverse slowdown segment, calculate the center pixel trajectory difference and adjust the coordinates to generate a pixel distribution contour map;

[0009] S3: Based on the pixel distribution contour map, extract the grayscale difference of the image block, calculate the local spatial gradient, identify the transition zone with consistent direction and frequent fluctuation, mark it as the contrast enhancement area, and superimpose the grayscale difference to generate the image block contrast enhancement layer;

[0010] S4: reading the edge grayscale band of each area in the block contrast enhancement layer, extracting the start and end coordinates of the brightness change, calculating and sorting the brightness span, grouping and sorting by area index, and generating a brightness transition segment map;

[0011] S5: Call the image area of the brightness span in the brightness transition segment spectrum, extract the coordinates and calculate the geometric center of gravity and grayscale value, judge the difference in combination with the brightness fluctuation range, and generate a mobile phone screen uniformity detection solution.

[0012] As a further solution of the present invention, the grayscale trend distribution image includes directional grayscale slope change characteristics, slope change amplitude distribution, and grayscale trend combination ratio; the pixel distribution contour map includes main direction slope frequency characteristics, reverse grayscale change segments, and coordinate offset adjustment parameters; the block contrast enhancement layer includes local grayscale difference gradients, continuous grayscale transition areas, and same-direction grayscale fluctuation frequency distributions; the brightness jump segment map includes bright and dark pixel jump spans, continuous jump dense distribution, and brightness level grouping blocks; the mobile phone screen uniformity detection scheme includes a pixel set with grayscale values higher than the mean, geometric bright spot centroid coordinates, and a brightness difference judgment threshold.

[0013] As a further solution of the present invention, the specific steps of S1 are:

[0014] S101: Acquire an evenly distributed initial central area in the screen image, extract a continuous grayscale value sequence in the four directions of up, down, left, and right for each central area, calculate the difference between adjacent pixels in the grayscale sequence, and group and summarize the difference sequence by direction to generate a directional grayscale difference sequence;

[0015] S102: Based on the directional grayscale difference sequence, three adjacent differences are selected to calculate two groups of slope differences, and then the amplitudes between the slope differences are marked. The number of change positions of each group of directions within a fixed pixel range is counted to obtain a directional slope change density distribution value.

[0016] S103: According to the directional slope change density distribution value, the density values of the four directions in each group of central areas are sequentially combined, the difference between the directions is calculated and the absolute value is taken, and then the ratio of the difference between the direction combinations is calculated and normalized to generate a grayscale trend distribution image.

[0017] As a further solution of the present invention, the specific steps of S2 are:

[0018] S201: extracting the main change direction of the region based on the grayscale distribution characteristics of the detection area in the grayscale trend distribution image, marking the center position where the difference exceeds a set grayscale difference threshold according to the difference between the directional grayscale fluctuation and the mean value within the region, and obtaining a coordinate set of the grayscale offset sensitive area;

[0019] S202: Calling the main direction grayscale sequence of each area in the grayscale offset sensitive area coordinate set, extracting continuous segments with frequent slope changes, locating the change starting point of the grayscale decreasing segment, obtaining the corresponding pixel index, and obtaining the coordinate set of the reverse slope change starting point;

[0020] S203: Calculate pixel trajectory offset values in the main direction between adjacent starting points based on the reverse slope change starting point coordinate set, establish corresponding linear connection relationships, perform directional uniform offset transformation on all coordinates, and generate a pixel distribution profile map.

[0021] As a further solution of the present invention, the calculation formula of the pixel trajectory offset value in the main direction between adjacent starting points is specifically:

[0022]

[0023] Where, ΔT k Represents the pixel trajectory offset value in the main direction between adjacent starting points, Δx k Represents the coordinate difference between the kth pair of adjacent starting points in the x-axis direction, Δy k Represents the coordinate difference between the kth pair of adjacent starting points in the y-axis direction, θ k Represents the reverse slope change value between the kth pair of adjacent starting points, Represents the overall slope mean of the starting point coordinate set of the reverse slope change, λk represents the normalized parameter adjusted according to the main direction weight coefficient, Represents the pixel density gradient vector of the local area where the kth pair of adjacent starting points are located.

[0024] As a further solution of the present invention, the specific steps of S3 are:

[0025] S301: Based on the image boundary in the pixel distribution profile map, extract the grayscale values of the current pixel and the adjacent pixels in the horizontal and vertical directions for the image block, calculate the grayscale difference, and classify them according to coordinates to generate a block grayscale difference value set;

[0026] S302: Counting the difference positions in the differentiated directions of the image blocks based on the grayscale difference value set, extracting continuous gradient amplitude change segments, marking continuous regions where the grayscale fluctuation frequency exceeds the directional mean, and obtaining grayscale transition marked regions;

[0027] S303: calling the grayscale difference in the grayscale transition mark area, performing accumulation processing on the continuous grayscale segments, and superimposing the accumulation result to the original block position to generate a block contrast enhancement layer.

[0028] As a further solution of the present invention, the grayscale difference calculation formula is specifically:

[0029]

[0030] Where ΔQ u,v Represents the local grayscale difference of the pixel at coordinate (u, v) in the image, p u,v Represents the grayscale value of the current pixel (u, v), q u+1,v Represents the grayscale value of the pixel directly below it (u+1,v), r u,v Represents the horizontal grayscale sampling value of the current pixel (u, v), s u,v+1 Represents the grayscale value of the pixel on its right (u,v+1), t u-1,v Represents the grayscale contrast value of the image just above it (u-1,v), w u,v-1 represents the grayscale contrast value of its left side (u, v-1), |·| represents the absolute value operator, and 2 is the constant offset term.

[0031] As a further solution of the present invention, the specific steps of S4 are:

[0032] S401: Reading the grayscale band at the edge of the image block in the image block contrast enhancement layer, extracting the start and end coordinates of the continuous brightness change segments in the grayscale sequence, calculating the grayscale difference between adjacent bright and dark pixels, and generating a brightness span list;

[0033] S402: Sort all span values according to the brightness span list, extract continuous transition segments with a spacing less than a set threshold, mark the pixel range index, and obtain a brightness transition segment index set;

[0034] S403: calling the brightness transition segment index set, counting the number of segment brightness spans, grouping by brightness, establishing a brightness hierarchy structure and mapping it to layer coordinates, and generating a brightness transition segment map.

[0035] As a further solution of the present invention, the specific steps of S5 are:

[0036] S501: Call all brightness span regions in the brightness transition segment map, extract pixels in the region whose grayscale values are higher than the local brightness average level, record their coordinate positions, and generate a coordinate set of pixels with relatively strong brightness;

[0037] S502: Calculating a weighted offset value of the coordinates of the pixel point with relatively high brightness relative to the center of gravity based on the coordinate set of the pixel point with relatively high brightness, and extracting the grayscale value corresponding to the coordinate to obtain the grayscale value of the center of gravity of the bright spot;

[0038] S503: Call the grayscale value of the center of gravity of the bright spot, perform difference calculation on the grayscale value set of the area, determine whether the difference exceeds the brightness fluctuation range threshold, and establish a mobile phone screen uniformity detection solution.

[0039] As a further solution of the present invention, the formula for calculating the weighted offset value of the coordinates of the pixel point with relatively strong brightness relative to the center of gravity is specifically:

[0040]

[0041] in, Represents the weighted offset value of the pixel coordinates with strong brightness relative to the center of gravity, x i Represents the horizontal coordinate value of the i-th pixel with strong brightness, y i Represents the vertical coordinate value of the i-th pixel with strong brightness, Represents the average horizontal coordinate of all pixels with strong brightness. Represents the average vertical coordinate of all pixels with strong brightness, I i Represents the grayscale value of the i-th pixel, Represents the grayscale average of all pixels with strong brightness, w i represents the weighting factor of the i-th pixel in the coordinate distribution, and n represents the total number of pixels with strong brightness.

[0042] Compared with the prior art, the advantages and positive effects of the present invention are:

[0043] In the present invention, the slope of multi-directional grayscale sequence is extracted and the fluctuation aggregation feature is constructed to enhance the capture of details of brightness trends. Combined with the positioning of the starting point of reverse grayscale change and coordinate offset, the positioning accuracy of abnormal areas is improved, local transition zones and jump segments are extracted, and grayscale fluctuation zoning enhancement is achieved. Through the analysis of the center of gravity of high grayscale pixel sets and local fluctuation differences, brightness anomalies are accurately identified. The overall process integrates grayscale trend extraction, change trajectory adjustment, contrast enhancement and center of gravity analysis to enhance detection sensitivity and judgment accuracy, and meet the needs of screen brightness micro-difference detection. BRIEF DESCRIPTION OF THE DRAWINGS

[0044] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.

[0045] Figure 1 Schematic diagram of the steps of the present invention. DETAILED DESCRIPTION

[0046] The technical solution of the present invention is described below in conjunction with the accompanying drawings.

[0047] In the embodiments of the present invention, words such as "exemplarily" and "for example" are used to indicate examples, illustrations, or explanations. Any embodiment or design described as an "exemplary" in the present invention should not be interpreted as being preferred or advantageous over other embodiments or designs. Rather, the use of the word "exemplary" is intended to present concepts in a concrete manner. Furthermore, in the embodiments of the present invention, "and / or" can mean both or either of the two.

[0048] In the embodiments of the present invention, the terms "image" and "picture" may be used interchangeably. It should be noted that, when the distinction between them is not emphasized, their intended meanings are the same. The terms "of," "corresponding," and "corresponding" may be used interchangeably. It should be noted that, when the distinction between them is not emphasized, their intended meanings are the same.

[0049] In the embodiments of the present invention, sometimes a subscript such as W1 may be written as a non-subscript such as W1. When the difference is not emphasized, the meanings to be expressed are the same.

[0050] In order to make the technical problems, technical solutions and advantages to be solved by the present invention clearer, a detailed description will be given below with reference to the accompanying drawings and specific embodiments.

[0051] See also Figure 1 , a mobile phone screen uniformity detection method based on image analysis, comprising the following steps:

[0052] S1: Collect multiple evenly distributed initial central areas on the mobile phone screen image, extract continuous grayscale value sequences in four directions in each area, perform interpolation on adjacent pixels in the grayscale sequence and calculate the change slope, extract the slope change position sequence from each direction, then calculate the amplitude distribution of the sequence slope change and construct the change concentration ratio. The directional grayscale trends are combined through the ratio sequence to generate a grayscale trend distribution image;

[0053] The gradient concentration ratio is obtained by calculating the ratio of the sum of the absolute values of the grayscale differences between adjacent pixels to the standard deviation of the grayscale values. It is used to measure the concentration of grayscale changes. The higher the ratio, the more concentrated the grayscale changes are in a specific direction.

[0054] S2: Based on the main change direction of the detection area in the grayscale trend distribution image, identify the central area where the grayscale fluctuation concentration is far away from the mean distribution, extract the frequently changing slope sequence from the main direction grayscale sequence, obtain the starting position of the change speed in the reverse grayscale slowdown segment of the sequence, calculate the pixel trajectory position difference between the center points, and perform coordinate offset adjustment according to the trajectory direction to generate a pixel distribution contour map;

[0055] The reverse gradient attenuation segment determines the starting position by detecting the reversal point of the acceleration direction of the grayscale change rate. When the acceleration direction changes from positive to negative, it indicates that the grayscale change rate begins to slow down.

[0056] S3: Based on the image boundary content in the pixel distribution contour map, the grayscale difference between the current pixel and the adjacent pixels is extracted for each block in the image. The spatial distribution gradient of the difference in the local block is calculated. Continuous grayscale transition bands are extracted based on the direction and amplitude of the gradient change. Transition areas with high grayscale fluctuation frequency in the same direction are marked as contrast-enhanced areas. The grayscale differences of the contrast-enhanced areas are then superimposed to generate a block contrast enhancement layer.

[0057] S4: Read the edge grayscale band of each area in the block contrast enhancement layer, extract the start and end coordinate points of the edge brightness value change, calculate the brightness change span of adjacent bright and dark pixels, sort and extract the transition-intensive segments, mark the pixel range of the brightness span in the continuous transition S, extract the segment index by grouping the corresponding area of the pixel range, and then sort them into multiple brightness level blocks according to the transition density to generate a brightness transition segment map;

[0058] The brightness transition span is the maximum difference in brightness between adjacent pixels. The high-frequency transition segment is defined as the area where the span value is significantly higher than the global brightness statistical standard deviation.

[0059] S5: Call the image area with brightness span in the brightness transition segment spectrum, identify the set of pixels in the area whose grayscale values are higher than the local brightness average level, extract the coordinate values of all pixels in the set, calculate the average of the horizontal and vertical coordinate values as the coordinates of the geometric bright spot's centroid, then extract the grayscale value of the centroid of the area and calculate the difference value to determine whether the difference value is greater than the fluctuation range of the overall brightness distribution, and generate a mobile phone screen uniformity detection solution;

[0060] The difference value is obtained by calculating the absolute difference between the centroid grayscale value and the global brightness mean. If the difference value exceeds 2-3 times the standard deviation of the brightness distribution, it is determined that the screen brightness distribution is abnormal.

[0061] The grayscale trend distribution image includes the directional grayscale slope change characteristics, the slope change amplitude distribution, and the grayscale trend combination ratio. The pixel distribution contour map includes the main direction slope frequency characteristics, the reverse grayscale change segment, and the coordinate offset adjustment parameters. The block contrast enhancement layer includes the local grayscale difference gradient, the continuous grayscale transition area, and the same-direction grayscale fluctuation frequency distribution. The brightness jump segment map includes the bright and dark pixel jump span, the continuous jump dense distribution, and the brightness level grouping block. The mobile phone screen uniformity detection solution includes the pixel set with grayscale values higher than the mean, the geometric bright spot center coordinates, and the brightness difference judgment threshold.

[0062] The specific steps of S1 are:

[0063] S101: Acquire an evenly distributed initial central area in the screen image, extract a continuous grayscale value sequence in the four directions of up, down, left, and right for each central area, calculate the difference between adjacent pixels in the grayscale sequence, and group and summarize the difference sequence by direction to generate a directional grayscale difference sequence;

[0064] The initial center area uniformly distributed in the acquisition screen image, that is, when the image size is 1920×1080, select 20 center points in the horizontal and vertical directions every 40 pixels to form 400 center areas. Each center area uses the center coordinate as the reference to extend the grayscale sampling path in the four directions of upward, downward, left and right. The sampling path length is set to 7 pixels, that is, starting from the center point, 3 pixels are taken in each direction, and a total of 4 grayscale sequences are obtained. The grayscale value of each sequence is read point by point. For example, if the grayscale value in the upper direction is 122, 125, 129, 131, 130, 127, and 124, the difference between adjacent grayscale values is calculated in sequence, that is, 3, 4, 2, -1, -3, -3, respectively correspond to the grayscale difference sequence in the upward direction. The same operation is performed on the downward, left, and right directions in turn to generate difference sequences. After generating the differences, the data in the four directions are stored separately. Four groups of difference sequences with a length of 6 are generated for each central area. All central areas in the image are traversed from left to right and from top to bottom and the same operation is performed. The changes in the grayscale sequences in different areas are compared. For example, the difference changes in the static area of the image are small, with fluctuations not exceeding 5, while the difference in the edge or motion area may be between ±15. The difference sequences in each direction are summarized and structured storage records are established to prepare for subsequent slope change analysis.

[0065] S102: Based on the directional grayscale difference sequence, three adjacent differences are selected to calculate two groups of slope differences, and then the amplitudes between the slope differences are marked. The number of change positions of each group of directions within a fixed pixel range is counted to obtain the directional slope change density distribution value;

[0066] According to the obtained directional grayscale difference sequence, three consecutive differences are taken from the beginning to the end of each sequence of 6 values, such as 3, 4, and 2, to form two difference pairs 3-4 and 4-2, and the difference changes of 1 and -2 are obtained respectively. Then the amplitude difference is taken as 3 to determine whether it is greater than the set threshold. If it is greater than, it is considered that there is a mutation point of the grayscale slope at that position, and the relative index of the current position is marked. This operation is performed on each sequence in turn, thereby generating a set of position mutation marks in each direction. When setting the specific threshold, the overall grayscale change trend of the image is used as the basis. If the slope difference change in most areas does not exceed 2, the threshold can be set. If the value is 3, when used for monitoring video images, if the image is in a daytime with sufficient lighting and a static background, setting the threshold to 4 can filter out high-frequency noise changes. In a nighttime environment, based on the change characteristics of infrared images, it is recommended to adjust the threshold to 2 to enhance the sensitivity of change detection. After completing the change point statistics in each direction, the number of mutation points in the area is counted based on a 5×5 pixel area. For example, in the left direction, mutations are found at three locations in a 5×5 area. The left direction density value is recorded as 3. The density statistics are completed similarly for the remaining directions. A structure containing density values of four directions is obtained, preparing to enter the grayscale trend determination stage.

[0067] S103: Based on the directional slope change density distribution value, sequentially combine the density values of the four directions in each group of central areas, calculate the difference between the directions and take the absolute value, then calculate the ratio of the difference between the direction combinations and perform normalization processing to generate a grayscale trend distribution image;

[0068] Based on the four-directional density values of each central area, ρ_top, ρ_bottom, ρ_left, and ρ_right are compared in pairs. First, the density difference in the upper and lower directions and the density difference in the left and right directions are calculated respectively. For example, the density values in the four directions of a central area are 2 for the upper direction, 5 for the lower direction, 1 for the left direction, and 6 for the right direction. Then, the upper and lower difference is 3, and the left and right difference is 5. Then, the ratio between the two groups of differences is compared. The ratio of 3 to 5 is 0.6. Then, the ratio is normalized according to the preset ratio interval. In order to keep the grayscale range of the output image between 0 and 255, all ratios are collected in the entire image and the most statistical value is obtained. The maximum and minimum values are as follows, for example, the minimum value is 0.2 and the maximum value is 3.0. Each ratio is linearly scaled to the range of 0 to 255 during normalization. This value will be used as the grayscale value of the current pixel in the final generated image. For the above ratio of 0.6, it is approximately 45 after conversion according to the scaling ratio, and the corresponding pixel grayscale is set to 45. All central areas are processed in turn and the results are mapped back to the corresponding pixel positions in the original image. In the process of reconstructing the image, the unsampled areas are smoothly filled using the interpolation and completion method, and finally a complete grayscale trend image is obtained, which is used for the subsequent visualization of scene stability or regional feature changes.

[0069] The specific steps of S2 are:

[0070] S201: Based on the grayscale distribution characteristics of the detection area in the grayscale trend distribution image, the main change direction of the area is extracted. According to the difference between the grayscale fluctuation in the direction and the mean value in the area, the center position where the difference exceeds the set grayscale difference threshold is marked to obtain the coordinate set of the grayscale offset sensitive area;

[0071] Based on the grayscale distribution characteristics of the detection area in the grayscale trend distribution image, the image is divided into blocks, each block is 40×40 pixels, and the maximum, minimum and average grayscale values of all pixels in each block are counted, recorded as G_max, G_min and G_avg, and then the grayscale change trend data of the four directions of the area are extracted direction by direction. The rising and falling segments of each grayscale change curve in the grayscale sequence of each direction are extracted and the fluctuation amplitude is calculated. The fluctuation amplitude is defined as the difference between the maximum grayscale and the minimum grayscale. If the grayscale value in a certain direction changes from 120 to 145 and then drops to 130, the fluctuation amplitude is 25. According to the fluctuation amplitude of each direction, the direction with the largest change is selected as the main change direction. If the up and down direction is 25 and the left and right direction is 15, the main direction is the up and down direction. Each grayscale path in the main direction is compared point by point with the regional mean G_avg. If the difference between the grayscale value of a point and G_avg is greater than the threshold ΔG_thresh, the position is marked as a grayscale offset sensitive point. The threshold ΔG_thresh sets the overall brightness distribution of the reference image. It is more reasonable to take ΔG_thresh as 15 in medium-brightness images, 20 in high-contrast images, and 10 in weak-contrast images. For example, when the regional G_avg is 130, if the grayscale value of a point is 110 or 150, that is, the grayscale difference is 20, then the threshold requirement is met and it is marked. All detection areas of the entire grayscale trend image are traversed in turn, and the coordinates of the center points that meet the conditions are recorded to form a coordinate set of grayscale offset sensitive areas.

[0072] S202: Calling the main direction grayscale sequence of each area in the grayscale offset sensitive area coordinate set, extracting the continuous segments with frequent slope changes, locating the change starting point of the grayscale decreasing segment, obtaining the corresponding pixel index, and obtaining the coordinate set of the reverse slope change starting point;

[0073] Call each center coordinate point in the grayscale offset sensitive area coordinate set, select the grayscale sequence according to the main change direction extracted previously, if the main direction is up and down, then extend the sampling from the center point upward and downward to obtain a grayscale value sequence of length 9, which includes the grayscale values of the center point and 4 pixels on both sides of it. A total of 9 points are used for slope analysis. The grayscale difference between each two consecutive points in the sequence is calculated pair by pair to obtain the slope sequence. For example, if the sequence is 140, 138, 135, 132, 130, 128, 127, 126, 125, the difference sequence is -2, -3, -3, -2, -2, -1, -1, - 1, and then judge whether the change between each difference pair is a continuous negative value, that is, whether the length of the continuous negative value segment exceeds the set continuous threshold L_thresh. The continuous threshold L_thresh is generally set to 3, indicating that only the continuous decreasing segments with a length greater than or equal to 3 are retained. In the above sequence, there is a continuous decrease from 140 to 127 with a length of 6, which meets the conditions. The sequence index position corresponding to the starting point of the segment is used as the starting point of the grayscale decreasing segment, and then its coordinate position in the original image is recorded. Repeat the processing of the grayscale sequences obtained from all center points, and finally extract the starting point coordinate positions of all segments that meet the slope decreasing feature to form a reverse slope change starting point coordinate set.

[0074] S203: Calculating pixel trajectory offset values in the main direction between adjacent starting points based on the reverse slope change starting point coordinate set, establishing corresponding linear connection relationships, performing a unified directional offset transformation on all coordinates, and generating a pixel distribution profile map;

[0075] The calculation formula for the pixel trajectory offset value in the main direction between adjacent starting points is:

[0076]

[0077] Where, ΔT k Represents the pixel trajectory offset value in the main direction between adjacent starting points, Δx k Represents the coordinate difference between the kth pair of adjacent starting points in the x-axis direction, Δy k Represents the coordinate difference between the kth pair of adjacent starting points in the y-axis direction, θ k Represents the reverse slope change value between the kth pair of adjacent starting points, Represents the overall slope mean of the starting point coordinate set of the reverse slope change, λ k represents the normalized parameter adjusted according to the main direction weight coefficient, Represents the pixel density gradient vector of the local area where the kth pair of adjacent starting points are located;

[0078] Take the adjacent starting point coordinate pairs A(2,3) and B(5,7) and calculate Δx k =5-2=3,Δy k=7-3=4; reverse slope θ k The coordinate difference of adjacent points is calculated as After standardization, the value retained to three decimal places is 1.333; the overall slope mean is the arithmetic mean of the reverse slopes of all adjacent points in the coordinate set. If there is another adjacent point pair C(8, 4), its reverse slope is calculated as but The normalization parameter λ_k is determined by the main direction weight coefficient. The main direction weight coefficient is the cosine value of the angle between the current adjacent point direction and the main direction. If the main direction is the positive direction of the x-axis, the angle cosine is Normalization parameter λ k =1 / (0.6×10)=0.167; pixel density gradient vector By calculating the local 5×5 pixel area, the horizontal gradient component Gx=3, the vertical gradient component Gy=4, and the vector modulus length

[0079] Substitute into the formula:

[0080]

[0081] The results show that the trajectory offset value of adjacent point pairs is composed of geometric distance and slope difference weighted pixel density gradient, 39.97 as ΔT k The value of will be used to establish the subsequent linear connection relationship;

[0082] Parameter definition:

[0083] Δx k Represents the coordinate difference of the kth pair of adjacent starting points in the x-axis direction, which is calculated by subtracting the horizontal coordinate of the previous point from the horizontal coordinate of the next point. k Similarly; θ k Represents the reverse slope of the kth pair of adjacent points, represented by Δy k / Δx k Keep three decimal places after calculation; represents the arithmetic mean of the reverse slopes of all adjacent pairs of points; k Represents the normalization parameter adjusted according to the main direction weight coefficient. The weight coefficient is the cosine value of the angle between the current direction and the main direction. The normalization parameter is calculated as 1 / (weight coefficient × 10); Represents the pixel density gradient vector of the local area. The horizontal gradient Gx and vertical gradient Gy are calculated by the Sobel operator and the vector modulus is obtained.

[0084] Parameter value source constraints:

[0085] Coordinate difference Δx k , Δy kDerived from actual coordinate monitoring data; reverse slope θ k The calculation accuracy is limited by the resolution of the coordinate acquisition device; the main direction weight coefficient is based on the definition of the angle cosine in the international standard ISO80000-2; the pixel density gradient vector follows the standard calculation process of the Sobel operator convolution kernel [-1, 0, 1; -2, 0, 2; -1, 0, 1]; the denominator of the normalization parameter 10 is the image width normalization constant, set according to the IEEE image processing standard;

[0086] Parameter rationality verification

[0087] Coordinate difference Δx k =3, Δy k =4 is consistent with the range of adjacent feature point spacing (1 to 50 pixels) at conventional image resolution (such as 1920×1080);

[0088] Reverse slope θ k = 1.333 in the normal slope range of [-5, 5], avoiding infinite slope in the vertical direction;

[0089] Normalization parameter λ k =0.167 satisfies the constraint condition of (0, 1] interval;

[0090] Pixel gradient modulus Comply with the calculation result range of Sobel operator (0~20√2);

[0091] Final ΔT k =39.97 is in the typical trajectory offset value range (0 to 100 pixels).

[0092] The specific steps of S3 are:

[0093] S301: Based on the image boundary in the pixel distribution contour map, extract the grayscale values of the current pixel and the adjacent pixels in the horizontal and vertical directions for the image block, calculate the grayscale difference, and classify them according to the coordinates to generate a block grayscale difference value set;

[0094] The grayscale difference calculation formula is:

[0095]

[0096] Where ΔQ u,v Represents the local grayscale difference of the pixel at coordinate (u, v) in the image, p u,v Represents the grayscale value of the current pixel (u, v), q u+1,v Represents the grayscale value of the pixel directly below it (u+1,v), r u,v Represents the horizontal grayscale sampling value of the current pixel (u, v), s u,v+1Represents the grayscale value of the pixel on its right (u,v+1), t u-1,v Represents the grayscale contrast value of the image just above it (u-1,v), w u,v-1 represents the grayscale contrast value of its left side (u, v-1), |·| represents the absolute value operator, and 2 is the constant offset term;

[0097] Parameter acquisition method and value setting:

[0098] p u,v : The grayscale value of the pixel with coordinates (u, v) is measured by the image acquisition device, and the obtained value is 150.

[0099] q u+1,v : Measure the grayscale value of the pixel with coordinates (u+1,v) and obtain a value of 145.

[0100] r u,v : Perform horizontal grayscale sampling on the pixel with coordinates (u, v) and obtain a value of 150.

[0101] s u,v+1 : Measure the grayscale value of the pixel with coordinates (u, v+1) and obtain a value of 155.

[0102] t u-1,v : Measure the grayscale value of the pixel with coordinates (u-1, v) and obtain a value of 148.

[0103] w u,v-1 : Measure the grayscale value of the pixel with coordinates (u, v-1) and obtain a value of 152.

[0104] Formula calculation process:

[0105] Calculate the molecular part:

[0106] p u,v -q u+1,v +r u,v -s u,v+1 =150-145+150-155=0;

[0107] Calculate the denominator:

[0108] 2+|t u-1,v -w u,v-1 |=2+|148-152|=2+4=6;

[0109] Substitute into the formula to calculate ΔQ u,v :

[0110]

[0111] The result shows that the grayscale variation of the pixel with coordinates (u, v) in its neighborhood is small, and the local grayscale difference is 0, indicating that the grayscale distribution in the area is relatively uniform, which helps to identify flat areas of the image in image processing.

[0112] S302: Based on the grayscale difference value set of the image block, the difference positions in the differentiated direction of the image block are counted, the continuous gradient amplitude change segments are extracted, and the continuous areas where the grayscale fluctuation frequency exceeds the directional mean are marked to obtain the grayscale transition marked area;

[0113] According to the grayscale difference set of the block, the grayscale difference of each pixel in the block in the horizontal and vertical directions is scanned and counted respectively to determine whether the direction of grayscale difference change is consistent. If the grayscale difference of multiple consecutive pixels in a certain direction has the same sign and the value change is not less than the set minimum change threshold ΔG_thresh_min, it is marked as a gradient change segment. ΔG_thresh_min is set according to the overall grayscale range of the image. In the scenario where the image grayscale value range is 0-255, it can be set to 5. For example, if the grayscale difference of a certain section of consecutive pixels in the horizontal direction of the block is 6, 8, 7, 5, or 10, then the segment is determined to be a continuous gradient change segment. The frequency of occurrence of all continuous segments that meet this condition is counted. , and then compare it with the average change frequency in all directions within the block, calculate the total number and length average of continuous gradient change segments in the horizontal and vertical directions of the block, set the frequency comparison threshold F_thresh_ratio to 1.5, that is, if the change frequency of a certain continuous change area is higher than 1.5 times the directional mean, then the area is determined to be an abnormal grayscale fluctuation frequency area and marked. For example, if the average grayscale fluctuation frequency in the horizontal direction of a block is 0.8 times / pixel, if the frequency of a certain continuous area reaches 1.3 times / pixel, that is, higher than 1.5 times, it meets the conditions and is marked. After traversing the entire block grayscale difference set, mark all eligible area positions, and finally obtain the grayscale transition mark area.

[0114] S303: calling the grayscale difference in the grayscale transition mark area, performing accumulation processing on the continuous grayscale segments, and superimposing the accumulation result to the original block position to generate a block contrast enhancement layer;

[0115] Call the grayscale difference data of each marked position in the grayscale transition mark area, and perform the grayscale difference accumulation operation from the beginning to the end of each continuous grayscale area. If the grayscale difference sequence of a segment is 5, 6, 4, 7, 5, then accumulate 5, 11, 15, 22, 27 in sequence. Each item in the accumulation operation is the result of adding the sum of the previous item and the current item. After the accumulation is completed, the accumulated value is mapped to the pixel grayscale of the original block position respectively. Set the enhancement intensity coefficient K to control the superposition intensity, and the K value is set to 1 .2 means that each accumulated value is multiplied by 1.2 and then superimposed. For example, if the previous accumulated value is 22, the enhanced value is 26.4, which is rounded down to 26. Finally, each pixel in the original block of the grayscale image is locally enhanced in this way, and the enhanced result is used to generate a block enhancement layer. The layer size is the same as the block, and all enhancement values ​​match the corresponding positions of the original image one by one. After repeating the processing of all blocks, the contrast enhancement layers of each block are merged to a unified image size to finally generate a complete block contrast enhancement layer.

[0116] The specific steps of S4 are:

[0117] S401: Read the grayscale band at the edge of the tile in the tile contrast enhancement layer, extract the start and end coordinates of the continuous brightness change segments in the grayscale sequence, calculate the grayscale difference between adjacent bright and dark pixels, and generate a brightness span list;

[0118] Read the grayscale band of each tile edge in the tile contrast enhancement layer, extract the grayscale sequence of the four boundary positions of each tile in the row and column directions, extract the grayscale sequence G_top from left to right for the upper edge, extract the grayscale sequence G_bottom from left to right for the lower edge, extract the grayscale sequence G_left from top to bottom for the left edge, and extract the grayscale sequence G_right from top to bottom for the right edge. Each sequence is a one-dimensional array, in which each element represents the grayscale value of the corresponding pixel. After extracting the grayscale sequence, perform a point-by-point difference operation on each sequence, starting from the first pixel to the last pixel, calculate the grayscale difference between the current pixel and the next pixel, record the positive and negative status of the difference and determine whether it is continuous. For example, in the G_top sequence, the grayscale value changes are 112, 118, 123, and 125. , 128, 125, 120, 114, the grayscale difference is 6, 5, 2, 3, -3, -5, -6, judge that the continuous positive segment is from 112 to 128, and the negative segment is from 128 to 114, extract the start and end coordinates of the continuous change segment as (0, 0) to (0, 4) and (0, 4) to (0, 7), and then calculate the difference in the grayscale values of the first and last two pixels between the start and end coordinates. For example, 128-112=16 is the positive span, and 128-114=14 is the negative span. Record the above span values in the brightness span list respectively. Each span record must contain the start coordinate, end coordinate and span value. The same operation is performed on all boundary continuous change segments. Finally, complete the grayscale continuous segment extraction and span value calculation at the edges of all blocks in the entire image, and obtain a brightness span list containing the brightness span information of the edge of the complete image block.

[0119] S402: Sort all span values according to the brightness span list, extract continuous transition segments with a spacing less than a set threshold, mark the pixel range index, and obtain a brightness transition segment index set;

[0120] According to the obtained brightness span list, all span values are sorted from small to large according to the grayscale difference. After arranging in order, the sorting results are traversed, and the grayscale difference between any two consecutive spans is selected for comparison. The distance between their grayscale differences is calculated. If the distance between the two span values is less than the set brightness spacing threshold ΔL_thresh, it is regarded as a group of continuous jump segments and the position index of the starting span and the ending span is recorded. The brightness spacing threshold ΔL_thresh setting should be configured according to the grayscale distribution characteristics of the entire image. If the overall grayscale span of the image is concentrated between 10-30, it is more reasonable to set the threshold to 5, which means that any two grayscale jumps within 5 are considered to belong to the same type of change area. For example, there is a span in the sorted list. The values are 11, 13, 14, 18, 25, and 40, where the spacing between 13 and 14 is 1, and they meet the conditions and are merged into one segment. The spacing between 25 and 40 is 15, so they are not merged. After continuously judging the entire list, several continuous transition segments are obtained. Then, the start and end coordinate ranges of the spans contained in each segment are marked. For example, a span value of 13 corresponds to coordinates (0, 5) to (0, 10), and a span value of 14 corresponds to coordinates (0, 11) to (0, 15). The coordinate range of the transition segment is (0, 5) to (0, 15). The pixel indexes involved in the segment are uniformly organized and recorded in sequence as an element in the brightness transition segment index set. All continuous transition segments that meet the spacing conditions are traversed and screened to finally obtain a complete brightness transition segment index set.

[0121] S403: Calling the brightness transition segment index set, counting the number of segment brightness spans, grouping by brightness, establishing a brightness hierarchy structure and mapping it to layer coordinates, and generating a brightness transition segment map;

[0122] Call the index range of each segment in the brightness transition segment index set, extract all brightness span values in the corresponding segment and count the number of brightness spans contained in the segment. For example, a segment contains 4 spans with span values 12, 14, 13, and 11, then the number of brightness spans in this segment is 4. Then, all transition segments are grouped according to their span values. The grouping standard is determined based on the average grayscale value in the segment. If the average grayscale is between 0 and 85, it is classified as a low brightness level, between 86 and 170 as a medium brightness level, and between 171 and 255 as a high brightness level. For example, a segment The inner span values are 120, 130, and 125, with an average value of 125, which are classified as the medium brightness group. Then a hierarchical structure is established, and the fragments in each brightness group are numbered and their levels are recorded. When establishing the hierarchy, they are arranged from top to bottom in order of high, medium, and low. Each fragment is attached with the level information, and then these level results are mapped back to the original image layer coordinate position. The start and end coordinate range of each fragment is used as the positioning basis, and the brightness level results are assigned to the corresponding pixel points in the corresponding area of the layer. Finally, a complete brightness jump fragment map is constructed based on the hierarchical mapping results.

[0123] The specific steps of S5 are:

[0124] S501: Call all brightness span regions in the brightness transition segment spectrum, extract pixels in the region whose grayscale values are higher than the local brightness average level, record their coordinate positions, and generate a coordinate set of pixels with relatively strong brightness;

[0125] First, in each brightness span area, the average grayscale value of all pixels in the area is calculated and set as the local average brightness level L_avg. Then, the grayscale value of each pixel in the area is compared with L_avg one by one. If the current pixel grayscale value is greater than L_avg, it is marked as a brightness-strong pixel, and the coordinate position (x, y) of the pixel in the original image is recorded. This process is repeated to traverse all brightness span areas. For example, if the grayscale value distribution of pixels in a certain area is 135, 138, 140, 144, 130, 132, then L_avg is 136.5, and the pixels with grayscale values of 138, 140, and 144 meet the conditions and are recorded. The above process is performed on all areas in the atlas in turn. Finally, the coordinates of all brightness-strong pixels are summarized and stored in a unified structure to form a brightness-strong pixel coordinate set. The coordinate set data structure should contain the horizontal and vertical coordinate values of each pixel and its corresponding original image index information, so that subsequent association operations can accurately point to the corresponding position of the image.

[0126] S502: Calculate the weighted offset value of the coordinates of the pixel with relatively strong brightness relative to the center of gravity based on the coordinate set of the pixel with relatively strong brightness, and extract the grayscale value corresponding to the coordinate to obtain the grayscale value of the center of gravity of the bright spot;

[0127] The specific calculation formula for the weighted offset value of the coordinates of the pixel point with strong brightness relative to the center of gravity is:

[0128]

[0129] in, Represents the weighted offset value of the pixel coordinates with strong brightness relative to the center of gravity, x i Represents the horizontal coordinate value of the i-th pixel with strong brightness, y i Represents the vertical coordinate value of the i-th pixel with strong brightness, Represents the average horizontal coordinate of all pixels with strong brightness. Represents the average vertical coordinate of all pixels with strong brightness, I i Represents the grayscale value of the i-th pixel, Represents the grayscale average of all pixels with strong brightness, w i represents the weighting factor of the i-th pixel in the coordinate distribution, and n represents the total number of pixels with strong brightness;

[0130] Take the calculation of the weighted offset of the coordinates of pixels with strong brightness relative to the center of gravity as an example. Consider a specific set of data, in which the coordinates and grayscale values of five pixels are recorded. These data are obtained through image analysis software to ensure that the accuracy of each value matches the actual situation. First, calculate the average horizontal and vertical coordinates of all pixels ( and ) and average gray value Assume the data is as follows: Pixel 1: x1=15, y1=20, I1=240;

[0131] Pixel 2: x2 = 16, y2 = 22, I2 = 250;

[0132] Pixel 3: x3 = 15, y3 = 21, I3 = 245;

[0133] Pixel 4: x4 = 14, y4 = 19, I4 = 235;

[0134] Pixel 5: x5 = 13, y5 = 18, I5 = 230;

[0135] Through monitoring, we can obtain:

[0136]

[0137] Weight w i The setting is based on the deviation of each point's brightness from the average brightness. Higher deviations are given greater weight to emphasize the contribution of pixels with larger grayscale value differences to the offset. The settings are as follows:

[0138] w1=|240-240|+1=1;

[0139] w2=|250-240|+1=11;

[0140] w3=|245-240|+1=6;

[0141] w4=|235-240|+1=6;

[0142] w5=|230-240|+1=11;

[0143] The specific calculation is as follows:

[0144]

[0145] The calculation multiplies the Euclidean distance between each point's coordinates and the average coordinate by the product of the absolute value of the grayscale deviation and the weight, then divides it by the sum of the weights to obtain the weighted average offset value for all points. This result shows that the weighted average offset value can more accurately measure the distribution deviation of a set of pixels relative to its grayscale centroid.

[0146] S503: Calling the grayscale value of the center of gravity of the bright spot, performing difference calculation on the grayscale value set of the area, determining whether the difference exceeds the brightness fluctuation range threshold, and establishing a mobile phone screen uniformity detection solution;

[0147] Call the bright spot centroid grayscale value L_center, and construct a complete grayscale set L_region for all pixel grayscale values in the brightness transition area where it is located. Then calculate the difference between the grayscale value of each pixel in the set and L_center in turn, and take the absolute value of the difference to generate a difference list D_list. For example, if L_center is 145, and the grayscale values in the area are 140, 147, 150, 142, and 138, the difference values are 5, 2, 5, 3, and 7 respectively. Continue to calculate the maximum value D_max of D_list and compare it with the set brightness fluctuation range threshold L_thresh. If D_max is greater than L_thresh, esh determines that the area has uneven brightness. The setting of the threshold L_thresh needs to refer to the standard brightness uniformity index of the screen. In mobile phone screen detection, the maximum brightness deviation is usually allowed to be 10-15 gray levels, so L_thresh can be set to 12. In the previous example, D_max is 7, which is less than the threshold and is not judged as uneven brightness. If there is an area with D_max of 18, it exceeds the threshold and the area is judged as uneven. Finally, all the bright spot center areas are traversed and the above judgment is performed. The uniformity status of each area is marked according to the judgment result, and a structured record containing the coordinate position, brightness difference degree, and judgment result is generated to build a mobile phone screen uniformity detection solution.

[0148] The above description is merely a specific embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any modifications or substitutions that can be easily conceived by a person skilled in the art within the technical scope disclosed in the present invention should be included in the scope of protection of the present invention. Therefore, the scope of protection of the present invention should be based on the scope of protection of the claims.

Claims

1. A method for detecting uniformity of a mobile phone screen based on image analysis, characterized in that: The following steps are involved: S1: Collect the uniformly distributed central area of the screen image, extract the four-directional grayscale sequence, calculate the grayscale difference and change slope of adjacent pixels, extract the direction change position, calculate the slope amplitude distribution, construct the concentration ratio, and combine them to generate a grayscale trend distribution image; S2: Based on the change direction of the grayscale trend distribution image, extract the slope sequence, obtain the change starting point in the reverse slowdown segment, calculate the center pixel trajectory difference and adjust the coordinates to generate a pixel distribution contour map; S3: Based on the pixel distribution contour map, extract the grayscale difference of the image block, calculate the local spatial gradient, identify the transition zone with consistent direction and frequent fluctuation, mark it as the contrast enhancement area, and superimpose the grayscale difference to generate the image block contrast enhancement layer; S4: reading the edge grayscale band of each area in the block contrast enhancement layer, extracting the start and end coordinates of the brightness change, calculating and sorting the brightness span, grouping and sorting by area index, and generating a brightness transition segment map; S5: Call the image area of the brightness span in the brightness transition segment spectrum, extract the coordinates and calculate the geometric center of gravity and grayscale value, judge the difference in combination with the brightness fluctuation range, and generate a mobile phone screen uniformity detection solution.

2. The method for detecting uniformity of a mobile phone screen based on image analysis according to claim 1, characterized in that: The grayscale trend distribution image includes the directional grayscale slope change characteristics, the slope change amplitude distribution, and the grayscale trend combination ratio; the pixel distribution contour map includes the main direction slope frequency characteristics, the reverse grayscale change segment, and the coordinate offset adjustment parameters; the block contrast enhancement layer includes the local grayscale difference gradient, the continuous grayscale transition area, and the same-direction grayscale fluctuation frequency distribution; the brightness jump segment map includes the bright and dark pixel jump span, the continuous jump dense distribution, and the brightness level grouping block; the mobile phone screen uniformity detection scheme includes the pixel set with grayscale values higher than the mean, the geometric bright spot centroid coordinates, and the brightness difference judgment threshold.

3. The method for detecting uniformity of a mobile phone screen based on image analysis according to claim 1, characterized in that: The specific steps of S1 are: S101: Acquire an evenly distributed initial central area in the screen image, extract a continuous grayscale value sequence in the four directions of up, down, left, and right for each central area, calculate the difference between adjacent pixels in the grayscale sequence, and group and summarize the difference sequence by direction to generate a directional grayscale difference sequence; S102: Based on the directional grayscale difference sequence, three adjacent differences are selected to calculate two groups of slope differences, and then the amplitudes between the slope differences are marked. The number of change positions of each group of directions within a fixed pixel range is counted to obtain a directional slope change density distribution value. S103: According to the directional slope change density distribution value, the density values of the four directions in each group of central areas are sequentially combined, the difference between the directions is calculated and the absolute value is taken, and then the ratio of the difference between the direction combinations is calculated and normalized to generate a grayscale trend distribution image.

4. The method for detecting uniformity of a mobile phone screen based on image analysis according to claim 1, wherein: The specific steps of S2 are: S201: extracting the main change direction of the region based on the grayscale distribution characteristics of the detection area in the grayscale trend distribution image, marking the center position where the difference exceeds a set grayscale difference threshold according to the difference between the directional grayscale fluctuation and the mean value within the region, and obtaining a coordinate set of the grayscale offset sensitive area; S202: Calling the main direction grayscale sequence of each area in the grayscale offset sensitive area coordinate set, extracting continuous segments with frequent slope changes, locating the change starting point of the grayscale decreasing segment, obtaining the corresponding pixel index, and obtaining the coordinate set of the reverse slope change starting point; S203: Calculate pixel trajectory offset values in the main direction between adjacent starting points based on the reverse slope change starting point coordinate set, establish corresponding linear connection relationships, perform directional uniform offset transformation on all coordinates, and generate a pixel distribution profile map.

5. The method for detecting uniformity of a mobile phone screen based on image analysis according to claim 4, characterized in that: The calculation formula of the pixel trajectory offset value in the main direction between adjacent starting points is specifically: Where, ΔT k Represents the pixel trajectory offset value in the main direction between adjacent starting points, Δx k Represents the coordinate difference between the kth pair of adjacent starting points in the x-axis direction, Δy k Represents the coordinate difference between the kth pair of adjacent starting points in the y-axis direction, θ k Represents the reverse slope change value between the kth pair of adjacent starting points, Represents the overall slope mean of the starting point coordinate set of the reverse slope change, λ k represents the normalized parameter adjusted according to the main direction weight coefficient, Represents the pixel density gradient vector of the local area where the kth pair of adjacent starting points are located.

6. The method for detecting uniformity of a mobile phone screen based on image analysis according to claim 1, wherein: The specific steps of S3 are: S301: Based on the image boundary in the pixel distribution profile map, extract the grayscale values of the current pixel and the adjacent pixels in the horizontal and vertical directions for the image block, calculate the grayscale difference, and classify them according to coordinates to generate a block grayscale difference value set; S302: Counting the difference positions in the differentiated directions of the image blocks based on the grayscale difference value set, extracting continuous gradient amplitude change segments, marking continuous regions where the grayscale fluctuation frequency exceeds the directional mean, and obtaining grayscale transition marked regions; S303: calling the grayscale difference in the grayscale transition mark area, performing accumulation processing on the continuous grayscale segments, and superimposing the accumulation result to the original block position to generate a block contrast enhancement layer.

7. The method for detecting uniformity of a mobile phone screen based on image analysis according to claim 6, wherein: The grayscale difference calculation formula is specifically: Where ΔQ u,v Represents the local grayscale difference of the pixel at coordinate (u, v) in the image, p u,v Represents the grayscale value of the current pixel (u, v), q u+1,v Represents the grayscale value of the pixel directly below it (u+1,v), r u,v Represents the horizontal grayscale sampling value of the current pixel (u, v), s u,v+1 Represents the grayscale value of the pixel on its right (u,v+1), t u-1,v Represents the grayscale contrast value of the image just above it (u-1,v), w u,v-1 represents the grayscale contrast value of its left side (u, v-1), |·| represents the absolute value operator, and 2 is the constant offset term.

8. The method for detecting uniformity of a mobile phone screen based on image analysis according to claim 1, wherein: The specific steps of S4 are: S401: Reading the grayscale band at the edge of the image block in the image block contrast enhancement layer, extracting the start and end coordinates of the continuous brightness change segments in the grayscale sequence, calculating the grayscale difference between adjacent bright and dark pixels, and generating a brightness span list; S402: Sort all span values according to the brightness span list, extract continuous transition segments with a spacing less than a set threshold, mark the pixel range index, and obtain a brightness transition segment index set; S403: calling the brightness transition segment index set, counting the number of segment brightness spans, grouping by brightness, establishing a brightness hierarchy structure and mapping it to layer coordinates, and generating a brightness transition segment map.

9. The method for detecting uniformity of a mobile phone screen based on image analysis according to claim 1, wherein: The specific steps of S5 are: S501: Call all brightness span regions in the brightness transition segment map, extract pixels in the region whose grayscale values are higher than the local brightness average level, record their coordinate positions, and generate a coordinate set of pixels with relatively strong brightness; S502: Calculating a weighted offset value of the coordinates of the pixel point with relatively high brightness relative to the center of gravity based on the coordinate set of the pixel point with relatively high brightness, and extracting the grayscale value corresponding to the coordinate to obtain the grayscale value of the center of gravity of the bright spot; S503: Call the grayscale value of the center of gravity of the bright spot, perform difference calculation on the grayscale value set of the area, determine whether the difference exceeds the brightness fluctuation range threshold, and establish a mobile phone screen uniformity detection solution.

10. The method for detecting uniformity of a mobile phone screen based on image analysis according to claim 9, characterized in that: The specific calculation formula of the weighted offset value of the coordinates of the pixel point with relatively strong brightness relative to the center of gravity is: in, Represents the weighted offset value of the pixel coordinates with strong brightness relative to the center of gravity, x i Represents the horizontal coordinate value of the i-th pixel with strong brightness, y i Represents the vertical coordinate value of the i-th pixel with strong brightness, Represents the average horizontal coordinate of all pixels with strong brightness. Represents the average vertical coordinate of all pixels with strong brightness, I i Represents the grayscale value of the i-th pixel, Represents the grayscale average of all pixels with strong brightness, w i represents the weighting factor of the i-th pixel in the coordinate distribution, and n represents the total number of pixels with strong brightness.

Citation Information

Patent Citations

  • Mobile phone screen defect intelligent detection method based on computer vision

    CN117078672A

  • Screen brightness uniformity detection method and detection equipment

    CN118762626A

  • OLED display screen quality detection method based on machine vision

    CN119648689A

  • Medical image automatic analysis system and method

    CN119991671A

  • Gray scale display device

    US20060055827A1

Cited By

  • Vision-based blade spraying uniformity identification method

    CN121121322A

  • A visual-based blade spraying uniformity identification method

    CN121121322B

  • Display screen bright and dark line adjustment optimization method and system and LED display screen

    CN121214850A

  • Display method and system based on adaptive block compensation

    CN121528165A