Image edge compensation processing method and system

CN121728230BActive Publication Date: 2026-08-21ANHUI SEMICON INTEGRATED DISPLAY TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202511887891.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-12-15
Publication Date
2026-08-21
Estimated Expiration
2045-12-15

AI Technical Summary

Technical Problem

传统图像处理算法在处理边缘时容易出现颜色失真、边缘模糊等问题,特别是在高对比度边缘区域,由于不同颜色通道的响应特性差异,往往会产生彩色镶边现象

Benefits of technology

1.采用微分卷积方法对图像中各像素的每个色彩通道分别进行灰阶值提取,通过计算表征亮度变化程度的特征值,实现对像素边缘的精准检测。每个色彩通道均独立进行上述微分卷积运算与判断,从而有效识别图像边缘。在对边缘像素进行补偿时,各色彩通道独立执行补偿操作,显著避免了图像边缘区域出现异常亮斑的问题。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121728230B_ABST
    Figure CN121728230B_ABST
Patent Text Reader

Abstract

The application discloses an image edge compensation processing method and system, and relates to the field of display, and comprises the following steps: receiving an inputted image to be processed, constructing a differential convolution kernel group, wherein the differential convolution kernel group comprises a first weight matrix and a second weight matrix; for each gray level channel of the image to be processed, performing the following steps on each target pixel in the channel: determining a row neighborhood window and a column neighborhood window of the target pixel, calculating eigenvalues of the row and column directions of the target pixel, summing the square of the row eigenvalue and the square of the column eigenvalue to obtain a composite eigenvalue of the target pixel; for the target pixel in each gray level channel, performing edge judgment on the composite eigenvalue by setting upper and lower thresholds, and using disorder to calculate the part between the upper and lower thresholds; performing a preset compensation operation on the gray level value of the edge pixel in each gray level channel, and outputting an optimized image. The application detects the boundary through disorder, and effectively improves the edge detection accuracy.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of silicon-based OLED technology, and particularly relates to an image edge compensation processing method and system. Background Technology

[0002] In digital image processing and display technology, the processing quality of edge areas directly affects the visual effect of an image. Traditional image processing algorithms are prone to problems such as color distortion and edge blurring when processing edges, especially in high-contrast edge areas, where the difference in response characteristics of different color channels often produces color fringing.

[0003] Existing edge compensation methods mainly suffer from the following problems: First, most methods use fixed compensation parameters, which cannot adapt to the characteristics of different image content; second, traditional methods often process based on a single channel, ignoring the mutual influence between multiple channels; in addition, existing technologies have limited edge detection accuracy, which is prone to misjudgment or missed judgment. Based on this, the present invention provides an image edge compensation processing method and system. Summary of the Invention

[0004] To address the aforementioned technical problems, this invention discloses an image edge compensation processing method and system.

[0005] An image edge compensation processing method includes the following steps: The system receives an input image to be processed, the image to be processed including at least one grayscale channel, each pixel in the grayscale channel having a grayscale value, the grayscale value being used to characterize the brightness information of the pixel; Construct a differential convolution kernel group, which includes a first weight matrix for row direction detection and a second weight matrix for column direction detection; For each grayscale channel of the image to be processed, the following operations are performed on each target pixel within that channel: Determine the row neighborhood window and column neighborhood window of the target pixel, wherein the size of the row neighborhood window is consistent with the first weight matrix, and the size of the column neighborhood window is consistent with the second weight matrix; multiply each weight value in the first weight matrix with the grayscale value of the corresponding pixel in the row neighborhood window and sum them to obtain the row feature value of the target pixel; multiply each weight value in the second weight matrix with the grayscale value of the corresponding pixel in the column neighborhood window and sum them to obtain the column feature value of the target pixel; sum the squares of the row feature value and the squares of the column feature value to obtain the composite feature value of the target pixel. For each target pixel within a grayscale channel, edge detection is performed using the composite feature value; Perform a preset compensation operation on the grayscale value of edge pixels in each grayscale channel to optimize the brightness transition effect between edge pixels and adjacent pixels; Based on the compensated pixel grayscale values ​​of all grayscale channels, the optimized image is output. The edge determination includes: (1) Calculate the composite feature value of the target pixel; (2) Edge detection is performed on the target pixel based on the composite feature value, wherein the edge detection includes: If the absolute value of the composite feature value is not less than a preset upper threshold, then the pixel is determined to be an edge pixel in the grayscale channel. If the absolute value of the composite feature value is not greater than a preset lower threshold, then the pixel is determined to be a non-edge pixel. (3) When the composite feature value of the target pixel is greater than the preset lower threshold and less than the preset upper threshold, the randomness calculation window of the target pixel is determined, and the randomness calculation window includes multiple pixels adjacent to the target pixel in the row and column directions. (4) Calculate the disorder of the disorder calculation window where the target pixel is located. If its disorder is greater than the preset disorder threshold, the target pixel is determined to be an edge pixel. Otherwise, the target pixel is not an edge pixel. The calculation of the disorder includes: (1) Extract the grayscale values ​​of all pixels, including the target pixel, in the randomness calculation window; (2) For all pixels, perform gray level difference calculation in the row direction. The difference calculation is to calculate the absolute value of the difference between all adjacent gray level values ​​in the row direction as the gray level row difference. (3) Sum all the grayscale row differences to get the grayscale row difference sum; (4) For all pixels, perform gray level difference calculation in the column direction. The difference calculation is to calculate the absolute value of the difference between all adjacent gray level values ​​in the column direction as the gray level column difference.

