An image conversion method, device and storage medium

By acquiring and calculating the parameters of two-color pixels in the image, a converted image is formed, which solves the problem of data loss caused by mismatch in the arrangement of display panels and realizes image restoration and quality improvement.

CN115834854BActive Publication Date: 2026-02-03CHIP WEALTH TECH LTD
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202211483519.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-11-24
Publication Date
2026-02-03
Estimated Expiration
2042-11-24

AI Technical Summary

Technical Problem

In the prior art, data loss occurs when the arrangement of the image to be displayed does not match the arrangement of the display panel.

Method used

By obtaining the two-color pixel parameters of each two-color pixel in the image to be converted, the initial single-color pixel parameters corresponding to each two-color pixel are determined and calculated to form the converted image. Gaussian filter filtering and sharpening are then applied to improve image quality.

Benefits of technology

It achieves the restoration of the image to be converted, solves the data loss problem, and makes the converted image closer to the original image, thus improving the quality of image conversion.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115834854B_ABST
    Figure CN115834854B_ABST
Patent Text Reader

Abstract

The application provides an image conversion method, device and electronic equipment, which comprises the following steps: acquiring two-color pixel parameters of each two-color pixel point in a to-be-converted image; determining initial monochrome pixel parameters corresponding to each two-color pixel point according to the two-color pixel parameters of each two-color pixel point and two-color pixel points around each two-color pixel point; performing calculation on the initial monochrome pixel parameters to obtain calculated monochrome pixel parameters; and forming a converted image after conversion according to the calculated monochrome pixel parameters. The image conversion method, device and electronic equipment provided by the application realize normal display of a to-be-displayed image which does not correspond to a display panel pixel arrangement mode by converting the original to-be-displayed image into an image formed by pixels composed of red, green and blue sub-pixels.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of image processing, and more specifically, to an image conversion method, apparatus, and storage medium. Background Technology

[0002] The pixels on a display panel (screen) are composed of sub-pixels formed by the three primary colors of light. Different display panels have different pixel arrangements, meaning the arrangement of the red, green, and blue sub-pixels is different. When displaying an image, the pixel arrangement of the image must correspond to the pixel arrangement of the display panel for the image to be displayed correctly.

[0003] When the pixel arrangement of the image to be displayed does not correspond to the arrangement of the display panel, it is necessary to convert the pixel arrangement of the image to match the display panel's arrangement. One method is Pentile Spread Reduction (PPR), which converts the image by performing a Pentile operation. The converted image is shown below. Figure 1 As shown, Figure 1 This is a comparison diagram of pixel arrangement. The left image shows the arrangement of two-color pixels in an image converted using existing technology. The right image shows the pixel arrangement of an image composed of three-color pixels. It can be seen that in the image converted by Pentile SPR, the pixels are arranged in a two-color pixel arrangement. Furthermore, as... Figure 1 As shown in the left image, the first row of the image is arranged in a cyclical pattern of pixels consisting of two sub-pixels: RG, BG, GR, BG... The second row is arranged in a staggered pattern of BG, RG, BG, GR... Therefore, compared to the arrangement of pixels consisting of three sub-pixels (red, green, and blue) in the right image, the data volume is 2 / 3 of the original. The arrangement of the display panel, as shown... Figure 1 The pixel arrangement of the RGB display panel shown in the right figure is RGB, RGB...

[0004] Therefore, in the existing technology, when converting the image to be displayed to achieve display on an image display device with a different pixel arrangement than the image to be displayed, there is a problem of data loss. Summary of the Invention

[0005] The purpose of this application is to provide an image conversion method, apparatus, and storage medium, which converts the original image to be displayed into an image formed by pixels composed of three sub-pixels: red, green, and blue, thereby solving the data loss problem that exists in the prior art when converting the image to be displayed.

[0006] In a first aspect, embodiments of this application provide an image conversion method, comprising: obtaining two-color pixel parameters for each two-color pixel in the image to be converted; determining initial monochromatic pixel parameters corresponding to each two-color pixel based on the two-color pixel parameters of each two-color pixel and the two-color pixels surrounding each two-color pixel; calculating the initial monochromatic pixel parameters to obtain calculated monochromatic pixel parameters; and forming a converted image based on the calculated monochromatic pixel parameters.

[0007] The image conversion method described above obtains the two-color pixel parameters of each two-color pixel in the image to be converted, determines the initial monochrome pixel parameters of the corresponding monochrome pixels for each two-color pixel, calculates the calculated monochrome pixel values ​​for the red, green, and blue sub-pixels based on the initial monochrome pixel parameters, and forms the final converted image based on these calculated monochrome pixel values. This achieves the restoration of the image to be converted and solves the data loss problem that occurs when converting the image to be displayed.

[0008] In conjunction with the first aspect, optionally, the step of determining the initial monochromatic pixel parameters of the monochromatic pixel corresponding to each two-color pixel based on the two-color pixel parameters of each two-color pixel and the two-color pixel parameters of the two-color pixels surrounding each two-color pixel includes: taking each two-color pixel as the center, determining an N×N two-color pixel matrix based on its own and the two-color pixel parameters of the surrounding two-color pixels; wherein N is a positive integer greater than 1; and generating a monochromatic sub-pixel matrix based on the two-color pixel matrix and the monochromatic pixel parameters corresponding to the two-color pixels therein to obtain the initial monochromatic pixel parameters.

