Image rendering method and device, equipment and medium

By performing pattern recognition and sub-pixel phase determination on the initial image, the problem of poor adaptability of sub-pixel rendering algorithms for OLED screens is solved, achieving simplified development and stable display effects.

CN121789592APending Publication Date: 2026-04-03RDA MICROELECTRONICS SHANGHAICO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-01-22
Publication Date
2026-04-03

AI Technical Summary

Technical Problem

Existing OLED screen subpixel rendering algorithms have poor adaptability, requiring the design of corresponding algorithm logic for different subpixel arrangement types, resulting in a cumbersome development process and unstable display effects, which affects the user's visual experience.

Method used

By performing pattern recognition on the initial image to determine whether there are non-standard patterns, determining the phase of each color sub-pixel according to the sub-pixel arrangement type of the target display screen, and performing sub-pixel interpolation calculations, an adapted processed image is generated.

Benefits of technology

It simplifies the development process, reduces the difficulty of algorithm maintenance, ensures the consistency and stability of display effects, and improves the user's visual experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121789592A_ABST
    Figure CN121789592A_ABST
Patent Text Reader

Abstract

The invention provides an image rendering method and device, equipment and a medium, and relates to the technical field of image processing. According to the method, pattern recognition is carried out on an initial image to judge whether a non-standard pattern exists or not, when it is determined that no non-standard pattern exists, sub-pixel phases of all colors are accurately determined according to the sub-pixel arrangement type of a target display screen, then sub-pixel interpolation calculation is carried out, and a processed image is obtained and output. The problem that in the prior art, a sub-pixel rendering algorithm is poor in adaptability is effectively solved, the algorithm does not need to be independently designed for different sub-pixel arrangement types, the development process is simplified, and the difficulty of follow-up algorithm maintenance is reduced; besides, the sub-pixel phase is accurately determined according to the target screen sub-pixel arrangement type, the problems of image blurring, distortion and the like caused by inaccurate phase determination in a conventional image rendering scene are avoided, the consistency and stability of the display effect are ensured, and the visual experience of a user is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of image processing technology, and in particular to an image rendering method, apparatus, device and medium. Background Technology

[0002] In the field of display technology, OLED displays have been widely used in various terminal devices due to their superior characteristics such as high brightness and wide color gamut. Compared to LCD screens, each subpixel of an OLED screen requires a separate driving circuit to control its illumination, resulting in a more complex driving circuit structure and a larger footprint. Limited by this hardware characteristic, OLED screens cannot achieve a standard RGB arrangement and must reduce the number of specific types of subpixels to lower the manufacturing complexity. To compensate for the impact of reducing the number of subpixels on display quality, subpixel rendering algorithms are used to process the displayed image.

[0003] Currently, existing subpixel rendering algorithms have poor adaptability, requiring the design of corresponding algorithm logic for different subpixel arrangement types. This not only complicates the development process but also increases the difficulty of subsequent algorithm maintenance. Furthermore, in conventional image rendering scenarios without special patterns, the rendered image is prone to blurring and distortion, making it difficult to guarantee the consistency and stability of the display effect and affecting the user's visual experience. Summary of the Invention

[0004] This application provides an image rendering method, apparatus, device, and medium to solve the problems in the prior art.

[0005] In a first aspect, this application provides an image rendering method, including:

[0006] Get the initial image;

[0007] Perform pattern recognition on the initial image to determine whether there are non-standard patterns in the initial image;

[0008] If it is determined that there are no non-standard patterns in the initial image, the phase of each color sub-pixel is determined according to the sub-pixel arrangement type of the target display screen;

[0009] Based on the phase of each color sub-pixel, sub-pixel interpolation calculation is performed on the initial image to obtain the first processed image;

[0010] The first processed image is output as the rendered image to the target display screen.

[0011] In one possible design, performing pattern recognition on the initial image to determine whether a non-standard pattern exists in the initial image includes:

[0012] The initial image is divided into at least one detection window according to a preset size;

[0013] Calculate the color difference between each adjacent pixel within the detection window;

[0014] Each color difference is compared with a preset color difference threshold to determine whether a non-standard pattern exists within the detection window.

[0015] In one possible design, comparing each of the color differences with a preset color difference threshold to determine whether a non-standard pattern exists within the detection window includes:

[0016] Obtain the target number of color differences within the detection window that are greater than the preset color difference threshold;

[0017] Calculate the target quantity as a percentage of the total number of color differences between all adjacent pixels within the detection window;

[0018] The target proportion is compared with a preset proportion threshold, and if the target proportion is greater than or equal to the preset proportion threshold, it is determined that there is a non-standard pattern in the detection window.

[0019] In one possible design, determining the phase of each color sub-pixel based on the sub-pixel arrangement type of the target display screen includes:

[0020] Based on the sub-pixel arrangement type of the target display screen, and using the phase of the standard three primary color sub-pixel arrangement type as a reference, the phase offset of each color sub-pixel in the target display screen relative to the standard three primary color sub-pixel arrangement type is determined;

[0021] The phase of each color sub-pixel of the target display screen is determined based on the phase offset.

[0022] In one possible design, the sub-pixel interpolation calculation of the initial image based on the phase of each color sub-pixel includes:

[0023] Obtain the initial value and corresponding initial phase of each color sub-pixel in the initial image;

[0024] Based on the actual phase under the sub-pixel arrangement type, select multiple reference initial values ​​from the initial phase that correspond to the actual phase;

[0025] Using a preset interpolation algorithm, the sub-pixel interpolation result corresponding to the actual phase is calculated based on the multiple reference initial values ​​and the corresponding initial phase.

[0026] In one possible design, the method also includes:

[0027] If it is determined that there is a non-standard pattern in the initial image, the appropriate grouping rules, sub-pixel quantity adjustment ratio and color value allocation rules are determined according to the sub-pixel arrangement type of the target display screen and the sub-pixel arrangement type of the non-standard pattern.

[0028] The image pixels corresponding to the non-standard patterns are grouped according to the grouping rules;

[0029] Based on the sub-pixel quantity adjustment ratio, the sub-pixel quantity corresponding to each group of image pixels is adjusted to the sub-pixel arrangement type that is compatible with the target display screen.

[0030] Based on the color value allocation rules and the color characteristics of the non-standard pattern, each adjusted sub-pixel is assigned a corresponding color value to obtain the second processed image.

[0031] The second processed image is output to the target display screen.

[0032] In one possible design, after acquiring the initial image, the process further includes:

[0033] Determine whether the color format of the initial image is a three-primary-color format;

[0034] If the initial image's color format is not a three-primary-color format, convert the initial image's color format to a three-primary-color format.

[0035] Secondly, this application provides an image rendering apparatus, comprising:

[0036] The acquisition module is used to acquire the initial image;

[0037] A pattern recognition module is used to perform pattern recognition on the initial image to determine whether there are non-standard patterns in the initial image;

[0038] The sub-pixel phase determination module is used to determine the phase of each color sub-pixel based on the sub-pixel arrangement type of the target display screen when it is determined that there is no non-standard pattern in the initial image.

[0039] An interpolation module is used to perform sub-pixel interpolation calculations on the initial image based on the phase of each color sub-pixel to obtain a first processed image;

[0040] The output module is used to output the first processed image as a rendered image to the target display screen.

[0041] Thirdly, this application provides an electronic device, including: a processor, and a memory communicatively connected to the processor;

[0042] The memory stores computer-executed instructions;