[0006] (5) Sum all the differences in the gray levels to obtain the sum of the gray level differences; (6) The randomness is obtained by summing the gray level row difference value and the gray level column difference value.

[0007] In the above method, the preset randomness threshold is greater than 0 and less than or equal to the randomness limit value. The randomness limit value is the state where the randomness calculation window is alternating between black and white pixels. Its value is the maximum gray level value of the current channel multiplied by the number of times the difference is calculated. The number of times the difference is calculated is the sum of the number of times the gray level row difference is calculated in the row direction and the number of times the gray level column difference is calculated in the column direction.

[0008] In the above method, the first weight matrix is ​​an m-row, n-column differential convolution kernel, where: n is an odd number not less than 3, m is a positive integer not less than 1, and the sum of all weights in the first weight matrix is ​​0; The first weight matrix uses the ((n+1) / 2)th column as the middle column, and all rows in the middle column have a weight of 0. The columns to the left of the middle column are symmetrically distributed with respect to the columns to the right of the middle column. The weights of the left columns are all negative, and the weights of the right columns are all positive. The absolute values ​​of the weights of the left columns and the right columns at symmetrical positions are equal. The first value is defined as the sum of all weights in the right column of the first weight matrix multiplied by the maximum gray level value of the gray level channel, wherein the maximum gray level value is the theoretical maximum value of the pixel gray level value in the gray level channel, which is determined by the number of bits of image quantization. The second weight matrix is ​​a differential convolution kernel with row j and column i, where: j is an odd number not less than 3, i is a positive integer not less than 1, and the sum of all weights in the second weight matrix is ​​0; The second weight matrix uses the ((j+1) / 2)th row as the middle row, and all column weights in the middle row are 0; The rows above the middle row and the rows below the middle row are symmetrically distributed, and the weights of the upper rows are all negative, while the weights of the lower rows are all positive. The absolute values ​​of the weights of the upper rows and the lower rows at symmetrical positions are equal. The second value is defined as the sum of all weights in the lower row of the second weight matrix multiplied by the maximum gray level value of the gray level channel.

[0009] The calculation of the preset upper threshold and the preset lower threshold includes: Calculate the theoretical limit of the composite eigenvalue, where the theoretical limit of the composite eigenvalue is when the row eigenvalue and column eigenvalue take the first and second values, respectively. Both the preset upper threshold and the preset lower threshold are greater than 0 and less than the theoretical limit value of the composite feature value.

[0010] In the above method, the image to be processed is a single-channel grayscale image, which is obtained by converting an RGB color image; the conversion process includes: For each pixel in the RGB color image, the R channel value, G channel value and B channel value are extracted, and the corresponding brightness value is calculated based on a preset brightness conversion formula. The brightness value is then used as the grayscale value of the pixel in the single-channel grayscale image. The preset brightness conversion formula is Y = a×R+b×G+c×B, where a, b, and c are weighting coefficients, and a+b+c=1.

[0011] In the above method, for target pixels determined to be edge pixels, a preset grayscale compensation operation is performed in the R channel, G channel, and B channel of the RGB color image to determine the grayscale compensation value of the edge pixel in the current channel. The calculation process includes: (1) Define the grayscale ratio of the edge pixel in the current channel: the grayscale ratio is the ratio of the input grayscale value of the pixel to the maximum grayscale value of the current channel; (2) Calculate the compensation weight: The compensation weight is a compensation coefficient, which is equal to the maximum grayscale value of the current channel minus the color shift grayscale value of the colored edge in the current channel when transitioning from a pure white image to a pure black image. (3) Calculate the eigenvalue weights: The eigenvalue weight is equal to the ratio of the composite eigenvalue to the theoretical limit of the composite eigenvalue, wherein the limit of the composite eigenvalue is taken as the first value and the second value of the row eigenvalue and the column eigenvalue, respectively. (4) Calculate the randomness weight: The disorder weight is equal to the ratio of the preset disorder threshold to the disorder limit value.

[0012] (5) The gray level compensation value is the product of the gray level ratio in step (1) and the compensation weight in step (2), the feature value weight in step (3) and the disorder weight in step (4).

[0013] Secondly, the present invention discloses an image edge compensation processing system, comprising: An image receiving module is used to receive the input image to be processed; The kernel construction module is used to construct groups of differential convolution kernels; The feature value calculation module is used to perform feature value calculation operations on each target pixel in each grayscale channel of the image to be processed. The disorder calculation module is used to calculate the disorder of the target pixel; The edge detection module is used to perform edge detection on target pixels within each grayscale channel; Compensation processing module: used to perform preset compensation operations on edge pixels within each grayscale channel; Image output module: Used to output an optimized image based on the compensated pixel grayscale values ​​of all grayscale channels.

[0014] In the above system, the differential convolution kernel group includes a first weight matrix for row direction detection and a second weight matrix for column direction detection.