[0009] The image conversion method described above involves selecting a square matrix of two-color pixels centered on the current two-color pixel and then generating a corresponding monochrome sub-pixel matrix to obtain the initial monochrome pixel parameters for each two-color pixel. Calculations are performed using these initial monochrome pixel parameters to ensure that the image information in the final converted image is closer to the initial image before processing by the Pentile algorithm.

[0010] In conjunction with the first aspect, optionally, the step of generating a monochromatic sub-pixel matrix based on the two-color pixel matrix and the monochromatic pixel parameters corresponding to the two-color pixels therein includes: taking the monochromatic sub-pixel parameters of the central two-color pixels of the N×N two-color pixel matrix as the pixel value of the center of the monochromatic sub-pixel matrix; selecting the monochromatic sub-pixel parameters of other two-color pixels that are closest to the central two-color pixels as other pixel values ​​in the monochromatic sub-pixel matrix; wherein the position of the other pixel values ​​in the monochromatic sub-pixel matrix is ​​consistent with the position of their corresponding other two-color pixels in the N×N two-color pixel matrix.

[0011] The above image conversion method selects the monochrome pixel parameters from the other monochrome pixel points that are closest to the center of the determined monochrome sub-pixel matrix as matrix elements in the monochrome sub-pixel matrix, and the positional relationship therein is consistent with the positional relationship between the corresponding two-color pixels. This makes the image information in the final converted image closer to the initial image before the Pentile algorithm processing.

[0012] In conjunction with the first aspect, optionally, the monochrome subpixel parameter of the selected other two-color pixels is not 0.

[0013] The above image conversion method selects the monochrome pixel parameters from the monochrome pixel points that are closest to the center of the determined monochrome sub-pixel matrix and whose monochrome pixel values ​​are not 0 as matrix elements in the monochrome sub-pixel matrix. This makes the image information in the final converted image even closer to the initial image before the Pentile algorithm processing.

[0014] In conjunction with the first aspect, optionally, the step of calculating the initial monochrome pixel parameters to obtain the calculated monochrome pixel parameters includes: multiplying the initial monochrome pixel parameters by a filter to obtain the calculated monochrome pixel parameters; wherein the filter includes a Gaussian filter.

[0015] The image conversion method described above uses a Gaussian filter to filter the initial monochrome pixel parameters. Compared with other filters, such as mean filters, median filters, and Laplacian filters, it can better suppress Gaussian noise and random noise introduced during the image input stage, thus improving the quality of image conversion.

[0016] In conjunction with the first aspect, optionally, the step of forming the converted image based on each of the calculated monochrome pixel parameters includes: performing a convolution operation on the calculated monochrome pixel parameters with a Gaussian filter function to obtain convolved monochrome pixel parameters; interleaving the convolved monochrome pixel parameters to form a smooth image; interleaving the calculated monochrome pixel parameters to form a calculated image; and sharpening the calculated image to obtain the converted image; wherein the sharpening formula is: I sharpness =(D in -g)*enh ratio +g;I sharpness For the transformed image, D in Let g be the calculated image, and enh be the smoothed image. ratio It is the sharpening factor, and enh ratio >1.

[0017] The image conversion method described above improves the quality of image conversion by performing edge enhancement processing on the calculated image obtained after Gaussian filtering using a sharpening algorithm.

[0018] In conjunction with the first aspect, optionally, before obtaining the two-color pixel parameters of the two-color pixels in the image to be converted, the method further includes: performing a gamma transformation on the original image to obtain the image to be converted; the formula for the gamma transformation is:

[0019] V out =AV in γ ;

[0020] The step of sharpening the calculated image to obtain the transformed image includes: sharpening the calculated image to obtain a sharpened image; and performing an inverse gamma transform on the sharpened image to obtain the transformed image; the formula for the gamma transform is:

[0021] V out =AV in 1 / γ

[0022] Among them, V out The output image grayscale values ​​are given, where A is a constant and V is a variable. in γ represents the grayscale value of the input image, and γ is the gamma exponent.

[0023] The above image conversion method, by performing gamma transformation on the image before conversion and gamma transformation at the end of the image conversion, makes the grayscale value of the final converted image more consistent with the perceptual characteristics of the human eye, and makes the tone of the converted image closer to the original image, thus further improving the quality of image conversion.

[0024] Secondly, embodiments of this application also provide an image conversion apparatus, including: an acquisition module, a determination module, a calculation module, and a forming module;

[0025] The acquisition module is used to acquire the two-color pixel parameters of the two-color pixels in the image to be converted;

[0026] The determining module is used to determine the initial monochrome pixel parameters of the monochrome pixel corresponding to each two-color pixel based on the two-color pixel parameters of each two-color pixel and the two-color pixels surrounding each two-color pixel.

[0027] The calculation module is used to calculate the monochrome pixel parameters to obtain the calculated monochrome pixel parameters;

[0028] The forming module is used to form the converted image based on the calculated monochrome pixel parameters.

[0029] The image conversion apparatus provided in the above embodiments has the same beneficial effects as the image conversion method provided in the first aspect or any optional embodiment of the first aspect, and will not be described in detail here.

[0030] Thirdly, embodiments of this application also provide a computer-readable storage medium storing a computer program that is executed by a processor to perform the methods described above.

[0031] The computer-readable storage medium provided in the above embodiments has the same beneficial effects as the image conversion method provided in the first aspect or any optional embodiment of the first aspect, and will not be described in detail here.