[0043] The processor executes computer execution instructions stored in the memory to implement the method as described in any of the first aspects.

[0044] Fourthly, embodiments of this application provide a computer-readable storage medium storing computer-executable instructions, which, when executed by a processor, are used to implement the method as described in any of the first aspects.

[0045] Fifthly, embodiments of this application provide a computer program product, including a computer program that, when executed by a processor, implements the method described in any of the first aspects.

[0046] This application provides an image rendering method, apparatus, device, and medium. The method first performs pattern recognition on an initial image to determine if any non-standard patterns exist. If no non-standard patterns are found, it accurately determines the phase of each color sub-pixel based on the sub-pixel arrangement type of the target display screen. Then, it performs sub-pixel interpolation calculations to obtain and output the processed image. This effectively solves the problem of poor adaptability of sub-pixel rendering algorithms in existing technologies. It eliminates the need to design separate algorithms for different sub-pixel arrangement types, simplifying the development process and reducing the difficulty of subsequent algorithm maintenance. Furthermore, accurately determining the sub-pixel phase based on the sub-pixel arrangement type of the target screen avoids problems such as image blurring and distortion caused by inaccurate phase determination in conventional image rendering scenarios, ensuring the consistency and stability of the display effect and improving the user's visual experience. Attached Figure Description

[0047] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this application and, together with the description, serve to explain the principles of this application.

[0048] Figure 1 This is an application scenario diagram corresponding to an image rendering method provided in an embodiment of this application;

[0049] Figure 2 A schematic flowchart of an image rendering method provided in an embodiment of this application;

[0050] Figure 3 A sub-pixel phase distribution feature map of a standard three-primary-color arrangement provided in one embodiment of this application;

[0051] Figure 4 This is a sub-pixel phase distribution feature map of a Delta RGB arrangement provided in one embodiment of this application;

[0052] Figure 5A flowchart illustrating an image rendering method provided in another embodiment of this application;

[0053] Figure 6 This is a schematic diagram of the structure of an image rendering apparatus provided in an embodiment of this application;

[0054] Figure 7 This is a structural example diagram of an electronic device provided in an embodiment of this application.

[0055] The accompanying drawings illustrate specific embodiments of this application, which will be described in more detail below. These drawings and descriptions are not intended to limit the scope of the concept in any way, but rather to illustrate the concept of this application to those skilled in the art through reference to particular embodiments. Detailed Implementation

[0056] Exemplary embodiments will now be described in detail, examples of which are illustrated in the accompanying drawings. When the following description relates to the drawings, unless otherwise indicated, the same numbers in different drawings denote the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with this application. Rather, they are merely examples of apparatuses and methods consistent with some aspects of this application as detailed in the appended claims.

[0057] To clearly understand the technical solution of this application, the solutions of the prior art will be described in detail first.

[0058] In the field of display technology, Organic Light-Emitting Diode (OLED) displays are widely used in various terminal devices due to their superior characteristics such as high brightness and wide color gamut. Compared to traditional Liquid Crystal Display (LCD) screens, each sub-pixel of an OLED screen requires a separate driving circuit to control its illumination, resulting in a more complex driving circuit structure and a larger footprint. Due to this hardware limitation, OLED screens cannot achieve a standard red, green, and blue (RGB) arrangement, meaning one image pixel corresponds to three red, green, and blue sub-pixels. This necessitates reducing the number of specific types of sub-pixels to lower the manufacturing complexity.

[0059] To compensate for the impact of reduced subpixel count on display quality, sub-pixel rendering (SPR) algorithms are required to process the displayed image. Currently, mainstream OLED screens employ various subpixel arrangements, such as red-green-green-blue, triangular red-green-blue, and red-green-green-blue. However, existing subpixel rendering algorithms have poor adaptability, requiring the design of corresponding algorithm logic for different subpixel arrangement types. This not only complicates the development process but also increases the difficulty of subsequent algorithm maintenance. Furthermore, in conventional image rendering scenarios without special patterns, existing algorithms cannot accurately determine the phase of each color subpixel based on the subpixel arrangement type of the target display screen. This leads to problems such as blurring and distortion in the rendered image, making it difficult to guarantee the consistency and stability of the display effect and affecting the user's visual experience.

[0060] Figure 1 An application scenario diagram corresponding to an image rendering method provided in an embodiment of this application is shown, such as... Figure 1 As shown, the application scenario provided in this embodiment includes: an image source device 10, an image processing device 11, and a display screen 12. The image source device 10 and the image processing device 11 communicate via a data transmission bus, and the image processing device 11 and the display screen 12 communicate via a display interface. The image source device 10 can be a smartphone motherboard, a tablet computer processor, or a vehicle central control unit, used to output initial image data.

[0061] Specifically, the image rendering method provided in this application can be applied to terminal devices equipped with OLED screens, such as smartphones, tablets, automotive displays, and laptops. In these scenarios, OLED screens use non-standard RGB subpixel arrangements due to hardware driving circuit limitations, requiring subpixel rendering algorithms to compensate for display quality defects.

[0062] Specifically, when rendering an image is required, firstly, the image processing device 11 acquires an initial image from the image source device 10, such as an application interface, video footage, or picture. Then, the image processing device 11 performs pattern recognition on the initial image to determine if there are any non-standard patterns, such as special textures or irregularly shaped icons. If no non-standard patterns are found, the image processing device 11 calls the preset sub-pixel arrangement type parameters of the display screen to calculate the phase of each color sub-pixel, solving the problem of ambiguous phase determination in existing algorithms. Next, based on the phase of each color sub-pixel, the image processing device 11 performs interpolation operations on the pixel information of the initial image, supplementing the missing color details by reducing the number of factor pixels, and generating a processed image with balanced colors and clear edges. Finally, the image processing device 11 outputs the processed image to the display screen 12, completing the rendering display.

[0063] The technical solution of this application and how the technical solution of this application solves the above-mentioned technical problems are described in detail below with specific embodiments. These specific embodiments can be combined with each other, and the same or similar concepts or processes may not be described again in some embodiments. The embodiments of this application will now be described with reference to the accompanying drawings.

[0064] In the several embodiments provided in this application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are merely illustrative; for instance, the division of modules is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple modules may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be indirect coupling or communication connection through some interfaces, devices, or modules, and may be electrical, mechanical, or other forms.

[0065] Figure 2 This is a flowchart illustrating an image rendering method according to an embodiment of this application, as shown below. Figure 2 As shown, the execution subject of this embodiment is an image rendering device. This device can be implemented by a computer program, or by a medium storing the relevant computer program, such as a USB flash drive and / or optical disc; alternatively, it can be implemented by a physical device integrating or installing the relevant computer program, such as a chip or electronic device. The electronic device may be a computer or a server, etc. The image rendering method provided in this embodiment includes the following steps:

[0066] S201. Obtain the initial image.

[0067] The initial image is the original image to be rendered. The initial image is in RGB format and can include various natural images, interface images, and other images in common display scenarios, such as high-definition images with a resolution of 1080×1920 and standard-definition images with a resolution of 720×1280. The specific resolution and bit width of the initial image are not limited.

[0068] Optionally, the method of obtaining the initial image may include reading image data stored locally, receiving image data transmitted from an external device, etc., as long as a complete original RGB format image can be obtained.

[0069] S202. Perform pattern recognition on the initial image to determine whether there are non-standard patterns in the initial image.