[0015] In the above system, the feature value calculation module is used to perform feature value calculation operations on each target pixel in each grayscale channel of the image to be processed, including: The row neighborhood window and column neighborhood window of the target pixel are determined. The first weight matrix is ​​multiplied and summed with the grayscale values ​​of the pixels in the row neighborhood window to obtain the row feature value. The second weight matrix is ​​multiplied and summed with the grayscale values ​​of the pixels in the column neighborhood window to obtain the column feature value. The composite eigenvalue is obtained by summing the squares of the row eigenvalues ​​and the squares of the column eigenvalues.

[0016] In the above system, the edge detection module is used to perform edge detection for target pixels within each grayscale channel, including: (1) Determine the randomness calculation window for the target pixel; (2) Calculate the composite feature value and randomness of the target pixel, and perform edge judgment based on the following: If the absolute value of the composite feature value is not less than a preset upper threshold, then the pixel is determined to be an edge pixel in the grayscale channel. If the absolute value of the composite feature value is not greater than a preset lower threshold, then the pixel is determined to be a non-edge pixel. If the composite feature value of the target pixel is greater than a preset lower threshold and less than a threshold, then according to: If the disorder of the target pixel is greater than the preset disorder threshold, then the target pixel is an edge pixel; If not, then the target pixel is not an edge pixel.

[0017] The beneficial effects of this invention are as follows: 1. A differential convolution method is used to extract grayscale values ​​for each color channel of each pixel in the image. By calculating feature values ​​that characterize the degree of brightness change, accurate detection of pixel edges is achieved. Each color channel independently performs the aforementioned differential convolution operation and judgment, thereby effectively identifying image edges. When compensating edge pixels, each color channel performs the compensation operation independently, significantly avoiding the problem of abnormal bright spots in image edge areas.

[0018] 2. In the edge detection process, the brightness variation of the target pixel in the row and column directions is calculated using the first and second weight matrices, respectively, to obtain the corresponding row and column feature values. These two values ​​are then fused into a composite feature value reflecting the overall brightness variation around the target pixel, and edge detection is performed based on this composite feature value. This method comprehensively considers the brightness gradient information in both rows and columns, improving the accuracy and robustness of edge pixel recognition.

[0019] 3. When performing edge detection based on composite feature values, an upper threshold, a lower threshold, and a buffer zone between them are introduced. Within the buffer zone, the edge state is further determined by calculating the randomness of brightness changes. This mechanism can assess the brightness uniformity of the area where the target pixel is located based on the flatness, and can also convert the randomness value into a weighting coefficient for the edge compensation value, thereby improving the reliability of edge detection while optimizing the accuracy of the compensation effect. Attached Figure Description

[0020] Figure 1 This is a flowchart illustrating an image edge compensation processing method disclosed in this invention; Figure 2 This is a flowchart of the disorder calculation in an image edge compensation processing method disclosed in this invention; Figure 3 This is a schematic diagram of the first weight matrix in an image edge compensation processing method disclosed in this invention; Figure 4 This is a schematic diagram of the second weight matrix in an image edge compensation processing method disclosed in this invention; Figure 5 This is an example diagram of randomness calculation in an image edge compensation processing method disclosed in this invention. Detailed Implementation

[0021] To facilitate understanding of this application and to make the aforementioned objectives, features, and advantages of this application more apparent, a detailed description of specific embodiments of this application is provided below in conjunction with the accompanying drawings. Numerous specific details are set forth in the following description to provide a thorough understanding of this application, and preferred embodiments are shown in the accompanying drawings. However, this application can be implemented in many different forms and is not limited to the embodiments described herein. Rather, these embodiments are provided to provide a more thorough and complete understanding of the disclosure of this application. This application can be implemented in many other ways different from those described herein, and those skilled in the art can make similar modifications without departing from the spirit of this application; therefore, this application is not limited to the specific embodiments disclosed below. Furthermore, the terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of indicated technical features. Thus, a feature defined as "first" or "second" may explicitly or implicitly include at least one of that feature. In the description of this application, "a plurality of" means at least two, such as two, three, etc., unless otherwise explicitly specified. In the description of this application, "several" means at least one, such as one, two, etc., unless otherwise explicitly specified. It should be noted that when an element is referred to as being "fixed to" another element, it can be directly attached to the other element or there may be an intervening element. When an element is referred to as being "connected to" another element, it can be directly connected to the other element or there may be an intervening element. The terms "vertical," "horizontal," "left," "right," and similar expressions used herein are for illustrative purposes only and do not represent the only possible implementations. Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application belongs. The terminology used herein is only for describing particular implementations and is not intended to limit the scope of this application. The term "and / or" as used herein includes any and all combinations of one or more of the associated listed items.

[0022] See attached document Figures 1-5 This invention discloses an image edge compensation processing method, comprising the following steps: S1: Receive input image data to be processed, wherein the image to be processed contains at least one grayscale channel. Each pixel in the grayscale channel has a corresponding grayscale value, which is used to accurately characterize the brightness information of the pixel.

[0023] S2: Construct a differential convolution kernel group, which consists of two parts: a first weight matrix for row-direction edge detection and a second weight matrix for column-direction edge detection.

