CN-122024612-A - Sub-pixel rendering method and device, electronic equipment and readable storage medium
Abstract
The application discloses a sub-pixel rendering method and device, electronic equipment and a readable storage medium, and belongs to the technical field of display. The sub-pixel rendering method comprises the steps of obtaining a target channel image of an image to be processed, dividing an inner area and an edge area in the target channel image, wherein the inner area is an area with gentle gray value change in the target channel image, the edge area is an area with severe gray value change in the target channel image, adjusting gray values of all image pixels in the inner area through a first type filter, and adjusting gray values of all image pixels in the edge area through a second type filter.
Inventors
- CAO ZIHANG
Assignees
- 维沃移动通信有限公司
Dates
- Publication Date
- 20260512
- Application Date
- 20260311
Claims (10)
- 1. A sub-pixel rendering method, comprising: Acquiring a target channel image of an image to be processed, wherein the target channel is at least one of a red channel and a blue channel, and the target channel image is a single-channel gray level image obtained by extracting color components corresponding to the target channel from the image to be processed; Dividing an inner region and an edge region in the target channel image, wherein the inner region is a region with gentle gray value change in the target channel image, and the edge region is a region with severe gray value change in the target channel image; The gray values of all the image pixels in the inner area are adjusted through a first type filter, the gray values of all the image pixels in the edge area are adjusted through a second type filter, the weight of the first type filter is determined based on the mapping relation between the visual image of the image to be processed in the human eye visual system and the image to be processed, and the weight of the second type filter corresponds to the edge type of the edge area.
- 2. The sub-pixel rendering method according to claim 1, wherein the dividing the inner region and the edge region in the target channel image includes: dividing the target channel image into a plurality of image areas, and calculating variances of gray values of a plurality of image pixels in each of the image areas; Dividing the image region into an inner region of the target channel image in a case where a variance of gray values of a plurality of image pixels in the image region is less than or equal to a variance threshold; In a case where the variance of the gray values of a plurality of image pixels in the image area is greater than the variance threshold, the image area is divided into edge areas of the target channel image.
- 3. The sub-pixel rendering method according to claim 1, wherein the second type filter includes a plurality of first filters, different first filters correspond to different first type edge types, and the adjusting, by the second type filter, the gray value of each image pixel in the edge region includes: Extracting a plurality of gray characteristic values corresponding to a plurality of first type edge types respectively in different position areas in the edge areas through a first window, wherein the gray characteristic values are used for indicating gray distribution conditions of image pixels occupied by edge images corresponding to the first type edge types in the first window; Determining the first type of edge of different position areas in the edge area according to a plurality of gray characteristic values corresponding to the different position areas in the edge area and a plurality of preset gray characteristic thresholds, wherein the gray characteristic thresholds correspond to the first type of edge respectively and are used for indicating gray distribution conditions of image pixels of an edge image corresponding to the first type of edge; and processing the different position areas in the edge area through the first filter corresponding to the first type of edge type of the different position areas in the edge area.
- 4. A sub-pixel rendering method according to claim 3, wherein extracting, through the first window, a plurality of gray feature values of different location areas in the edge area, which respectively correspond to a plurality of the first type of edge types, includes: Determining a plurality of edge pixels corresponding to each first type of edge type in the first window in each position area in the edge areas, wherein the edge pixels are image pixels occupied by edge images corresponding to the first type of edge type in the first window; According to the gray level difference value of several edge pixels and the central pixel of the first window respectively, determining gray level characteristic value of every position region in the edge region correspondent to every first type edge type or And weighting the gray values of the plurality of edge pixels to obtain gray characteristic values of each position area in the edge areas corresponding to each first type of edge type.
- 5. A sub-pixel rendering method according to claim 3, wherein the second type of filter includes a plurality of second filters, the second filters have a filtering range larger than that of the first filter, different second filters correspond to different second type of edge types, a size of the second type of edge is larger than a size of the first type of edge, and the adjusting, by the second type of filter, the gray value of each image pixel in the edge region includes: Extracting region characteristics of different position regions in the edge region through a second window under the condition that the image to be processed is applied to a high-definition display scene, wherein the display definition of the high-definition display scene is larger than a preset threshold value, the size of the second window is larger than that of the first window, and the region characteristics are used for indicating the gray distribution condition of image pixels of each position region in the edge region; Determining the second type of edge types of different position areas in the edge area according to the area characteristics of the different position areas in the edge area and a plurality of preset characteristic conditions, wherein the characteristic conditions respectively correspond to the second type of edge types and are used for indicating the gray distribution condition of image pixels of the edge image corresponding to the second type of edge types; And processing the different position areas in the edge area through the second filter corresponding to the second type of edge type of the different position areas in the edge area.
- 6. The sub-pixel rendering method according to any one of claims 1 to 5, wherein the adjusting the gray value of each image pixel in the inner region by the first type filter and the adjusting the gray value of each image pixel in the edge region by the second type filter includes: Traversing the interior region through the first type filter with each image pixel in the interior region as a center pixel of the first type filter; At each traversing position, carrying out weighted calculation on gray values of a plurality of image pixels in the filtering range of the first type filter and the weight value in the first type filter, and taking the calculation result as the gray value of the central pixel of the first type filter; traversing the edge region by the second type filter with each image pixel in the edge region as a center pixel of the second type filter; and at each traversing position, carrying out weighted calculation on gray values of a plurality of image pixels in the filtering range of the second type filter and the weight values in the second type filter, and taking the calculation result as the gray value of the central pixel of the second type filter.
- 7. A sub-pixel rendering apparatus, comprising: the input unit is used for acquiring a target channel image of an image to be processed, wherein the target channel is at least one of a red channel and a blue channel, and the target channel image is a single-channel gray level image obtained by extracting color components corresponding to the target channel from the image to be processed; The image detection unit is used for dividing an inner area and an edge area in the target channel image, wherein the inner area is an area with gentle gray value change in the target channel image, and the edge area is an area with severe gray value change in the target channel image; the rendering unit is used for adjusting the gray value of each image pixel in the internal area through a first type filter, and adjusting the gray value of each image pixel in the edge area through a second type filter, the weight of the first type filter is determined based on the mapping relation between the visual image of the image to be processed in the human eye visual system and the image to be processed, and the weight of the second type filter corresponds to the edge type of the edge area.
- 8. The sub-pixel rendering device according to claim 7, wherein the picture detection unit is specifically configured to: dividing the target channel image into a plurality of image areas, and calculating variances of gray values of a plurality of image pixels in each of the image areas; Dividing the image region into an inner region of the target channel image in a case where a variance of gray values of a plurality of image pixels in the image region is less than or equal to a variance threshold; In a case where the variance of the gray values of a plurality of image pixels in the image area is greater than the variance threshold, the image area is divided into edge areas of the target channel image.
- 9. An electronic device comprising a processor and a memory storing a program or instructions executable on the processor, which when executed by the processor, implement the steps of the sub-pixel rendering method of any one of claims 1 to 6.
- 10. A readable storage medium having stored thereon a program or instructions which when executed by a processor performs the steps of the sub-pixel rendering method according to any one of claims 1 to 6.
Description
Sub-pixel rendering method and device, electronic equipment and readable storage medium Technical Field The application belongs to the technical field of display, and particularly relates to a sub-pixel rendering method and device, electronic equipment and a readable storage medium. Background With the intelligent device becoming an indispensable tool in modern life, the requirements of users on the display quality of the intelligent device are continuously improved. Display screen technology has undergone an evolution from LCD (Liquid CRYSTAL DISPLAY) to OLED (Organic LIGHT EMITTING DISPLAY), and display resolution has also achieved rapid upgrades from standard definition to high definition or even ultra high definition. As users perform increasingly complex and diverse tasks on smart devices, such as reading electronic books, browsing intensive web pages, and using productivity applications, smart devices need to present large amounts of information in smaller fonts and fine displays. Based on the above, an SPR (Subpixel Rendering, sub-pixel rendering) technology is provided, and the SPR technology can remarkably improve the edge definition of small fonts by fine adjustment of sub-pixels, so that texts are easier to read, and display definition and effect are improved. However, in the related art, the SPR technique aims at truly reflecting the gray value of the pixel of the image to be processed, and for the edge portion pixel of the bright portion pixel, the influence of the sub-pixel rendering result of the bright portion pixel on the sub-pixel rendering result of the dark portion pixel is ignored, which results in the problem that the bright-dark contrast ratio is reduced and the edge is blurred. Disclosure of Invention The embodiment of the application aims to provide a sub-pixel rendering method and device, electronic equipment and a readable storage medium, which can effectively reduce the problem of edge blurring adhesion after sub-pixel rendering. The embodiment of the application provides a sub-pixel rendering method, which comprises the steps of obtaining a target channel image of an image to be processed, wherein a target channel is at least one of a red channel and a blue channel, the target channel image is a single-channel gray level image obtained by extracting color components corresponding to the target channel from the image to be processed, dividing an inner area and an edge area in the target channel image, wherein the inner area is an area with gentle gray level change in the target channel image, the edge area is an area with severe gray level change in the target channel image, adjusting gray level of each image pixel in the inner area through a first type filter, adjusting gray level of each image pixel in the edge area through a second type filter, and determining the weight of the first type filter based on the mapping relation between a visual image of the image to be processed in a human eye visual system and the image to be processed, wherein the weight of the second type filter corresponds to the edge type of the edge area. In a second aspect, the embodiment of the application provides a sub-pixel rendering device, which comprises an input unit, a picture detection unit and a rendering unit, wherein the input unit is used for acquiring a target channel image of an image to be processed, the target channel is at least one of a red channel and a blue channel, the target channel image is a single-channel gray image obtained by extracting color components corresponding to the target channel from the image to be processed, the picture detection unit is used for dividing an inner area and an edge area in the target channel image, the inner area is an area with gentle gray value change in the target channel image, the edge area is an area with severe gray value change in the target channel image, the rendering unit is used for adjusting gray values of pixels of all images in the inner area through a first type filter and adjusting gray values of pixels of all images in the edge area through a second type filter, and the weight of the first type filter is determined based on a mapping relation between a visual image of the image to be processed in a human eye visual system and the image to be processed, and the weight of the second type filter corresponds to the edge area. In a third aspect, an embodiment of the present application provides an electronic device comprising a processor and a memory storing a program or instructions executable on the processor, the program or instructions implementing the steps of the sub-pixel rendering method as in the first aspect when executed by the processor. In a fourth aspect, embodiments of the present application provide a readable storage medium having stored thereon a program or instructions which, when executed by a processor, implement the steps of the sub-pixel rendering method as in the first aspect. In a fifth aspect, an embodiment of t