Image processing method, device, computer equipment, storage medium and program product

By inserting the second subpixel into the original image and performing subpixel rendering processing, the problem that the rendering effect of the subpixel rendering module in the prior art is solved, and the accuracy of the test results is achieved.

CN118014845BActive Publication Date: 2025-03-11GLENFLY TECH CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202211389619.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-11-08
Publication Date
2025-03-11
Estimated Expiration
2042-11-08

AI Technical Summary

Technical Problem

The prior art cannot effectively eliminate the rendering effect of the subpixel rendering module, resulting in inaccurate test results when testing the output effect of the target module after the subpixel rendering module.

Method used

By acquiring the original image, a second sub-pixel is inserted to form an image of the second resolution, and the image is rendered by sub-pixels, eliminating the second sub-pixels to obtain the same sub-pixel information as the original image.

Benefits of technology

The rendering effect of the sub-pixel rendering module is achieved, making the test results more accurate and can directly match the sub-pixel information of the original image.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118014845B_ABST
    Figure CN118014845B_ABST
Patent Text Reader

Abstract

The present application relates to an image processing method, apparatus, computer equipment, storage medium and program product. The method comprises: inserting a second sub-pixel at an adjacent position of a first sub-pixel of an original image of a first resolution to obtain a first image of a second resolution; the second resolution is greater than the first resolution; performing sub-pixel rendering processing on the first image, eliminating the second sub-pixel inserted in the first image, and obtaining a second image of the first resolution; the sub-pixel information of the second image is the same as the pixel information of the first sub-pixel of the original image. In the above method, the position of the second sub-pixel insertion is determined according to the inverse sub-pixel rendering algorithm, and when performing sub-pixel rendering, the weight of the sub-pixel at the adjacent position of the first sub-pixel is set to 0, so that the pixels in the interpolation area are filtered out by the sub-pixel algorithm to eliminate the sub-pixel rendering effect.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of image display technology, and in particular to an image processing method, apparatus, computer equipment, storage medium and program product. Background Art

[0002] Display screens generally use pixels to emit light. Each pixel is divided into three sub-pixels: R (red), G (green) and B (blue). Each sub-pixel is a TFT thin-film transistor used to display a predetermined color. In order to reduce the power consumption when the display screen is lit, a sub-pixel rendering module is generally used to simulate the effect of uniform and normal pixel display, and the rendered image is input into other modules, such as the anti-aliasing module. The sub-pixel rendering module converts 6 RGB sub-pixels into 4 RGB sub-pixels and discards 2 RGB sub-pixels. In other words, the sub-pixel rendering module reduces the number of sub-pixels in the original image, thereby reducing the difficulty of the device manufacturing process and extending the power supply life.

[0003] In some application scenarios, it is necessary to eliminate the influence of sub-pixel rendering. For example, in order to test the output effect of the target module after the sub-pixel rendering module, it is necessary to eliminate the influence of sub-pixel rendering. However, no method to eliminate sub-pixel rendering has been proposed yet. Therefore, when testing the output effect of the target module after the sub-pixel rendering module, the image input to the target module is the image after the sub-pixel rendering module reduces the number of sub-pixels, not the original image, and the original image cannot skip the sub-pixel rendering module and be directly input into the target module. Therefore, the test result of the target module is inaccurate. Summary of the invention

[0004] Based on this, it is necessary to provide an image processing method, apparatus, computer device, computer-readable storage medium and computer program product that can eliminate the rendering effect of the sub-pixel rendering module in order to address the above technical problems.

[0005] In a first aspect, the present application provides a first aspect, and the present application provides an image processing method, the method comprising:

[0006] Acquire an original image of a first resolution;

[0007] Inserting a second sub-pixel at an adjacent position of the first sub-pixel of the original image to obtain a first image with a second resolution; the second resolution is greater than the first resolution;

[0008] Sub-pixel rendering is performed on the first image to eliminate the second sub-pixel inserted in the first image, thereby obtaining a second image of the first resolution; the sub-pixel information of the second image is the same as the pixel information of the first sub-pixel of the original image.

[0009] In one embodiment, inserting a second sub-pixel at an adjacent position of a first sub-pixel of an original image to obtain a first image of a second resolution includes:

[0010] Obtaining a first coordinate of a first sub-pixel in the original image;

[0011] Determine, according to the first coordinate of the first sub-pixel in the original image, a second coordinate after interpolation of the first sub-pixel in the original image;

[0012] If the first sub-pixel of the original image is in an even-numbered column of the original image, inserting a second sub-pixel at a left adjacent position of the second coordinate corresponding to the first sub-pixel;

[0013] If the first sub-pixel of the original image is in an odd-numbered column of the original image, inserting a second sub-pixel at a right adjacent position of the second coordinate corresponding to the first sub-pixel;

[0014] After the second sub-pixels are inserted into adjacent positions of the second coordinates corresponding to the first sub-pixels, a first image with a second resolution is obtained; the first image includes the first sub-pixels and the second sub-pixels.

[0015] In one embodiment, determining, according to a first coordinate of a first sub-pixel in an original image, a second coordinate of the first sub-pixel after interpolation in the original image includes:

[0016] If the first sub-pixel of the original image is in an even-numbered row of the original image, and the first sub-pixel in the original image is a sub-pixel of a red channel or a green channel, the ordinate of the second coordinate after interpolation of the first sub-pixel in the original image is the same as the ordinate of the first coordinate corresponding to the first sub-pixel, the abscissa of the second coordinate after interpolation of the first sub-pixel in the original image is equal to a preset multiple of the abscissa of the first coordinate corresponding to the first sub-pixel, and the pixel value of the first sub-pixel is assigned to the second coordinate; the preset multiple is greater than 1;

[0017] If the first sub-pixel of the original image is in an even row of the original image, and the first sub-pixel in the original image is a sub-pixel of the blue channel, the ordinate of the second coordinate after interpolation of the first sub-pixel in the original image is the same as the ordinate of the first coordinate corresponding to the first sub-pixel, and the abscissa of the second coordinate after interpolation of the first sub-pixel in the original image is equal to the sum of a preset multiple of the abscissa of the first coordinate corresponding to the first sub-pixel and 1, and the pixel value of the first sub-pixel is assigned to the second coordinate; the preset multiple is greater than 1.

[0018] In one embodiment, determining, according to a first coordinate of a first sub-pixel in an original image, a second coordinate of the first sub-pixel after interpolation in the original image includes:

[0019] If the first sub-pixel of the original image is in an odd-numbered row of the original image, and the first sub-pixel in the original image is a sub-pixel of a red channel or a green channel, the ordinate of the second coordinate after interpolation of the first sub-pixel in the original image is the same as the ordinate of the first coordinate corresponding to the first sub-pixel, the abscissa of the second coordinate after interpolation of the first sub-pixel in the original image is equal to the sum of a preset multiple of the abscissa of the first coordinate corresponding to the first sub-pixel and 1, and the pixel value of the first sub-pixel is assigned to the second coordinate; the preset multiple is greater than 1;

[0020] If the first sub-pixel of the original image is in an odd row of the original image, and the first sub-pixel in the original image is a sub-pixel of the blue channel, the ordinate of the second coordinate after interpolation of the first sub-pixel in the original image is the same as the ordinate of the first coordinate corresponding to the first sub-pixel, and the abscissa of the second coordinate after interpolation of the first sub-pixel in the original image is equal to a preset multiple of the abscissa of the first coordinate corresponding to the first sub-pixel, and the pixel value of the first sub-pixel is assigned to the second coordinate; the preset multiple is greater than 1.

[0021] In one embodiment, performing sub-pixel rendering processing on the first image, eliminating the second sub-pixel inserted in the first image, and obtaining the second image of the first resolution includes:

[0022] Determine, according to the second coordinate of the first sub-pixel in the first image, a third coordinate of the first sub-pixel in the first image after rendering;

[0023] If the abscissa of the third coordinate is in an even column, the pixel value of the first sub-pixel in the first image and the pixel value of the first sub-pixel or the second sub-pixel at the left adjacent position of the first sub-pixel are weighted summed to obtain the target pixel at the third coordinate; the weight of the first sub-pixel in the first image is 1; the weight of the first sub-pixel or the second sub-pixel at the left adjacent position of the first sub-pixel is 0;

[0024] If the abscissa of the third coordinate is in an odd column, the pixel value of the first sub-pixel in the first image and the pixel value of the first sub-pixel or the second sub-pixel at the right adjacent position of the first sub-pixel are weighted summed to obtain the target pixel at the third coordinate; the weight of the first sub-pixel in the first image is 1; the weight of the first sub-pixel or the second sub-pixel at the right adjacent position of the first sub-pixel is 0;

[0025] After each first sub-pixel of the first image is rendered, a second image with a first resolution is obtained.

[0026] In one embodiment, determining a third coordinate of a first sub-pixel in the first image after rendering according to a second coordinate of a first sub-pixel in the first image includes:

[0027] If the first sub-pixel in the first image is in an even row, and the first sub-pixel in the first image is a sub-pixel of a red channel or a green channel, the ordinate of the third coordinate of the first sub-pixel after rendering in the first image is the same as the ordinate of the second coordinate corresponding to the first sub-pixel in the first image, the abscissa of the third coordinate of the first sub-pixel after rendering in the first image is equal to a value rounded up to a preset multiple of the abscissa of the second coordinate corresponding to the first sub-pixel, and the pixel value of the first sub-pixel is assigned to the second coordinate; the preset multiple is less than 1;

[0028] If the first sub-pixel in the first image is in an even row and the first sub-pixel in the first image is a sub-pixel of the blue channel, the ordinate of the third coordinate after rendering the first sub-pixel in the first image is the same as the ordinate of the second coordinate corresponding to the first sub-pixel in the first image, and the abscissa of the third coordinate after rendering the first sub-pixel in the first image is equal to the value rounded up of the difference between a preset multiple of the abscissa of the second coordinate corresponding to the first sub-pixel and 2 / 3, and the pixel value of the first sub-pixel is assigned to the second coordinate; the preset multiple is less than 1.

[0029] In one embodiment, determining a third coordinate of a first sub-pixel in the first image after rendering according to a second coordinate of a first sub-pixel in the first image includes:

[0030] If the first sub-pixel in the first image is in an odd row, and the first sub-pixel in the first image is a sub-pixel of a red channel or a green channel, the ordinate of the third coordinate after rendering of the first sub-pixel in the first image is the same as the ordinate of the second coordinate corresponding to the first sub-pixel in the first image, the abscissa of the third coordinate after rendering of the first sub-pixel in the first image is equal to the value obtained by rounding up the difference between a preset multiple of the abscissa of the second coordinate corresponding to the first sub-pixel and 2 / 3, and the pixel value of the first sub-pixel is assigned to the second coordinate; the preset multiple is less than 1;