[0070] Non-standard patterns refer to special image patterns that are prone to display abnormalities (such as uneven stripes or loss of detail) under conventional SPR interpolation processing, such as periodically repeating vertical stripes or horizontal stripes. The specific type of non-standard pattern can be flexibly defined according to the actual application scenario, and this invention does not limit it. The color difference between adjacent pixels in a conventional natural image is usually relatively smooth and has no obvious pattern.

[0071] Optionally, the pixel distribution features of the initial image are detected using preset recognition rules to determine whether there are pixel regions that conform to the definition of a non-standard pattern. For example, a detection window can be set in the image, the color distribution differences of pixels within the window can be calculated, and then compared with preset judgment conditions to determine whether a non-standard pattern exists.

[0072] Optionally, if the identification result indicates that there is no non-standard pattern, the normal rendering process of steps S203-S205 is executed.

[0073] S203. If it is determined that there are no non-standard patterns in the initial image, determine the phase of each color sub-pixel according to the sub-pixel arrangement type of the target display screen.

[0074] The subpixel arrangement type of the target display screen is pre-defined known information, including but not limited to mainstream OLED screen subpixel arrangements such as diamond arrangement (RGGB), triangle red-green-blue arrangement (Delta RGB), and red-green-green-blue arrangement (RGGB). It should be noted that the subpixel arrangement type of the target display screen can be pre-configured when the algorithm is deployed to the terminal device, without requiring real-time detection by the algorithm, and the arrangement type remains fixed during algorithm operation.

[0075] Optionally, the phase of each color sub-pixel (red R, green G, blue B) can be derived and determined based on a preset standard RGB arrangement (Real RGB) sub-pixel phase reference and the sub-pixel arrangement characteristics of the target display screen. The phase of a sub-pixel characterizes its positional coordinates in screen space and is a crucial parameter for interpolation calculations. While the phase derivation logic differs for different sub-pixel arrangement types, all are adapted and adjusted based on the phase of the standard RGB arrangement.

[0076] It should be noted that in this embodiment, there is no need to design separate algorithms for different arrangement types. Only the inherent physical characteristics of the target arrangement type and the corresponding phase mapping rules need to be called to uniformly calculate the actual phase of each color sub-pixel. For example, for a standard RGB arrangement, if the phases of the R sub-pixels in the first row are 0, 1, 2, 3… respectively, then for an RGBG arrangement (where the number of G sub-pixels remains unchanged and the number of R / B sub-pixels is halved), the corresponding R / B sub-pixel phases can be derived by adjusting the spatial interval parameters of the R / B sub-pixels. The G sub-pixel phases follow the phase logic of the standard RGB arrangement.

[0077] S204. Based on the phase of each color sub-pixel, perform sub-pixel interpolation calculation on the initial image to obtain the first processed image.

[0078] It should be noted that in this embodiment, the missing sub-pixel values ​​of the OLED screen are supplemented by precise interpolation to ensure display quality.

[0079] Optionally, after determining the phase of each color sub-pixel, an interpolation algorithm is used to calculate the sub-pixel data of the initial image to supplement the pixel information missing due to the reduction of sub-pixels on the OLED screen, thereby obtaining the first processed image after rendering.

[0080] Optionally, the interpolation algorithm includes, but is not limited to, interpolation methods such as Lagrange interpolation, least squares fitting, and linear interpolation.

[0081] All interpolation results corresponding to the actual phases are integrated according to the sub-pixel arrangement rules of the target screen to form a complete first processed image. The first processed image is fully adapted to the hardware characteristics of the target display screen and can be directly used for display.

[0082] S205. Output the first processed image as the rendered image to the target display screen.

[0083] Specifically, the first processed image, after interpolation, is transmitted to the target display screen, where the screen illuminates the corresponding sub-pixels according to its own hardware driving logic, ultimately presenting a clear and stable display effect. The output process can be achieved through the conventional data transmission interface between the image processing device and the display screen, and the transmission method is not limited.

[0084] This application provides an image rendering method that first performs pattern recognition on the initial image to determine whether there are non-standard patterns. When no non-standard patterns are found, the phase of each color sub-pixel is accurately determined based on the sub-pixel arrangement type of the target display screen. Then, sub-pixel interpolation calculation is performed to obtain the processed image and output it. This effectively solves the problem of poor adaptability of sub-pixel rendering algorithms in the prior art. It eliminates the need to design separate algorithms for different sub-pixel arrangement types, simplifies the development process, and reduces the difficulty of subsequent algorithm maintenance. In addition, the accurate determination of sub-pixel phase based on the sub-pixel arrangement type of the target screen avoids problems such as image blurring and distortion caused by inaccurate phase determination in conventional image rendering scenarios, ensuring the consistency and stability of the display effect and improving the user's visual experience.

[0085] As an optional implementation, based on any of the above embodiments, pattern recognition is performed on the initial image to determine whether there are non-standard patterns in the initial image, including the following steps:

[0086] First, the initial image is divided into at least one detection window according to a preset size.

[0087] Optionally, the preset detection window size can be M×N, where M is the vertical number of pixels in the window and N is the horizontal number of pixels in the window. The window size setting needs to be adapted to the periodic characteristics of the target non-standard pattern. For example, for vertical stripes with a period of "1 pixel white and 1 pixel black", the window size can be set to 3×3 or 5×3, with the horizontal number of pixels N matching the stripe period and the vertical number of pixels M ensuring the detection reliability of local areas. For non-standard patterns with larger periods, the horizontal or vertical size of the window can be increased accordingly.

[0088] Optionally, the initial image can be divided into at least one detection window using a sliding window or a non-overlapping window method. The step size of the sliding window can be set according to the required detection accuracy. Specifically, a smaller step size results in higher detection accuracy but also greater computational complexity; a larger step size results in higher detection efficiency and avoids redundant calculations. For example, the step size can be set to 1 pixel or half the window size. Non-overlapping windows are suitable for scenarios with high detection efficiency requirements, where there is no pixel overlap between windows, and the image is divided block by block according to the window size.

[0089] Optionally, for regions where the edges of the initial image cannot completely accommodate an M×N window, such as when the number of remaining pixels on the right side of the image is less than N or the number of remaining pixels at the bottom is less than M, zero padding, cropping of a portion of the region, or using the parameters of adjacent windows can be used to ensure that the entire image region can be detected and covered. This implementation does not limit this.

[0090] Secondly, the color difference between each adjacent pixel within the detection window is calculated.

[0091] Adjacent pixels include horizontally adjacent pixels (pixels that are adjacent left and right in the same row) and vertically adjacent pixels (pixels that are adjacent top and bottom in the same column) within the detection window. The detection dimension can be selected based on the directional characteristics of the non-standard pattern. For example, when detecting vertical stripes, the focus is on calculating the color difference between horizontally adjacent pixels; when detecting horizontal stripes, the focus is on calculating the color difference between vertically adjacent pixels. Simultaneous calculation of the color differences between horizontally and vertically adjacent pixels can also improve the ability to recognize complex non-standard patterns.

[0092] Optionally, the color difference can be calculated using any combination of one or more of the following methods:

[0093] Firstly, the grayscale differences between adjacent pixels in the R, G, and B channels can be calculated separately. , , ( , , The RGB grayscale value of the first pixel. , , (The RGB grayscale values ​​of adjacent pixels).

[0094] Secondly, the RGB color space can be converted to a luminance-chrominance space, and the luminance difference ΔY or the overall color difference ΔE between adjacent pixels can be calculated (such as in the CIE Lab color space). Among them, the brightness difference is better able to reflect the human eye's perception of light and dark stripes, while the overall color difference is better able to reflect non-standard patterns with obvious color differences.

[0095] Third, the color differences between all adjacent pixels within each detection window can be statistically analyzed to obtain a set of color differences within that window, such as... k is the total number of adjacent pixels within the window.

[0096] Finally, each color difference value is compared with a preset color difference threshold to determine whether there are non-standard patterns within the detection window.

[0097] Optionally, the preset color difference threshold Thr can be preset and set according to the characteristics of the non-standard pattern and the screen display characteristics. For example, for non-standard patterns such as black and white stripes, since the grayscale values ​​of black and white pixels are large, a higher threshold Thr=200 can be set; for non-standard patterns with smaller color differences, a lower threshold Thr=100 can be set. In addition, a color difference threshold range can be set to adapt to the recognition needs of non-standard patterns of different intensities. The specific value of the color difference threshold range can be calibrated through a large amount of experimental data, and this embodiment does not limit it.

[0098] Optionally, if there is at least one color difference greater than or equal to a preset color difference threshold in the detection window, and the proportion of color differences satisfying this condition in the window exceeds a preset ratio (e.g., 60%), or the color differences satisfying this condition show a periodic distribution, such as the difference between three consecutive groups of adjacent pixels being greater than or equal to the preset color difference threshold, then it is determined that there is a non-standard pattern in the detection window.

[0099] Optionally, if all color differences within the detection window are less than a preset color difference threshold, or if the proportion of color differences that meet the conditions is less than a preset proportion, then it is determined that there is no non-standard pattern within the detection window.

[0100] Optionally, if at least one detection window in the initial image is determined to have a non-standard pattern, then the initial image is determined to have a non-standard pattern overall; if all detection windows are determined not to have a non-standard pattern, then the initial image is determined to have no non-standard pattern overall.

[0101] This application provides an image rendering method that divides the initial image into detection windows according to a preset size and calculates the color difference between adjacent pixels within the detection window and compares it with a preset color difference threshold to determine non-standard patterns. Thus, local analysis is performed using standardized and modular detection windows as units, which reduces the complexity of global calculations and accurately captures color change areas through local comparison of adjacent pixels, effectively distinguishing standard patterns from non-standard patterns that may cause rendering abnormalities.

[0102] As an optional implementation, based on any of the above embodiments, each color difference value is compared with a preset color difference threshold to determine whether a non-standard pattern exists within the detection window, including the following steps:

[0103] First, obtain the target number of color differences within the detection window that are greater than the preset color difference threshold.

[0104] Optionally, the color difference of all adjacent pixels in the detection window is compared with a preset color difference threshold one by one, and the difference that satisfies the condition that the color difference is greater than the preset color difference threshold is selected as the target difference.

[0105] Optionally, the total number of all target differences within the detection window is counted and denoted as the target quantity K. For example, in a 3×3 detection window, there are 6 sets of horizontal adjacent pixel differences and 6 sets of vertical adjacent pixel differences, totaling 12 sets of differences; if 8 of these differences are greater than the preset color difference threshold, then the target quantity K=8.

[0106] It should be noted that during the statistical process, there is no need to distinguish the specific size of the difference or the distribution of the difference. It is only necessary to count the total number of differences that meet the conditions. The calculation logic is simple and easy to implement in hardware.

[0107] Secondly, calculate the target percentage relative to the total number of color differences between all adjacent pixels within the detection window.

[0108] Optionally, the total number T of color differences between all adjacent pixels within the detection window is first determined, and its calculation method is determined by the detection window size and the detection dimension of adjacent pixels. For example, if only horizontally adjacent pixels are detected, then T = number of vertical pixels in the window M × (number of horizontal pixels in the window N-1); if only vertically adjacent pixels are detected, then T = (number of vertical pixels in the window M-1) × number of horizontal pixels in the window N; if both horizontally and vertically adjacent pixels are detected, then T = [M × (N-1)] + [(M-1) × N].

[0109] Optionally, the target percentage can be calculated using the formula: Target percentage P = (Number of targets K / Total number of targets T) × 100%. The target percentage directly reflects the distribution density of adjacent pixel pairs with large color differences within the detection window. For example, when K=8 and T=12, P≈66.7%.

[0110] Finally, the target proportion is compared with the preset proportion threshold, and if the target proportion is greater than or equal to the preset proportion threshold, it is determined that there is a non-standard pattern in the detection window.

[0111] The preset percentage threshold P0 is set based on the characteristics and recognition requirements of the non-standard pattern. The stronger the regularity of the non-standard pattern and the denser the distribution of large color differences, the higher P0 can be set (e.g., 70%~80%). For non-standard patterns with weak regularity, P0 can be appropriately reduced (e.g., 50%~60%). For example, for non-standard patterns with high contrast, high density, and large color differences, such as "one white and one black vertical stripe", P0 can be set to 70%; for low-contrast regular textures, P0 can be set to 55%. Optionally, the preset percentage threshold can be calibrated through a large amount of experimental data, and this embodiment does not limit this.

[0112] Optionally, if the target proportion P ≥ the preset proportion threshold P0, it indicates that the distribution density of adjacent pixel pairs with large color differences within the detection window meets the characteristic requirements of a non-standard pattern, and it is determined that a non-standard pattern exists within the detection window. If the target proportion P < the preset proportion threshold P0, it indicates that the adjacent pixel pairs with large color differences within the detection window are randomly distributed and do not meet the regularity characteristics of a non-standard pattern, and it is determined that no non-standard pattern exists within the detection window.

[0113] This application provides an image rendering method that obtains the number of targets with color differences greater than a preset color difference threshold within the detection window to quantify the distribution density of significant color differences within the detection window. The proportion of the number of targets is used as the basis for judging non-standard patterns, avoiding misjudgments caused by individual pixel color differences exceeding the limit. It can also dynamically adapt to different image features through a preset proportion threshold, significantly improving the accuracy and robustness of pattern recognition while reducing computational complexity.

[0114] As an optional implementation, based on any of the above embodiments, the phase of each color sub-pixel is determined according to the sub-pixel arrangement type of the target display screen, specifically including the following steps:

[0115] First, based on the subpixel arrangement type of the target display screen and using the phase of the standard three primary color subpixel arrangement type as a reference, the phase offset of each color subpixel in the target display screen relative to the standard three primary color subpixel arrangement type is determined.

[0116] First, the phase reference for the standard three primary colors (Real RGB) sub-pixel arrangement is explained. Specifically, the horizontal direction of the screen is taken as the main direction for phase calculation, and the vertical phase calculation logic is the same as the horizontal direction. This implementation takes the horizontal direction as an example. The phases of the R sub-pixels in the first row are set as p_R0=0, p_R1=1, p_R2=2, p_R3=3...p_Rn=n, where n is the sequence number of the R sub-pixels. Similarly, the phases of the G sub-pixels in the first row are p_G0=0, p_G1=1, p_G2=2...p_Gn=n, and the phases of the B sub-pixels in the first row are p_B0=0, p_B1=1, p_B2=2...p_Bn=n. That is, in the standard arrangement, the phase step of sub-pixels of the same color is 1, and the phase value corresponds one-to-one with the horizontal spatial position of the sub-pixel. Figure 3 This application provides a sub-pixel phase distribution feature map of a standard three-primary-color arrangement according to an embodiment of the present application. To more clearly present the sub-pixel phase distribution features of the standard three-primary-color arrangement, refer to... Figure 3 As shown, taking the first row of R sub-pixels as an example, its phase increases sequentially in the order of 0, 1, 2, 3..., which precisely corresponds to the physical arrangement position of the sub-pixels and forms the reference for subsequent phase offset calculation.

[0117] Optionally, the subpixel arrangement type of the target display screen (such as Delta RGB, RGBG, RGGB) is obtained, and the characteristics of each color subpixel under this subpixel arrangement type are analyzed. The characteristics may include the horizontal / vertical distribution period, the ratio of the number of subpixels to the standard arrangement, and the spatial arrangement rules (such as whether there is an odd-even row reversal, missing subpixel positions, etc.).

[0118] Optionally, based on the characteristics of the sub-pixel arrangement type of the target display screen, the phase offset Δφ of each color sub-pixel relative to the standard phase reference is calculated. The phase offset can be a fixed value or a variable that changes with the sub-pixel number, specifically determined by the spatial distribution law of the arrangement type.

[0119] Specifically, the phase offset is calculated as follows: Δφ = f(subpixel spatial spacing of the target arrangement / subpixel spatial spacing of the standard arrangement). Here, the subpixel spatial spacing refers to the physical distance between two adjacent subpixels of the same color in the horizontal (or vertical) direction (based on pixel units).

[0120] For example, taking Delta RGB arrangement as an example, the calculation method of phase offset is given. The specific value can be calibrated according to the actual screen parameters, and this implementation method is not limited. Specifically, the characteristic of Delta RGB arrangement is that the number of RGB sub-pixels is 2 / 3 of that of the standard arrangement, and the horizontal spatial interval is 1.5 times that of the standard arrangement (standard interval 1, Delta interval 1.5). Therefore, the phase offset of each color sub-pixel changes with the index: the offset of the t-th sub-pixel of the same color Δφ_t = 0.5 × t, where t is the sub-pixel index, starting from 0.

[0121] Secondly, the phase of each color sub-pixel of the target display screen is determined based on the phase offset.

[0122] Using the phase of the standard three primary color sub-pixels as the reference phase p_std, and combining it with the calculated phase offset Δφ, the final phase p_target of each color sub-pixel in the target display screen is calculated using the following formula: p_target = p_std + Δφ.

[0123] Wherein, the reference phase p_std is the phase of the corresponding numbered sub-pixel in the standard arrangement (e.g., the standard phase of the second R sub-pixel is 2); if there are missing sub-pixels in the target arrangement, such as missing R and B sub-pixels in the RGBG arrangement, the phase calculation of the missing positions is skipped, and the above formula is only executed for the actual existing sub-pixels.

[0124] For example, taking the Delta RGB arrangement as an example, an exemplary explanation of subpixel phase determination is given: the reference phase of the R subpixel in the standard arrangement is p_std=0, 1, 2, 3, 4, 5 in sequence; the offset of the R subpixel in the Delta RGB arrangement is Δφ=0, 0.5, 1, 1.5, 2, 2.5 in sequence; then the target phase is 0+0=0, 1+0.5=1.5, 2+1=3, 3+1.5=4.5, 4+2=6, 5+2.5=7.5 in sequence, with a horizontal phase step of 1.5. Figure 4 This is a sub-pixel phase distribution feature map of a Delta RGB arrangement provided in one embodiment of this application. The phase difference between the Delta RGB arrangement and the standard three-primary-color arrangement can be obtained through... Figure 3 and Figure 4 It can be seen intuitively that, Figure 4The spacing between adjacent vertical lines in the horizontal direction represents the phase spacing, clearly demonstrating the non-integer increasing characteristic of sub-pixel phase under Delta RGB arrangement due to the increase in spatial spacing, which is consistent with the phase calculation logic of this implementation.

[0125] This application provides an image rendering method that calculates the phase offset of the target display screen based on the phase of the standard three primary color arrangement, realizing unified phase modeling for different sub-pixel arrangement types and avoiding redundant development of designing phase calculation logic separately for each arrangement.

[0126] As an optional implementation, based on any of the above embodiments, sub-pixel interpolation calculation is performed on the initial image based on the phase of each color sub-pixel, including the following steps:

[0127] First, obtain the initial values ​​and corresponding initial phases of each color sub-pixel in the initial image.

[0128] Optionally, if the initial image is in RGB format, the grayscale values ​​of the sub-pixels in its R, G, and B channels are directly extracted as initial values ​​(denoted as V_std). For example, for an initial image with a resolution of 1080×1920, the R channel contains 1080×1920 initial values, each ranging from 0 to 255, with an 8-bit width. The bit width can be flexibly adjusted, and this implementation does not limit it.

[0129] The initial phase (denoted as P_std) corresponds one-to-one with the standard RGB arrangement of the initial image. Following the phase reference definition of the standard three primary color arrangement, unidirectional (horizontal / vertical) or bidirectional interpolation can be selected according to the actual rendering requirements. This implementation method takes horizontal interpolation as an example for explanation.

[0130] Optionally, a data pair of initial value and initial phase is established for each color sub-pixel to form a complete data mapping set for that color channel.

[0131] Secondly, based on the actual phase under the sub-pixel arrangement type, select multiple reference initial values ​​that correspond to the actual phase from the initial phase.

[0132] Optionally, for a single actual phase of a certain color sub-pixel of the target screen, m adjacent initial phases on both sides of the actual phase are selected from the mapping set of the initial value and the initial phase of the color channel. m is the reference number, which can be 4 to 6 and can be adjusted according to the interpolation accuracy requirements. This embodiment does not limit the number of reference initial phases.

[0133] The core of selecting the reference initial value is phase proximity matching, ensuring that the selected initial phase can cover the spatial location range of the actual phase, providing sufficient effective information for interpolation calculation. For example, if the actual phase = 1.5 (the phase of the R sub-pixel arranged in DeltaRGB), then the four initial values ​​corresponding to the initial phases of 0, 1, 2, and 3 are selected as reference initial values; if the actual phase = 2 (the phase of the R sub-pixel arranged in RGBG), then the four initial values ​​corresponding to the initial phases of 0, 1, 3, and 4 are selected as reference initial values.

[0134] It should be noted that the actual phase distribution patterns of different sub-pixel arrangement types are different, but the selection rules for the reference initial values ​​remain consistent. It is only necessary to select the initial values ​​corresponding to the m adjacent initial phases from the standard mapping set based on the specific values ​​of the actual phases, without modifying the selection logic.

[0135] Finally, using a preset interpolation algorithm, based on multiple reference initial values ​​and corresponding initial phases, the sub-pixel interpolation result corresponding to the actual phase is calculated.

[0136] Optionally, the preset interpolation algorithm includes, but is not limited to, Lagrange interpolation, least squares fitting, linear interpolation, cubic spline interpolation, etc. This embodiment takes Lagrange interpolation as an example for explanation, and its advantage is that it can accurately fit a continuous function with a limited number of reference nodes.

[0137] First, using m selected reference initial values ​​as dependent variables and the corresponding initial phase as independent variables, a function relationship V=f(P) is constructed through a preset interpolation algorithm. This function characterizes the continuous law of the change of the initial value of the sub-pixel with the initial phase. Second, the actual phase is substituted into the above function, and the calculated function value V_target=f(P_target) is the sub-pixel interpolation result corresponding to the actual phase.

[0138] It should be noted that, for all actual sub-pixel phases of the R, G, and B channels of the target screen, the above steps of selecting reference initial values ​​and interpolation calculations are repeated to obtain the complete interpolation results of the three channels, which are then combined to form the first processed image.

[0139] It should be noted that the sub-pixel data of the initial image is generated based on the standard three primary colors (Real RGB) arrangement, and its initial value has a one-to-one correspondence with the initial phase. However, the actual sub-pixel phase of the target OLED screen differs from the initial phase due to different arrangement types. By selecting multiple reference initial values ​​that match the actual phase and using an interpolation algorithm to construct a mapping relationship between the initial phase and the initial value, the sub-pixel value corresponding to the actual phase can be accurately calculated, thereby compensating for the loss of display information caused by the reduction of sub-pixels on the OLED screen.

[0140] Figure 5A flowchart illustrating an image rendering method provided in another embodiment of this application is shown below. Figure 5 As shown, as an optional implementation, based on any of the above embodiments, the method further includes the following steps:

[0141] S301. If it is determined that there is a non-standard pattern in the initial image, determine the appropriate grouping rules, sub-pixel quantity adjustment ratio and color value allocation rules according to the sub-pixel arrangement type of the target display screen and the sub-pixel arrangement type of the non-standard pattern.

[0142] Among them, the grouping rules need to match the periodic characteristics of the non-standard pattern with the distribution period of the screen sub-pixel arrangement; the sub-pixel quantity adjustment ratio needs to strictly follow the sub-pixel reduction ratio of the target screen; and the color value allocation rules need to conform to the color distribution pattern of the non-standard pattern (such as black and white alternation, fixed color gradient).

[0143] It should be noted that the period of non-standard patterns determines the basic unit of grouping. For example, the period of a "1 white, 1 black" vertical stripe is 2 pixels, and the period of a "2 white, 2 black" stripe is 4 pixels. The distribution period of the target screen's subpixel arrangement determines the group size. For example, the horizontal distribution period of a Delta RGB arrangement is 3 pixels. For instance, for a Delta RGB arrangement and a "1 white, 1 black" vertical stripe, the grouping rule can be set to group 3 image pixels together, matching the 3-pixel distribution period of Delta RGB; for an RGBG arrangement and a "2 white, 2 black" horizontal stripe, the grouping rule can be set to group 2 image pixels together, matching the 2-pixel R / B subpixel distribution period of RGBG.

[0144] Optionally, the subpixel quantity adjustment ratio is directly determined based on the subpixel arrangement characteristics of the target screen, i.e., the adjusted subpixel quantity = standard RGB arrangement subpixel quantity × screen subpixel retention ratio. Specifically, in the Delta RGB arrangement, each of the three RGB subpixels retains 2 / 3 of the standard arrangement, so the subpixel quantity adjustment ratio is "2 / 3 for each of RGB"; in the RGBG / RGGB arrangement, the G subpixel retains 100% (the quantity remains unchanged), and the R / B subpixels retain 50%, so the subpixel quantity adjustment ratio is "G:100%, R / B:50%".

[0145] Optionally, the color value allocation rules can be set according to the color characteristics of non-standard patterns (such as black and white, red and green alternation, fixed color values), with the core being to preserve the inherent color distribution rules of the pattern. For example, for non-standard patterns of alternating black and white, the color value rules can be set as "based on the black and white distribution of the pattern, assign corresponding extreme color values ​​(min for black and max for white) or intermediate transition values ​​to the adjusted sub-pixels"; for non-standard patterns of color gradients, the color value rules can be set as "allocate color values ​​according to the gradient ratio, maintaining the original gradient rules".

[0146] S302. Group the image pixels corresponding to non-standard patterns according to the grouping rules.

[0147] The grouping scope is limited to the regions corresponding to non-standard patterns in the initial image, without processing the entire image, in order to improve computational efficiency. If the non-standard pattern covers the entire image, then all image pixels are grouped.

[0148] Optionally, according to the grouping rules determined in S301, the pixels are grouped into consecutive pixel blocks as units. After grouping, the pixels in each group retain the spatial order and color distribution characteristics of the original image. For example, for Delta RGB arrangement and "white 1 black 1" vertical stripes, the pixel sequence of the initial image is "white, black, white, black, white, black...". After grouping into groups of 3 pixels, the resulting groups are "white, black, white", "black, white, black", etc. (each group retains the original color order). For RGBG arrangement and "white 2 black 2" horizontal stripes, the pixel sequence is "white, white, black, black, white, white, black, black...". After grouping into groups of 2 pixels, the resulting groups are "white, white", "black, black", "white, white", etc.

[0149] S303. Adjust the ratio according to the number of sub-pixels, and adjust the number of sub-pixels corresponding to each group of image pixels to the number of sub-pixels of the sub-pixel arrangement type that is adapted to the target display screen.

[0150] Optionally, taking each group of image pixels as a unit, first determine the total number of sub-pixels in the standard RGB arrangement for each group of image pixels (1 image pixel corresponds to 3 sub-pixels in standard RGB, so the number of standard sub-pixels in H pixel groups = 3H), then adjust the ratio according to the number of sub-pixels determined in S301, reduce the corresponding number of sub-pixels, and retain the number of sub-pixels adapted to the target screen.

[0151] For example, for Delta RGB arrangement, with 3 pixels as a group, the number of sub-pixels in this group under the standard RGB arrangement is "R:3, G:3, B:3" (9 in total). After adjusting by a 2 / 3 ratio, "R:2, G:2, B:2" (6 in total) are retained, and the redundant 1 R, 1 G, and 1 B sub-pixels are removed. For RGBG arrangement, with 2 pixels as a group, the number of sub-pixels in this group under the standard RGB arrangement is "R:2, G:2, B:2". After adjusting by a ratio, "R:1, G:2, B:1" are retained.

[0152] S304. Based on the color value allocation rules and the color characteristics of the non-standard pattern, assign corresponding color values ​​to each adjusted sub-pixel to obtain the second processed image.

[0153] Optionally, extract the color features of each group of image pixels, such as "black and white black", "white black and white", "white white black and white", etc., and specify the color value of each pixel in each group (such as black min=0, white max=255, or other fixed color values).

[0154] Optionally, according to the color value allocation rules determined in S301, a corresponding color value is assigned to each adjusted sub-pixel to preserve the color distribution pattern within the group.

[0155] For example, for Delta RGB arrangement and vertical stripes of "1 white and 1 black", after grouping, the color type of each group is "black black and white" or "white black and white", and black=min=0 and white=max=255 are set; the 6 sub-pixels (R2, G2, B2) of the "black black and white" group are assigned as "R1:min, R2:max, G1:min, G2:max, B1:max, B2:min"; the 6 sub-pixels of the "white black and white" group are assigned as "R1:max, R2:(max+min) / 2, G1:max, G2:(max+min) / 2, B1:(max+min) / 2, B2:max".

[0156] It should be noted that after the color values ​​of each group are assigned, the color values ​​of the boundary sub-pixels of adjacent groups are made continuous. For example, the B sub-pixel at the end of the previous group is set to max, and the R sub-pixel at the beginning of the next group is set to max. This avoids abrupt changes in boundary colors and ensures the overall texture continuity of non-standard patterns.

[0157] S305. Output the second processed image to the target display screen.

[0158] Optionally, all the sub-pixel data after grouping and processing are combined to form a complete second processed image. The resolution and format of the second processed image are adapted to the display requirements of the target display screen. The image is output to the target OLED display screen according to the screen's interface protocol and timing requirements. The driving circuit controls each sub-pixel to light up according to the assigned color value, thus completing the high-quality display of non-standard patterns.

[0159] This application provides an image rendering method that proposes a dynamic adaptation processing mechanism for non-standard patterns. By combining the sub-pixel arrangement characteristics of the target display screen and the pattern to customize grouping rules, sub-pixel quantity adjustment ratios, and color value allocation rules, it not only preserves the original feature details of the non-standard pattern, but also ensures that it can be accurately mapped to the physical sub-pixel structure of the target display screen, avoiding distortion or information loss caused by direct rendering.

[0160] As an optional implementation, based on any of the above embodiments, after obtaining the initial image, the following steps are further included:

[0161] First, determine whether the initial image's color format is a three-primary-color format.

[0162] Among them, the three primary color format refers to the image format based on red (R), green (G), and blue (B) as the basic color channels, including but not limited to sRGB, Adobe RGB, RGB888 (8-bit three-channel), RGB101010 (10-bit three-channel), etc. Its characteristic is that the image data directly contains independent R, G, and B three-channel sub-pixel grayscale values ​​without the need for additional color channel splitting or conversion.

[0163] Optionally, non-primary color formats include, but are not limited to, luminance-chrominance formats, printing color formats, hue-saturation-brightness formats, etc. The characteristic is that the image data does not directly provide independent R, G, B channel information, which needs to be converted through specific algorithms.

[0164] Optionally, the color format type can be identified by reading the file header identifier, metadata information, or color channel descriptor of the initial image. For example, if the image metadata contains identifiers such as "RGB" or "sRGB" and the number of channels is 3 (R, G, B only), it is determined to be a three-primary-color format.

[0165] Optionally, if the image metadata contains identifiers such as "YUV", "CMYK", or "HSV", or the number of channels is 1 or 4, it is determined to be a non-three-primary-color format.

[0166] It should be noted that this implementation method does not limit the specific judgment algorithm and can be implemented using existing image format recognition technology.

[0167] Secondly, if the initial image's color format is not a three-primary-color format, convert the initial image's color format to a three-primary-color format.

[0168] Optionally, the primary color format for conversion should be selected to match the display characteristics of the target OLED screen. For example, if the screen supports 10-bit color depth, it should be converted to RGB101010 format; otherwise, it should be converted to RGB888 format to ensure that the converted color range and bit width are compatible with subsequent rendering processing and screen display requirements.

[0169] Optionally, a color space conversion algorithm is employed, selecting the corresponding conversion logic based on the non-primary color format type of the initial image. For example, when converting HSV to RGB, RGB values ​​can be calculated in intervals using the numerical mapping relationship of hue (H), saturation (S), and lightness (V), ensuring that the color tone and vibrancy are consistent with the original HSV format.

[0170] Optionally, after the conversion is complete, verify the validity of the RGB format, such as whether the three-channel data is complete, whether the grayscale value range meets the settings, and whether there are any abnormal values, to ensure that the converted image can be directly input into the subsequent pattern recognition and rendering processing stages.

[0171] The image rendering method provided in this application effectively eliminates the risk of subsequent rendering anomalies caused by differences in input image formats by unifying the color format to a three-primary-color format, ensuring the accurate execution of the sub-pixel rendering algorithm in a unified color space and improving the accuracy of color processing.

[0172] Figure 6 This is a schematic diagram of the structure of an image rendering apparatus provided in an embodiment of this application, as shown below. Figure 6 As shown, the image rendering apparatus provided in this embodiment is located in an electronic device. The image rendering apparatus 40 provided in this embodiment includes: an acquisition module 41, a pattern recognition module 42, a sub-pixel phase determination module 43, an interpolation module 44, and an output module 45.

[0173] Specifically, the acquisition module 41 is used to acquire an initial image; the pattern recognition module 42 is used to perform pattern recognition on the initial image to determine whether there is a non-standard pattern in the initial image; the sub-pixel phase determination module 43 is used to determine the phase of each color sub-pixel according to the sub-pixel arrangement type of the target display screen when it is determined that there is no non-standard pattern in the initial image; the interpolation module 44 is used to perform sub-pixel interpolation calculation on the initial image based on the phase of each color sub-pixel to obtain a first processed image; and the output module 45 is used to output the first processed image as a rendered image to the target display screen.

[0174] Optionally, when performing pattern recognition on the initial image to determine whether there is a non-standard pattern in the initial image, the pattern recognition module 42 is specifically used to: divide the initial image into at least one detection window according to a preset size; calculate the color difference between each adjacent pixel in the detection window; and compare each color difference with a preset color difference threshold to determine whether there is a non-standard pattern in the detection window.

[0175] Optionally, when comparing each color difference with a preset color difference threshold to determine whether there is a non-standard pattern in the detection window, the pattern recognition module 42 is specifically used to: obtain the target number of color differences greater than the preset color difference threshold in the detection window; calculate the target proportion of the target number to the total number of color differences of all adjacent pixels in the detection window; compare the target proportion with a preset proportion threshold, and determine that there is a non-standard pattern in the detection window if the target proportion is greater than or equal to the preset proportion threshold.

[0176] Optionally, the sub-pixel phase determination module 43, when determining the phase of each color sub-pixel according to the sub-pixel arrangement type of the target display screen, is specifically used to: determine the phase offset of each color sub-pixel in the target display screen relative to the standard three primary color sub-pixel arrangement type, based on the phase of the standard three primary color sub-pixel arrangement type; and determine the phase of each color sub-pixel in the target display screen based on the phase offset.

[0177] Optionally, the interpolation module 44, when performing sub-pixel interpolation calculation on the initial image based on the phase of each color sub-pixel, is specifically used to: obtain the initial value and corresponding initial phase of each color sub-pixel in the initial image; select multiple reference initial values ​​corresponding to the actual phase in the initial phase according to the actual phase under the sub-pixel arrangement type; and calculate the sub-pixel interpolation result corresponding to the actual phase based on the multiple reference initial values ​​and the corresponding initial phase using a preset interpolation algorithm.

[0178] Optionally, the image rendering apparatus provided in this embodiment further includes a non-standard pattern processing module.

[0179] Optionally, the non-standard pattern processing module is used to: when it is determined that a non-standard pattern exists in the initial image, determine the appropriate grouping rules, sub-pixel quantity adjustment ratio, and color value allocation rules based on the sub-pixel arrangement type of the target display screen and the sub-pixel arrangement type of the non-standard pattern; group the image pixels corresponding to the non-standard pattern according to the grouping rules; adjust the sub-pixel quantity of each group of image pixels to the sub-pixel quantity that adapts to the sub-pixel arrangement type of the target display screen according to the sub-pixel quantity adjustment ratio; assign corresponding color values ​​to each adjusted sub-pixel according to the color value allocation rules and the color characteristics of the non-standard pattern to obtain a second processed image; and output the second processed image to the target display screen.

[0180] Optionally, the image rendering apparatus provided in this embodiment further includes a format conversion module.

[0181] Optionally, after obtaining the initial image, the format conversion module is used to: determine whether the color format of the initial image is a three-primary-color format; if the color format of the initial image is not a three-primary-color format, convert the color format of the initial image to a three-primary-color format.

[0182] It should be noted that the technical effects of the image rendering device provided in this embodiment have been described in the above method embodiments, and will not be repeated here.

[0183] Figure 7 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application, as shown below. Figure 7As shown, the electronic device 50 provided in this embodiment includes: a processor 51 and a memory 52 communicatively connected to the processor 51.

[0184] The memory 52 stores computer execution instructions; the processor 51 executes the computer execution instructions stored in the memory 52 to implement an image rendering method provided in any of the above embodiments.

[0185] The program may include program code, which includes computer-executable instructions. Memory 52 may include high-speed RAM, and may also include non-volatile memory, such as at least one disk storage device.

[0186] In this embodiment, the memory 52 and the processor 51 are connected via a bus. The bus can be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus, or an Extended Industry Standard Architecture (EISA) bus, etc. The bus can be divided into address bus, data bus, control bus, etc. For ease of representation, Figure 7 The bus is represented by a single straight line, but this does not mean that there is only one bus or one type of bus.

[0187] This application also provides a computer-readable storage medium, which stores computer-executable instructions that, when executed by a processor, are used to implement an image rendering method provided in any of the above embodiments.

[0188] This application also provides a computer program product, including a computer program that, when executed by a processor, implements an image rendering method provided in any of the above embodiments.

[0189] The modules described as separate components may or may not be physically separate. The components shown as modules may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to implement the solution of this embodiment according to actual needs.

[0190] Furthermore, the functional modules in the various embodiments of this application can be integrated into one processing unit, or each module can exist physically separately, or two or more modules can be integrated into one unit. The unit composed of the above modules can be implemented in hardware or in the form of hardware plus software functional units.

[0191] The integrated modules described above, implemented as software functional modules, can be stored in a computer-readable storage medium. These software functional modules, stored in a storage medium, include several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) or processor to execute some steps of the methods of the various embodiments of this application.