[0024] S3: For each grayscale channel of the image to be processed, perform the following operations on each target pixel within that channel: determine the row neighborhood window and column neighborhood window of the target pixel, wherein the size of the row neighborhood window is consistent with the first weight matrix, and the size of the column neighborhood window is consistent with the second weight matrix; multiply each weight value in the first weight matrix with the grayscale value of the corresponding pixel in the row neighborhood window and sum them to obtain the row feature value of the target pixel; multiply each weight value in the second weight matrix with the grayscale value of the corresponding pixel in the column neighborhood window and sum them to obtain the column feature value of the target pixel; sum the squares of the row feature value and the squares of the column feature value to obtain the composite feature value of the target pixel; The composite feature value comprehensively characterizes the brightness gradient change characteristics of the surrounding area in both row and column directions centered on the target pixel, and can fully reflect the brightness transition in the pixel neighborhood.

[0025] S4: For each target pixel within a grayscale channel, perform precise edge detection based on composite feature values, specifically including: S41: Calculate the composite feature value of the target pixel, and then based on: If the absolute value of the composite feature value is not less than a preset upper threshold, then the pixel is determined to be an edge pixel in the grayscale channel. If the absolute value of the composite feature value is not greater than a preset lower threshold, then the pixel is determined to be a non-edge pixel. S42: For undetermined pixels whose composite feature values ​​are between the upper and lower thresholds, determine the randomness calculation window of the target pixel. The randomness calculation window is used to calculate the randomness of the target pixel within a certain range. The randomness calculation window includes multiple pixels that are adjacent to the target pixel in the row and column directions.

[0026] S43: Calculate the disorder of the disorder calculation area. If the disorder is greater than the preset disorder threshold, the target pixel is determined to be an edge pixel. Otherwise, the target pixel is not an edge pixel. The disorder level is calculated as follows: (1) Extract the grayscale values ​​of all pixels, including the target pixel, in the randomness calculation window; (2) For all pixels, perform gray level difference calculation in the row direction. The difference calculation is to calculate the absolute value of the difference between all adjacent gray level values ​​in the row direction as the gray level row difference. (3) Sum all the grayscale row differences to get the grayscale row difference sum; (4) For all pixels, perform gray level difference calculation in the column direction. The difference calculation is to calculate the absolute value of the difference between all adjacent gray level values ​​in the column direction as the gray level column difference.

[0027] (5) Sum all the differences in the gray levels to obtain the sum of the gray level differences; (6) The randomness is obtained by summing the “sum of gray row differences” and the “sum of gray column differences”.

[0028] S5: Perform a preset compensation operation on the grayscale values ​​of pixels identified as edge pixels in each grayscale channel. This operation aims to optimize the brightness transition effect between edge pixels and adjacent pixels. By adjusting the grayscale values ​​of edge pixels, it eliminates abnormal brightness prominence caused by edge effects, achieving a smooth brightness transition from a visual perception perspective.

[0029] S6: Generate and output the final image with optimized visual quality based on the pixel grayscale values ​​of all grayscale channels after compensation processing.

[0030] By employing the aforementioned dynamic randomness calculation window design and multi-level edge determination mechanism, the real-time transmission characteristics of image data are fully considered. Randomness calculation is used to determine the non-uniformity of brightness changes in the area where the target pixel is located, and edge determination is performed based on the non-uniformity, thereby improving the accuracy of edge determination.

[0031] In one feasible embodiment, the first weight matrix is ​​an m-row, n-column differential convolution kernel, where n is an odd number not less than 3, m is a positive integer not less than 1, and the sum of all weights in the matrix is ​​zero. The specific structure is as follows: Figure 3 As shown.

[0032] The matrix uses the ((n+1) / 2)th column as the middle column, where all weights are zero. The columns to the left of the middle column are symmetrically distributed with their corresponding columns to the right. The weights of the left columns are all negative, while the weights of the right columns are all positive, and the absolute values ​​of the weights of the left and right columns at symmetrical positions are equal.

[0033] The first value is defined as the sum of the products of all weights in the right column of the first weight matrix and the maximum grayscale value of the grayscale channel. The maximum grayscale value is determined by the number of bits used in the image quantization; for an n-bit quantized image, its theoretical maximum value is 2^n-1. Taking an 8-bit image as an example, the maximum grayscale value is 255, so the first value can be expressed as 255×(A+B+C+D+E+F). The first value represents the theoretical maximum value of the row feature value and can be calculated using a reference image with alternating black and white values ​​and a white middle column.

[0034] like Figure 3As shown, when the second row and third column of the first weight matrix are aligned with the target pixel, the rest of the matrix corresponds to the neighborhood window of the target pixel. The weight values ​​A, B, C, D, E, F and their symmetrical negative values ​​-A, -B, -C, -E, -F correspond to pixels within the neighborhood window. In practice, the weight values ​​can be designed in the form of 2^n (n ranges from 0 to 6). The larger the weight value, the higher the edge detection accuracy. It is worth noting that the weight values ​​B, D, F, and their symmetrical negative values ​​closer to the target pixel are usually set to be greater than the weight values ​​A, C, E, and their symmetrical negative values ​​on either side. This design stems from the spatial correlation of neighboring pixels—neighboring points closer to the target pixel contribute more significantly to edge detection.

[0035] For high bit depth images (such as 10-bit or 16-bit), the maximum gray level value is adjusted accordingly to 1023 or 65535.

[0036] Similarly, the second weight matrix is ​​a differential convolution kernel with rows j and columns i, where j is an odd number not less than 3, i is a positive integer not less than 1, and the sum of all weights in the matrix is ​​zero. The specific structure is as follows: Figure 4 As shown in the diagram, the matrix has row ((j+1) / 2) as its middle row, where all weights are zero. The rows above and below the middle row are symmetrically distributed, with all weights of the upper rows being negative and all weights of the lower rows being positive. Furthermore, the absolute values ​​of the weights of the rows above and below the symmetrical positions are equal.