[0031] If the first sub-pixel in the first image is in an odd row and the first sub-pixel in the first image is a sub-pixel of the blue channel, the ordinate of the third coordinate after rendering the first sub-pixel in the first image is the same as the ordinate of the second coordinate corresponding to the first sub-pixel in the first image, and the abscissa of the third coordinate after rendering the first sub-pixel in the first image is equal to a preset multiple of the abscissa of the second coordinate corresponding to the first sub-pixel rounded up, and the pixel value of the first sub-pixel is assigned to the second coordinate; the preset multiple is less than 1.

[0032] In one embodiment, after determining the third coordinate of the first sub-pixel in the first image after rendering according to the second coordinate of the first sub-pixel in the first image, the method further includes:

[0033] If the first sub-pixel of the first image satisfies the boundary condition and the abscissa of the third coordinate of the first sub-pixel is in an even column, assigning a preset pixel value to the left adjacent position of the first sub-pixel;

[0034] If the first sub-pixel of the first image meets the boundary condition and the abscissa of the third coordinate of the first sub-pixel is in an odd column, a preset pixel value is assigned to the right adjacent position of the first sub-pixel.

[0035] In a second aspect, the present application also provides an image processing device. The device comprises:

[0036] An acquisition module, used for acquiring an original image of a first resolution;

[0037] An interpolation module, used for inserting a second sub-pixel at an adjacent position of the first sub-pixel of the original image to obtain a first image with a second resolution; the second resolution is greater than the first resolution;

[0038] The rendering module is used to perform sub-pixel rendering processing on the first image, eliminate the second sub-pixel inserted in the first image, and obtain a second image of the first resolution; the sub-pixel information of the second image is the same as the pixel information of the first sub-pixel of the original image.

[0039] In a third aspect, the present application further provides a computer device. The computer device includes a memory and a processor, the memory stores a computer program, and the processor implements the following steps when executing the computer program:

[0040] Acquire an original image of a first resolution;

[0041] Inserting a second sub-pixel at an adjacent position of the first sub-pixel of the original image to obtain a first image with a second resolution; the second resolution is greater than the first resolution;

[0042] Sub-pixel rendering is performed on the first image to eliminate the second sub-pixel inserted in the first image, thereby obtaining a second image of the first resolution; the sub-pixel information of the second image is the same as the pixel information of the first sub-pixel of the original image.

[0043] In a fourth aspect, the present application further provides a computer-readable storage medium. The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the following steps are implemented:

[0044] Acquire an original image of a first resolution;

[0045] Inserting a second sub-pixel at an adjacent position of the first sub-pixel of the original image to obtain a first image with a second resolution; the second resolution is greater than the first resolution;

[0046] Sub-pixel rendering is performed on the first image to eliminate the second sub-pixel inserted in the first image, thereby obtaining a second image of the first resolution; the sub-pixel information of the second image is the same as the pixel information of the first sub-pixel of the original image.

[0047] In a fifth aspect, the present application further provides a computer program product. The computer program product includes a computer program, and when the computer program is executed by a processor, the following steps are implemented:

[0048] Acquire an original image of a first resolution;

[0049] Inserting a second sub-pixel at an adjacent position of the first sub-pixel of the original image to obtain a first image with a second resolution; the second resolution is greater than the first resolution;

[0050] Sub-pixel rendering is performed on the first image to eliminate the second sub-pixel inserted in the first image, thereby obtaining a second image of the first resolution; the sub-pixel information of the second image is the same as the pixel information of the first sub-pixel of the original image.

[0051] The above-mentioned image processing method, apparatus, computer equipment, storage medium and program product insert a second sub-pixel at an adjacent position of a first sub-pixel of an original image of a first resolution to obtain a first image of a second resolution; the second resolution is greater than the first resolution; the first image is subjected to sub-pixel rendering processing to eliminate the second sub-pixel inserted in the first image to obtain a second image of the first resolution; the sub-pixel information of the second image is the same as the pixel information of the first sub-pixel of the original image. In the above-mentioned method, according to the domain weighted summation rule of sub-pixel rendering, the second sub-pixel is inserted at an adjacent position of the first sub-pixel of the original image, and after the first image is rendered by the sub-pixel algorithm, the inserted second sub-pixel is finally eliminated, and the first sub-pixel of the original image is retained, thereby eliminating the sub-pixel rendering effect. BRIEF DESCRIPTION OF THE DRAWINGS

[0052] Figure 1 A diagram showing an application environment of an image processing method in an embodiment;

[0053] Figure 2 is a schematic flow chart of an image processing method in one embodiment;

[0054] Figure 3 A schematic diagram of a sub-pixel arrangement in one embodiment;

[0055] Figure 4 is a schematic diagram of an original image in another embodiment;

[0056] Figure 5 is a schematic diagram of a first image in one embodiment;

[0057] Figure 6 is a coordinate diagram of a first sub-pixel of an original image with a dimension of 2*2 in one embodiment;

[0058] Figure 7 A schematic diagram of a flow chart of determining a second coordinate after interpolation of a first sub-pixel in an original image according to an embodiment;

[0059] Figure 8 is a coordinate diagram of a first sub-pixel and a second sub-pixel of a first image corresponding to an original image with a dimension of 2*2 in one embodiment;

[0060] Fig. 9 It is a schematic diagram of performing sub-pixel rendering processing on a first image in one embodiment;

[0061] Fig.10 is a schematic diagram of a boundary area of ​​a first image in an embodiment;

[0062] Fig.11 is a structural block diagram of an image processing device in one embodiment;

[0063] Fig.12 FIG. 4 is a diagram showing the internal structure of a computer device in one embodiment. DETAILED DESCRIPTION

[0064] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.

[0065] The image processing method provided in the embodiment of the present application can be applied to Figure 1In the application environment shown. Among them, the terminal 102 obtains an original image of a first resolution; the terminal 102 inserts a second sub-pixel at an adjacent position of the first sub-pixel of the original image to obtain a first image of a second resolution; the second resolution is greater than the first resolution; the terminal 102 performs sub-pixel rendering processing on the first image, eliminates the second sub-pixel inserted in the first image, and obtains a second image of a first resolution; the sub-pixel information of the second image is the same as the pixel information of the first sub-pixel of the original image. The terminal 102 transmits the pixel information of the first sub-pixel of the original image and the pixel information of the second image to the server 104. The data storage system can store the pixel information of the first image and the second image to be stored by the server 104. The data storage system can be integrated on the server 104, or it can be placed on the cloud or other network servers. Among them, the terminal 102 can be, but is not limited to, various personal computers, laptops, smart phones, tablet computers, Internet of Things devices and portable wearable devices, and the Internet of Things devices can be smart speakers, smart TVs, smart air conditioners, smart car-mounted devices, etc. Portable wearable devices can be smart watches, smart bracelets, head-mounted devices, etc. The server 104 can be implemented with an independent server or a server cluster consisting of multiple servers.

[0066] In one embodiment, Figure 2 As shown, an image processing method is provided, which is applied to Figure 1 The terminal in is used as an example to illustrate, including the following steps:

[0067] Step 202: Acquire an original image with a first resolution.

[0068] The first resolution may be any resolution of a display screen on the market. For example, the first resolution may be a resolution of a smartphone display screen or a computer display screen. In this embodiment, the first resolution is 720*2340 as an example, where 720 indicates that the width of the original image includes 720 pixels, and 2340 indicates that the height of the original image includes 2340 pixels.

[0069] Step 204: insert a second sub-pixel at a position adjacent to the first sub-pixel of the original image to obtain a first image with a second resolution; the second resolution is greater than the first resolution.

[0070] Among them, the display screen generally uses pixel points to emit light, and each pixel point is divided into three sub-pixels of red (R), green (G) and blue (B). Each sub-pixel is a TFT thin film transistor for displaying a predetermined color. All colors on the display screen are mixed and superimposed by R sub-pixels, G sub-pixels and B sub-pixels in different proportions. In this embodiment, the first sub-pixel of the original image includes R sub-pixels, G sub-pixels and B sub-pixels. The second sub-pixel can be a sub-pixel that improves the resolution, for example, a black frame.

[0071] like Figure 3 As shown, the R sub-pixels, G sub-pixels and B sub-pixels of the original image are arranged in a stripe arrangement, each pixel contains complete three-primary color sub-pixels, and the arrangement order of each row is the same. After the sub-pixel algorithm is rendered, the R sub-pixels, G sub-pixels and B sub-pixels are arranged in a triangle arrangement, and the number of single-primary color sub-pixels is reduced by 1 / 3 compared to the stripe arrangement. In other words, the image rendered by the sub-pixel algorithm is 2 / 3 times the original image. In order to eliminate the sub-pixel rendering of the original image, the first resolution of the original image needs to be increased by 3 / 2 times when the sub-pixel rendering algorithm is performed, so that after sub-pixel rendering, a second image with the same first resolution as the original image can be obtained. Figure 4 As shown, taking the first resolution of the original image as 720*2340 as an example, after inserting the second sub-pixel at the adjacent position of the first sub-pixel, the resolution becomes 1080*2340. Figure 5 shown.

[0072] It should be noted that: since a pixel is composed of a mixture of R sub-pixels, G sub-pixels and B sub-pixels, the horizontal and vertical coordinates of the R sub-pixels, G sub-pixels and B sub-pixels belonging to the same pixel are the same, and the R sub-pixels, G sub-pixels and B sub-pixels of the pixel point are arranged in the order of R, G, B. When inserting the second sub-pixel, the arrangement order of the second sub-pixel in the adjacent position is determined according to the type of the first sub-pixel. For example, the first sub-pixel is a sub-pixel of the green channel, and the first coordinate is (0,0). When inserting the second sub-pixel at the right adjacent position of the first sub-pixel, the second sub-pixel should be inserted after the R sub-pixel with the second coordinate of (0,0). Taking the 2*2 pixel area in the original image with a resolution of 720*2340 as an example, the coordinates of each sub-pixel in the 2*2 pixel area are as follows: Figure 6 As shown, R00, G00, and B00 belong to the 0th row and the 0th column, and the corresponding first coordinate is the pixel of (0, 0). The first coordinates of R00, G00, and B00 are the same; R01, G01, and B01 belong to the 0th row and the 1st column, and the corresponding first coordinate is the pixel of (1, 0). The coordinates of R01, G01, and B01 are the same.

[0073] It should be noted that the adjacent position of the first sub-pixel of the original image refers to the position adjacent to the left or right of the first sub-pixel in the original image. Figure 6 In the example, the right adjacent position of R00 is R01, and the left adjacent position of G01 is G00.

[0074] Optionally, the terminal 102 performs reverse deduction according to the rule of weighted summation of the sub-pixel rendering domain, and then determines whether to insert the second sub-pixel at the left adjacent position or the right adjacent position of the first sub-pixel of the original image, and then determines the arrangement order of the second sub-pixels at the adjacent position according to the type of the first sub-pixel, and finally obtains the first image of the second resolution; the second resolution is greater than the first resolution.