[0032] Fourthly, embodiments of this application also provide an electronic device, including: a processor and a memory, the memory storing machine-readable instructions executable by the processor, which, when executed by the processor, perform the method described above.

[0033] The above embodiments provide an electronic device that has the same beneficial effects as the image conversion method provided by the first aspect or any optional implementation of the first aspect, which will not be elaborated here.

[0034] In summary, the image conversion method, apparatus, and storage medium provided in this application acquire the two-color pixel parameters of each two-color pixel in the image to be converted, determine the initial monochrome pixel parameters of the monochrome pixels corresponding to each two-color pixel, calculate the calculated monochrome pixel values ​​for the red, green, and blue sub-pixels based on the initial monochrome pixel parameters, and form the final converted image based on these calculated monochrome pixel values, enabling the converted image to be displayed normally on the corresponding display panel. Furthermore, by selecting a monochrome sub-pixel matrix during the image conversion process, the image information in the final converted image is made closer to the initial image before processing by the Pentile algorithm. In addition, after image restoration, image sharpening is performed to eliminate edge blurring in the restored calculated image. Performing a gamma transformation on the original image before image conversion and an inverse gamma transformation on the image after conversion both ultimately improve the quality of image conversion. Attached Figure Description

[0035] To more clearly illustrate the technical solutions of the embodiments of this application, the accompanying drawings used in the embodiments of this application will be briefly introduced below. It should be understood that the following drawings only show some embodiments of this application and should not be regarded as a limitation of the scope. For those skilled in the art, other related drawings can be obtained based on these drawings without creative effort.

[0036] Figure 1 This is a diagram illustrating the pixel arrangement comparison.

[0037] Figure 2 A flowchart illustrating the image conversion method provided in this application embodiment;

[0038] Figure 3 This is a schematic diagram illustrating the extraction of a monochrome pixel arrangement from a two-color pixel arrangement, provided as an embodiment of this application.

[0039] Figure 4 A detailed flowchart of step S240 in the image conversion method provided in the embodiments of this application;

[0040] Figure 5 A detailed flowchart of step S242 in the image conversion method provided in the embodiments of this application;

[0041] Figure 6 A detailed flowchart of step S280 in the image conversion method provided in the embodiments of this application;

[0042] Figure 7 This is a functional block diagram of the image conversion device provided in the embodiments of this application;

[0043] Figure 8 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Detailed Implementation

[0044] The embodiments of the technical solution of this application will now be described in detail with reference to the accompanying drawings. These embodiments are only used to more clearly illustrate the technical solution of this application and are therefore merely examples, and should not be used to limit the scope of protection of this application.

[0045] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application belongs; the terminology used herein is for the purpose of describing particular embodiments only and is not intended to limit this application.

[0046] In the description of the embodiments of this application, technical terms such as "first" and "second" are used only to distinguish different objects and should not be construed as indicating or implying relative importance or implicitly specifying the number, specific order, or primary and secondary relationship of the indicated technical features. In the description of the embodiments of this application, "multiple" means two or more, unless otherwise explicitly defined.

[0047] Please refer to Figure 2 , Figure 2 This is a flowchart of an image conversion method provided in an embodiment of this application. The image conversion method provided in this application includes:

[0048] Step S220: Obtain the two-color pixel parameters for each two-color pixel in the image to be converted.

[0049] In step S220 above, the pixels in the image to be displayed can be any two or three of R sub-pixels, G sub-pixels, and B sub-pixels. The two-color pixel parameters can include the two-color pixel coordinate parameters and the two-color pixel values.

[0050] Step S240: Determine the initial monochrome pixel parameters of the monochrome pixel corresponding to each two-color pixel based on the two-color pixel parameters of each two-color pixel and the two-color pixels surrounding each two-color pixel.

[0051] In step S240 above, the single-color pixel parameters are determined based on the two-color pixel parameters corresponding to each two-color pixel. For example... Figure 3 As shown, Figure 3 This is a schematic diagram illustrating the extraction of a monochromatic pixel arrangement from a two-color pixel arrangement, provided in an embodiment of this application. The upper diagram shows the two-color pixel arrangement, and the lower diagram shows the monochromatic pixel arrangement. All R, G, and B sub-pixels in the image to be converted, formed by the two-color pixels, are listed separately to obtain the coordinate parameters and pixel values ​​of each R, G, and B sub-pixel in the image to be converted. Based on the coordinate parameters and pixel values ​​of these sub-pixels, initial monochromatic pixel parameters are determined. These initial monochromatic pixel parameters can be the pixel parameters of a single monochromatic pixel, or they can be the monochromatic pixel and several surrounding monochromatic pixels forming a monochromatic pixel set.

[0052] Step S260: Calculate the initial monochrome pixel parameters to obtain the calculated monochrome pixel parameters.

[0053] In step S260 above, the initial monochrome pixel parameters include the initial monochrome pixel coordinate parameters and the initial monochrome pixel value. These parameters can be calculated using filtering to suppress noise in the initial monochrome pixels. The formula for filtering is as follows:

[0054]

[0055]

[0056]

[0057] Where Rout, Gout, and Bout are the calculated monochrome pixel values, and filter_red, filter_green, and filter_blue are the corresponding filters. Those skilled in the art can select and determine the parameters and size of the matrices in the formula according to actual needs. The filter is a matrix corresponding to the size of this matrix.