[0192] It should be understood that the aforementioned processor can be a Central Processing Unit (CPU), or other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), etc. A general-purpose processor can be a microprocessor or any conventional processor. The steps of the method disclosed in this invention can be directly manifested as execution by a hardware processor, or execution by a combination of hardware and software modules within the processor.

[0193] The memory may include high-speed RAM, and may also include non-volatile storage (NVM), such as at least one disk storage device, and may also be a USB flash drive, external hard drive, read-only memory, disk or optical disc, etc.

[0194] The aforementioned storage medium can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic storage, flash memory, magnetic disk, or optical disk. The storage medium can be any available medium that can be accessed by a general-purpose or special-purpose computer.

[0195] An exemplary storage medium is coupled to a processor, enabling the processor to read information from and write information to the storage medium. Alternatively, the storage medium can be an integral part of the processor. The processor and storage medium can reside in an Application Specific Integrated Circuit (ASIC). Alternatively, the processor and storage medium can exist as discrete components in an electronic control unit or main control device.

[0196] Those skilled in the art will understand that all or part of the steps of the above-described method embodiments can be implemented by hardware related to program instructions. The aforementioned program can be stored in a computer-readable storage medium. When executed, the program performs the steps of the above-described method embodiments; and the aforementioned storage medium includes various media capable of storing program code, such as ROM, RAM, magnetic disks, or optical disks.