[0075] Step 206, performing sub-pixel rendering processing on the first image, eliminating the second sub-pixel inserted in the first image, and obtaining a second image of the first resolution; the sub-pixel information of the second image is the same as the pixel information of the first sub-pixel of the original image.

[0076] The sub-pixel information includes the coordinates of the sub-pixel and the pixel value of the sub-pixel.

[0077] The process of sub-pixel rendering is the process of weighted summing the target sub-pixel and the sub-pixels at the adjacent positions. Therefore, according to the domain weighted summation rule of sub-pixel rendering, reverse deduction is performed to know whether the second sub-pixel is finally inserted at the left adjacent position or the right adjacent position of the first sub-pixel in the original image. In this way, when performing sub-pixel rendering, the object of domain weighted summation is determined according to the position of the first sub-pixel in the original image, whether it is the sub-pixel at the left adjacent position or the sub-pixel at the right adjacent position. Then, when performing domain weighted summation, the weight of the sub-pixel at the adjacent position of the first sub-pixel is set to 0. In this way, after the first image is rendered by the sub-pixel algorithm, the inserted second sub-pixel is finally eliminated, and the first sub-pixel of the original image is retained. Therefore, the sub-pixel information of the second image is the same as the pixel information of the first sub-pixel of the first image. In other words, the second image is the original image.

[0078] Taking the first resolution of the original image as 720*2340 as an example, after the second sub-pixel is inserted at the adjacent position of the first sub-pixel, the resolution becomes 1080*2340. When performing the domain weighted summation, the first sub-pixel of the first image is weightedly summed with the first sub-pixel or the second sub-pixel at the left adjacent position or the right adjacent position, and the weight of the first sub-pixel or the second sub-pixel at the adjacent position is set to 0, thereby eliminating the second sub-pixel inserted in the column, so that the resolution of the second image is 720*2340, and the pixel information of the first sub-pixel in the second image is the same as the pixel information of the first sub-pixel in the original image.

[0079] Optionally, the terminal 102 performs reverse deduction according to the domain weighted summation rule of sub-pixel rendering, and then finds out whether the second sub-pixel is finally inserted at the left adjacent position or the right adjacent position of the first sub-pixel in the original image. In this way, when performing sub-pixel rendering, it is determined whether the object of the domain weighted summation is the second sub-pixel at the left adjacent position or the second sub-pixel at the right adjacent position according to the position of the first sub-pixel in the original image. Then, when performing the domain weighted summation, the weight of the first sub-pixel or the second sub-pixel at the adjacent position is set to 0. In this way, after the first image is rendered by the sub-pixel algorithm, the inserted second sub-pixel is finally eliminated, and the obtained second image retains the first sub-pixel of the original image. The second image has the same resolution as the first image, and the sub-pixel information of the second image is the same as the pixel information of the first sub-pixel of the original image.

[0080] In the above image processing method, a second sub-pixel is inserted into an adjacent position of a first sub-pixel of an original image of a first resolution to obtain a first image of a second resolution; the second resolution is greater than the first resolution; the first image is subjected to sub-pixel rendering processing to eliminate the second sub-pixel inserted in the first image to obtain a second image of the first resolution; the sub-pixel information of the second image is the same as the pixel information of the first sub-pixel of the original image. In the above method, according to the domain weighted summation rule of sub-pixel rendering, reverse deduction is performed to determine whether the second sub-pixel is finally inserted into the left adjacent position or the right adjacent position of the first sub-pixel of the original image, so that when performing sub-pixel rendering, the object of the domain weighted summation is determined according to the position of the first sub-pixel in the original image, whether it is the second sub-pixel at the left adjacent position or the second sub-pixel at the right adjacent position, and then when performing domain weighted summation, the weight of the first sub-pixel or the second sub-pixel at the adjacent position is set to 0, so that after the first image is rendered by the sub-pixel algorithm, the inserted second sub-pixel is finally eliminated, and the first sub-pixel of the original image is retained, thereby eliminating the sub-pixel rendering effect.

[0081] The arrangement of the R sub-pixels, G sub-pixels and B sub-pixels of the original image includes a stripe arrangement and a triangle arrangement. Among them, the LCD panel adopts a stripe arrangement, the LCD panel adopts a backlight panel to emit light, the pixel ratio of the R, G, and B channels of the light-emitting panel is 1:1:1, the pixels are evenly arranged, and there is no mutual influence of the light emission of adjacent pixels. Due to the manufacturing process and power consumption requirements of the AMOLED display device, the ratio of the R, G, and B sub-pixels in the panel is 1:2:1, and the number of green pixels is twice that of red and blue pixels. In order to reduce the power consumption of the screen when it is lit, it is necessary to use a sub-pixel rendering method to simulate the effect of uniform and normal display of pixels. However, in order to test the real output of the target test mode after the sub-pixel rendering module in the AMOLED display device, it is necessary to eliminate the sub-pixel rendering effect. In this embodiment, in order to eliminate the sub-pixel rendering effect, the original image is interpolated according to the inverse sub-pixel rendering algorithm, and the second sub-pixel is inserted at the left adjacent position or the right adjacent position of the first sub-pixel of the original image. Since the interpolation position is determined by the inverse process of sub-pixel rendering, the sub-pixel rendering effect can be eliminated when performing sub-pixel rendering.

[0082] In one embodiment, Figure 7 As shown, according to the first coordinate of the first sub-pixel in the original image, determining the second coordinate of the first sub-pixel in the original image after interpolation specifically includes the following steps:

[0083] Step 702: Obtain the first coordinate of the first sub-pixel in the original image.

[0084] The first coordinate of the first sub-pixel in the original image represents the row and column of the original image where the first sub-pixel is located, the row represents the ordinate of the first coordinate, and the column represents the abscissa of the first coordinate. For example, if the first sub-pixel is in the 1st row and the 2nd column, the first coordinate of the first sub-pixel is (1, 2).

[0085] Step 704: Determine the interpolated second coordinate of the first sub-pixel in the original image according to the first coordinate of the first sub-pixel in the original image.

[0086] The second coordinate represents the row and column of the first sub-pixel in the first image, where the row is the ordinate and the column is the abscissa.

[0087] This step is to determine the interpolation position according to the inverse sub-pixel algorithm, insert the second sub-pixel at the left adjacent position or the right adjacent position of the first sub-pixel in the original image, and obtain the first image. In other words, the ordinate of the second coordinate after the interpolation of the first sub-pixel in the original image is the same as the ordinate of the first coordinate corresponding to the first sub-pixel, and the abscissa of the second coordinate after the interpolation of the first sub-pixel in the original image is determined according to the inverse sub-pixel rendering algorithm. The first sub-pixel in the first image changes not only the column, but also the row and the corresponding pixel value.

[0088] Since the sub-pixel rendering algorithm has different community weighting methods for even rows and odd columns, when interpolating, it is necessary to consider the first coordinate of the first sub-pixel in the original image and the inverse sub-pixel rendering algorithm to determine the interpolation position in the original image.

[0089] Since the sub-pixel rendering algorithm has the same borrowing principle for the sub-pixels of the red channel or the green channel, the sub-pixels of the red channel or the green channel are processed using the same weighting coefficient in the sub-pixel rendering algorithm, and the sub-pixels of the red channel or the green channel are interpolated using the same interpolation method in the inverse sub-pixel rendering algorithm.

[0090] In some embodiments, if the first sub-pixel of the original image is in an even row of the original image, and the first sub-pixel in the original image is a sub-pixel of a red channel or a green channel, the ordinate of the second coordinate after interpolation of the first sub-pixel in the original image is the same as the ordinate of the first coordinate corresponding to the first sub-pixel, and the abscissa of the second coordinate after interpolation of the first sub-pixel in the original image is equal to a preset multiple of the abscissa of the first coordinate corresponding to the first sub-pixel, and the pixel value of the first sub-pixel is assigned to the second coordinate; the preset multiple is greater than 1.

[0091] Since the image rendered by the sub-pixel algorithm is 2 / 3 times the original image, in order to eliminate the sub-pixel rendering of the original image, when performing the sub-pixel rendering algorithm, the first resolution of the original image needs to be increased by 3 / 2 times, so that the second image with the same first resolution as the original image can be obtained after sub-pixel rendering. That is to say, the preset multiple must be set to 3 / 2. Since the horizontal coordinate is an integer, the horizontal coordinate of the second coordinate after the interpolation of the first sub-pixel in the original image should be equal to 3 / 2 times the horizontal coordinate of the first coordinate rounded down. If the first sub-pixel of the original image is in an even row of the original image, and the first sub-pixel in the original image is a sub-pixel of the red channel or the green channel, the relationship between the first coordinate and the second coordinate of the first sub-pixel is as follows:

[0092]

[0093] Wherein, x0 represents the horizontal coordinate of the first sub-pixel of the original image; Indicates the horizontal coordinate of the second coordinate after interpolation of the first sub-pixel of the red channel or green channel in the original image; floor means rounding down. Figure 8 As shown, provide Figure 6 The sub-pixel position after interpolation of the pixel area shown, Figure 6 The abscissa of the second coordinate of the first sub-pixel R01 of the red or green channel whose abscissa is 1 in the original image after interpolation is 1, that is, Figure 6The first sub-pixel R01 in becomes R01' after interpolation.

[0094] In some embodiments, if the first sub-pixel of the original image is in an even row of the original image, and the first sub-pixel in the original image is a sub-pixel of the blue channel, the ordinate of the second coordinate after interpolation of the first sub-pixel in the original image is the same as the ordinate of the first coordinate corresponding to the first sub-pixel, and the abscissa of the second coordinate after interpolation of the first sub-pixel in the original image is equal to the sum of a preset multiple of the abscissa of the first coordinate corresponding to the first sub-pixel and 1, and the pixel value of the first sub-pixel is assigned to the second coordinate; the preset multiple is greater than 1.

[0095] Among them, since the image rendered by the sub-pixel algorithm is 2 / 3 times the original image, in order to eliminate the sub-pixel rendering of the original image, when performing the sub-pixel rendering algorithm, the first resolution of the original image needs to be increased by 3 / 2 times, so that the second image with the same first resolution as the original image can be obtained after sub-pixel rendering. That is to say, the preset multiple must be set to 3 / 2. Since the horizontal coordinate is an integer, the horizontal coordinate of the second coordinate after the interpolation of the first sub-pixel in the original image should be equal to the sum of 3 / 2 times the horizontal coordinate of the first coordinate rounded down and 1. If the first sub-pixel of the original image is in an even row of the original image, and the first sub-pixel in the original image is a sub-pixel of the blue channel, the relationship between the first coordinate and the second coordinate of the first sub-pixel is as follows:

[0096]

[0097] Among them, B Represents the horizontal coordinate of the second coordinate after interpolation of the first sub-pixel of the blue channel in the original image. Figure 8 As shown, Figure 6 The abscissa of the second coordinate of the first sub-pixel B01 of the blue channel with abscissa 1 in the original image after interpolation is 2, that is, Figure 6 The first sub-pixel B01 in is interpolated to become B01'.

[0098] In some embodiments, if the first sub-pixel of the original image is in an odd row of the original image, and the first sub-pixel in the original image is a sub-pixel of a red channel or a green channel, the ordinate of the second coordinate after interpolation of the first sub-pixel in the original image is the same as the ordinate of the first coordinate corresponding to the first sub-pixel, and the abscissa of the second coordinate after interpolation of the first sub-pixel in the original image is equal to the sum of a preset multiple of the abscissa of the first coordinate corresponding to the first sub-pixel and 1, and the pixel value of the first sub-pixel is assigned to the second coordinate; the preset multiple is greater than 1.

[0099] Among them, the preset multiples of this embodiment are the same as the above content and will not be repeated here.

[0100] If the first sub-pixel of the original image is in an odd row of the original image, and the first sub-pixel in the original image is a sub-pixel of a red channel or a green channel, the relationship between the first coordinate and the second coordinate of the first sub-pixel is as follows:

[0101]

[0102] In some embodiments, if the first sub-pixel of the original image is in an odd row of the original image, and the first sub-pixel in the original image is a sub-pixel of a blue channel, the ordinate of the second coordinate after interpolation of the first sub-pixel in the original image is the same as the ordinate of the first coordinate corresponding to the first sub-pixel, and the abscissa of the second coordinate after interpolation of the first sub-pixel in the original image is equal to a preset multiple of the abscissa of the first coordinate corresponding to the first sub-pixel, and the pixel value of the first sub-pixel is assigned to the second coordinate; the preset multiple is greater than 1.

[0103] Among them, the preset multiples of this embodiment are the same as the above content and will not be repeated here.

[0104] If the first sub-pixel of the original image is in an odd row of the original image, and the first sub-pixel in the original image is a sub-pixel of the blue channel, the relationship between the first coordinate and the second coordinate of the first sub-pixel is as follows:

[0105]

[0106] Based on the above content, the following is a summary:

[0107] If the first sub-pixel of the original image is in an even row, the relationship between the first coordinate and the second coordinate of the first sub-pixel satisfies the following relationship:

[0108]

[0109]

[0110] If the first sub-pixel of the original image is in an odd row, the relationship between the first coordinate and the second coordinate of the first sub-pixel satisfies the following relationship:

[0111]

[0112]

[0113] Step 706: If the first sub-pixel of the original image is in an even column of the original image, insert a second sub-pixel at a left adjacent position of the second coordinate corresponding to the first sub-pixel.

[0114] Among them, no matter whether the first sub-pixel of the original image is a sub-pixel of the red channel, the green channel or the blue channel, or the first sub-pixel of the original image is in an even row or an odd row, if the first sub-pixel of the original image is in an even column of the original image, the second sub-pixel is inserted at the left adjacent position of the second coordinate corresponding to the first sub-pixel.

[0115] like Figure 8 As shown, provide Figure 6 The sub-pixel position after interpolation of the pixel area shown, Figure 8 The coordinates of R00', G00', and B00' correspond to Figure 6 The interpolated coordinates of R00, G00, and B00 in Figure 8 W00' in the image indicates that the interpolated coordinate is the second sub-pixel (0, 0). Taking B00 in the original image as an example, the interpolation rule is explained. According to the rule of step 704, B00 belongs to the 0th row and the 0th column, that is, it belongs to an even row and an even column, and the corresponding first coordinate is (0, 0). Then the abscissa of the second coordinate after B00 interpolation satisfies the formula:

[0116]

[0117] That is, the horizontal coordinate of the second coordinate of B00 is 1, so the second coordinate is (1, 0), corresponding to Figure 8 Since B00 is in an even column, the second sub-pixel is inserted at the left adjacent position of the second coordinate corresponding to the first sub-pixel, that is, Figure 8 The second sub-pixel is inserted into the left adjacent position of B00', that is, Figure 8 Medium W00'.

[0118] Step 708: If the first sub-pixel of the original image is in an odd column of the original image, insert a second sub-pixel at a right adjacent position of the second coordinate corresponding to the first sub-pixel.

[0119] Among them, no matter whether the first sub-pixel of the original image is a sub-pixel of the red channel, the green channel or the blue channel, or the first sub-pixel of the original image is in an even row or an odd row, if the first sub-pixel of the original image is in an odd column of the original image, the second sub-pixel is inserted at the right adjacent position of the second coordinate corresponding to the first sub-pixel.

[0120] like Figure 8 As shown, provide Figure 6 The sub-pixel position after interpolation of the pixel area shown, Figure 8 The coordinates of R00', G00', and B00' correspond to Figure 6 The interpolated coordinates of R00, G00, and B00 in Figure 8W00' in the figure indicates that the interpolated coordinate is the second sub-pixel (0, 0). Taking R01 in the original image as an example, the interpolation rule is explained. According to the rule in step 704, R01 belongs to the 0th row and the 1st column, that is, it belongs to the even row and the odd column, and the corresponding first coordinate is (1, 0). Then the abscissa of the second coordinate after interpolation of R01 satisfies the formula:

[0121]

[0122] That is, the horizontal coordinate of the second coordinate of R00 is 1, so the second coordinate is also (1, 0), corresponding to Figure 8 Since R01 is in an odd column, the second sub-pixel is inserted at the right adjacent position of the second coordinate corresponding to the first sub-pixel, that is, Figure 8 The second sub-pixel is inserted into the left adjacent position of R00', that is, Figure 8 Medium W01'.

[0123] Step 710 , inserting the second sub-pixel into the adjacent position of the second coordinate corresponding to each first sub-pixel, thereby obtaining a first image with a second resolution; the first image includes the first sub-pixel and the second sub-pixel.

[0124] Among them, the resolution of the display screen is an even number, so the first sub-pixel and the last first sub-pixel of the original image are both in even columns, and the second sub-pixel needs to be inserted at the left adjacent position of the second coordinate corresponding to the first sub-pixel. For the first sub-pixel of the red channel or the green channel of the first pixel of the original image, the first coordinate of the first sub-pixel of the red channel or the green channel is (0, 0), and the corresponding second coordinate is also (0, 0). The second sub-pixel needs to be inserted at the position with the second coordinate (-1, 0) in the first image. Since the position with the second coordinate (-1, 0) is not in the first image, it should be discarded.

[0125] In this embodiment, the second coordinate of the first sub-pixel in the original image after interpolation is determined according to the inverse sub-pixel rendering algorithm, and according to the parity of the horizontal coordinate of the first coordinate of the first sub-pixel in the original image, it is determined to insert the second sub-pixel at the left adjacent position or the right adjacent position of the first sub-pixel in the original image. In this way, when performing sub-pixel rendering, the sub-pixel rendering effect can be eliminated.

[0126] In one embodiment, Fig. 9 As shown, performing sub-pixel rendering processing on the first image, eliminating the second sub-pixel inserted in the first image, and obtaining a second image with a first resolution includes the following steps:

[0127] Step 902: Determine a third coordinate of the first sub-pixel in the first image after rendering according to the second coordinate of the first sub-pixel in the first image.

[0128] The third coordinate represents the row and column of the first sub-pixel in the second image, where the row is the ordinate and the column is the abscissa.

[0129] This step is to perform sub-pixel rendering processing according to the sub-pixel algorithm, and perform field weighted summation processing on the first sub-pixel in the first image, and the first sub-pixel or the second sub-pixel at the left adjacent position or the right adjacent position of the first sub-pixel, to obtain the second image. In other words, the ordinate of the third coordinate after sub-pixel rendering is the same as the ordinate of the second coordinate. After the first image is sub-pixel rendered, the first sub-pixel in the first image changes not only the column, but also the row and the corresponding pixel value. In this embodiment, the third coordinate of the first sub-pixel in the first image after rendering can be determined based on the sub-pixel rendering algorithm and the second coordinate of the first sub-pixel in the first image.

[0130] In some embodiments, if the first sub-pixel in the first image is in an even row and the first sub-pixel in the first image is a sub-pixel of a red channel or a green channel, the ordinate of the third coordinate after rendering the first sub-pixel in the first image is the same as the ordinate of the second coordinate corresponding to the first sub-pixel in the first image, and the abscissa of the third coordinate after rendering the first sub-pixel in the first image is equal to a preset multiple of the abscissa of the second coordinate corresponding to the first sub-pixel rounded up, and the pixel value of the first sub-pixel is assigned to the second coordinate; the preset multiple is less than 1.

[0131] Among them, since the image rendered by the sub-pixel algorithm is 2 / 3 times the original image, the preset multiple of this embodiment is set to 2 / 3. Since the horizontal coordinate is an integer, the horizontal coordinate of the third coordinate after the first sub-pixel in the first image is rendered should be equal to the value of 2 / 3 times the horizontal coordinate of the first coordinate rounded up. If the first sub-pixel in the first image is in an even row, and the first sub-pixel in the first image is a sub-pixel of the red channel or the green channel, the relationship between the second coordinate and the third coordinate of the first sub-pixel is as follows:

[0132]

[0133] Among them, x spr Represents the abscissa of the third coordinate of the first sub-pixel of the red channel or the green channel in the first image after rendering; ceil represents rounding up.

[0134] In some embodiments, if the first sub-pixel in the first image is in an even row and the first sub-pixel in the first image is a sub-pixel of the blue channel, the ordinate of the third coordinate after rendering the first sub-pixel in the first image is the same as the ordinate of the second coordinate corresponding to the first sub-pixel in the first image, and the abscissa of the third coordinate after rendering the first sub-pixel in the first image is equal to the value rounded up of the difference between a preset multiple of the abscissa of the second coordinate corresponding to the first sub-pixel and 2 / 3, and the pixel value of the first sub-pixel is assigned to the second coordinate; the preset multiple is less than 1.

[0135] Among them, since the image rendered by the sub-pixel algorithm is 2 / 3 times the original image, the preset multiple of this embodiment is set to 2 / 3. Since the horizontal coordinate is an integer, the horizontal coordinate of the third coordinate after the first sub-pixel is rendered in the first image should be equal to the value of the difference between 2 / 3 times and 2 / 3 of the horizontal coordinate of the first coordinate rounded up. If the first sub-pixel in the first image is in an even row, and the first sub-pixel in the first image is a sub-pixel of the red channel or the green channel, the relationship between the second coordinate and the third coordinate of the first sub-pixel is as follows:

[0136]