[0058] Step S280: Form the converted image based on the calculated monochrome pixel parameters.

[0059] In step S280 above, after obtaining the pixel parameter values ​​corresponding to the three sub-pixels of red, green and blue respectively—the calculated monochrome pixel values—they are fused to obtain the converted image.

[0060] In the above implementation process, the two-color pixel parameters of each two-color pixel in the image to be converted are obtained, and the initial monochrome pixel parameters of the monochrome pixel corresponding to each two-color pixel are determined. After calculating the initial monochrome pixel parameters, the calculated monochrome pixel values ​​of the three sub-pixels of red, green and blue are obtained. Based on the calculated monochrome pixel values, the final converted image is formed, realizing the restoration of the image to be converted and solving the data loss problem that exists when converting the image to be displayed.

[0061] Please refer to Figure 4 , Figure 4 This is a detailed flowchart of step S240 in the image conversion method provided in this application embodiment. In an optional implementation, step S240 includes:

[0062] Step S241: Taking each two-color pixel as the center, determine an N×N two-color pixel matrix based on its own and the two-color pixel parameters of the surrounding two-color pixels. Where N is a positive integer greater than 1.

[0063] Step S242: Generate a monochrome sub-pixel matrix based on the two-color pixel matrix and the monochrome pixel parameters corresponding to the two-color pixels therein, so as to obtain the initial monochrome pixel parameters.

[0064] In the above steps, in the image to be converted, composed of two-color pixels, an N-order two-color pixel matrix is ​​selected, centered on the current two-color pixel. The monochromatic pixels contained within this two-color pixel matrix are used as matrix elements in this monochromatic pixel matrix. Each matrix element in this monochromatic pixel matrix contains its corresponding monochromatic pixel parameters. These monochromatic pixel parameters are used as matrix elements to form a monochromatic sub-pixel matrix, which serves as the initial monochromatic pixel parameters for subsequent calculations.

[0065] Those skilled in the art can select two-color pixel arrays of different sizes according to actual needs, such as: 3-order two-color pixel arrays, 5-order two-color pixel arrays and 7-order two-color pixel arrays, etc.

[0066] In the above implementation process, a two-color pixel matrix is ​​formed by selecting several other two-color pixels around the current two-color pixel as the center, and a corresponding monochrome sub-pixel matrix is ​​generated to obtain the initial monochrome pixel parameters for each two-color pixel. Calculations are performed using these initial monochrome pixel parameters, making the image information in the final converted image closer to the initial image before processing by the Pentile algorithm.

[0067] Please refer to Figure 5 The figure is a detailed flowchart of step S242 in the image conversion method provided in this application embodiment. In an optional embodiment, step S242 includes:

[0068] Step S2421: Use the monochrome subpixel parameters of the center two-color pixels of the N×N two-color pixel matrix as the pixel value of the center of the monochrome subpixel matrix.

[0069] Step S2422: Select the monochrome sub-pixel parameters of the other two-color pixels that are closest to the central two-color pixel, and use them as the other pixel values ​​in the monochrome sub-pixel matrix. The position of each other pixel value in the monochrome sub-pixel matrix is ​​consistent with the position of its corresponding other two-color pixel in the N×N two-color pixel matrix.

[0070] Since the size of the selected two-color pixel matrix may differ from the final determined monochrome subpixel matrix, in the above steps, when selecting the monochrome subpixel matrix from the two-color pixel matrix, the central two-color pixels of the two-color pixel matrix are used as the center elements of the monochrome subpixel matrix. Based on the required monochrome subpixel size, a corresponding number of monochrome pixels from the other two-color pixels closest to the center element are selected, and their monochrome pixel values ​​are used as elements in the monochrome subpixel matrix. After determining each element in the monochrome subpixel matrix, a monochrome subpixel matrix corresponding to the positional relationship between the corresponding two-color pixels is generated.

[0071] After generating the monochrome sub-pixel matrix, corresponding initial monochrome pixel parameters are generated based on each element of the monochrome sub-pixel matrix. These initial monochrome pixel parameters are the matrices multiplied by the filter in the filtering calculation formula described in step S260 above. Specifically, the determination of the values ​​of each matrix element in the initial monochrome pixel parameters can be implemented as follows: Figure 3 For example, the currently determined monochrome pixel matrix is ​​as follows: Figure 3 As shown in the lower right figure, B11 is the leftmost and topmost element of the entire matrix, B12 is located to the right of B11, B13 is located to the right of B12, and so on. Based on the relative positions of each element in the matrix, the corresponding initial monochrome pixel parameters are determined. The matrix represents the positional relationships between elements. Each element in the monochrome sub-pixel matrix contains the pixel value and coordinate parameters of the corresponding monochrome pixel. The values ​​of each matrix element in the initial monochrome pixel parameters are the pixel value and coordinate parameters of the corresponding monochrome pixel in the monochrome sub-pixel matrix.

[0072] In the above implementation process, by selecting the monochrome pixel parameters from the other monochrome pixel points that are closest to the center of the determined monochrome sub-pixel matrix as matrix elements in the monochrome sub-pixel matrix, and ensuring that their positional relationships are consistent with the positional relationships between their corresponding two-color pixels, the image information in the final converted image is made to be closer to the initial image before processing by the Pentile algorithm.