[0037] The second value is defined as the sum of the products of all weights in the lower row of the second weight matrix and the maximum gray level value. For example... Figure 4 As shown, when the second row and second column of the matrix are aligned with the target pixel, the weight values ​​G, H, and I, and their symmetric negative values ​​-G, -H, and -I, correspond to the pixels in the neighborhood window, respectively. Taking an 8-bit image as an example, the second value is 255×(G+H+I), representing the theoretical maximum value of the column feature value.

[0038] The theoretical limit of the composite feature value can be derived from the first and second values. This value comprehensively reflects the brightness gradient characteristics of the target pixel in the row and column directions.

[0039] In practical implementation, the preset upper threshold should be greater than zero and not exceed the theoretical limit of the composite feature value. This can be achieved by setting a coefficient no greater than 1 multiplied by the theoretical limit value. The preset upper threshold directly determines the strictness of edge detection: the higher the value, the stricter the edge detection standard and the higher the display accuracy, but at the same time, it will increase the computational load of the display chip; when the value is low, although the computational load is reduced, the accuracy of edge detection will decrease accordingly. Therefore, it is necessary to make targeted adjustments according to the actual edge display requirements of the product.

[0040] The preset lower threshold is also greater than zero and does not exceed the theoretical limit, and its setting method is similar to that of the upper threshold. The lower the lower threshold value, the fewer areas are judged as non-edges, and the larger the buffer area between the upper and lower thresholds is. The advantage of this buffer area design is that it can effectively suppress boundary misjudgment caused by special pixel jumps and avoid the boundary / non-boundary state alternation phenomenon commonly seen when using single threshold judgment, thereby fundamentally eliminating the display flicker problem caused by this. By reasonably setting the dual thresholds and their intermediate buffer zone, the visual stability of the display system can be significantly improved while ensuring the accuracy of edge detection.

[0041] In one feasible embodiment, the preset randomness threshold is greater than 0 and less than or equal to the randomness limit value. The randomness limit value is the state where the randomness calculation window alternates between black and white pixels. Its value is the "maximum grayscale value of the current channel" multiplied by the "number of difference calculations". The number of difference calculations is the sum of the "number of grayscale row difference calculations in the row direction" and the "number of grayscale column difference calculations in the column direction". In this embodiment, it is used to confirm the randomness limit value. Figure 5 For example, it contains 3 rows and 5 columns, totaling 15 pixels. When the randomness is at its maximum, that is... Figure 5 In the image, the areas containing "1", "3", "5", "7", "9", "11", "13", and "15" are black / white, while the remaining areas are white / black. Taking an 8-bit image as an example, the grayscale row difference and grayscale column difference are both the maximum grayscale value of 255 minus the minimum grayscale value of 0. Therefore, the image's randomness limit is 255 multiplied by the number of grayscale difference calculations, which is 22, equal to 5610. The preset randomness threshold can be set between 0 and 5610, depending on the specific display panel material, display effect, and edge computing cost.

[0042] In one feasible embodiment, the image to be processed is an RGB color image, which contains three grayscale channels: an R channel, a G channel, and a B channel, wherein: The grayscale value of the R channel is the R channel value of the pixel in the RGB color image, the grayscale value of the G channel is the G channel value of the pixel in the RGB color image, and the grayscale value of the B channel is the B channel value of the pixel in the RGB color image. As can be seen in this embodiment, this solution can perform brightness and darkness edge compensation processing on a single-channel grayscale image, and can also process color images. The processing method is to separate the color image into multiple independent color channels R, G, and B, and then perform grayscale processing on each color channel to achieve grayscale compensation for the above multiple color channels respectively.

[0043] In one feasible embodiment, for a target pixel determined to be an edge pixel, a preset grayscale compensation operation is performed in the R channel, G channel, and B channel of its corresponding RGB color image to determine the grayscale compensation value of the edge pixel in the current channel. The calculation process includes: (1) Define the grayscale ratio of the edge pixel in the current channel: the grayscale ratio is the ratio of the input grayscale value of the pixel to the maximum grayscale value of the current channel; (2) Calculate the compensation weight The compensation weight is a compensation coefficient, which is equal to the maximum grayscale value of the current channel minus the "color shift grayscale value of the colored edge in the current channel when transitioning from a pure white image to a pure black image"; (3) Calculate the eigenvalue weights; The eigenvalue weight is equal to the ratio of the composite eigenvalue to the theoretical maximum value of the composite eigenvalue, wherein the theoretical maximum value of the composite eigenvalue is the first value of the row eigenvalue and the second value of the column eigenvalue. (4) Calculate the randomness weight: The disorder weight is equal to the ratio of the preset disorder threshold to the disorder limit value.

[0044] (5) The gray level compensation value is the product of the gray level ratio in step (1) and the compensation weight in step (2), the feature value weight in step (3) and the disorder weight in step (4).