[0137] In some embodiments, if the first sub-pixel in the first image is in an odd row and the first sub-pixel in the first image is a sub-pixel of a red channel or a green channel, the ordinate of the third coordinate after rendering the first sub-pixel in the first image is the same as the ordinate of the second coordinate corresponding to the first sub-pixel in the first image, and the abscissa of the third coordinate after rendering the first sub-pixel in the first image is equal to the value rounded up between a preset multiple of the abscissa of the second coordinate corresponding to the first sub-pixel and 2 / 3, and the pixel value of the first sub-pixel is assigned to the second coordinate; the preset multiple is less than 1.

[0138] Among them, since the image rendered by the sub-pixel algorithm is 2 / 3 times the original image, the preset multiple of this embodiment is set to 2 / 3. Since the horizontal coordinate is an integer, the horizontal coordinate of the third coordinate after the first sub-pixel is rendered in the first image should be equal to the value of the difference between 2 / 3 times and 2 / 3 of the horizontal coordinate of the first coordinate rounded up. If the first sub-pixel in the first image is in an even row, and the first sub-pixel in the first image is a sub-pixel of the red channel or the green channel, the relationship between the second coordinate and the third coordinate of the first sub-pixel is as follows:

[0139]

[0140] In some embodiments, if the first sub-pixel in the first image is in an odd row and the first sub-pixel in the first image is a sub-pixel of the blue channel, the ordinate of the third coordinate after rendering the first sub-pixel in the first image is the same as the ordinate of the second coordinate corresponding to the first sub-pixel in the first image, and the abscissa of the third coordinate after rendering the first sub-pixel in the first image is equal to a preset multiple of the abscissa of the second coordinate corresponding to the first sub-pixel rounded up, and the pixel value of the first sub-pixel is assigned to the second coordinate; the preset multiple is less than 1.

[0141] Among them, since the image rendered by the sub-pixel algorithm is 2 / 3 times the original image, the preset multiple of this embodiment is set to 2 / 3. Since the horizontal coordinate is an integer, the horizontal coordinate of the third coordinate after the first sub-pixel in the first image is rendered should be equal to the value of 2 / 3 times the horizontal coordinate of the first coordinate rounded up. If the first sub-pixel in the first image is in an even row, and the first sub-pixel in the first image is a sub-pixel of the red channel or the green channel, the relationship between the second coordinate and the third coordinate of the first sub-pixel is as follows:

[0142]

[0143] Based on the above content, the following is a summary:

[0144] If the first sub-pixel in the first image is in an even row, the relationship between the second coordinate and the third coordinate of the first sub-pixel is as follows:

[0145]

[0146]

[0147] If the first sub-pixel in the first image is located in an odd row, the relationship between the second coordinate and the third coordinate of the first sub-pixel is as follows:

[0148]

[0149]

[0150] Step 904, if the horizontal coordinate of the third coordinate is in an even column, weighted sum is performed on the pixel value of the first sub-pixel in the first image and the pixel value of the first sub-pixel or the second sub-pixel at the left adjacent position of the first sub-pixel to obtain the target pixel on the third coordinate; the weight of the first sub-pixel in the first image is 1; the weight of the first sub-pixel or the second sub-pixel at the left adjacent position of the first sub-pixel is 0.

[0151] Among them, after determining the third horizontal coordinate of the first sub-pixel in the second image according to step 902, the row of the first sub-pixel in the second image is determined according to the horizontal coordinate of the third coordinate, and rendering is performed according to the rendering algorithm corresponding to the odd and even rows, and finally the rendered second image is obtained.

[0152] The neighborhood weighting algorithm for the sub-pixel rendering algorithm is as follows:

[0153] If the abscissa of the third coordinate of the first sub-pixel in the second image is in an even row, the pixel value at the third coordinate is:

[0154]

[0155]

[0156] in, The third coordinate of the first sub-pixel of the red channel or the green channel on the second image is (x spr y) pixel value; The third coordinate of the first sub-pixel of the red channel or the green channel on the second image is (x spr y) pixel value; The second coordinate of the first sub-pixel representing the red channel or the green channel in the first image is The pixel value of The second coordinate representing the red channel or green channel in the first image is The pixel value of The second coordinate of the first sub-pixel representing the blue channel in the first image is The pixel value of The second coordinate of the first sub-pixel representing the blue channel in the first image is The pixel value of ; factor represents the weight.

[0157] If the abscissa of the third coordinate of the first sub-pixel in the second image is in an odd row, the pixel value at the third coordinate is:

[0158]

[0159]

[0160] According to the domain weighted algorithm of the sub-pixel rendering algorithm, no matter whether the first sub-pixel of the first image is a sub-pixel of the red channel, the green channel or the blue channel, or the first sub-pixel of the first image is in an even row or an odd row, if the horizontal coordinate of the third coordinate is in an even column, the pixel value of the first sub-pixel in the first image and the pixel value of the second sub-pixel at the left adjacent position of the first sub-pixel are weighted summed, and the weight of the first sub-pixel or the second sub-pixel at the left adjacent position of the first sub-pixel is 0.

[0161] by Figure 8 For example, the second coordinate of B00' is (1, 0), which is located in the even rows and odd columns of the first image. According to step 902, the third coordinate corresponding to B00' is (0, 0), which is located in the even rows and even columns of the second image. Since the abscissa of the third coordinate corresponding to B00' is in the even columns, Figure 8 The pixel value of B00' in the second image and the pixel value of W00' at the left adjacent position of B00' are weightedly summed, the weight of the pixel value of W00' is 0, and finally the pixel value at the third coordinate on the second image is equal to the pixel value of B00'.

[0162] Step 906, if the horizontal coordinate of the third coordinate is in an odd column, the pixel value of the first sub-pixel in the first image and the pixel value of the first sub-pixel or the second sub-pixel at the right adjacent position of the first sub-pixel are weighted summed to obtain the target pixel on the third coordinate; the weight of the first sub-pixel in the first image is 1; the weight of the first sub-pixel or the second sub-pixel at the right adjacent position of the first sub-pixel is 0.

[0163] According to the domain weighted algorithm of the sub-pixel rendering algorithm, no matter whether the first sub-pixel of the first image is a sub-pixel of the red channel, the green channel or the blue channel, or the first sub-pixel of the first image is in an even row or an odd row, if the horizontal coordinate of the third coordinate is in an odd column, the pixel value of the first sub-pixel in the first image and the pixel value of the second sub-pixel at the right adjacent position of the first sub-pixel are weighted and summed, and the weight of the first sub-pixel or the second sub-pixel at the right adjacent position of the first sub-pixel is 0.

[0164] like Figure 8 As shown, when performing sub-pixel rendering, the pixel value of the first sub-pixel in the first image and the pixel value of the sub-pixel at the right adjacent position of the first sub-pixel are weighted summed, but, Figure 8 The sub-pixel at the right adjacent position of B01' is B02'. Therefore, the sub-pixel at the right adjacent position in this embodiment may be the first sub-pixel or the second sub-pixel. The specific type of the sub-pixel at the right adjacent position is determined according to step 704 and will not be repeated here.