[0073] In one alternative implementation, the monochrome subpixel parameters of the other two color pixels are not 0.

[0074] In conjunction with the foregoing embodiments, when selecting matrix elements from a monochrome sub-pixel matrix from a two-color pixel matrix, if a monochrome sub-pixel with a corresponding pixel parameter value of 0 is encountered, that monochrome sub-pixel is skipped, and the next adjacent monochrome sub-pixel with a non-zero pixel parameter value is selected as an element in the monochrome sub-pixel matrix. The parameter values ​​of each matrix element in the initial monochrome pixel parameters are then determined according to the method described in the foregoing embodiments, based on the elements in the monochrome sub-pixel matrix. Specifically, if the selected current monochrome sub-pixel is 0, other monochrome sub-pixels adjacent to the current monochrome sub-pixel are selected as elements in the monochrome sub-pixel matrix along horizontal, vertical, and / or 45° directions, moving away from the central monochrome sub-pixel.

[0075] As another embodiment, still using Figure 2 For example, please continue to refer to Figure 2 ,from Figure 2In the two-color pixel distribution map on the upper middle side, a 3rd order two-color pixel matrix is ​​selected with the current pixel as the center. It is determined whether the pixel value of each monochrome pixel on both sides of the middle column in the two-color pixel matrix is ​​0. If it is 0, the monochrome pixel parameter value of the next monochrome pixel that is horizontally away from the middle column of the monochrome pixel with the value of 0 is selected as the matrix element in the monochrome pixel matrix. Regardless of whether the monochrome pixel parameter in the middle column is 0, the monochrome pixel parameter is selected as the matrix element in the middle column of the monochrome pixel matrix.

[0076] In the above implementation process, by selecting the monochrome pixel parameters from the other monochrome pixels that are closest to the center of the determined monochrome sub-pixel matrix and whose monochrome pixel values ​​are not 0, the image information in the finally converted image is made to be even closer to the initial image before the Pentile algorithm processing.

[0077] In an optional implementation, step S260 includes:

[0078] Step S261: Multiply the initial monochrome pixel parameters by the filter to obtain the calculated monochrome pixel parameters. The filter includes a Gaussian filter.

[0079] In the above implementation process, a Gaussian filter is used to filter the initial monochrome pixel parameters. Compared with other filters, such as mean filter, median filter, Laplacian filter, etc., it can better suppress Gaussian noise and random noise introduced in the image input stage, and ultimately improve the quality of image conversion.

[0080] Please refer to Figure 6 The figure is a detailed flowchart of step S280 in the image conversion method provided in this application embodiment. In an optional embodiment, step S280 includes:

[0081] Step S281: Perform a convolution operation between the calculated monochrome pixel parameters and the Gaussian filter function to obtain the convolved monochrome pixel parameters.

[0082] Step S282: Interweave the monochromatic pixel parameters after each convolution to form a smooth image.

[0083] Step S283: Interweave the calculated image according to the calculated monochrome pixel parameters.

[0084] Step S284: Sharpen the calculated image to obtain the converted image. The sharpening formula is: I sharpness =(D in -g)*enh ratio +g.

[0085] I sharpness For the converted image, D in The image is the result of the calculation, g is the smoothed image, and enh is the result of the calculation. ratio It is the sharpening factor, and enh ratio >1.

[0086] In the above steps, the convolutional parameters of red, green, and blue monochromatic pixels are interleaved together to form the smooth image. Similarly, the calculated parameters of red, green, and blue monochromatic pixels obtained after filtering are interleaved together to form the calculated image.

[0087] It should be understood that the execution order of steps S281 to S284 is not limited to the order listed above. For example, step S283 can be executed first, followed by steps S281, S282, and S284.

[0088] In the above implementation process, the edge enhancement processing of the calculated image obtained by Gaussian filtering is performed by the sharpening processing algorithm, which solves the edge blurring problem of the calculated image and further improves the quality of image conversion.

[0089] In an optional implementation, prior to step S220, the method further includes:

[0090] Step S210: Perform a gamma transformation on the original image to obtain the image to be converted. The formula for the gamma transformation is: V out =AV in γ .

[0091] In step S210 above, the original image is subjected to gamma transformation before conversion, so that the resulting image to be converted is more in line with the human eye's perception of image grayscale.

[0092] Accordingly, step S284 above includes:

[0093] Step S2841: Sharpen the calculated image to obtain a sharpened image.

[0094] Step S2842: Perform an inverse gamma transform on the sharpened image to obtain the transformed image. The formula for this gamma transform is:

[0095] V out =AV in 1 / γ

[0096] Among them, V out The output image grayscale values ​​are given, where A is a constant and V is a variable. in γ represents the grayscale value of the input image, and γ is the gamma exponent.

[0097] In step S2842 above, a gamma transformation is performed on the sharpened image after sharpening to make the hue of the final transformed image closer to that of the original image after processing by the Pentile algorithm.

[0098] In the above implementation process, by performing gamma transformation on the image before conversion and gamma transformation at the end of the image conversion, the grayscale value of the final converted image is more in line with the perceptual characteristics of the human eye, and the hue of the converted image is closer to that of the original image, thus further improving the quality of image conversion.

[0099] In one alternative implementation, the gamma index γ = 2.2.