[0045] The above compensation coefficient is a reference compensation value. When the extreme edge display state is taken, the two sides of the edge are black and white. At this time, a pixel located at the edge in the row direction has a color shift phenomenon. That is, theoretically, the pixel is white, but from a visual point of view, the pixel has a color shift, that is, it is not white as seen by the eye. After the above reference compensation value is added to the pixel for compensation, the pixel will appear white from the eye. The compensation coefficient includes three grayscale compensation values ​​in the red color channel, green color channel and blue color channel respectively in the color image. In one feasible embodiment, based on the compensated pixel grayscale values ​​of all grayscale channels, an optimized image is output, including: Calculate the output grayscale value of the edge pixel in the current channel. The output grayscale value is the input grayscale value of the pixel minus the grayscale compensation value. The compensated R-channel grayscale values, G-channel grayscale values, and B-channel grayscale values ​​are recombined into pixel values ​​of the RGB color image to obtain the optimized RGB color image; In this embodiment, pixel compensation is optimized by decomposing a color image into grayscale values ​​of multiple grayscale channels, compensating the grayscale values ​​of each grayscale channel, and then restoring the pixel values ​​of the color image.

[0046] In one feasible embodiment, the image to be processed is a single-channel grayscale image, which is obtained by converting an RGB color image; the conversion process includes: For each pixel in the RGB color image, the R channel value, G channel value, and B channel value are extracted. The corresponding brightness value is calculated based on a preset brightness conversion formula. The brightness value is used as the grayscale value of the pixel in the single-channel grayscale image. At this time, the brightness information of the pixel in the channel is represented by the grayscale value. The RGB color image is proportionally converted into a single-channel grayscale image. The advantage of this is that the brightness features of the target pixel can be separated. By increasing the brightness features, the accuracy of edge detection can be improved. The brightness conversion formula is Y=a×R+b×G+c×B, where a, b, and c are weight coefficients, and a+b+c=1. In most cases, Y=0.299R+0.587G+0.114B.

[0047] Meanwhile, the present invention also provides an image edge compensation processing system, which is applied to the image edge compensation method provided above. The image edge compensation system includes: The image receiving module is used to receive the input image to be processed, which can be either a single-channel grayscale image or a color image with three color channels (RGB). The kernel construction module is used to construct groups of differential convolution kernels; The feature value calculation module is used to perform feature value calculation operations on each target pixel in each grayscale channel of the image to be processed. The disorder calculation module is used to calculate the disorder of the target pixel; The edge detection module is used to perform edge detection on target pixels within each grayscale channel; Compensation processing module: used to perform preset compensation operations on edge pixels within each grayscale channel; Image output module: Used to output an optimized image based on the compensated pixel grayscale values ​​of all grayscale channels. For single-channel grayscale images, the image output module directly outputs the compensated optimized image. For color images, the image output module will supplement the grayscale values ​​of multiple color channels to restore the optimized color image.

[0048] In one feasible embodiment, the image to be processed includes at least one grayscale channel, and each pixel in the grayscale channel has a grayscale value. The grayscale value is used to characterize the brightness information of the pixel. For a single-channel grayscale image, the grayscale value can directly express the brightness information of the pixel. For a color image, a preset brightness conversion formula can be used to convert the color image into a brightness image, and the brightness information of the pixel can be represented by the grayscale value.

[0049] In one feasible embodiment, the convolution kernel construction module is used to construct a differential convolution kernel group, which includes a first weight matrix for row direction detection and a second weight matrix for column direction detection.

[0050] In one feasible embodiment, the feature value calculation module is used to perform feature value calculation operations on each target pixel in each grayscale channel of the image to be processed: A differential convolution kernel group is constructed to determine the row neighborhood window and column neighborhood window of the target pixel. The row neighborhood window contains at least three columns (an odd number of columns) and one row, which are used to determine the degree of brightness change of the target pixel in the row direction. The column neighborhood window contains at least three rows (an odd number of rows) and one row, which are used to determine the degree of brightness change of the target pixel in the column direction. At this time, the first weight matrix is ​​multiplied and summed with the gray level values ​​of the pixels in the row neighborhood window to obtain the row feature value, which quantifies the degree of brightness change in the row direction. The second weight matrix is ​​multiplied and summed with the gray level values ​​of the pixels in the column neighborhood window to obtain the column feature value, which quantifies the degree of brightness change in the column direction.

[0051] In one feasible embodiment, the edge determination module is used to perform edge determination for target pixels within each grayscale channel: The edge determination includes: (1) Determine the neighborhood window and randomness calculation window of the target pixel; (2) Calculate the composite feature value and randomness of the target pixel, and perform edge judgment based on the following: If the absolute value of the composite feature value is not less than a preset upper threshold, then the pixel is determined to be an edge pixel in the grayscale channel. If the absolute value of the composite feature value is not greater than a preset lower threshold, then the pixel is determined to be a non-edge pixel. If the composite feature value of the target pixel is greater than a preset lower threshold and less than a threshold, then according to: If the disorder of the target pixel is greater than the preset disorder threshold, then the target pixel is an edge pixel; If not, then the target pixel is not an edge pixel.

[0052] In one feasible embodiment, the compensation processing module is used to perform a preset compensation operation on the edge pixels within each grayscale channel: If the image to be processed is an RGB color image, the grayscale compensation value is calculated independently in the R channel, G channel and B channel respectively. The output grayscale value is obtained by subtracting the grayscale compensation value from the input grayscale value. After obtaining the three output grayscale values, the grayscale values ​​of the R / G / B channels are output separately.