[0165] by Figure 8 For example, the second coordinate of B01' is (2, 0), which is located in the even rows and even columns of the first image. According to step 902, the third coordinate corresponding to B01' is (1, 0), which is located in the even rows and odd columns of the second image. Since the abscissa of the third coordinate corresponding to B01' is in the odd columns, Figure 8 The pixel value of B01' in , and the pixel value of B02' at the right adjacent position of B01' ( Figure 8The pixel values ​​of B02′ (not shown) are weighted summed, the weight of the pixel value of B02′ is 0, and finally the pixel value at the third coordinate on the second image is equal to the pixel value of B01′.

[0166] It can be seen from step 904 and step 906 that, in this embodiment, when performing the domain weighted processing of the sub-pixel rendering algorithm, for even-numbered rows:

[0167] Let factor rg00 =1, factor rg01 =1, factor b00 =1, factor b01 =1; the sub-pixel rendering algorithm is improved as follows:

[0168]

[0169]

[0170] For odd numbered rows:

[0171] Let factor rg10 =1, factor rg11 =1, factor b10 =1, factor b11 =1; the sub-pixel rendering algorithm is improved as follows:

[0172]

[0173]

[0174] Step 908 : After rendering each first sub-pixel of the first image, a second image with a first resolution is obtained.

[0175] According to the process of step 902 to step 906, the third coordinates of each first sub-pixel in the second image and the pixel value at the third coordinates are determined, and finally a second image having the same pixel information as the original image is obtained. Figure 8 After the first sub-pixel in is processed according to the improved sub-pixel rendering algorithm, let factor rg00 =1, factor rg01 =1, factor b00 =1, factor b01 =1, we can get:

[0176] R00=(1-factor rg00 )*R01'+factor rg00 *R00'=R00'

[0177] G00=(1-factor rg00)*G01'+factor rg00 *G00'=G00'

[0178] R01=factor rg01 *R01'+(1-factor rg01 )*W01'=R01'

[0179] G01=factor rg01 *G01'+(1-factor rg01 )*W02'=G01'

[0180] B00=(1-factor b00 )*W00'+factor b00 *B00'=B00'

[0181] B01=factor b01 *B01'+(1-factor b01 )*B02'=B01'

[0182] Figure 8 The odd-numbered rows in are derived according to the same principle and will not be repeated here.

[0183] In this embodiment, when the domain weighted algorithm is applied to the first sub-pixel rendering of the second image, the weight of the sub-pixel at the left adjacent position or the right adjacent position of the first sub-pixel in the second image is set to 0 according to the parity of the horizontal coordinate of the third coordinate corresponding to the first sub-pixel. In this way, the second image after sub-pixel rendering completely retains the first sub-pixel in the second image, eliminates the second sub-pixel of the second image, and restores the second image to the original image, thereby eliminating the sub-pixel rendering effect.

[0184] Before performing the sub-pixel rendering algorithm, in order to avoid the situation where there is no element in the boundary coordinates of the pixel weighted region at the boundary of the first image, in some embodiments, after determining the third coordinate of the first sub-pixel in the first image after rendering according to the second coordinate of the first sub-pixel in the first image, the method further includes:

[0185] If the first sub-pixel of the first image meets the boundary condition and the abscissa of the third coordinate of the first sub-pixel is in an even column, a preset pixel value is assigned to the left adjacent position of the first sub-pixel.

[0186] The boundary condition is that the difference between the horizontal coordinate of the second coordinate of the first sub-pixel of the first image and 1 is less than 0, or the horizontal coordinate of the second coordinate of the first sub-pixel of the first image is greater than 1.

[0187] Since the weight of the pixel value at the left adjacent position or the right adjacent position of the first sub-pixel in the second image is set to 0 in the domain weighted summation algorithm for sub-pixel rendering, it needs to be eliminated. Therefore, the preset pixel value can be the second pixel value, the first pixel value, or any pixel value. In this embodiment, when the first sub-pixel of the first image meets the boundary condition and the horizontal coordinate of the third coordinate of the first sub-pixel is in an even column, the column where the first sub-pixel is located is used as the symmetry axis for mirror processing.

[0188] Fig.10 The pixels at the boundary of the first image are provided. Fig.10 For example, the coordinates of R00' are (0, 0), which is located in the even rows and even columns of the first image. According to step 902, the third coordinates corresponding to R00' are determined to be (0, 0), which is located in the even rows and even columns of the second image. Since the abscissa of the third coordinate corresponding to R00' is in the even columns, Figure 8 The pixel value of R00' in the image and the first pixel value at the left adjacent position of R00' are weighted summed, but R00' is at the boundary and there is no element at the left adjacent position of R00', so the column where R00' is located is used as the symmetry axis for mirror processing, and the pixel value of R01' is assigned to the left adjacent position of R00'. Finally, Figure 8 The pixel value of R00' in the image and the pixel value of R01' at the left adjacent position of R00' are weightedly summed, the weight of the pixel value of R01' is 0, and finally the pixel value at the third coordinate on the second image is equal to the pixel value of R00'.

[0189] In some embodiments, after determining the third coordinate of the first sub-pixel in the first image after rendering according to the second coordinate of the first sub-pixel in the first image, the method further includes:

[0190] If the first sub-pixel of the first image meets the boundary condition and the abscissa of the third coordinate of the first sub-pixel is in an odd column, a preset pixel value is assigned to the right adjacent position of the first sub-pixel.

[0191] The boundary conditions and the preset pixel values ​​are the same as those in the above embodiment and will not be described again here.

[0192] by Figure 8 For example, the coordinates of B01' are (2, 0), which are located in the even rows and even columns of the first image. According to step 902, the third coordinates corresponding to B01' are (1, 0), which are located in the even rows and odd columns of the second image. Since the abscissa of the third coordinate corresponding to B01' is in the odd column, Figure 8The pixel value of B01' in the column and the first pixel value at the right adjacent position of B01' are weighted summed, but B01' is at the boundary and there is no element at the right adjacent position of B01', so the column where B01' is located is used as the symmetry axis for mirror processing, and the pixel value of B00' is assigned to the right adjacent position of B01'. Finally, Figure 8 The pixel value of B01' in the second image and the pixel value of B00' at the right adjacent position of B01' are weighted summed, the weight of the pixel value of B00' is 0, and finally the pixel value at the third coordinate on the second image is equal to the pixel value of B01'.

[0193] In this embodiment, after determining the third coordinate of the first sub-pixel after rendering in the first image based on the second coordinate of the first sub-pixel in the first image, by traversing the first image, if the first sub-pixel of the first image meets the boundary condition and the horizontal coordinate of the third coordinate of the first sub-pixel is in an even column or an odd column, a preset pixel value is assigned to the left adjacent position or the right adjacent position of the first sub-pixel, thereby avoiding the situation where there are no elements in the boundary coordinates of the pixel weighted area at the boundary of the first image, resulting in the resolution of the second image after sub-pixel rendering not being the first resolution.

[0194] In one embodiment, the image processing method comprises the following steps:

[0195] Step 1: Obtain an original image of a first resolution.

[0196] Step 2: Obtain the first coordinate of the first sub-pixel in the original image.

[0197] Step 3, determine whether the first sub-pixel of the original image is in an even row of the original image, if so, execute step 4, if not, execute step 7.

[0198] Step 4, determining whether the first sub-pixel in the original image is a sub-pixel of the red channel or the green channel, if so, executing step 5, if not, executing step 6.

[0199] Step 5: the ordinate of the second coordinate after the interpolation of the first sub-pixel in the original image is the same as the ordinate of the first coordinate corresponding to the first sub-pixel, the abscissa of the second coordinate after the interpolation of the first sub-pixel in the original image is equal to a preset multiple of the abscissa of the first coordinate corresponding to the first sub-pixel, and the pixel value of the first sub-pixel is assigned to the second coordinate; the preset multiple is greater than 1; execute step 10.

[0200] Step 6: the ordinate of the second coordinate after the interpolation of the first sub-pixel in the original image is the same as the ordinate of the first coordinate corresponding to the first sub-pixel, the abscissa of the second coordinate after the interpolation of the first sub-pixel in the original image is equal to the sum of a preset multiple of the abscissa of the first coordinate corresponding to the first sub-pixel and 1, and the pixel value of the first sub-pixel is assigned to the second coordinate; the preset multiple is greater than 1; execute step 10.

[0201] Step 7, determine whether the first sub-pixel in the original image is a sub-pixel of the red channel or the green channel, if so, execute step 8, if not, execute step 9.

[0202] Step 8: The ordinate of the second coordinate after interpolation of the first sub-pixel in the original image is the same as the ordinate of the first coordinate corresponding to the first sub-pixel, and the abscissa of the second coordinate after interpolation of the first sub-pixel in the original image is equal to the sum of a preset multiple of the abscissa of the first coordinate corresponding to the first sub-pixel and 1, and the pixel value of the first sub-pixel is assigned to the second coordinate; the preset multiple is greater than 1; and step 10 is executed.

[0203] Step 9: the ordinate of the second coordinate after the interpolation of the first sub-pixel in the original image is the same as the ordinate of the first coordinate corresponding to the first sub-pixel, the abscissa of the second coordinate after the interpolation of the first sub-pixel in the original image is equal to a preset multiple of the abscissa of the first coordinate corresponding to the first sub-pixel, and the pixel value of the first sub-pixel is assigned to the second coordinate; the preset multiple is greater than 1; execute step 10.

[0204] Step 10, determining whether the first sub-pixel of the original image is in an even column of the original image, if so, executing step 11, if not, executing step 12.

[0205] Step 11, inserting a second sub-pixel at the left adjacent position of the second coordinate corresponding to the first sub-pixel, and executing step 13.

[0206] Step 12, inserting a second sub-pixel at the right adjacent position of the second coordinate corresponding to the first sub-pixel, and executing step 13.

[0207] Step 13, after inserting the second sub-pixel at the adjacent position of the second coordinate corresponding to each first sub-pixel, obtain the first image with a second resolution; the first image includes the first sub-pixel and the second sub-pixel; the second resolution is greater than the first resolution, execute step 14.

[0208] Step 14, determining whether the first sub-pixel in the first image is in an even row of the original image, if so, executing step 15, if not, executing step 18.

[0209] Step 15, determining whether the first sub-pixel in the first image is a sub-pixel of a red channel or a green channel, if so, executing step 16, if not, executing step 17.

[0210] Step 16: the ordinate of the third coordinate after the first sub-pixel in the first image is rendered is the same as the ordinate of the second coordinate corresponding to the first sub-pixel in the first image, and the abscissa of the third coordinate after the first sub-pixel in the first image is equal to the value rounded up to a preset multiple of the abscissa of the second coordinate corresponding to the first sub-pixel, and the pixel value of the first sub-pixel is assigned to the second coordinate; if the preset multiple is less than 1, execute step 18.

[0211] Step 17, the ordinate of the third coordinate after the first sub-pixel in the first image is rendered is the same as the ordinate of the second coordinate corresponding to the first sub-pixel in the first image, and the abscissa of the third coordinate after the first sub-pixel in the first image is equal to the value obtained by rounding up the difference between a preset multiple of the abscissa of the second coordinate corresponding to the first sub-pixel and 2 / 3, and the pixel value of the first sub-pixel is assigned to the second coordinate; if the preset multiple is less than 1, execute step 18.

[0212] Step 18, determining whether the first sub-pixel in the first image is a sub-pixel of a red channel or a green channel, if so, executing step 19, if not, executing step 20.

[0213] Step 19, the ordinate of the third coordinate after the first sub-pixel in the first image is rendered is the same as the ordinate of the second coordinate corresponding to the first sub-pixel in the first image, and the abscissa of the third coordinate after the first sub-pixel in the first image is equal to the value obtained by rounding up the difference between a preset multiple of the abscissa of the second coordinate corresponding to the first sub-pixel and 2 / 3, and the pixel value of the first sub-pixel is assigned to the second coordinate; if the preset multiple is less than 1, execute step 21.

[0214] Step 20: When the ordinate of the third coordinate after the first sub-pixel in the first image is rendered is the same as the ordinate of the second coordinate corresponding to the first sub-pixel in the first image, and the abscissa of the third coordinate after the first sub-pixel in the first image is equal to a preset multiple of the abscissa of the second coordinate corresponding to the first sub-pixel rounded up, the pixel value of the first sub-pixel is assigned to the second coordinate; if the preset multiple is less than 1, execute step 21.

[0215] Step 21, determine whether the horizontal coordinate of the third coordinate of the first image is in an even column of the original image, if so, execute step 22, if not, execute step 23.

[0216] Step 22, perform weighted summation on the pixel value of the first sub-pixel in the first image and the pixel value of the second sub-pixel at the left adjacent position of the first sub-pixel to obtain the target pixel at the third coordinate; the weight of the first sub-pixel in the first image is 1; the weight of the first sub-pixel or the second sub-pixel at the left adjacent position of the first sub-pixel is 0, and execute step 24.

[0217] Step 23, perform weighted summation on the pixel value of the first sub-pixel in the first image and the pixel value of the second sub-pixel at the right adjacent position of the first sub-pixel to obtain the target pixel at the third coordinate; the weight of the first sub-pixel in the first image is 1; the weight of the first sub-pixel or the second sub-pixel at the right adjacent position of the first sub-pixel is 0, and execute step 24.

[0218] Step 24, after each first sub-pixel of the first image is rendered, a second image of the first resolution is obtained; the sub-pixel information of the second image is the same as the pixel information of the first sub-pixel of the original image.

[0219] For display screens with uneven sub-pixel spacing and arrangement, this embodiment adopts an inverse sub-pixel rendering algorithm to perform interpolation processing, complete the data space domain, perform sub-pixel rendering on the interpolated first image, adopt a weighted method of selecting the maximum weight of adjacent pixels and discarding one of the pixel values, filter out pixels in the interpolation area, eliminate the sub-pixel rendering effect, and make the sub-pixel information of the second image after sub-pixel rendering the same as the original image.

[0220] It should be understood that, although the various steps in the flowcharts involved in the above-mentioned embodiments are displayed in sequence according to the indication of the arrows, these steps are not necessarily executed in sequence according to the order indicated by the arrows. Unless there is a clear explanation in this article, the execution of these steps does not have a strict order restriction, and these steps can be executed in other orders. Moreover, at least a part of the steps in the flowcharts involved in the above-mentioned embodiments can include multiple steps or multiple stages, and these steps or stages are not necessarily executed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily to be carried out in sequence, but can be executed in turn or alternately with other steps or at least a part of the steps or stages in other steps.

[0221] Based on the same inventive concept, the embodiment of the present application also provides an image processing device for implementing the above-mentioned image processing method. The implementation solution provided by the device to solve the problem is similar to the implementation solution recorded in the above-mentioned method, so the specific limitations in one or more image processing device embodiments provided below can refer to the limitations on the image processing method above, and will not be repeated here.

[0222] In one embodiment, Fig.11 As shown, an image processing device is provided, comprising: an acquisition module 100, an interpolation module 200 and a rendering module 300, wherein:

[0223] An acquisition module 100 is used to acquire an original image with a first resolution;

[0224] An interpolation module 200 is used to insert a second sub-pixel at an adjacent position of a first sub-pixel of an original image to obtain a first image with a second resolution; the second resolution is greater than the first resolution;

[0225] The rendering module 300 is used to perform sub-pixel rendering processing on the first image, eliminate the second sub-pixel inserted in the first image, and obtain a second image of the first resolution; the sub-pixel information of the second image is the same as the pixel information of the first sub-pixel of the original image.

[0226] In one embodiment, the interpolation module 200 is further used to obtain a first coordinate of a first sub-pixel in the original image;

[0227] Determine, according to the first coordinate of the first sub-pixel in the original image, a second coordinate after interpolation of the first sub-pixel in the original image;

[0228] If the first sub-pixel of the original image is in an even-numbered column of the original image, inserting a second sub-pixel at a left adjacent position of the second coordinate corresponding to the first sub-pixel;

[0229] If the first sub-pixel of the original image is in an odd-numbered column of the original image, inserting a second sub-pixel at a right adjacent position of the second coordinate corresponding to the first sub-pixel;

[0230] After the second sub-pixels are inserted into adjacent positions of the second coordinates corresponding to the first sub-pixels, a first image with a second resolution is obtained; the first image includes the first sub-pixels and the second sub-pixels.

[0231] In one embodiment, the interpolation module 200 is further configured to assign the pixel value of the first subpixel to the second coordinate when the first subpixel of the original image is in an even row of the original image and the first subpixel in the original image is a subpixel of a red channel or a green channel, the ordinate of the second coordinate of the first subpixel after interpolation in the original image is the same as the ordinate of the first coordinate corresponding to the first subpixel, and the abscissa of the second coordinate of the first subpixel after interpolation in the original image is equal to a preset multiple of the abscissa of the first coordinate corresponding to the first subpixel; the preset multiple is greater than 1;

[0232] When the first sub-pixel of the original image is in an even row of the original image and the first sub-pixel in the original image is a sub-pixel of the blue channel, the ordinate of the second coordinate after interpolation of the first sub-pixel in the original image is the same as the ordinate of the first coordinate corresponding to the first sub-pixel, and the abscissa of the second coordinate after interpolation of the first sub-pixel in the original image is equal to the sum of a preset multiple of the abscissa of the first coordinate corresponding to the first sub-pixel and 1, and the pixel value of the first sub-pixel is assigned to the second coordinate; the preset multiple is greater than 1.

[0233] In one embodiment, the interpolation module 200 is further configured to assign the pixel value of the first subpixel to the second coordinate after interpolation of the first subpixel in the original image, when the first subpixel in the original image is in an odd row of the original image and the first subpixel in the original image is a subpixel of a red channel or a green channel, the ordinate of the second coordinate after interpolation of the first subpixel in the original image is the same as the ordinate of the first coordinate corresponding to the first subpixel, the abscissa of the second coordinate after interpolation of the first subpixel in the original image is equal to the sum of a preset multiple of the abscissa of the first coordinate corresponding to the first subpixel and 1; and the preset multiple is greater than 1;

[0234] When the first sub-pixel of the original image is in an odd row of the original image and the first sub-pixel in the original image is a sub-pixel of the blue channel, the ordinate of the second coordinate after interpolation of the first sub-pixel in the original image is the same as the ordinate of the first coordinate corresponding to the first sub-pixel, and the abscissa of the second coordinate after interpolation of the first sub-pixel in the original image is equal to a preset multiple of the abscissa of the first coordinate corresponding to the first sub-pixel, and the pixel value of the first sub-pixel is assigned to the second coordinate; the preset multiple is greater than 1.

[0235] In one embodiment, the rendering module 300 is further used to determine a third coordinate of the first sub-pixel in the first image after rendering according to the second coordinate of the first sub-pixel in the first image;

[0236] If the abscissa of the third coordinate is in an even column, the pixel value of the first sub-pixel in the first image and the pixel value of the first sub-pixel or the second sub-pixel at the left adjacent position of the first sub-pixel are weighted summed to obtain the target pixel at the third coordinate; the weight of the first sub-pixel in the first image is 1; the weight of the first sub-pixel or the second sub-pixel at the left adjacent position of the first sub-pixel is 0;

[0237] If the abscissa of the third coordinate is in an odd column, the pixel value of the first sub-pixel in the first image and the pixel value of the first sub-pixel or the second sub-pixel at the right adjacent position of the first sub-pixel are weighted summed to obtain the target pixel at the third coordinate; the weight of the first sub-pixel in the first image is 1; the weight of the first sub-pixel or the second sub-pixel at the right adjacent position of the first sub-pixel is 0;

[0238] After each first sub-pixel of the first image is rendered, a second image with a first resolution is obtained.

[0239] In one embodiment, the rendering module 300 is further configured to, if the first sub-pixel in the first image is in an even row and the first sub-pixel in the first image is a sub-pixel of a red channel or a green channel, then the ordinate of the third coordinate of the first sub-pixel after rendering in the first image is the same as the ordinate of the second coordinate corresponding to the first sub-pixel in the first image, the abscissa of the third coordinate of the first sub-pixel after rendering in the first image is equal to a value rounded up to a preset multiple of the abscissa of the second coordinate corresponding to the first sub-pixel, and assign the pixel value of the first sub-pixel to the second coordinate; the preset multiple is less than 1;

[0240] If the first sub-pixel in the first image is in an even row and the first sub-pixel in the first image is a sub-pixel of the blue channel, the ordinate of the third coordinate after rendering the first sub-pixel in the first image is the same as the ordinate of the second coordinate corresponding to the first sub-pixel in the first image, and the abscissa of the third coordinate after rendering the first sub-pixel in the first image is equal to the value rounded up of the difference between a preset multiple of the abscissa of the second coordinate corresponding to the first sub-pixel and 2 / 3, and the pixel value of the first sub-pixel is assigned to the second coordinate; the preset multiple is less than 1.

[0241] In one embodiment, the rendering module 300 is further configured to, if the first sub-pixel in the first image is in an odd row and the first sub-pixel in the first image is a sub-pixel of a red channel or a green channel, then the ordinate of the third coordinate of the first sub-pixel after rendering in the first image is the same as the ordinate of the second coordinate corresponding to the first sub-pixel in the first image, the abscissa of the third coordinate of the first sub-pixel after rendering in the first image is equal to the value obtained by rounding up the difference between a preset multiple of the abscissa of the second coordinate corresponding to the first sub-pixel and 2 / 3, and assign the pixel value of the first sub-pixel to the second coordinate; the preset multiple is less than 1;

[0242] If the first sub-pixel in the first image is in an odd row, and the first sub-pixel in the first image is a sub-pixel of the blue channel, the ordinate of the third coordinate of the first sub-pixel in the first image after rendering is the same as the ordinate of the second coordinate corresponding to the first sub-pixel in the first image, and the abscissa of the third coordinate of the first sub-pixel in the first image after rendering is equal to the value rounded up to a preset multiple of the abscissa of the second coordinate corresponding to the first sub-pixel, and the pixel value of the first sub-pixel is assigned to the second coordinate; the preset multiple is less than 1. .

[0243] In one embodiment, the rendering module 300 is further configured to assign a preset pixel value to a left adjacent position of the first sub-pixel if the first sub-pixel of the first image satisfies the boundary condition and the abscissa of the third coordinate of the first sub-pixel is in an even column;

[0244] If the first sub-pixel of the first image meets the boundary condition and the abscissa of the third coordinate of the first sub-pixel is in an odd column, a preset pixel value is assigned to the right adjacent position of the first sub-pixel.

[0245] Each module in the above image processing device can be implemented in whole or in part by software, hardware or a combination thereof. Each module can be embedded in or independent of a processor in a computer device in the form of hardware, or can be stored in a memory in a computer device in the form of software, so that the processor can call and execute operations corresponding to each module.

[0246] In one embodiment, a computer device is provided. The computer device may be a terminal, and its internal structure diagram may be as follows: Fig.12 As shown. The computer device includes a processor, a memory, an input / output interface, a communication interface, a display unit and an input device. Among them, the processor, the memory and the input / output interface are connected through a system bus, and the communication interface, the display unit and the input device are connected to the system bus through the input / output interface. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The input / output interface of the computer device is used to exchange information between the processor and the external device. The communication interface of the computer device is used to communicate with an external terminal in a wired or wireless manner, and the wireless manner can be implemented through WIFI, a mobile cellular network, NFC (near field communication) or other technologies. When the computer program is executed by the processor, an image processing method is implemented. The display unit of the computer device is used to form a visually visible picture, which can be a display screen, a projection device or a virtual reality imaging device. The display screen can be a liquid crystal display screen or an electronic ink display screen, and the input device of the computer device can be a touch layer covering the display screen, or a button, trackball or touchpad set on the computer device shell, or an external keyboard, touchpad or mouse.

[0247] Those skilled in the art will understand that Fig.12 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.

[0248] In one embodiment, a computer device is provided, including a memory and a processor, wherein a computer program is stored in the memory, and the processor implements the steps in the above-mentioned method embodiments when executing the computer program.

[0249] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the steps in the above-mentioned method embodiments are implemented.

[0250] In one embodiment, a computer program product is provided, including a computer program, which implements the steps in the above method embodiments when executed by a processor.

[0251] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with relevant laws, regulations and standards of relevant countries and regions.

[0252] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to the memory, database or other medium used in the embodiments provided in the present application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetoresistive random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The database involved in each embodiment provided in this application may include at least one of a relational database and a non-relational database. Non-relational databases may include distributed databases based on blockchains, etc., but are not limited thereto. The processors involved in each embodiment provided in this application may be general-purpose processors, central processing units, graphics processors, digital signal processors, programmable logic devices, data processing logic devices based on quantum computing, etc., but are not limited thereto.

[0253] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0254] The above-described embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the present application. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the attached claims.