[0100] In the above implementation process, an excessively high gamma index increases the difficulty for the human eye to distinguish image information in high-brightness areas, while an excessively low gamma index increases the difficulty for the human eye to distinguish image information in low-brightness areas. Therefore, when the gamma index γ = 2.2, the grayscale and brightness values ​​in the image best match the perceptual characteristics of the human eye. Ultimately, this further improves the quality of image conversion.

[0101] Based on the same inventive concept, please refer to Figure 7 , Figure 7 This is a functional block diagram of the image conversion device 700 provided in the embodiments of this application; the image conversion device 700 provided in the embodiments of this application includes: an acquisition module 710, a determination module 720, a calculation module 730, and a forming module 740;

[0102] The acquisition module 710 is used to acquire the two-color pixel parameters of the two-color pixels in the image to be converted.

[0103] The determining module 720 is used to determine the initial monochrome pixel parameters of the monochrome pixel corresponding to each two-color pixel based on the two-color pixel parameters of each two-color pixel and the two-color pixels surrounding each two-color pixel.

[0104] The calculation module 730 is used to calculate the monochrome pixel parameters and obtain the calculated monochrome pixel parameters.

[0105] The forming module 740 is used to form the converted image based on the calculated monochrome pixel parameters.

[0106] Please continue to refer to Figure 7In one optional implementation, the determining module 720 is specifically used to: take each two-color pixel as the center, determine an N×N two-color pixel matrix based on its own and the two-color pixel parameters of the surrounding two-color pixels; where N is a positive integer greater than 1; generate a monochrome sub-pixel matrix based on the two-color pixel matrix and the monochrome pixel parameters corresponding to the two-color pixels therein, so as to obtain the initial monochrome pixel parameters.

[0107] Please continue to refer to Figure 7 In an optional implementation, the determining module 720 is more specifically used to: take the monochrome sub-pixel parameters of the central two-color pixel point of the N×N two-color pixel matrix as the pixel value of the center of the monochrome sub-pixel matrix; select the monochrome sub-pixel parameters of the other two-color pixel points that are closest to the central two-color pixel point as the other pixel values ​​in the monochrome sub-pixel matrix; wherein the position of the other pixel values ​​in the monochrome sub-pixel matrix is ​​consistent with the position of their corresponding other two-color pixel points in the N×N two-color pixel matrix.

[0108] Please continue to refer to Figure 7 In one optional implementation, the monochrome subpixel parameters of the selected other two color pixels are not 0.

[0109] Please continue to refer to Figure 7 In one optional implementation, the calculation module 730 is specifically used to: multiply the initial monochrome pixel parameters by a filter to obtain the calculated monochrome pixel parameters. The filter includes a Gaussian filter.

[0110] Please continue to refer to Figure 7 In one optional implementation, the forming module 740 is specifically used for: performing a convolution operation on the calculated monochrome pixel parameters with a Gaussian filter function to obtain convolved monochrome pixel parameters; interleaving the convolved monochrome pixel parameters to form a smooth image; interleaving the calculated monochrome pixel parameters to form a calculated image; and sharpening the calculated image to obtain a converted image; wherein the sharpening formula is: I sharpness =(D in -g)*enh ratio +g;I sharpness For the converted image, D in The image is the result of the calculation, g is the smoothed image, and enh is the result of the calculation. ratio It is the sharpening factor, and enh ratio >1.

[0111] In an optional embodiment, the image conversion device 700 further includes a transformation module 750, which performs gamma transformation on the original image to obtain the image to be converted.

[0112] The formula for gamma transformation is:

[0113] V out =AV in γ ;

[0114] Accordingly, the forming module 740 is also specifically used for: sharpening the calculated image to obtain a sharpened image; performing an inverse gamma transform on the sharpened image to obtain a transformed image; the formula for the gamma transform is:

[0115] V out =AV in 1 / γ ;

[0116] Among them, V out The output image grayscale values ​​are given, where A is a constant and V is a variable. in γ represents the grayscale value of the input image, and γ is the gamma exponent.

[0117] In one alternative implementation, the gamma index γ = 2.2.

[0118] It should be understood that this device corresponds to the above-described image conversion method embodiments and is capable of performing the various steps involved in the above-described method embodiments. The specific functions of this device can be found in the description above, and detailed descriptions are omitted here to avoid repetition. The device includes at least one software functional module that can be stored in memory or embedded in the device's operating system (OS) in the form of software or firmware.

[0119] Based on the same inventive concept, please refer to Figure 8 , Figure 8 This is a schematic diagram of the structure of an electronic device 800 provided in an embodiment of this application. The electronic device 800 may include a memory 811, a memory controller 812, a processor 813, a peripheral interface 814, an input / output unit 818, and a display unit 816. Those skilled in the art will understand that... Figure 8 The structure shown is for illustrative purposes only and does not limit the structure of the electronic device 800. For example, the electronic device 800 may also include components that are more... Figure 8 The more or fewer components shown, or having the same Figure 8 The different configurations shown.

[0120] The aforementioned memory 811, memory controller 812, processor 813, peripheral interface 814, input / output unit 818, and display unit 816 are electrically connected directly or indirectly to each other to achieve data transmission or interaction. For example, these components can be electrically connected to each other through one or more communication buses or signal lines. The aforementioned processor 813 is used to execute executable modules stored in the memory.