[0053] If the image to be processed is a single-channel grayscale image, the compensation operation is performed directly on the edge pixels of that channel; if the single-channel grayscale image is converted from an RGB color image, the edge pixel positions can be mapped to the original RGB color image, and the compensation operation is performed on each of the three channels respectively.

[0054] As is known from common technical knowledge, this invention can be implemented through other embodiments that do not depart from its spirit or essential characteristics. Therefore, the disclosed embodiments described above are merely illustrative in all respects and are not the only ones. All modifications within the scope of this invention or its equivalents are included in this invention.

Claims

1. An image edge compensation processing method, characterized in that, Includes the following steps: The system receives an input image to be processed, the image to be processed including at least one grayscale channel, each pixel in the grayscale channel having a grayscale value, the grayscale value being used to characterize the brightness information of the pixel; Construct a differential convolution kernel group, which includes a first weight matrix for row direction detection and a second weight matrix for column direction detection; For each grayscale channel of the image to be processed, perform the following operations on each target pixel within that channel: determine the row neighborhood window and column neighborhood window of the target pixel, wherein the size of the row neighborhood window is consistent with the first weight matrix, and the size of the column neighborhood window is consistent with the second weight matrix; multiply each weight value in the first weight matrix by the grayscale value of the corresponding pixel in the row neighborhood window and sum them to obtain the row feature value of the target pixel; The column feature value of the target pixel is obtained by multiplying each weight value in the second weight matrix with the gray level value of the corresponding pixel in the column neighborhood window one by one and summing them. The composite feature value of the target pixel is obtained by summing the square of the row feature value and the square of the column feature value. For each target pixel within a grayscale channel, edge detection is performed using the composite feature value; Perform a preset compensation operation on the grayscale value of edge pixels in each grayscale channel to optimize the brightness transition effect between edge pixels and adjacent pixels; Based on the compensated pixel grayscale values ​​of all grayscale channels, the optimized image is output. The edge determination includes: (1) Calculate the composite feature value of the target pixel; (2) Edge detection is performed on the target pixel based on the composite feature value, wherein the edge detection includes: If the absolute value of the composite feature value is not less than a preset upper threshold, then the pixel is determined to be an edge pixel in the grayscale channel. If the absolute value of the composite feature value is not greater than a preset lower threshold, then the pixel is determined to be a non-edge pixel. (3) When the composite feature value of the target pixel is greater than the preset lower threshold and less than the preset upper threshold, the randomness calculation window of the target pixel is determined, and the randomness calculation window includes multiple pixels adjacent to the target pixel in the row and column directions. (4) Calculate the disorder of the disorder calculation window where the target pixel is located. If its disorder is greater than the preset disorder threshold, the target pixel is determined to be an edge pixel. Otherwise, the target pixel is not an edge pixel. The calculation of the disorder includes: (1) Extract the grayscale values ​​of all pixels, including the target pixel, in the randomness calculation window; (2) For all pixels, perform gray level difference calculation in the row direction. The difference calculation is to calculate the absolute value of the difference between all adjacent gray level values ​​in the row direction as the gray level row difference. (3) Sum all the grayscale row differences to get the grayscale row difference sum; (4) For all pixels, perform gray level difference calculation in the column direction. The difference calculation is to calculate the absolute value of the difference between all adjacent gray level values ​​in the column direction as the gray level column difference. (5) Sum all the differences in the gray levels to obtain the sum of the gray level differences; (6) The randomness is obtained by summing the grayscale row difference value and the grayscale column difference value; The preset compensation operation includes determining the grayscale compensation value of the target pixel that is determined to be an edge pixel. The calculation process includes: (1) Define the grayscale ratio of the edge pixel in the current channel: the grayscale ratio is the ratio of the input grayscale value of the pixel to the maximum grayscale value of the current channel; (2) Calculate the compensation weight: The compensation weight is a compensation coefficient, which is equal to the maximum grayscale value of the current channel minus the color shift grayscale value of the colored edge in the current channel when transitioning from a pure white image to a pure black image. (3) Calculate the eigenvalue weights: The eigenvalue weight is equal to the ratio of the composite eigenvalue to the theoretical limit of the composite eigenvalue, wherein the theoretical limit of the composite eigenvalue is taken as the first value and the second value of the row eigenvalue and the column eigenvalue, respectively. The first value is defined as the sum of all weights in the right column of the first weight matrix multiplied by the maximum gray level value of the gray level channel, wherein the maximum gray level value is the theoretical maximum value of the pixel gray level value in the gray level channel, which is determined by the number of bits of image quantization. The second value is defined as the sum of all weights in the lower row of the second weight matrix multiplied by the maximum gray level value of the gray level channel. (4) Calculate the randomness weight: The randomness weight is equal to the ratio of the preset randomness threshold to the randomness limit value. The randomness limit value is the state where the randomness calculation window is alternating between black and white pixels. Its value is the maximum gray level value of the current channel multiplied by the number of times the difference is calculated. The number of times the difference is calculated is the sum of the number of times the gray level row difference is calculated in the row direction and the number of times the gray level column difference is calculated in the column direction. (5) The gray level compensation value is the product of the gray level ratio in step (1) and the compensation weight in step (2), the feature value weight in step (3) and the disorder weight in step (4).