[0197] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of this application, and are not intended to limit them. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some or all of the technical features therein. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of this application.

Claims

1. An image rendering method, characterized in that, include: Get the initial image; Perform pattern recognition on the initial image to determine whether there are non-standard patterns in the initial image; If it is determined that there are no non-standard patterns in the initial image, the phase of each color sub-pixel is determined according to the sub-pixel arrangement type of the target display screen; Based on the phase of each color sub-pixel, sub-pixel interpolation calculation is performed on the initial image to obtain the first processed image; The first processed image is output as the rendered image to the target display screen.

2. The method according to claim 1, characterized in that, The step of performing pattern recognition on the initial image to determine whether there are non-standard patterns in the initial image includes: The initial image is divided into at least one detection window according to a preset size; Calculate the color difference between each adjacent pixel within the detection window; Each color difference is compared with a preset color difference threshold to determine whether a non-standard pattern exists within the detection window.

3. The method according to claim 2, characterized in that, The step of comparing each of the color differences with a preset color difference threshold to determine whether a non-standard pattern exists within the detection window includes: Obtain the target number of color differences within the detection window that are greater than the preset color difference threshold; Calculate the target quantity as a percentage of the total number of color differences between all adjacent pixels within the detection window; The target proportion is compared with a preset proportion threshold, and if the target proportion is greater than or equal to the preset proportion threshold, it is determined that there is a non-standard pattern in the detection window.

