A row-column direction pseudo-color suppression RGBG-to-RGB sub-pixel rendering method and system
By extracting local green feature vectors from RGBG images and calculating attention weights, combined with green component gradient judgment, the false color suppression in the RGBG to RGB conversion process is optimized, solving the false color problem and improving the visual clarity and processing efficiency of the image.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- ZHONGYIN MICROELECTRONICS NANJING CO LTD
- Filing Date
- 2026-05-08
- Publication Date
- 2026-07-28
AI Technical Summary
Existing technologies cannot effectively suppress the occurrence of false colors during the RGBG to RGB conversion process, especially at image edges and in high-contrast texture areas, resulting in a decrease in visual clarity and color fidelity, as well as low processing efficiency and poor adaptability.
By acquiring RGBG format image data, extracting local green feature vectors, using an attention weight calculation network to generate a weighted sequence, performing weighted calculations to interpolate missing color components, and combining the green component gradient to determine the edge type, optimizing existing color components, and finally generating complete RGB format pixel data.
It achieves adaptive RGBG to RGB rendering, effectively suppressing false colors, preserving image edge details, and improving visual quality and processing efficiency.
Smart Images

Figure CN122473296A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of intelligent image processing, specifically to an RGBG to RGB subpixel rendering method and system for suppressing false color in the row and column directions. Background Technology
[0002] As mobile devices continue to demand higher resolutions from displays, the use of organic electro-laser display panels has become a mainstream technological trend. Currently, mainstream OLEDs employ an RGBG subpixel arrangement, presenting a checkerboard structure with alternating RG and BG pixels. When RGBG format image data is converted to the standard RGB format, false colors are easily introduced in areas such as image edges and high-contrast textures. This can lead to unnatural, extraneous color spots appearing at object edges, impairing the image's visual clarity and color fidelity.
[0003] Traditional methods employ static, rule-driven processing strategies with fixed parameters and templates, lacking adaptability to image content. When faced with complex and varied natural image content, especially edges of various directions, intensities, and types, it is difficult to balance the inherent contradiction between maintaining edge sharpness and suppressing false color smoothing. This results in problems such as ineffective suppression of false color, noise generation in smoothed areas, poor adaptability to different images, and poor processing efficiency.
[0004] In summary, there is an urgent need for an RGBG to RGB subpixel rendering method that can adaptively render based on local image features, effectively suppress false color in the row and column directions, and balance edge sharpness and algorithm adaptability. Summary of the Invention
[0005] This application provides an RGBG to RGB subpixel rendering method and system for suppressing false color in the row and column directions, which addresses the problems of existing technologies that cannot effectively suppress false color, are prone to noise in smooth areas, have poor adaptability to different images, and have poor processing efficiency.
[0006] In view of the above problems, this application provides an RGBG to RGB subpixel rendering method for suppressing false color in the row and column directions.
[0007] In a first aspect, this application provides an RGBG to RGB subpixel rendering method for suppressing false color in the row and column directions, the method comprising: Acquire source RGBG format image data, and for each target pixel in the source RGBG format image data, extract the green component sub-pixel values within a preset neighborhood centered on the target pixel to form a local green feature vector; The local green feature vector is input into the attention weight calculation network to generate an attention weight sequence for weighted calculation of the neighboring sub-pixel values of the target pixel; Based on the attention weight sequence, the values of the neighboring sub-pixels of the target pixel are weighted and calculated to interpolate the missing color component values of the target pixel. Calculate the green component gradient of the target pixel in the row and column directions, determine the edge type based on the green component gradient, calculate the existing color components of the target pixel, and obtain the optimized value of the existing color components. The missing color component value and the existing optimized color component value are combined to generate the final RGB format pixel data for the target pixel position.
[0008] Secondly, the present invention provides an RGBG to RGB subpixel rendering system for suppressing false color in the row and column directions, comprising: The image data acquisition module is used to acquire source RGBG format image data, and for each target pixel in the source RGBG format image data, extract the green component sub-pixel values in a preset neighborhood centered on the target pixel to form a local green feature vector. The attention weight calculation module is used to input the local green feature vector into the attention weight calculation network to generate an attention weight sequence for weighted calculation of the neighboring sub-pixel values of the target pixel; The missing component acquisition module is used to perform weighted calculation on the neighboring sub-pixel values of the target pixel based on the attention weight sequence, so as to interpolate and obtain the missing color component value of the target pixel. The color component optimization module is used to calculate the green component gradient of the target pixel in the row and column directions, and to determine the edge type based on the green component gradient. It also calculates the existing color components of the target pixel to obtain the optimized value of the existing color components. The pixel data generation module is used to fuse the missing color component value and the existing color component optimization value to generate the final RGB format pixel data of the target pixel position.
[0009] One or more technical solutions provided in this application have at least the following technical effects or advantages: This application first acquires image data and extracts the green component reflecting the local structure and texture features of the image within the neighborhood of each pixel, constructing an effective local feature vector to provide a foundation for subsequent adaptive processing. Second, it analyzes the local green feature vector using a neural network model, dynamically and adaptively calculating the attention weight that best matches the content of the current pixel's neighborhood. This allows subsequent weighted calculations to be optimized based on local image features, achieving accurate interpolation and effectively suppressing false color in specific directions. Third, it performs weighted fusion of existing sub-pixel values of the same color within the neighborhood, overcoming the drawback of traditional linear interpolation that easily leads to blurred edges, selecting the most suitable contributing pixel, reconstructing missing color information, and reducing color defects caused by improper interpolation. Furthermore, by calculating the green gradient in the row and column directions, it accurately identifies the edge type of the current pixel, achieving adaptive optimization and eliminating color stripes along the edges. Finally, it combines the missing color component obtained by intelligent interpolation with the optimized values of the existing color components after edge adaptive optimization to obtain complete RGB pixel data.
[0010] In summary, a complete RGB format pixel value containing red, green, and blue channels is generated for each target pixel location. This ensures the integrity and consistency of color information, achieving a high-quality conversion from RGBG data to full-resolution RGB data. It realizes sub-pixel rendering based on image content adaptation, achieving a comprehensive technical effect of effectively suppressing false color in row and column directions, preserving image edge details, and improving overall visual quality. Attached Figure Description
[0011] Figure 1 This is a flowchart illustrating an RGBG to RGB subpixel rendering method for suppressing false color in the row and column directions, as described in this application.
[0012] Figure 2 This is a schematic diagram of the structure of an RGBG to RGB subpixel rendering system for suppressing false color in the row and column directions, as described in this application.
[0013] In the attached diagram, the components represented by each number are as follows: Image data acquisition module 11; attention weight calculation module 12; missing component acquisition module 13; color component optimization module 14; pixel data generation module 15. Detailed Implementation
[0014] This application provides an RGBG to RGB subpixel rendering method that suppresses false color in the row and column directions. By completing missing parts, it solves the problems of ineffective suppression of false color, easy generation of noise in smooth areas, poor adaptability to different images, and poor processing efficiency.
[0015] The present invention will now be described in detail with reference to the accompanying drawings.
[0016] Example 1, as Figure 1 As shown, this application provides an RGBG to RGB subpixel rendering method for suppressing false color in the row and column directions, the method comprising: S10: Acquire source RGBG format image data, and for each target pixel in the source RGBG format image data, extract the green component sub-pixel values within a preset neighborhood centered on the target pixel to form a local green feature vector; In this embodiment, the source RGBG format image data refers to the original data format of the input image; the target pixel refers to the source image pixel position that is currently being processed and needs to be converted from RGBG format to full RGB format. The processing traverses every pixel position in the image; the preset neighborhood refers to a specific range of pixel regions surrounding the target pixel; the green component sub-pixel value refers to the brightness or intensity value of the green sub-pixel that every pixel must contain in the RGBG format.
[0017] Specifically, the original RGBG interleaved image data is read. Then, each pixel position, i.e., the target pixel, is iteratively processed. A fixed-size region is defined centered on the target pixel coordinates. This region is traversed, and the values of the green sub-pixels carried by each pixel are collected. The collected green sub-pixel values are arranged in a predetermined order to form a local green feature vector.
[0018] Step S10 in the method provided in this application embodiment includes: The target pixel is determined to be either an RG type pixel or a BG type pixel; Centered on the target pixel, select the green component sub-pixel value within a preset neighborhood. The preset neighborhood is a 3×3 pixel area that includes the target pixel and its adjacent pixels. The obtained green component sub-pixel values are used as local green feature vectors.
[0019] In this embodiment, the target pixel is first determined to be either an RG-type pixel or a BG-type pixel. An RG-type pixel refers to a physical pixel unit represented by the target pixel consisting of red and green sub-pixels, lacking blue sub-pixels; a BG-type pixel refers to a physical pixel unit represented by the target pixel consisting of blue and green sub-pixels, lacking red sub-pixels. Depending on whether the starting pixel of the source image is RGBG or BGRG, the rendering method for sub-pixels at different coordinate positions differs. Furthermore, RGBG format images physically employ an alternating structure of RG and BG sub-pixel pairs. Before processing each pixel, the pixel type must be clearly defined, as the pixel type determines the subsequent missing component interpolation process and optimization strategy.
[0020] Based on the preset arrangement rules, the spatial coordinates of the target pixel in the entire image, namely the row coordinate j and the column coordinate i, are analyzed to identify and determine whether the pixel belongs to the RG type or the BG type. Taking the top left corner of the image as the origin (0,0), the coordinates of the target pixel are calculated by taking the modulo operation. If the sum of the row number and the column number is even, the target pixel is an RG type pixel; otherwise, if the sum of the row number and the column number is odd, the target pixel is a BG type pixel.
[0021] For example, the source RGBG image being processed has a starting pixel (0,0) of type RG. According to the rules, if the calculation result of pixel (0,0) is 0, it is determined to be an RG type pixel; if the calculation result of pixel (0,1) is 1, it is determined to be a BG type pixel.
[0022] Next, focusing on the target pixel, select the green component sub-pixel values within a preset neighborhood. The preset neighborhood is a 3×3 pixel area containing the target pixel and its neighboring pixels. After determining the type of the target pixel, collect local information for analysis. Expand a square area by one pixel to the top, bottom, left, and right of the target pixel's coordinates. Form a 3×3 preset neighborhood by including four directly adjacent pixels and pixels along the four diagonals. Traverse each pixel within the 3×3 pixel area, extracting the green (G) sub-pixel values and arranging them according to a fixed spatial order, i.e., row priority: from left to right, arrange all G values in the first row, then the second row, and finally the third row. This transforms the 3×3 pixel area into a feature vector with 9 elements, i.e., a local green feature vector.
[0023] Since the human eye is most sensitive to the green component, and the green component contains the main brightness information of an image, its spatial variations best reflect the structural features of the image, such as edges and textures. Therefore, focusing on analyzing the G component is an efficient and effective feature extraction strategy.
[0024] In this embodiment, pixel types are clearly distinguished to facilitate subsequent data processing; extracting green sub-pixels reduces the amount of data and improves computational efficiency; at the same time, it provides high-quality input for attention mechanisms and edge detection; converting two-dimensional neighborhood data into one-dimensional vectors is a widely used method for machine learning input preprocessing, which facilitates the subsequent reception and processing of local features from any location in the image in a unified manner.
[0025] S20: Input the local green feature vector into the attention weight calculation network to generate an attention weight sequence for weighted calculation of the neighboring sub-pixel values of the target pixel; In this embodiment, the attention weight calculation network is a trained neural network model; the attention weight sequence is the network output value, and each weight value in the sequence corresponds to a sub-pixel value of a specific position and a specific color channel in the neighborhood of the target pixel.
[0026] Specifically, after obtaining the local green feature vector of the target pixel, it is input into the attention weight calculation network to perform in-depth nonlinear analysis and output the weight values corresponding one-to-one with the neighboring sub-pixels, which determine the proportion of the missing color component in the target pixel during interpolation calculation.
[0027] In step S20 of the method provided in this application embodiment, the construction step of the attention weight calculation network includes: Collect a sample RGB image set, and convert each sample RGB image in the sample RGB image set into RGBG format to obtain a sample RGBG image set; For each sample pixel in the sample RGBG image set, the green component sub-pixel values of a preset neighborhood are extracted to form a sample local green feature vector set; Based on the standard subpixel rendering algorithm, each pixel and its neighboring subpixel values in the sample RGBG image set are processed to obtain multiple sets of standard neighboring subpixel contribution weights, which constitute a sample attention weight sequence set. Using the local green feature vector set of the sample as input and the attention weight sequence set of the sample as supervision, the neural network model is trained until convergence, thus obtaining the attention weight calculation network.
[0028] In this embodiment, a sample RGB image set is first acquired, and each sample RGB image in the sample RGB image set is converted into RGBG format to obtain a sample RGBG image set. Here, the sample RGB image set refers to the original dataset used to train the attention weight calculation network; acquisition involves collecting and organizing high-quality RGB images through public databases or other means; conversion to RGBG format refers to using a specific sub-pixel arrangement simulation algorithm to degrade or adapt each standard RGB image into RGBG format.
[0029] Specifically, a representative standard RGB image library is constructed as a standard. Then, for each image in the library, a defined RGB-to-RGBG conversion model is used to simulate the physical characteristics of the target display panel: for each pixel position in the image, based on its coordinates and a preset arrangement rule, it is determined whether the position is of type RG or BG. For RG positions, its original B component value is discarded, and R and G are retained; for BG positions, its original R component value is discarded, and B and G are retained. Finally, a set of RGBG images corresponding to the original RGB image content but with incomplete data is obtained, simulating the original data format received by the display driver chip in the real world.
[0030] For example, a standard RGB landscape image with a resolution of 1920×1080 is selected from a public dataset as a sample. Each pixel in this image has complete R, G, and B values. The simulated permutation is set to Pentile permutation, and the starting pixel (0,0) is of type RG. Iterating through each pixel coordinate (j,i) of the image, the three values of each pixel in the original RGB image are reduced to two values, RG / BG. This operation is repeated for all images in the dataset to obtain the sample RGBG image set.
[0031] Secondly, for each sample pixel in the sample RGBG image set, the green component sub-pixel values of the preset neighborhood are extracted to form a sample local green feature vector set.
[0032] Here, sample pixel refers to each pixel position in the sample RGBG image set; preset neighborhood usually refers to a fixed-size region centered on the current sample pixel; extraction is to read the value of the green (G) component of each pixel position in the preset neighborhood; sample local green feature vector is a vector composed of the G values of its neighborhood for a single sample pixel; sample local green feature vector set is the set of local green feature vectors corresponding to all sample pixels, which is the input feature dataset for training the network.
[0033] Specifically, input features are constructed for each training sample. For each image in the sample RGBG image set, every pixel position is traversed. For each sample pixel, a neighborhood of a predetermined size is defined centered on its coordinates. Then, the green sub-pixel values of all pixels within the neighborhood are collected and organized into a one-dimensional feature vector, namely the sample local green feature vector. This set of sample local green feature vectors is then integrated and used as input data for subsequent neural network learning.
[0034] Next, based on the standard subpixel rendering algorithm, each pixel and its neighboring subpixel values in the sample RGBG image set are processed: For each pixel in the sample RGBG image, the standard algorithm uses the pixel and all its subpixel values within a preset neighborhood as input. Through numerical optimization methods, it calculates the contribution ratio of each subpixel in the neighborhood to the final output RGB value. The ratio usually satisfies normalization constraints and is organized into a one-dimensional sequence in a preset order to obtain multiple sets of standard neighborhood subpixel contribution weights corresponding to the sample pixel. This process is repeated for all sample pixels, and all sequences are summarized to form a sample attention weight sequence set.
[0035] Specifically, the standard subpixel rendering algorithm is a subpixel rendering algorithm that provides high-quality rendering results; the standard neighborhood subpixel contribution weight is a set of values output by the standard algorithm for a given sample pixel, where each value represents the ideal weight that should be assigned to the subpixel value of a specific position and a specific color channel in its neighborhood when rendering the pixel; the sample attention weight sequence is a sequence of standard weights corresponding to a sample pixel.
[0036] For example, complete RGB neighborhood information is input into a selected standard subpixel rendering algorithm to calculate weights. The resulting sample attention weight sequences are sorted and then integrated to form a sample attention weight sequence set.
[0037] Finally, the neural network model is trained using the local green feature vector set of the samples as input and the attention weight sequence set of the samples as supervision until convergence, resulting in the attention weight calculation network. The neural network model refers to the network model architecture to be trained; the input layer dimension must match the length of the local green feature vector, and the output layer dimension must match the length of the attention weight sequence.
[0038] Specifically, a backpropagation (BP) neural network can be used to construct an attention weight calculation network to predict the direction of output parameter adjustment. The BP neural network model is a type of feedforward neural network that is trained through error backpropagation and is commonly used to predict continuous values.
[0039] For example, the steps to construct an attention weight calculation network based on a BP neural network are as follows: First, data preparation is performed. The local green feature vector set of the samples is used as input, and the sample attention weight sequence set is used as supervision to train the neural network model. The set is divided into training set and validation set in a 7:3 ratio.
[0040] Next, the model was built. It mainly consists of an input layer, a hidden layer, and an output layer. The input layer receives the local green feature vector set of the sample; the hidden layer uses the sample attention weight sequence set as the supervision label and performs nonlinear transformation through an activation function; the output layer outputs the predicted attention weight values.
[0041] Next, model training is performed. The sample feature vector set is used as input data, and the sample standard weight sequence set is used as label data. The constructed neural network model maps from the sample feature vector set to the sample standard weight sequence set. In each training loop, a small batch of sample feature vector data is input into the network, and the network forward propagates to generate predicted output standard weight values. Then, the loss between the predicted standard weight values and the corresponding true labels is calculated. Using the backpropagation algorithm, the gradient of the loss with respect to all network parameters is calculated, and the Adam optimizer is used to calculate the error between the predicted result and the true label using the mean squared error function. Weight adjustments are made and calculations are repeated iteratively until the error is minimized. Parameters are generated through forward propagation and updated through backpropagation. After each training epoch, performance is evaluated using a validation set to avoid overfitting. The goal is to achieve a minimum MSE loss of <1e for five consecutive training epochs. -5 When the MSE loss on the validation set stabilizes below 0.01, the model is considered converged, and the attention weight calculation network is obtained. The final model has the ability to intelligently infer rendering weights based on local green features.
[0042] For example, for each target pixel, the values of all green sub-pixels within a 3×3 neighborhood centered on it are extracted to form a local green feature vector, which encodes the structural information of the current pixel's context. This feature vector is then input into a lightweight attention weight computation network, which, after training, outputs a sequence of attention weights corresponding to the positions of each color sub-pixel in the neighborhood.
[0043] In this embodiment, the sample RGB image set is converted into a sample RGBG image set to simulate training data with missing data. A high-quality sample attention weight sequence set is generated for each sample using a standard subpixel rendering algorithm, providing high-quality data input for the neural network. Compared to manually designing fixed formulas, this method is highly automated and allows for continuous optimization. Ultimately, it provides adaptive computational data for subsequent interpolation and optimization, improving the rendering algorithm's adaptability to different rendering objects and enhancing the quality of image optimization.
[0044] S30: Based on the attention weight sequence, the values of the neighboring sub-pixels of the target pixel are weighted and calculated to interpolate the missing color component values of the target pixel; In this embodiment, interpolation is the process of estimating new data points between discrete data. It uses known and complete sub-pixel information around the target pixel to infer the value of the missing color channel of the target pixel itself through calculation. The missing color component value is that each RGBG pixel is naturally missing a primary color, where RG type pixels are missing the blue component and BG type pixels are missing the red component.
[0045] Specifically, based on the type of the target pixel, it is determined whether the interpolation needs to be performed on the blue or red component. Then, depending on the computational requirements, all sub-pixel values of the same color that can be used to calculate the missing component are selected from the complete neighborhood data. Finally, a weighted calculation is performed to calculate the blue component value interpolated from the target pixel.
[0046] Step S30 in the method provided in this application embodiment includes: If the target pixel is an RG type pixel, it is missing a blue component. The weights corresponding to the positions of blue sub-pixels in the adjacent rows of the target pixel are selected from the attention weight sequence, and the values of the blue sub-pixels in the adjacent rows are weighted and summed to obtain the missing blue component value. If the target pixel is a BG type pixel, then it lacks a red component. The weights corresponding to the positions of red sub-pixels in the adjacent rows of the target pixel are selected from the attention weight sequence, and the values of the red sub-pixels in the adjacent rows are weighted and summed to obtain the value of the missing red component.
[0047] In this embodiment, firstly, if the target pixel is an RG-type pixel, it lacks a blue component. Weights corresponding to the positions of blue sub-pixels in adjacent rows of the target pixel are selected from the attention weight sequence. The values of the blue sub-pixels in adjacent rows are then weighted and summed to obtain the missing blue component value. The blue sub-pixel position refers to the specific coordinates of a BG-type pixel within the neighborhood of the RG-type target pixel, carrying blue sub-pixel information.
[0048] The weighted summation involves multiplying each selected blue sub-pixel value by its corresponding weight obtained from the attention weight sequence, and then summing all the products to obtain a weighted sum. The missing blue component value is obtained by normalization, which yields the blue channel value calculated for interpolation of RG-type target pixels.
[0049] Specifically, based on the pixel coordinates, the image is determined to be of type RG, clearly indicating the need to calculate the missing blue component. Next, weights corresponding to the blue sub-pixel positions are selected from the attention weight sequence. The four selected blue sub-pixel positions are input into the attention weight calculation network to obtain the corresponding four weight values, w1, w2, w3, and w4. Simultaneously, the blue sub-pixel values B(j,i-1), B(j+1,i), B(j,i+1), and B(j-1,i) at the four positions are read from the source RGBG image data. Then, a weighted calculation is performed: Weighted sum = w1×B(j,i-1) + w2×B(j+1,i) + w3×B(j,i+1) + w4×B(j-1,i). Finally, the weighted sum is used as the blue component value derived from the pixel through intelligent inference.
[0050] For example, the target pixel P is an RG-type pixel located at coordinates (5,10). According to the rules, the missing blue component needs to be calculated using the blue sub-pixels at the following four positions in the neighborhood: B(5,9), B(6,10), B(5,11), and B(4,10). In the weight sequence obtained from the attention weight calculation network, the weights corresponding to the four positions are: w1=0.1, w2=0.4, w3=0.1, and w4=0.4. Assuming the four blue values are read as: B(5,9)=30, B(6,10)=200, B(5,11)=35, and B(4,10)=190. Calculating the weighted sum: 0.1×30+0.4×200+0.1×35+0.4×190=162.5, then the missing blue component value B=162.5.
[0051] Secondly, if the target pixel is a BG type pixel, it lacks a red component. Weights corresponding to the positions of red sub-pixels in the adjacent rows of the target pixel are selected from the attention weight sequence. The values of the red sub-pixels in the adjacent rows are then weighted and summed to obtain the missing red component value. Here, the missing red component refers to the red channel value that needs to be supplemented in the data for this target pixel; the red sub-pixel position refers to the specific coordinates of a BG type target pixel that is itself an RG type pixel and carries red sub-pixel information within its neighborhood.
[0052] The target pixel is determined to be of type BG. Based on preset rules, a set of neighboring sub-pixels participating in the red component interpolation is identified; these are the four red sub-pixels located at specific coordinates in adjacent rows. Then, the set is input into an attention weight calculation network. From the attention weight sequence output by the network, four corresponding weight values are obtained, and the values of the four red sub-pixels are read. A weighted calculation is performed: Weighted sum = w1×R(j,i-1) + w2×R(j+1,i) + w3×R(j,i+1) + w4×R(j-1,i). The final weighted sum is the red component value intelligently inferred for that pixel. Note that w1, w2, w3, and w4 have different weights than the blue component values, representing different numerical values.
[0053] For example, the target pixel P is a BG-type pixel located at coordinates (5,11). According to the rules, the missing red component needs to be calculated using the red sub-pixels at the following four positions in the neighborhood: R(5,10), R(6,11), R(5,12), and R(4,11). The current target pixel is input into the attention weight calculation network to calculate the attention weight sequence, and the corresponding weights are selected as follows: w5=0.3, w6=0.2, w7=0.3, w8=0.2. Assuming that the four red values are read as follows: R(5,10)=180, R(6,11)=50, R(5,12)=185, and R(4,11)=65, the weighted sum is calculated as: 0.3×180+0.2×50+0.3×185+0.2×65=132.5. Therefore, the missing red component value R=132.5.
[0054] In this embodiment, to address the issue of missing blue in RG-type pixels and missing red in BG-type pixels, a weighted sum is performed by selecting weights from the attention weight sequence that match the positions of the corresponding color sub-pixels in adjacent rows. In smooth regions, the weights are evenly distributed, achieving a natural transition; in edge regions, the network spontaneously assigns high weights to pixels on the same side of the edge, effectively avoiding borrowing incompatible color information from the other side of the edge. While completing the color, pseudo-color suppression at the source is achieved, improving interpolation quality and ensuring processing efficiency.
[0055] S40: Calculate the green component gradient of the target pixel in the row and column directions, and determine the edge type based on the green component gradient. Calculate the existing color components of the target pixel to obtain the optimized value of the existing color components. In this embodiment, the green component gradient refers to the rate of change of the green (G) component value in space; the edge type judgment is to classify the region type of the target pixel based on the calculated relationship between the horizontal and vertical gradients and a preset threshold; the existing color component refers to the two color sub-pixel values that the target pixel originally possesses in the RGBG format; the optimized value of the existing color component is the R, G, and B values after calculation and processing.
[0056] Edge detection is performed using the G component to quantify the severity of local changes in the horizontal and vertical directions. Then, the horizontal and vertical gradients are compared with preset thresholds, and the edge type is determined based on the comparison results.
[0057] Step S40 in the method provided in this application embodiment includes: Calculate the absolute value of the difference between the green component of the target pixel and the pixel directly below it, and use it as the gradient in the vertical direction; Calculate the absolute value of the difference between the green component of the target pixel and the pixel to its right, and use it as the horizontal gradient; If the horizontal gradient is less than a preset first threshold and the vertical gradient is greater than a preset second threshold, then the target pixel is determined to be located on a horizontal edge. The existing color components of the target pixel are then sharpened to maintain edge sharpness and suppress false color. The red or blue component value of the target pixel itself is directly used as the optimized value of the existing color components.
[0058] In this embodiment, the absolute value of the difference in green components between the target pixel and the pixel directly below it is first calculated as the vertical gradient. Here, the pixel directly below refers to the pixel in the same column as the target pixel, but with a row coordinate increased by 1. In a standard image coordinate system, this refers to the adjacent pixel directly below the target pixel. The absolute value of the green component difference is a mathematical method for calculating the difference in green channel values between two pixels. The vertical gradient, obtained through calculation, represents the intensity of the change in green brightness between the target pixel and the pixel directly below it in the column direction.
[0059] Read the green sub-pixel value G(j,i) of the current target pixel (j,i) from the source image data. Next, read the green sub-pixel value G(j+1,i) of the pixel located directly below it at position (j+1,i). Then, perform a subtraction operation d=G(j+1,i)-G(j,i) to obtain the original difference, and then take the absolute value of the difference. The absolute value of the difference is the green component gradient of the target pixel in the vertical direction. A larger gradient value indicates a more drastic color change in the vertical direction, corresponding to an edge in the horizontal direction; a smaller gradient value indicates a gentler color change in the vertical direction.
[0060] For example, the current target pixel P is located at coordinates (5,10), and its green component value G(5,10)=150. The green component value of the pixel directly below it (6,10) is G(6,10)=30. The difference d=30-150=-120. Taking the absolute value, we get the vertical gradient: g=120, which indicates that there is a significant brightness change in the vertical direction between pixels (5,10) and (6,10), and there is likely a horizontal edge.
[0061] Next, the absolute value of the difference between the green component of the target pixel and the pixel directly to its right is calculated as the horizontal gradient. The pixel directly to the right refers to the pixel in the same row as the target pixel but with a column coordinate increased by 1, with coordinates (j,i+1), and is the adjacent pixel directly to the right of the target pixel. The horizontal gradient is obtained by calculating the absolute value of the difference between the target pixel's G value G(j,i) and the pixel's G value G(j,i+1).
[0062] Read the green value G(j,i) of the target pixel (j,i) and the green value G(j,i+1) of the pixel directly to its right (j,i+1). Then calculate the difference d = G(j,i+1) - G(j,i) and obtain the absolute value g. The obtained g is the green component gradient of the target pixel in the horizontal direction. In the row direction, it is the intensity of the change in green brightness between the target pixel and the pixel to its right. The larger the gradient value, the more drastic the color change in the horizontal direction, which may correspond to a vertical edge; the smaller the gradient value, the smoother the color transition in the horizontal direction.
[0063] For example, using the target pixel P(5,10), its green component value G(5,10)=150. The green component value of the pixel directly to its right (5,11) is G(5,11)=148. Calculate the difference: d=148-150=-2. Taking the absolute value, we get the horizontal gradient g=2. The gradient value is very small, indicating that in the horizontal direction, the green brightness hardly changes from pixel (5,10) to (5,11).
[0064] Finally, if the horizontal gradient is less than the preset first threshold and the vertical gradient is greater than the preset second threshold, the target pixel is determined to be located on the horizontal edge. The existing color components of the target pixel are then sharpened to maintain edge sharpness and suppress false color. The red or blue component value of the target pixel itself is directly used as the optimized value of the existing color components.
[0065] The first preset threshold is a critical value used to determine whether the gradient in the horizontal direction is small; the second preset threshold is a critical value used to determine whether the gradient in the vertical direction is large. The setting of the two thresholds is usually based on the gradient statistics of a large number of typical RGBG images covering smooth areas, horizontal edges, vertical edges, textures, etc. In actual deployment, they can be adapted and adjusted according to the characteristics of the target panel, image resolution, and the requirements for pseudo-color suppression intensity.
[0066] Horizontal edges are a type of edge in an image, characterized by extending horizontally and abruptly changing in brightness or color vertically. From a gradient perspective, this manifests as a small horizontal gradient and a large vertical gradient. Existing color components refer to the two color sub-pixel values that a target pixel inherently possesses in the RGBG format. For RG type pixels, these are R and G; for BG type pixels, they are B and G. Sharpening enhances edge contrast by directly preserving the target pixel's existing color values without blending them with neighboring pixels.
[0067] Specifically, the horizontal and vertical gradients are compared with two preset thresholds. When the horizontal gradient is less than the first preset threshold and the vertical gradient is greater than the second preset threshold, it is inferred that the local region where the current pixel is located has continuous color in the horizontal direction, but a sharp break occurs in the vertical direction, which is a horizontal edge.
[0068] Once a horizontal edge is identified, a sharpening strategy must be applied to the existing color components. To avoid blurring the edges due to smooth blending of edge pixels, the optimized value of the existing red or blue components of the target pixel is its original value stored within the pixel itself. At a clear edge, the pixel's own color best represents the color on one side of the edge. Borrowing the color of adjacent pixels may introduce incorrect colors from the other side of the edge, resulting in false color or blurring the edge.
[0069] If the horizontal gradient is small and the vertical gradient is large, it is identified as a horizontal edge. On such edges, to maintain edge sharpness, the existing red or blue components of the target pixel are directly used with their own values to avoid blurring or incorrect colors introduced by interpolation. In other cases, it is identified as a non-horizontal edge region. To suppress false color, smoothing optimization is applied to the existing color components. Specifically, from the attention weight sequence, weights corresponding to the same color sub-pixels in the diagonal direction are selected, and a weighted sum is performed to obtain the optimized value of the existing color components.
[0070] For example, the horizontal gradient is 2 and the vertical gradient is 120. A first preset threshold is 10 and a second preset threshold is 50. Since the horizontal gradient < the first preset threshold and the vertical gradient > the second preset threshold, the target pixel P(5,10) is determined to be located at the horizontal edge. If P(5,10) is an RG-type pixel, its red component is R(5,10) = 200. According to the sharpening strategy, the optimized value of its red component is directly taken as its own value = R(5,10) = 200. This is directly used in the red channel of the final RGB pixel, without mixing with the red values of any neighboring pixels, maintaining the purity of the red on the upper side of the horizontal edge and avoiding blurring or purple artifacts caused by the mixing of dark red on the lower side.
[0071] In step S40 of the method provided in this application embodiment, the green component gradient of the target pixel in the row and column directions is calculated, and the edge type is determined based on the green component gradient. The existing color components of the target pixel are then calculated to obtain optimized values for the existing color components. The method further includes: If the horizontal gradient is greater than or equal to the preset first threshold, or the vertical gradient is less than or equal to the preset second threshold, then the target pixel is determined to be located in a non-horizontal edge region, and the existing color components of the target pixel are subjected to smoothing pseudo-color processing. The weights corresponding to the positions of sub-pixels of the same color in the neighborhood of the target pixel are selected from the attention weight sequence, and the values of the sub-pixels of the same color are weighted and summed to obtain the optimized values of the existing color components.
[0072] In this embodiment, firstly, if the horizontal gradient is greater than or equal to a preset first threshold, or the vertical gradient is less than or equal to a preset second threshold, then the target pixel is determined to be located in a non-horizontal edge region, and the existing color components of the target pixel are subjected to smoothing pseudo-color processing.
[0073] Non-horizontal edge regions are a set of regions complementary to horizontal edge regions. They include all pixel locations that do not meet the strict conditions for horizontal edges, covering a wide range, specifically including vertical edge regions, smooth regions, complex textures, and corner regions. Existing color components refer to the red or blue components inherent in the target pixel itself. Smoothing pseudo-color processing is an image processing strategy relative to sharpening. It eliminates subtle color unevenness or pseudo-color artifacts that may be caused by RGBG arrangement, image noise, or suboptimal interpolation by mixing the values of the target pixel itself with those of its neighboring sub-pixels of the same color, resulting in more natural and smooth color transitions.
[0074] Specifically, after gradient calculation, it checks whether the horizontal edge condition is met. If it is, a sharpening strategy is executed. If not, that is, when the horizontal gradient is greater than or equal to a preset first threshold and the vertical gradient is less than or equal to a preset second threshold, the current pixel is classified as a non-horizontal edge region.
[0075] Furthermore, if a region is determined to be a non-horizontal edge region, a smoothing pseudo-color processing is applied to the existing color components. This shifts the strategy from edge protection and isolation to optimization and fusion over a wider area, specifying the type of operation to be performed subsequently.
[0076] For example, with a preset first threshold of 10 and a preset second threshold of 50, a target pixel Q has a horizontal gradient of 100 and a vertical gradient of 5. The horizontal gradient is greater than or equal to the preset first threshold. Therefore, pixel Q is located in a non-horizontal edge region and requires smoothing pseudo-color processing. A target pixel R has a horizontal gradient of 3 and a vertical gradient of 8, but the vertical gradient is less than or equal to the preset second threshold. Therefore, pixel R is located in a non-horizontal edge region, a smoothing region, and also requires smoothing pseudo-color processing.
[0077] Secondly, weights corresponding to the positions of sub-pixels of the same color in the neighborhood of the target pixel are selected from the attention weight sequence, and the values of the sub-pixels of the same color are weighted and summed to obtain the optimized values of the existing color components.
[0078] Based on the type of the target pixel, the color components to be optimized are determined. Then, after determining the set of sub-pixels to participate in the calculation, the dynamic weights of the target pixels are obtained through preset indices. The sub-pixel values at the corresponding positions in the source image are read, and weighted summation and normalization are performed with the selected weights to execute intelligent smoothing.
[0079] In step S40 of the method provided in this application embodiment, weights corresponding to the positions of sub-pixels of the same color in the neighborhood of the target pixel are selected from the attention weight sequence, and the values of the sub-pixels of the same color are weighted and summed to obtain the optimized value of the existing color components, including: If the target pixel is an RG type pixel, then select the weights corresponding to the positions of the red sub-pixels in the four diagonal directions (top left, top right, bottom left, and bottom right) from the attention weight sequence, and sum the weighted values of the red sub-pixels in the four diagonal directions to obtain the optimized value of the red component. If the target pixel is a BG type pixel, then the weights corresponding to the positions of the blue sub-pixels in the four diagonal directions of the upper left, upper right, lower left, and lower right are selected from the attention weight sequence, and the values of the blue sub-pixels in the four diagonal directions are weighted and summed to obtain the optimized value of the blue component.
[0080] In this embodiment, if the target pixel is an RG-type pixel, weights corresponding to the positions of the red sub-pixels in the four diagonal directions (top left, top right, bottom left, and bottom right) are selected from the attention weight sequence. The values of the red sub-pixels in the four diagonal directions are then weighted and summed to obtain the optimized red component value. Here, the corresponding weights refer to the four weight values pre-corresponding to the four specific diagonal red sub-pixel coordinates in the attention weight sequence, reflecting the importance of the red information in the corresponding directions in the current smoothing process. The weighted summation involves multiplying the red sub-pixel values at the four positions by the corresponding weights selected from the attention weight sequence, and then adding the four products together.
[0081] The red components of the RG-type pixels along the four diagonal directions are selected to balance the information in the horizontal and vertical directions. The red sub-pixel values at the four diagonal positions in the source image are read, and the current target pixel is input into the attention weight calculation network to calculate the attention weight sequence. The corresponding weights are then selected for weighted calculation. The calculation is as follows: Weighted sum = w9 × R(j-1, i-1) + w 10 ×R(j-1,i+1)+w 11 ×R(j+1,i-1)+w 12 ×R(j+1,i+1). The final optimized value for the red component is obtained.
[0082] For example, target pixel T is an RG-type pixel located at coordinates (5,6), which has been determined to be located in a non-horizontal edge region, with its own red component R(5,6)=128. The positions of the four diagonal red pixels are determined: (4,5), (4,7), (6,5), (6,7). These positions are confirmed to be RG-type pixels with red values. The corresponding weights are read from the attention weight sequence: 0.26, 0.24, 0.25, 0.25. The red values are read: R(4,5)=126, R(4,7)=130, R(6,5)=127, R(6,7)=129. The weighted sum is 0.26×126+0.24×130+0.25×127+0.25×129=127.96. The optimized red component value is approximately 127.96.
[0083] If the target pixel is a BG type pixel, then weights corresponding to the blue sub-pixel positions in the four diagonal directions (top left, top right, bottom left, and bottom right) are selected from the attention weight sequence. The values of these four diagonal blue sub-pixels are then weighted and summed to obtain the optimized blue component value. Similarly, pixels in the four diagonal directions of the target pixel are selected. Since the diagonal pixels are BG type, a blue (B) component is provided for blending; subsequently, four corresponding weight values are indexed from the attention weight sequence. These weights are then weighted, summed, and normalized to calculate the optimized blue component value.
[0084] For example, target pixel U is a BG-type pixel located at coordinates (5,7), which has been determined to be located in a non-horizontal edge region. Its own blue component B(5,7)=80. The current target pixel is input into the attention weight sequence of the attention weight calculation network, and the corresponding weights are selected for weighted calculation. The dynamic weights are obtained as 0.3, 0.2, 0.3, 0.2. The blue values are read as follows: B(4,6)=78, B(4,8)=82, B(6,6)=79, B(6,8)=81. The weighted sum is 0.3×78+0.2×82+0.3×79+0.2×81=79.7, and the optimized value of the blue component is 79.7.
[0085] In step S40 of the method provided in this application embodiment, calculating the existing color components of the target pixel to obtain optimized values for the existing color components further includes: Obtain the preset green mixing coefficient; Using the green mixing coefficient, the values of green sub-pixels at preset positions in the neighborhood of the target pixel are weighted and summed to obtain the optimized value of the green component of the target pixel.
[0086] In this embodiment, a preset green blending coefficient is first obtained. This green blending coefficient is used to weight and sum multiple green sub-pixel values. The setting of this coefficient is primarily based on the sampling characteristics of the green channel in the RGBG arrangement and the sensitivity of human vision: since green sub-pixels have the highest density and contribute most of the brightness information, a strategy of prioritizing the green of the target pixel itself while appropriately fusing neighboring similar color information is typically adopted to balance edge preservation and smooth transition. Specific values can be obtained by evaluating various coefficient combinations on a standard image set.
[0087] Specifically, when processing the existing color components of a target pixel, in addition to the red or blue components needing to be sharpened or smoothed according to the edge type, the green component inherent in the RGBG pixel also needs to be optimized through appropriate mixing to enhance smoothness or make fine adjustments at the edges to better match with other color components.
[0088] Secondly, a green blending coefficient is used to weight and sum the values of green sub-pixels at preset positions in the neighborhood of the target pixel to obtain the optimized green component value of the target pixel. Here, the preset positions in the neighborhood of the target pixel refer to predefined specific coordinate positions, and the green sub-pixel values at these preset positions will participate in the blending calculation. The preset positions include the target pixel itself (j, i), the pixel directly to the right of the target pixel (j, i+1), and the pixel directly below the target pixel (j+1, i); the green sub-pixel values refer to the values of the green channel at the preset positions in the source RGBG image data.
[0089] Specifically, after obtaining the preset green blending coefficient and determining the preset neighborhood position, the green value of the target pixel itself, the green value of the pixel directly to its right, and the green value of the pixel directly below it are sequentially read from the source image buffer. The optimized green component value of the target pixel is then calculated according to the formula G=g0×G0+g1×G1+g2×G2, and used for the subsequent combination of the final RGB pixel data.
[0090] For example, target pixel P is an RG-type pixel located at coordinates (5,10), with its own green component G(5,10)=150. The green component of the pixel directly to its right (5,11) is G(5,11)=148. The green component of the pixel directly below it (6,10) is G(6,10)=30. The preset green blending coefficients are: 0.5, 0.3, 0.2. Then the optimized green component value is calculated as follows: G=0.5×150+0.3×148+0.2×30=125.4. The optimized green value (125) is closer to the green brightness (150) on the upper edge.
[0091] In this embodiment, by calculating the green gradient in the row and column directions and comparing thresholds, precise identification and differentiated processing of specific sensitive scenes at horizontal edges are achieved. At horizontal edges, an extreme sharpening strategy is adopted to eliminate the possibility of false color caused by cross-edge color mixing while maintaining absolute edge sharpness. For all other scenes, an attention-weighted intelligent smoothing strategy is enabled, which effectively suppresses false color in smooth areas and maintains structure in complex areas by weighted fusion of sub-pixels of the same color in the diagonal direction. In addition, the green component is processed by mixing at fixed positions using preset coefficients, minimizing computational complexity while ensuring a uniform transition of the green channel. Through the above precise branch judgment, the strongest protection is implemented at horizontal edges, intelligent smoothing is implemented in a wide range of areas, and the green channel is processed in a simplified manner. Ultimately, with limited hardware resources, the optimal balance between visual clarity and color purity of existing color components is achieved.
[0092] S50: Fuse the missing color component value and the existing color component optimization value to generate the final RGB format pixel data of the target pixel position.
[0093] In this embodiment, RGB format pixel data is standard image data where each pixel contains complete and independent 8-bit values for R, G, and B. The calculated three values are combined in standard RGB order to output the [R, G, B] data corresponding to the current target pixel position in the image.
[0094] Step S50 in the method provided in this application embodiment includes: If the target pixel is an RG type pixel, then the missing blue component value, the red component optimization value and the green component optimization value in the existing color component optimization values are combined to generate the RGB format pixel data; If the target pixel is a BG type pixel, then the missing red component value, the blue component optimization value and the green component optimization value in the existing color component optimization values are combined to generate the RGB format pixel data.
[0095] In this embodiment, if the target pixel is an RG-type pixel, the missing blue component value, the optimized red component value from the existing optimized color component values, and the optimized green component value are combined to generate RGB format pixel data. The combination involves packaging or arranging the three independent color channel values R, G, and B belonging to the same pixel in the order of standard RGB image data format to form a complete triplet. The RGB format pixel data is the result of the combination operation, containing pixel data units with complete R, G, and B channel values, which can be directly used to drive traditional RGB displays or as input for subsequent image processing.
[0096] Specifically, after calculating the color channel values R, G, and B, the RG-type pixel obtains the final values for the three color channels: the red channel R, obtained through adaptive optimization of the existing red component; the green channel G, obtained through optimization of the existing green component using fixed rules; and the blue channel B, obtained through interpolation from the neighborhood. The calculated results are combined to form a (R, G, B) triplet, corresponding to the final converted RGB pixel data at the location of the RG-type pixel in the source image.
[0097] For example, the target pixel P is an RG-type pixel located at coordinates (5,10). After interpolation, its missing blue component value B=162.5 is obtained. Edge detection shows that since the horizontal gradient is 2 and the vertical gradient is 120, the horizontal edge condition is met, and sharpening is applied. The optimized value R for the red component is directly taken as R(5,10)=200. After green component optimization calculation, the optimized value G=125 is obtained. Combining the three component values: R=200, G=125, B=162.5, the final RGB format pixel data is generated as (200,125,162.5).
[0098] If the target pixel is a BG type pixel, then the missing red component value, the blue component optimization value from the existing color component optimization value, and the green component optimization value are combined to generate RGB format pixel data.
[0099] Specifically, for BG type pixels: the missing red component R is completed by interpolation, the existing blue component B is optimized by edge adaptation, and the existing green component G is optimized by a fixed-rule process. The three values (R, G, B) are combined in RGB order to form the complete RGB output data corresponding to the position of the BG type pixel.
[0100] For example, target pixel Q is a BG-type pixel located at coordinates (5, 11). After interpolation, its missing red component value is R = 130.5. The gradient determination result indicates it is a non-horizontal edge region. Therefore, after smoothing pseudo-color processing, attention weights are used to weight and sum the diagonal blue sub-pixels, resulting in an optimized blue component value B = 79.7. After green component optimization calculation, the optimized green component value G = 127.97 is obtained. After rounding and combining, we get: R = 131, G = 128, B = 80. Therefore, the final RGB format pixel data for this location is (131, 128, 80).
[0101] In this embodiment, based on the pixel type, the three color channel values obtained through intelligent interpolation and adaptive optimization are correctly combined to generate standard RGB format pixel data. By fusing RGB format pixel data, it is ensured that all component values generated by complex calculations are combined into complete pixel data. A standardized output interface is provided, forming a processing flow for the rendering of each pixel from feature analysis and intelligent decision-making to final synthesis.
[0102] The embodiments of this application, through the above specific implementation methods, achieve the following technical effects: In this embodiment, pixel types are clearly distinguished first to facilitate subsequent data processing; extracting green sub-pixels reduces the amount of data and improves computational efficiency; it also provides high-quality input for attention mechanisms and edge detection; converting two-dimensional neighborhood data into one-dimensional vectors is a widely used method for machine learning input preprocessing, which facilitates the subsequent reception and processing of local features from any location in the image in a unified manner. Secondly, the sample RGB image set is transformed into a sample RGBG image set to simulate training data with missing data. A high-quality sample attention weight sequence set is generated for each sample using a standard subpixel rendering algorithm, providing high-quality data input for the neural network. Compared to manually designing fixed formulas, this method is highly automated and can be continuously optimized. Ultimately, it provides adaptive computational data for subsequent interpolation and optimization, improving the rendering algorithm's adaptability to different rendering objects and enhancing the quality of image optimization.
[0103] Furthermore, to address the issue of missing blue in RG-type pixels and missing red in BG-type pixels, a weighted sum is performed by selecting weights from the attention weight sequence that match the positions of the corresponding color sub-pixels in adjacent rows. In smooth regions, the weights are evenly distributed, achieving a natural transition; in edge regions, the network spontaneously assigns high weights to pixels on the same side of the edge, effectively avoiding borrowing incompatible color information from the other side of the edge. While completing the color, pseudo-color suppression is achieved at the source, improving interpolation quality and ensuring processing efficiency.
[0104] Simultaneously, by calculating the green gradient along the row and column directions and comparing thresholds, precise identification and differentiated processing of specific sensitive scenes at horizontal edges are achieved: at horizontal edges, an extreme sharpening strategy is employed to eliminate the possibility of false color due to cross-edge color mixing while absolutely maintaining edge sharpness. For all other scenes, an attention-weighted intelligent smoothing strategy is enabled, effectively suppressing false color in smooth areas and preserving structure in complex areas through weighted fusion of sub-pixels of the same color along the diagonal direction. In addition, the green component is processed using preset coefficients for fixed-position mixing, minimizing computational complexity while ensuring a uniform transition of the green channel. Through the above precise branch judgment, the strongest protection is implemented at horizontal edges, intelligent smoothing is implemented in a wide range of areas, and the green channel is processed in a simplified manner, ultimately achieving the optimal balance between visual clarity and color purity of existing color components under limited hardware resources.
[0105] Finally, based on the pixel type, the three color channel values obtained through intelligent interpolation and adaptive optimization are correctly combined to generate standard RGB format pixel data. This RGB format pixel data fusion ensures that all component values generated by complex calculations are combined into complete pixel data. A standardized output interface is provided, forming a processing flow for each pixel's rendering, from feature analysis and intelligent decision-making to final compositing.
[0106] Example 2, as Figure 2 As shown, based on the same inventive concept as the RGBG to RGB subpixel rendering method for suppressing false color in the row and column direction provided in Embodiment 1, this embodiment of the invention also provides an RGBG to RGB subpixel rendering system for suppressing false color in the row and column direction, comprising: Image data acquisition module 11 is used to acquire source RGBG format image data, and for each target pixel in the source RGBG format image data, extract the green component sub-pixel values in a preset neighborhood centered on the target pixel to form a local green feature vector. Attention weight calculation module 12 is used to input the local green feature vector into the attention weight calculation network to generate an attention weight sequence for weighted calculation of the neighboring sub-pixel values of the target pixel; The missing component acquisition module 13 is used to perform weighted calculation on the neighboring sub-pixel values of the target pixel based on the attention weight sequence, so as to interpolate and obtain the missing color component value of the target pixel. The color component optimization module 14 is used to calculate the green component gradient of the target pixel in the row and column directions, and to determine the edge type based on the green component gradient, and to calculate the existing color components of the target pixel to obtain the optimized value of the existing color components. The pixel data generation module 15 is used to fuse the missing color component value and the existing color component optimization value to generate the final RGB format pixel data of the target pixel position.
[0107] In one embodiment, the image data acquisition module 11 is used for: The target pixel is determined to be either an RG type pixel or a BG type pixel; Centered on the target pixel, select the green component sub-pixel value within a preset neighborhood. The preset neighborhood is a 3×3 pixel area that includes the target pixel and its adjacent pixels. The obtained green component sub-pixel values are used as local green feature vectors.
[0108] In one embodiment, the attention weight calculation module 12 is used for: Collect a sample RGB image set, and convert each sample RGB image in the sample RGB image set into RGBG format to obtain a sample RGBG image set; For each sample pixel in the sample RGBG image set, the green component sub-pixel values of a preset neighborhood are extracted to form a sample local green feature vector set; Based on the standard subpixel rendering algorithm, each pixel and its neighboring subpixel values in the sample RGBG image set are processed to obtain multiple sets of standard neighboring subpixel contribution weights, which constitute a sample attention weight sequence set. Using the local green feature vector set of the sample as input and the attention weight sequence set of the sample as supervision, the neural network model is trained until convergence, thus obtaining the attention weight calculation network.
[0109] In one embodiment, the missing component acquisition module 13 is used for: If the target pixel is an RG type pixel, it is missing a blue component. The weights corresponding to the positions of blue sub-pixels in the adjacent rows of the target pixel are selected from the attention weight sequence, and the values of the blue sub-pixels in the adjacent rows are weighted and summed to obtain the missing blue component value. If the target pixel is a BG type pixel, then it lacks a red component. The weights corresponding to the positions of red sub-pixels in the adjacent rows of the target pixel are selected from the attention weight sequence, and the values of the red sub-pixels in the adjacent rows are weighted and summed to obtain the value of the missing red component.
[0110] In one embodiment, the color component optimization module 14 is used for: Calculate the absolute value of the difference between the green component of the target pixel and the pixel directly below it, and use it as the gradient in the vertical direction; Calculate the absolute value of the difference between the green component of the target pixel and the pixel to its right, and use it as the horizontal gradient; If the horizontal gradient is less than a preset first threshold and the vertical gradient is greater than a preset second threshold, then the target pixel is determined to be located on a horizontal edge. The existing color components of the target pixel are then sharpened to maintain edge sharpness and suppress false color. The red or blue component value of the target pixel itself is directly used as the optimized value of the existing color components.
[0111] The process includes calculating the green component gradient of the target pixel in the row and column directions, determining the edge type based on the green component gradient, calculating the existing color components of the target pixel to obtain optimized values for the existing color components, and further including: If the horizontal gradient is greater than or equal to the preset first threshold, or the vertical gradient is less than or equal to the preset second threshold, then the target pixel is determined to be located in a non-horizontal edge region, and the existing color components of the target pixel are subjected to smoothing pseudo-color processing. The weights corresponding to the positions of sub-pixels of the same color in the neighborhood of the target pixel are selected from the attention weight sequence, and the values of the sub-pixels of the same color are weighted and summed to obtain the optimized values of the existing color components.
[0112] Specifically, the weights corresponding to the positions of sub-pixels of the same color in the neighborhood of the target pixel are selected from the attention weight sequence, and the values of the sub-pixels of the same color are weighted and summed to obtain the optimized values of the existing color components, including: If the target pixel is an RG type pixel, then select the weights corresponding to the positions of the red sub-pixels in the four diagonal directions (top left, top right, bottom left, and bottom right) from the attention weight sequence, and sum the weighted values of the red sub-pixels in the four diagonal directions to obtain the optimized value of the red component. If the target pixel is a BG type pixel, then the weights corresponding to the positions of the blue sub-pixels in the four diagonal directions of the upper left, upper right, lower left, and lower right are selected from the attention weight sequence, and the values of the blue sub-pixels in the four diagonal directions are weighted and summed to obtain the optimized value of the blue component.
[0113] In one embodiment, the color component optimization module 14 is further configured to: Obtain the preset green mixing coefficient; Using the green mixing coefficient, the values of green sub-pixels at preset positions in the neighborhood of the target pixel are weighted and summed to obtain the optimized value of the green component of the target pixel.
[0114] In one embodiment, the pixel data generation module 15 is used for: If the target pixel is an RG type pixel, then the missing blue component value, the red component optimization value and the green component optimization value in the existing color component optimization values are combined to generate the RGB format pixel data; If the target pixel is a BG type pixel, then the missing red component value, the blue component optimization value and the green component optimization value in the existing color component optimization values are combined to generate the RGB format pixel data.
[0115] In this embodiment, the image data acquisition module 11 first clearly distinguishes pixel types to facilitate subsequent data processing; extracting green sub-pixels reduces the amount of data and improves computational efficiency; it also provides high-quality input for attention mechanisms and edge detection; converting two-dimensional neighborhood data into one-dimensional vectors is a widely used method for machine learning input preprocessing, which facilitates the subsequent reception and processing of local features from any location in the image in a unified manner. Secondly, the attention weight calculation module 12 transforms the sample RGB image set into a sample RGBG image set to simulate training data with missing data. A high-quality sample attention weight sequence set is generated for each sample using a standard subpixel rendering algorithm, providing high-quality data input for the neural network. Compared to manually designing fixed formulas, this method is highly automated and can be continuously optimized. Ultimately, it provides adaptive computational data for subsequent interpolation and optimization, improving the rendering algorithm's adaptability to different rendering objects and enhancing the quality of image optimization.
[0116] Furthermore, through the missing component acquisition module 13, for the problem of missing blue in RG type pixels and missing red in BG type pixels, weights matching the positions of corresponding color sub-pixels in adjacent rows are selected from the attention weight sequence and weighted summed. In smooth regions, the weights are evenly distributed, achieving a natural transition; in edge regions, the network can spontaneously assign high weights to pixels on the same side of the edge, effectively avoiding borrowing inconsistent color information from the other side of the edge. While completing the color, pseudo-color suppression is achieved at the source, improving interpolation quality and ensuring processing efficiency.
[0117] Simultaneously, through the color component optimization module 14, the green gradient in the row and column directions is calculated and threshold comparisons are performed, achieving accurate identification and differentiated processing for specific sensitive scenes at horizontal edges: at horizontal edges, an extreme sharpening strategy is adopted to eliminate the possibility of false color caused by cross-edge color mixing while absolutely maintaining edge sharpness. For all other scenes, an intelligent smoothing strategy based on attention weights is enabled, which effectively suppresses the false color feeling in smooth areas and maintains structure in complex areas by weighted fusion of sub-pixels of the same color in the diagonal direction. In addition, the green component is processed by mixing at fixed positions using preset coefficients, minimizing computational complexity while ensuring a uniform transition of the green channel. Through the above precise branch judgment, the strongest protection is implemented at horizontal edges, intelligent smoothing is implemented in a wide range of areas, and the green channel is processed in a simplified manner, ultimately achieving the optimal balance between visual clarity and color purity of existing color components under limited hardware resources.
[0118] Finally, the pixel data generation module 15 correctly combines the three color channel values obtained by intelligent interpolation and adaptive optimization according to the pixel type to generate standard RGB format pixel data. RGB format pixel data fusion ensures that all component values generated by complex calculations are combined into complete pixel data. A standardized output interface is provided, forming a processing flow for the rendering of each pixel from feature analysis and intelligent decision-making to final compositing.
[0119] In summary, traditional methods often employ fixed-pattern filters for interpolation and smoothing, which struggles to handle complex textures and diverse edges. This application first utilizes an attention weight calculation network to dynamically generate optimal neighboring sub-pixel contribution weights based on the image structure and texture information represented by local green feature vectors. This adapts the optimization scheme to the visual environment of the current pixel, avoiding row and column false colors caused by local features. Second, existing technologies often face the challenge of blurring edges due to smoothing false colors, while sharpening edges may exacerbate color fringing. This application determines edge types by calculating the green component gradient in the row and column directions. For specific structures such as horizontal edges, a sharpening strategy directly preserves their own color components to maintain edge sharpness; for non-edge regions, attention weights are used for smoothing optimization. This achieves differentiated processing for different image regions, eliminating color stripes along edges in specific directions while avoiding the loss of edge details.
[0120] Traditional subpixel rendering algorithms typically rely on manual experience to set weight coefficients, making it difficult to achieve global optimization. This application trains a neural network to construct a complex mapping from local image features to the optimal weight distribution. It automatically learns from data the optimal interpolation kernel and smoothing kernel suitable for RGBG conversion tasks, resulting in more accurate interpolation of missing components and optimization of existing components. Ultimately, it provides complete image data, improving the visual quality of RGBG displays and constructing a complete system from feature extraction, intelligent weight allocation, missing component reconstruction, existing component optimization to final fusion.
[0121] This invention proposes an adaptive discriminative subpixel rendering framework by combining an attention mechanism with traditional image gradient analysis. It achieves precise and adaptive suppression of pseudocolor in the row and column directions, striking a balance between edge preservation and noise smoothing. Ultimately, it provides an image quality enhancement scheme superior to existing fixed filtering methods for display devices using RGBG pixel arrangement.
Claims
1. A RGBG-to-RGB subpixel rendering method for suppressing row and column direction pseudo-color, characterized in that, The method includes: Acquire source RGBG format image data, and for each target pixel in the source RGBG format image data, extract the green component sub-pixel values within a preset neighborhood centered on the target pixel to form a local green feature vector; The local green feature vector is input into the attention weight calculation network to generate an attention weight sequence for weighted calculation of the neighboring sub-pixel values of the target pixel; Based on the attention weight sequence, the values of the neighboring sub-pixels of the target pixel are weighted and calculated to interpolate the missing color component values of the target pixel. Calculate the green component gradient of the target pixel in the row and column directions, determine the edge type based on the green component gradient, calculate the existing color components of the target pixel, and obtain the optimized value of the existing color components. The missing color component value and the existing optimized color component value are combined to generate the final RGB format pixel data for the target pixel position.
2. The method of claim 1, wherein, Extracting the green component sub-pixel values within a preset neighborhood centered on the target pixel to construct a local green feature vector includes: The target pixel is determined to be either an RG type pixel or a BG type pixel; Centered on the target pixel, select the green component sub-pixel value within a preset neighborhood. The preset neighborhood is a 3×3 pixel area that includes the target pixel and its adjacent pixels. The obtained green component sub-pixel values are used as local green feature vectors.
3. The method of claim 1, wherein, The construction steps of the attention weight calculation network include: Collect a sample RGB image set, and convert each sample RGB image in the sample RGB image set into RGBG format to obtain a sample RGBG image set; For each sample pixel in the sample RGBG image set, the green component sub-pixel values of a preset neighborhood are extracted to form a sample local green feature vector set; Based on the standard subpixel rendering algorithm, each pixel and its neighboring subpixel values in the sample RGBG image set are processed to obtain multiple sets of standard neighboring subpixel contribution weights, which constitute a sample attention weight sequence set. Using the local green feature vector set of the sample as input and the attention weight sequence set of the sample as supervision, the neural network model is trained until convergence, thus obtaining the attention weight calculation network.
4. The method of claim 1, wherein, Based on the attention weight sequence, the neighboring sub-pixel values of the target pixel are weighted and calculated to interpolate the missing color component values of the target pixel, including: If the target pixel is an RG type pixel, it is missing a blue component. The weights corresponding to the positions of blue sub-pixels in the adjacent rows of the target pixel are selected from the attention weight sequence, and the values of the blue sub-pixels in the adjacent rows are weighted and summed to obtain the missing blue component value. If the target pixel is a BG type pixel, then it lacks a red component. The weights corresponding to the positions of red sub-pixels in the adjacent rows of the target pixel are selected from the attention weight sequence, and the values of the red sub-pixels in the adjacent rows are weighted and summed to obtain the value of the missing red component.
5. The method of claim 1, wherein, Calculate the green component gradient of the target pixel in the row and column directions, determine the edge type based on the green component gradient, and calculate the existing color components of the target pixel to obtain optimized values for the existing color components, including: Calculate the absolute value of the difference between the green component of the target pixel and the pixel directly below it, and use it as the gradient in the vertical direction; Calculate the absolute value of the difference between the green component of the target pixel and the pixel to its right, and use it as the horizontal gradient; If the horizontal gradient is less than a preset first threshold and the vertical gradient is greater than a preset second threshold, then the target pixel is determined to be located on a horizontal edge. The existing color components of the target pixel are then sharpened to maintain edge sharpness and suppress false color. The red or blue component value of the target pixel itself is directly used as the optimized value of the existing color components.
6. The method of claim 5, wherein, Calculating the green component gradient of the target pixel in the row and column directions, determining the edge type based on the green component gradient, calculating the existing color components of the target pixel to obtain optimized values for the existing color components, and further including: If the horizontal gradient is greater than or equal to the preset first threshold, or the vertical gradient is less than or equal to the preset second threshold, then the target pixel is determined to be located in a non-horizontal edge region, and the existing color components of the target pixel are subjected to smoothing pseudo-color processing. The weights corresponding to the positions of sub-pixels of the same color in the neighborhood of the target pixel are selected from the attention weight sequence, and the values of the sub-pixels of the same color are weighted and summed to obtain the optimized values of the existing color components.
7. The method of claim 6, wherein, From the attention weight sequence, weights corresponding to the positions of sub-pixels of the same color in the neighborhood of the target pixel are selected. The values of these sub-pixels of the same color are then weighted and summed to obtain the optimized values of the existing color components, including: If the target pixel is an RG type pixel, then select the weights corresponding to the positions of the red sub-pixels in the four diagonal directions (top left, top right, bottom left, and bottom right) from the attention weight sequence, and sum the weighted values of the red sub-pixels in the four diagonal directions to obtain the optimized value of the red component. If the target pixel is a BG type pixel, then the weights corresponding to the positions of the blue sub-pixels in the four diagonal directions of the upper left, upper right, lower left, and lower right are selected from the attention weight sequence, and the values of the blue sub-pixels in the four diagonal directions are weighted and summed to obtain the optimized value of the blue component.
8. The method of claim 5, wherein, The calculation of the existing color components of the target pixel to obtain optimized values for the existing color components also includes: Obtain the preset green mixing coefficient; Using the green mixing coefficient, the values of green sub-pixels at preset positions in the neighborhood of the target pixel are weighted and summed to obtain the optimized value of the green component of the target pixel.
9. The method of claim 1, wherein, By fusing the missing color component values and the optimized values of the existing color components, the final RGB format pixel data for the target pixel position is generated, including: If the target pixel is an RG type pixel, then the missing blue component value, the red component optimization value and the green component optimization value in the existing color component optimization values are combined to generate the RGB format pixel data; If the target pixel is a BG type pixel, then the missing red component value, the blue component optimization value and the green component optimization value in the existing color component optimization values are combined to generate the RGB format pixel data.
10. An RGBG to RGB subpixel rendering system for suppressing false color in the row and column directions, characterized in that, The system for implementing the RGBG to RGB subpixel rendering method for suppressing false color in the row and column directions as described in any one of claims 1-9 includes: The image data acquisition module is used to acquire source RGBG format image data, and for each target pixel in the source RGBG format image data, extract the green component sub-pixel values in a preset neighborhood centered on the target pixel to form a local green feature vector. The attention weight calculation module is used to input the local green feature vector into the attention weight calculation network to generate an attention weight sequence for weighted calculation of the neighboring sub-pixel values of the target pixel; The missing component acquisition module is used to perform weighted calculation on the neighboring sub-pixel values of the target pixel based on the attention weight sequence, so as to interpolate and obtain the missing color component value of the target pixel. The color component optimization module is used to calculate the green component gradient of the target pixel in the row and column directions, and to determine the edge type based on the green component gradient. It also calculates the existing color components of the target pixel to obtain the optimized value of the existing color components. The pixel data generation module is used to fuse the missing color component value and the existing color component optimization value to generate the final RGB format pixel data of the target pixel position.