2. The method according to claim 1, characterized in that, The preset randomness threshold value is greater than 0 and less than or equal to the randomness limit value. The randomness limit value is the state where the randomness calculation window is alternating between black and white pixels. Its value is the maximum gray level value of the current channel multiplied by the number of times the difference is calculated. The number of times the difference is calculated is the sum of the number of times the gray level row difference is calculated in the row direction and the number of times the gray level column difference is calculated in the column direction.

3. The method according to claim 1, characterized in that, The first weight matrix is ​​an m-row, n-column differential convolution kernel, where: n is an odd number not less than 3, m is a positive integer not less than 1, and the sum of all weights in the first weight matrix is ​​0; The first weight matrix uses the ((n+1) / 2)th column as the middle column, and all weights in the middle column are 0; the columns to the left of the middle column are symmetrically distributed with respect to the columns to the right of the middle column, and the weights of the left columns are all negative, while the weights of the right columns are all positive, and the absolute values ​​of the weights of the left columns and the right columns at symmetrical positions are equal. The first value is defined as the sum of all weights in the right column of the first weight matrix multiplied by the maximum gray level value of the gray level channel, wherein the maximum gray level value is the theoretical maximum value of the pixel gray level value in the gray level channel, which is determined by the number of bits of image quantization. The second weight matrix is ​​a differential convolution kernel with row j and column i, where: j is an odd number not less than 3, i is a positive integer not less than 1, and the sum of all weights in the second weight matrix is ​​0; The second weight matrix uses the ((j+1) / 2)th row as the middle row, and all weights in the middle row are 0; The rows above the middle row and the rows below the middle row are symmetrically distributed, and the weights of the upper rows are all negative, while the weights of the lower rows are all positive. The absolute values ​​of the weights of the upper rows and the lower rows at symmetrical positions are equal. The second value is defined as the sum of all weights in the lower row of the second weight matrix multiplied by the maximum gray level value of the gray level channel.

4. The method according to claim 3, characterized in that, The calculation of the preset upper threshold and the preset lower threshold includes: Calculate the theoretical limit of the composite eigenvalue, where the theoretical limit of the composite eigenvalue is when the row eigenvalue and column eigenvalue take the first and second values, respectively. Both the preset upper threshold and the preset lower threshold are greater than 0 and less than the theoretical limit value of the composite feature value.

5. The method according to claim 1, characterized in that, The image to be processed is a single-channel grayscale image, which is obtained by converting an RGB color image; the conversion process includes: For each pixel in the RGB color image, the R channel value, G channel value and B channel value are extracted, and the corresponding brightness value is calculated based on a preset brightness conversion formula. The brightness value is then used as the grayscale value of the pixel in the single-channel grayscale image. The preset brightness conversion formula is Y = a×R+b×G+c×B, where a, b, and c are weighting coefficients, and a+b+c=1.

6. The method according to claim 1, characterized in that, For a target pixel determined to be an edge pixel, a preset grayscale compensation operation is performed in the R channel, G channel, and B channel of its RGB color image to determine the grayscale compensation value of the edge pixel in the current channel.

7. An image edge compensation processing system, characterized in that, For performing any one of the methods of claims 1 to 6, comprising: An image receiving module is used to receive the input image to be processed; The kernel construction module is used to construct groups of differential convolution kernels; The feature value calculation module is used to perform feature value calculation operations on each target pixel in each grayscale channel of the image to be processed. The disorder calculation module is used to calculate the disorder of the target pixel; The edge detection module is used to perform edge detection on target pixels within each grayscale channel; Compensation processing module: used to perform preset compensation operations on edge pixels within each grayscale channel; Image output module: Used to output an optimized image based on the compensated pixel grayscale values ​​of all grayscale channels.

8. The image edge compensation processing system according to claim 7, characterized in that, The differential convolution kernel group includes a first weight matrix for row direction detection and a second weight matrix for column direction detection.

9. The image edge compensation processing system according to claim 7, characterized in that, The feature value calculation module is used to perform feature value calculation operations on each target pixel in each grayscale channel of the image to be processed, including: The row neighborhood window and column neighborhood window of the target pixel are determined. The first weight matrix is ​​multiplied and summed with the grayscale values ​​of the pixels in the row neighborhood window to obtain the row feature value. The second weight matrix is ​​multiplied and summed with the grayscale values ​​of the pixels in the column neighborhood window to obtain the column feature value. The composite eigenvalue is obtained by summing the squares of the row eigenvalues ​​and the squares of the column eigenvalues.

10. The image edge compensation processing system according to claim 7, characterized in that, The edge detection module is used to perform edge detection for target pixels within each grayscale channel, including: (1) Determine the neighborhood window and randomness calculation window of the target pixel; (2) Calculate the composite feature value and randomness of the target pixel, and perform edge judgment based on the following: If the absolute value of the composite feature value is not less than a preset upper threshold, then the pixel is determined to be an edge pixel in the grayscale channel. If the absolute value of the composite feature value is not greater than a preset lower threshold, then the pixel is determined to be a non-edge pixel. If the composite feature value of the target pixel is greater than a preset lower threshold and less than a preset upper threshold, then according to: If the disorder of the target pixel is greater than the preset disorder threshold, then the target pixel is an edge pixel; If not, then the target pixel is not an edge pixel.

Citation Information

Patent Citations

  • Brightness compensation method and system for display panel

    CN112614468A

  • Image processing apparatus, image processing method and computer program

    JP2010157877A