4. The method according to claim 1, characterized in that, Determining the phase of each color sub-pixel based on the sub-pixel arrangement type of the target display screen includes: Based on the sub-pixel arrangement type of the target display screen, and using the phase of the standard three primary color sub-pixel arrangement type as a reference, the phase offset of each color sub-pixel in the target display screen relative to the standard three primary color sub-pixel arrangement type is determined; The phase of each color sub-pixel of the target display screen is determined based on the phase offset.

5. The method according to claim 1, characterized in that, The sub-pixel interpolation calculation of the initial image based on the phase of each color sub-pixel includes: Obtain the initial value and corresponding initial phase of each color sub-pixel in the initial image; Based on the actual phase under the sub-pixel arrangement type, select multiple reference initial values ​​from the initial phase that correspond to the actual phase; Using a preset interpolation algorithm, the sub-pixel interpolation result corresponding to the actual phase is calculated based on the multiple reference initial values ​​and the corresponding initial phase.

6. The method according to any one of claims 1-5, characterized in that, Also includes: If it is determined that there is a non-standard pattern in the initial image, the appropriate grouping rules, sub-pixel quantity adjustment ratio and color value allocation rules are determined according to the sub-pixel arrangement type of the target display screen and the sub-pixel arrangement type of the non-standard pattern. The image pixels corresponding to the non-standard patterns are grouped according to the grouping rules; Based on the sub-pixel quantity adjustment ratio, the sub-pixel quantity corresponding to each group of image pixels is adjusted to the sub-pixel arrangement type that is compatible with the target display screen. Based on the color value allocation rules and the color characteristics of the non-standard pattern, each adjusted sub-pixel is assigned a corresponding color value to obtain the second processed image. The second processed image is output to the target display screen.

7. The method according to any one of claims 1-5, characterized in that, After obtaining the initial image, the process also includes: Determine whether the color format of the initial image is a three-primary-color format; If the initial image's color format is not a three-primary-color format, convert the initial image's color format to a three-primary-color format.

8. An image rendering apparatus, characterized in that, include: The acquisition module is used to acquire the initial image; A pattern recognition module is used to perform pattern recognition on the initial image to determine whether there are non-standard patterns in the initial image; The sub-pixel phase determination module is used to determine the phase of each color sub-pixel based on the sub-pixel arrangement type of the target display screen when it is determined that there is no non-standard pattern in the initial image. An interpolation module is used to perform sub-pixel interpolation calculations on the initial image based on the phase of each color sub-pixel to obtain a first processed image; The output module is used to output the first processed image as a rendered image to the target display screen.

9. An electronic device, characterized in that, include: A processor, and a memory communicatively connected to the processor; The memory stores computer-executed instructions; The processor executes computer execution instructions stored in the memory to implement the method as described in any one of claims 1-7.

10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer-executable instructions, which, when executed by a processor, are used to implement the method as described in any one of claims 1-7.