[0121] The memory 811 can be, but is not limited to, Random Access Memory (RAM), Read Only Memory (ROM), Programmable Read-Only Memory (PROM), Erasable Programmable Read-Only Memory (EPROM), Electrically Erasable Programmable Read-Only Memory (EEPROM), etc. The memory 811 stores programs, and the processor 813 executes these programs upon receiving execution instructions. The methods executed by the electronic device 800, as defined in any embodiment of this application, can be applied to or implemented by the processor 813.

[0122] The aforementioned processor 813 may be an integrated circuit chip with signal processing capabilities. The processor 813 may be a general-purpose processor, including a Central Processing Unit (CPU), a Network Processor (NP), etc.; it may also be a digital signal processor (DSP), an Application Specific Integrated Circuit (ASIC), a Field-Programmable Gate Array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components. It can implement or execute the methods, steps, and logic block diagrams disclosed in the embodiments of this application. The general-purpose processor may be a microprocessor or any conventional processor.

[0123] The peripheral interface 814 described above couples various input / output devices to the processor 813 and the memory 811. In some embodiments, the peripheral interface 814, the processor 813, and the memory controller 812 can be implemented in a single chip. In other instances, they can be implemented by separate chips.

[0124] The input / output unit 818 described above is used to provide user input data. The input / output unit 818 may be, but is not limited to, a mouse and keyboard.

[0125] The aforementioned display unit 816 provides an interactive interface (e.g., a user interface) between the electronic device 800 and the user, or displays image data for the user's reference. In this embodiment, the display unit can be a liquid crystal display (LCD) or a touch display. If it is a touch display, it can be a capacitive touchscreen or a resistive touchscreen that supports single-point and multi-point touch operations. Supporting single-point and multi-point touch operations means that the touch display can sense touch operations generated simultaneously from one or more locations on the touch display and pass the sensed touch operations to the processor for calculation and processing.

[0126] The electronic device 800 in this embodiment can be used to perform the various steps in the various methods provided in the embodiments of this application.

[0127] Based on the same inventive concept, this application also provides a storage medium storing a computer program, which is executed by a processor to perform the above-described method.

[0128] The storage medium can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as Static Random Access Memory (SRAM), Electrically Erasable Programmable Read-Only Memory (EEPROM), Erasable Programmable Read Only Memory (EPROM), Programmable Red-Only Memory (PROM), Read-Only Memory (ROM), magnetic storage, flash memory, magnetic disk, or optical disk.

[0129] In summary, the image conversion method, apparatus, and storage medium provided in this application obtain the two-color pixel parameters of each two-color pixel in the image to be converted, determine the initial monochrome pixel parameters of the monochrome pixels corresponding to each two-color pixel, calculate the calculated monochrome pixel values ​​for the red, green, and blue sub-pixels after calculating the initial monochrome pixel parameters, and form the final converted image based on these calculated monochrome pixel values. This achieves the restoration of the image to be converted and solves the data loss problem that exists when converting the image to be displayed. Furthermore, by selecting a monochrome sub-pixel matrix during the image conversion process, the image information in the final converted image is made closer to the initial image before processing by the Pentile algorithm. In addition, after the image is restored, the image is sharpened to eliminate the edge blurring problem of the restored calculated image. The gamma transformation of the original image before the image conversion begins and the inverse gamma transformation of the image at the end of the image conversion both ultimately improve the quality of the image conversion.

[0130] It should be understood that the disclosed apparatus and methods can also be implemented in other ways, given the several embodiments provided in this application. The apparatus embodiments described above are merely illustrative. For example, the flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of apparatus, methods, and computer program products according to various embodiments of this application. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code, which contains one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions marked in the blocks may occur in a different order than those marked in the drawings. For example, two consecutive blocks may actually be executed substantially in parallel, or they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in a block diagram and / or flowchart, and combinations of blocks in block diagrams and / or flowcharts, can be implemented using a dedicated hardware-based system that performs the specified function or action, or using a combination of dedicated hardware and computer instructions.

[0131] In addition, the functional modules in the various embodiments of this application can be integrated together to form an independent part, or each module can exist independently, or two or more modules can be integrated to form an independent part.

[0132] The above description is only an optional implementation of the embodiments of this application, but the protection scope of the embodiments of this application is not limited thereto. Any changes or substitutions that can be easily conceived by those skilled in the art within the technical scope disclosed in the embodiments of this application should be covered within the protection scope of the embodiments of this application.

Claims

1. An image conversion method, characterized in that, include: Obtain the two-color pixel parameters for each two-color pixel in the image to be converted; Based on the two-color pixel parameters of each two-color pixel and the two-color pixels surrounding each two-color pixel, the initial monochrome pixel parameters of the monochrome pixel corresponding to each two-color pixel are determined. The initial monochrome pixel parameters are calculated to obtain the calculated monochrome pixel parameters; as well as The converted image is formed based on the calculated monochrome pixel parameters. The step of determining the initial monochrome pixel parameters of the monochrome pixel corresponding to each two-color pixel based on the two-color pixel parameters of each two-color pixel and the two-color pixels surrounding each two-color pixel includes: Centered on each of the two-color pixels, an N×N two-color pixel matrix is ​​determined based on the two-color pixel parameters of itself and the surrounding two-color pixels; where N is a positive integer greater than 1. A monochrome sub-pixel matrix is ​​generated based on the two-color pixel matrix and the monochrome pixel parameters corresponding to the two-color pixels therein, so as to obtain the initial monochrome pixel parameters; The step of generating a monochromatic sub-pixel matrix based on the two-color pixel matrix and the monochromatic pixel parameters corresponding to the two-color pixels includes: The monochrome sub-pixel parameters of the center two-color pixels of the N×N two-color pixel matrix are used as the pixel values ​​of the center of the monochrome sub-pixel matrix. Centered on the current pixel, select an N-order two-color pixel matrix. Determine whether the pixel value of each monochrome sub-pixel on both sides of the middle column in the two-color pixel matrix is ​​0. If it is 0, select the monochrome pixel parameter value of the next monochrome sub-pixel that is horizontally away from the middle column of the monochrome sub-pixel with the value of 0 as the matrix element in the monochrome sub-pixel matrix. Regardless of whether the monochrome sub-pixel parameter in the middle column is 0, the monochrome sub-pixel parameter is selected as the matrix element of the middle column in the monochrome sub-pixel matrix; wherein, the position of the monochrome sub-pixel in the monochrome sub-pixel matrix is ​​consistent with the position of its corresponding two-color pixel in the N×N two-color pixel matrix.