Claims

1. An image processing method, characterized in that: The method comprises: Acquire an original image of a first resolution; Inserting a second sub-pixel at an adjacent position of the first sub-pixel of the original image to obtain a first image with a second resolution; the second resolution is greater than the first resolution; Performing sub-pixel rendering processing on the first image, eliminating a second sub-pixel inserted in the first image, and obtaining a second image of a first resolution; sub-pixel information of the second image is the same as pixel information of the first sub-pixel of the original image; The performing sub-pixel rendering on the first image to eliminate the second sub-pixel inserted in the first image to obtain the second image with the first resolution includes: Determine, according to the second coordinate of the first sub-pixel in the first image, a third coordinate of the first sub-pixel in the first image after rendering; wherein the second coordinate of the first sub-pixel in the first image refers to: according to the first coordinate of the first sub-pixel in the original image, the second coordinate of the first sub-pixel in the original image after interpolation; If the abscissa of the third coordinate is in an even column, a pixel value of the first sub-pixel in the first image and a pixel value of the first sub-pixel or the second sub-pixel at the left adjacent position of the first sub-pixel are weighted summed to obtain a target pixel at the third coordinate; the weight of the first sub-pixel in the first image is 1; the weight of the first sub-pixel or the second sub-pixel at the left adjacent position of the first sub-pixel is 0; If the abscissa of the third coordinate is in an odd column, a pixel value of the first sub-pixel in the first image and a pixel value of the first sub-pixel or the second sub-pixel at a right adjacent position to the first sub-pixel are weighted summed to obtain a target pixel at the third coordinate; the weight of the first sub-pixel in the first image is 1; the weight of the first sub-pixel or the second sub-pixel at a right adjacent position to the first sub-pixel is 0; After each of the first sub-pixels of the first image is rendered, a second image of the first resolution is obtained.