2. The image conversion method according to claim 1, characterized in that, The calculation of the initial monochrome pixel parameters to obtain the calculated monochrome pixel parameters includes: The initial monochrome pixel parameters are multiplied by the filter to obtain the calculated monochrome pixel parameters; wherein the filter includes a Gaussian filter.

3. The image conversion method according to claim 1, characterized in that, The process of forming the converted image based on the calculated monochrome pixel parameters includes: The calculated monochrome pixel parameters are convolved with a Gaussian filter function to obtain the convolved monochrome pixel parameters. A smooth image is formed by interlacing the monochrome pixel parameters after each convolution; The calculated monochrome pixel parameters are interwoven to form the calculated image; The calculated image is then sharpened to obtain the transformed image; wherein the sharpening formula is: I sharpness =(D in -g)*enh ratio +g; I sharpness For the transformed image, D in Let g be the calculated image, and enh be the smoothed image. ratio It is the sharpening factor, and enh ratio >1.

4. The image conversion method according to claim 3, characterized in that, Before obtaining the two-color pixel parameters of each two-color pixel in the image to be converted, the method further includes: The original image is subjected to a gamma transformation to obtain the image to be converted; the formula for the gamma transformation is: V out =OFF in γ ; The step of sharpening the calculated image to obtain the converted image includes: The calculated image is then sharpened to obtain a sharpened image; The sharpened image is subjected to an inverse gamma transform to obtain the transformed image; the formula for the gamma transform is: V out =OFF in 1 / γ Among them, V out The output image grayscale values ​​are given, where A is a constant and V is a variable. in γ represents the grayscale value of the input image, and γ is the gamma exponent.

5. The image conversion method according to claim 4, characterized in that, in, The gamma index γ = 2.

2.

6. An image conversion device, characterized in that, include: Acquisition module, determination module, calculation module, and formation module; The acquisition module is used to acquire the two-color pixel parameters of each two-color pixel in the image to be converted; The determining module is used to determine the initial monochrome pixel parameters of the monochrome pixel corresponding to each two-color pixel based on the two-color pixel parameters of each two-color pixel and the two-color pixels surrounding each two-color pixel. The calculation module is used to calculate the initial monochrome pixel parameters to obtain the calculated monochrome pixel parameters; The forming module is used to form the converted image based on the calculated monochrome pixel parameters; In the process of determining the initial monochrome pixel parameters of the monochrome pixel corresponding to each two-color pixel based on the two-color pixel parameters of each two-color pixel and the two-color pixels surrounding each two-color pixel, the determining module is specifically used for: Centered on each of the two-color pixels, an N×N two-color pixel matrix is ​​determined based on the two-color pixel parameters of itself and the surrounding two-color pixels; where N is a positive integer greater than 1; a monochrome sub-pixel matrix is ​​generated based on the two-color pixel matrix and the monochrome pixel parameters corresponding to the two-color pixels therein, so as to obtain the initial monochrome pixel parameters. In the process of generating a monochrome sub-pixel matrix based on the two-color pixel matrix and the monochrome pixel parameters corresponding to the two-color pixels therein, the determining module is specifically used to: take the monochrome sub-pixel parameters of the center two-color pixels of the N×N two-color pixel matrix as the pixel value of the center of the monochrome sub-pixel matrix; take the current pixel as the center, select an N-order two-color pixel matrix, and determine whether the pixel values ​​of each monochrome sub-pixel on both sides of the middle column in the two-color pixel matrix are 0. If they are 0, select the monochrome pixel parameter value of the next monochrome sub-pixel that is horizontally away from the center column of the monochrome sub-pixel with the value of 0 as the matrix element in the monochrome sub-pixel matrix; regardless of whether the monochrome sub-pixel parameter in the middle column is 0, select the monochrome sub-pixel parameter as the matrix element of the middle column in the monochrome sub-pixel matrix; wherein, the position of the monochrome sub-pixel in the monochrome sub-pixel matrix is ​​consistent with the position of its corresponding two-color pixel in the N×N two-color pixel matrix.

7. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that, when executed by a processor, performs the method as described in any one of claims 1 to 5.

Citation Information

Patent Citations

  • Image display method based on sub-pixel downsampling

    CN106341671A

  • Image enhancement method and device and electronic device

    CN109785264A

  • Method and device for converting Pentile images into RGB images, and storage medium

    CN113793249A