2. The method according to claim 1, characterized in that Inserting a second sub-pixel at a position adjacent to the first sub-pixel of the original image to obtain a first image with a second resolution includes: Acquire a first coordinate of a first sub-pixel in the original image in the original image; Determine, according to a first coordinate of a first sub-pixel in the original image, a second coordinate of the first sub-pixel in the original image after interpolation; If the first sub-pixel of the original image is in an even column of the original image, inserting a second sub-pixel at a left adjacent position of the second coordinate corresponding to the first sub-pixel; If the first sub-pixel of the original image is in an odd column of the original image, inserting a second sub-pixel at a right adjacent position of the second coordinate corresponding to the first sub-pixel; After the second sub-pixel is inserted into the adjacent position of the second coordinate corresponding to each of the first sub-pixels, a first image with a second resolution is obtained; the first image includes the first sub-pixel and the second sub-pixel.

3. The method according to claim 2, characterized in that The step of determining, according to the first coordinate of the first sub-pixel in the original image, the interpolated second coordinate of the first sub-pixel in the original image comprises: If a first sub-pixel of the original image is in an even-numbered row of the original image, and the first sub-pixel in the original image is a sub-pixel of a red channel or a green channel, the ordinate of a second coordinate after interpolation of the first sub-pixel in the original image is the same as the ordinate of a first coordinate corresponding to the first sub-pixel, the abscissa of the second coordinate after interpolation of the first sub-pixel in the original image is equal to a preset multiple of the abscissa of the first coordinate corresponding to the first sub-pixel, and the pixel value of the first sub-pixel is assigned to the second coordinate; the preset multiple is greater than 1; If the first sub-pixel of the original image is in an even row of the original image, and the first sub-pixel in the original image is a sub-pixel of a blue channel, the ordinate of the second coordinate of the first sub-pixel in the original image after interpolation is the same as the ordinate of the first coordinate corresponding to the first sub-pixel, and the abscissa of the second coordinate of the first sub-pixel in the original image after interpolation is equal to the sum of a preset multiple of the abscissa of the first coordinate corresponding to the first sub-pixel and 1, and the pixel value of the first sub-pixel is assigned to the second coordinate; the preset multiple is greater than 1.

4. The method according to claim 3, characterized in that The step of determining, according to the first coordinate of the first sub-pixel in the original image, the interpolated second coordinate of the first sub-pixel in the original image comprises: If a first sub-pixel of the original image is in an odd row of the original image, and the first sub-pixel in the original image is a sub-pixel of a red channel or a green channel, the ordinate of a second coordinate after interpolation of the first sub-pixel in the original image is the same as the ordinate of a first coordinate corresponding to the first sub-pixel, the abscissa of the second coordinate after interpolation of the first sub-pixel in the original image is equal to the sum of a preset multiple of the abscissa of the first coordinate corresponding to the first sub-pixel and 1, and the pixel value of the first sub-pixel is assigned to the second coordinate; the preset multiple is greater than 1; If the first sub-pixel of the original image is in an odd row of the original image, and the first sub-pixel in the original image is a sub-pixel of a blue channel, the ordinate of the second coordinate after interpolation of the first sub-pixel in the original image is the same as the ordinate of the first coordinate corresponding to the first sub-pixel, and the abscissa of the second coordinate after interpolation of the first sub-pixel in the original image is equal to a preset multiple of the abscissa of the first coordinate corresponding to the first sub-pixel, and the pixel value of the first sub-pixel is assigned to the second coordinate; the preset multiple is greater than 1.

5. The method according to claim 1, characterized in that: The determining, according to the second coordinate of the first sub-pixel in the first image, a third coordinate of the first sub-pixel after rendering in the first image includes: If the first sub-pixel in the first image is in an even row, and the first sub-pixel in the first image is a sub-pixel of a red channel or a green channel, the ordinate of the third coordinate of the first sub-pixel after rendering in the first image is the same as the ordinate of the second coordinate corresponding to the first sub-pixel in the first image, the abscissa of the third coordinate of the first sub-pixel after rendering in the first image is equal to a value rounded up to a preset multiple of the abscissa of the second coordinate corresponding to the first sub-pixel, and the pixel value of the first sub-pixel is assigned to the second coordinate; the preset multiple is less than 1; If the first sub-pixel in the first image is in an even row and the first sub-pixel in the first image is a sub-pixel of the blue channel, the ordinate of the third coordinate after rendering the first sub-pixel in the first image is the same as the ordinate of the second coordinate corresponding to the first sub-pixel in the first image, and the abscissa of the third coordinate after rendering the first sub-pixel in the first image is equal to the value rounded up of the difference between a preset multiple of the abscissa of the second coordinate corresponding to the first sub-pixel and 2 / 3, and the pixel value of the first sub-pixel is assigned to the second coordinate; the preset multiple is less than 1.

6. The method according to claim 1, characterized in that The determining, according to the second coordinate of the first sub-pixel in the first image, a third coordinate of the first sub-pixel after rendering in the first image includes: If the first sub-pixel in the first image is in an odd row, and the first sub-pixel in the first image is a sub-pixel of a red channel or a green channel, the ordinate of the third coordinate after rendering of the first sub-pixel in the first image is the same as the ordinate of the second coordinate corresponding to the first sub-pixel in the first image, the abscissa of the third coordinate after rendering of the first sub-pixel in the first image is equal to the value obtained by rounding up the difference between a preset multiple of the abscissa of the second coordinate corresponding to the first sub-pixel and 2 / 3, and the pixel value of the first sub-pixel is assigned to the second coordinate; the preset multiple is less than 1; If the first sub-pixel in the first image is in an odd row and the first sub-pixel in the first image is a sub-pixel of the blue channel, the ordinate of the third coordinate after rendering the first sub-pixel in the first image is the same as the ordinate of the second coordinate corresponding to the first sub-pixel in the first image, and the abscissa of the third coordinate after rendering the first sub-pixel in the first image is equal to a preset multiple of the abscissa of the second coordinate corresponding to the first sub-pixel rounded up, and the pixel value of the first sub-pixel is assigned to the second coordinate; the preset multiple is less than 1.

7. The method according to claim 1, characterized in that After determining the third coordinate of the first sub-pixel in the first image after rendering according to the second coordinate of the first sub-pixel in the first image, the method further includes: If the first sub-pixel of the first image satisfies the boundary condition and the abscissa of the third coordinate of the first sub-pixel is in an even column, assigning a preset pixel value to the left adjacent position of the first sub-pixel; wherein the boundary condition is that the difference between the abscissa of the second coordinate of the first sub-pixel of the first image and 1 is less than 0, or the abscissa of the second coordinate of the first sub-pixel of the first image is greater than 1; If the first sub-pixel of the first image meets the boundary condition and the abscissa of the third coordinate of the first sub-pixel is in an odd column, a preset pixel value is assigned to the right adjacent position of the first sub-pixel.

8. An image processing device, characterized in that: The device comprises: An acquisition module, used for acquiring an original image of a first resolution; an interpolation module, configured to insert a second sub-pixel at an adjacent position of the first sub-pixel of the original image to obtain a first image of a second resolution; the second resolution is greater than the first resolution; a rendering module, configured to perform sub-pixel rendering processing on the first image, eliminate the second sub-pixel inserted in the first image, and obtain a second image of the first resolution; the sub-pixel information of the second image is the same as the pixel information of the first sub-pixel of the original image; The rendering module is further used to determine the third coordinate of the first sub-pixel in the first image after rendering according to the second coordinate of the first sub-pixel in the first image; wherein the second coordinate of the first sub-pixel in the first image refers to: the second coordinate of the first sub-pixel in the original image after interpolation is determined according to the first coordinate of the first sub-pixel in the original image; if the abscissa of the third coordinate is in an even column, the pixel value of the first sub-pixel in the first image and the pixel value of the first sub-pixel or the second sub-pixel at the left adjacent position of the first sub-pixel are weighted summed to obtain the target pixel on the third coordinate; The weight of the first subpixel in the first image is 1; the weight of the first subpixel or the second subpixel at the left adjacent position of the first subpixel is 0; if the horizontal coordinate of the third coordinate is in an odd column, the pixel value of the first subpixel in the first image and the pixel value of the first subpixel or the second subpixel at the right adjacent position of the first subpixel are weighted summed to obtain the target pixel on the third coordinate; the weight of the first subpixel in the first image is 1; the weight of the first subpixel or the second subpixel at the right adjacent position of the first subpixel is 0; after each of the first subpixels of the first image is rendered, a second image of the first resolution is obtained.

9. The device according to claim 8, characterized in that The interpolation module is further used to obtain the first coordinate of the first sub-pixel in the original image; determine the second coordinate of the first sub-pixel in the original image after interpolation according to the first coordinate of the first sub-pixel in the original image; if the first sub-pixel of the original image is in an even column of the original image, insert the second sub-pixel at the left adjacent position of the second coordinate corresponding to the first sub-pixel; if the first sub-pixel of the original image is in an odd column of the original image, insert the second sub-pixel at the right adjacent position of the second coordinate corresponding to the first sub-pixel; after inserting the second sub-pixel at the adjacent position of the second coordinate corresponding to each of the first sub-pixels, a first image of a second resolution is obtained; the first image includes the first sub-pixel and the second sub-pixel.

10. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 7 are implemented.

11. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 7 are implemented.

Citation Information

Patent Citations

  • Image restoration method and device

    CN109886886A