Image display method based on flatness analysis, electronic equipment, storage medium and program product
Through the combination of flatness analysis and error diffusion method, the problem of dynamic false contour phenomenon in digital-driven silicon-based microdisplay is solved, image quality and processing efficiency are improved, and image quality loss is avoided.
Patent Information
- Application Number
- CN202411235354.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-04
- Publication Date
- 2024-11-08
AI Technical Summary
When displaying dynamic images on digitally driven silicon-based microdisplays, dynamic false contour (DFC) phenomenon will occur due to the human eye visual follow-up effect, reducing the user's visual experience. The existing technology improvement methods such as adding subfields or using halftones Technology can lead to increased power consumption or decreased image quality.
Using an image display method based on flatness analysis, the flatness is calculated by obtaining the grayscale value of the pixel and the grayscale changes of adjacent pixels, and whether the pixel is in a flat area, and using the error diffusion method to perform grayscale correction when necessary to avoid Use halftone technology in non-flat areas.
Improve image quality, retain original contour and texture information, while reducing processing pixels, improving processing efficiency, and avoiding image quality loss caused by using halftone technology in non-flat areas where DFC phenomenon cannot be observed.
Smart Images

Figure CN118918810A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of display technology, and in particular to an image display method, electronic device, storage medium and program product based on flatness analysis. Background Art
[0002] In the display industry, silicon-based microdisplays have attracted widespread attention due to their high resolution, high contrast, and low power consumption. Although digital drive technology has many advantages, when displaying dynamic images on digitally driven silicon-based microdisplays, due to the visual following effect of the human eye, the human eye can perceive bright or dark textures other than the image's own contour information in the smooth area where the image changes slowly, which is called dynamic false contour (DFC), which reduces the user's visual experience.
[0003] In the prior art, there are two main methods for improving the DFC phenomenon: one is to achieve the goal of improving the DFC phenomenon by dividing a high-weight subfield into multiple low-weight subfields and optimizing the subfield order, but this method will lead to a series of problems such as increased power consumption as the number of subfields increases; the other solution is to improve the DFC phenomenon through halftoning technology, but halftoning technology will cause the grayscale level of the image to decrease, thereby causing a decrease in image quality. Summary of the invention
[0004] In order to solve the problems existing in the prior art, the present application provides an image display method, electronic device, storage medium and program product based on flatness analysis.
[0005] The present application provides an image display method based on flatness analysis, comprising the steps of: acquiring a frame of image and scanning it to acquire the grayscale value of a current pixel in the image; acquiring the flatness of the current pixel according to the grayscale change between the current pixel and adjacent pixels; comparing the flatness of the current pixel with a preset flatness threshold, if the flatness of the current pixel is less than the preset flatness threshold, the current pixel is in a flat area, otherwise, the current pixel is in a non-flat area; presetting a grayscale set, the dynamic false contour quantization value of the pixel corresponding to each grayscale value in the grayscale set is greater than the preset dynamic false contour threshold; judging whether the grayscale value of the current pixel in the flat area is within the preset grayscale set, if the grayscale value of the current pixel is within the preset grayscale set, the current pixel needs to be grayscale corrected, otherwise, no processing is performed; and using an error diffusion method to perform grayscale correction on the current pixel whose grayscale value is within the preset grayscale set.
[0006] Optionally, obtaining the flatness of the current pixel based on the grayscale change between the current pixel and the adjacent pixels includes the steps of: obtaining a grayscale difference value between the current pixel and the adjacent pixels in a first direction as a first difference value of the current pixel, and obtaining a grayscale difference value between the current pixel and the adjacent pixels in a second direction perpendicular to the first direction as a second difference value of the current pixel, wherein the adjacent pixels of the current pixel include pixels adjacent to the current pixel in the same row, pixels adjacent to the current pixel in the same column, and pixels adjacent to the current pixel diagonally; and obtaining a flatness quantization value of the position of the current pixel according to the first difference value and the second difference value of the current pixel.
[0007] Optionally, the image display method based on flatness analysis also includes the steps of: when the rightmost pixel in each row of pixels is used as the current pixel, setting the first difference value to 0; when the bottommost pixel in each column of pixels is used as the current pixel, setting the second difference value to 0.
[0008] Optionally, the flatness quantization value includes: a maximum value of a first difference value and a second difference value of a current pixel, a square sum of the first difference value and the second difference value of the current pixel, and a sum of absolute values of the first difference value and the second difference value of the current pixel.
[0009] Optionally, the process of comparing the flatness of the current pixel with a preset flatness threshold comprises the steps of: dividing the image into a plurality of block areas; obtaining an adaptive threshold of the block where the current pixel is located as a preset flatness threshold; comparing a flatness quantization value of the current pixel with the adaptive threshold of the block where the current pixel is located; if the flatness quantization value of the current pixel is less than the adaptive threshold of the block where the current pixel is located, the current pixel is considered to be in a flat area, otherwise the current pixel is considered to be in a non-flat area.
[0010] Optionally, the adaptive threshold of the block where the current pixel is located is one or a combination of the average grayscale, the maximum grayscale, the minimum grayscale, the grayscale contrast and the grayscale uniformity of the block where the current pixel is located.
[0011] Optionally, the grayscale correction of the pixel requiring grayscale correction by using the error diffusion method includes the steps of: correcting the grayscale value of the current pixel to a grayscale value that does not belong to a preset grayscale set and is closest to the grayscale value of the current pixel by using the error diffusion method.
[0012] The present application also provides an electronic device, comprising: one or more processors; a memory for storing executable instructions; wherein the one or more processors are configured to call the executable instructions stored in the memory to execute the above-mentioned image display method based on flatness analysis.
[0013] The present application also provides a computer-readable storage medium on which computer program instructions are stored. When the computer program instructions are executed by a processor, the above-mentioned image display method based on flatness analysis is implemented.
[0014] The present application also provides a computer program product, including a computer-readable code, or a non-volatile computer-readable storage medium carrying the computer-readable code, characterized in that when the computer-readable code runs in an electronic device, a processor in the electronic device executes the above-mentioned image display method based on flatness analysis.
[0015] Compared with the prior art, the technical solution of the present application has the following beneficial effects:
[0016] The present application provides an image display method based on flatness analysis, which uses the error diffusion method to perform correction only in local flat areas where the grayscale variation of the image is small, thereby avoiding the use of halftone technology in non-flat areas where the DFC phenomenon cannot be observed, retaining the original contour and texture information of the image, thereby improving the image quality. At the same time, since the number of pixels that need to be processed using the error diffusion method is reduced, the processing efficiency of the image is also improved. BRIEF DESCRIPTION OF THE DRAWINGS
[0017] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For those skilled in the art, other drawings can be obtained based on these drawings without creative work.
[0018] Figure 1 A schematic diagram of a process of an image display method based on flatness analysis according to an embodiment of the present application;
[0019] Figure 2 A schematic diagram of a process for obtaining the flatness of a current pixel according to an embodiment of the present application;
[0020] Figure 3 A schematic diagram of a row buffer according to an embodiment of the present application;
[0021] Figure 4 A schematic diagram of a process for obtaining the flatness of a current pixel according to an embodiment of the present application;
[0022] Figure 5 A schematic diagram of a process of determining whether a current pixel is located in a flat area according to an embodiment of the present application;
[0023] Figure 6 A distribution diagram of DFC quantization values of all gray levels in one embodiment of the present application;
[0024] Figure 7-10 FIG. 1 is a schematic diagram of an error diffusion process according to an embodiment of the present application. DETAILED DESCRIPTION
[0025] The preferred embodiments of the present application will be described in more detail below. Although the preferred embodiments of the present application are described below, it should be understood that the present application can be implemented in various forms and should not be limited by the embodiments described herein.
[0026] In the present application, unless otherwise specified, the directional words used, such as "upper and lower", generally refer to the upper and lower parts of the device in normal use, and "inside and outside" refer to the outline of the device. In addition, the terms "first, second, third" are used for descriptive purposes only and cannot be understood as indicating or implying relative importance or implicitly indicating the number of technical features indicated. Therefore, the features defined as "first, second, third" may explicitly or implicitly include one or more of the features. In the description of the present application, "multiple" means two or more, unless otherwise clearly and specifically defined. In the present application, the electrical device is used, so connection and interconnection both refer to conductive interconnection. Since the accompanying drawings are descriptions of the same device, the same numbers in the drawings represent the same components.
[0027] As described in the background technology, the prior art generally uses half-tone technology to improve the DFC phenomenon. However, according to the mechanism of DFC generation, the human eye will not observe the DFC phenomenon in the local non-flat area with a large grayscale change. Therefore, if the half-tone technology is still used in the local non-flat area, the original contour and texture information of the image will be destroyed, resulting in problems such as image blur. This not only does not help to improve the DFC phenomenon, but on the contrary causes image quality loss.
[0028] To solve this problem, the present application provides an image display method, electronic device, storage medium and program product based on flatness analysis, which avoids the use of halftone technology in non-flat areas where the DFC phenomenon cannot be observed, retains the original contour and texture information of the image, and improves the image quality.
[0029] The present application provides an image display method based on flatness analysis, comprising the steps of: acquiring a frame of image and scanning it to acquire the grayscale value of a current pixel in the image; acquiring the flatness of the current pixel according to the grayscale change between the current pixel and adjacent pixels; comparing the flatness of the current pixel with a preset flatness threshold, if the flatness of the current pixel is less than the preset flatness threshold, the current pixel is in a flat area, otherwise, the current pixel is in a non-flat area; presetting a grayscale set, the dynamic false contour quantization value of the pixel corresponding to each grayscale value in the grayscale set is greater than the preset dynamic false contour threshold; judging whether the grayscale value of the current pixel in the flat area is within the preset grayscale set, if the grayscale value of the current pixel is within the preset grayscale set, the current pixel needs to be grayscale corrected, otherwise, no processing is performed; and using an error diffusion method to perform grayscale correction on the current pixel whose grayscale value is within the preset grayscale set.
[0030] In order to provide a further understanding of the purpose, structure, features, and functions of the present application, specific examples of the present application are further described in detail below in conjunction with the accompanying drawings.
[0031] Figure 1 FIG. 1 is a flow chart of an image display method based on flatness analysis according to an embodiment of the present application. Figure 2 FIG. 1 is a flow chart showing a process of obtaining the flatness of a current pixel according to an embodiment of the present application. Figure 1-2 , this embodiment provides an image display method based on flatness analysis, comprising the steps of:
[0032] S1: Acquire a frame of image and scan it to obtain the grayscale value of the current pixel in the image.
[0033] In the embodiment of the present application, specifically, a frame size of 1920*1080 image I is obtained, the position of the current pixel scanned is (i, j), and the gray value of the pixel is I ij .
[0034] In some embodiments, in order to improve processing efficiency, a row buffer may be added to complete the acquired image data and the processing process in one traversal process, and the capacity of the row buffer is just enough to store the grayscale values of a row of pixels.
[0035] S2: Obtain the flatness of the current pixel according to the grayscale change between the current pixel and adjacent pixels.
[0036] In the embodiment of the present application, a row buffer whose capacity is just enough to store the grayscale value of a row of pixels is added, so as to achieve the purpose of processing the i-th row of data while acquiring the i+1-th row of data. For example, assuming that the currently acquired data is the grayscale value of the pixel at the position (i+1, j), Figure 3As shown, due to the existence of the line buffer, the data I required for flattening the current pixel is stored. i,j and I i,j+1 , and combined with the gray value of the current pixel I i+1,j . Therefore, flatness quantification can be performed.
[0037] The step of obtaining the flatness of the current pixel according to the grayscale change between the current pixel and adjacent pixels comprises the following steps:
[0038] S21: Obtain a grayscale difference value between a current pixel and an adjacent pixel in a first direction as a first difference value of the current pixel, and obtain a grayscale difference value between the current pixel and an adjacent pixel in a second direction perpendicular to the first direction as a second difference value of the current pixel.
[0039] The neighboring pixels of the current pixel include pixels adjacent to the current pixel in the same row, pixels adjacent to the current pixel in the same column, and pixels adjacent to the current pixel diagonally.
[0040] In an embodiment of the present application, first, the grayscale difference value between the grayscale value of the current pixel and the grayscale value of the next pixel in the horizontal direction is obtained as the first difference value; then, the grayscale difference value between the grayscale value of the current pixel and the grayscale value of the next pixel in the vertical direction is obtained as the second difference value.
[0041] S22: Obtain a flatness quantization value of the position where the current pixel is located according to the first difference value and the second difference value of the current pixel.
[0042] After obtaining the first difference value and the second difference value of the current pixel, a flatness quantization value of the position of the current pixel is obtained by calculation. The flatness quantization value may be the maximum value of the first difference value and the second difference value of the current pixel, the square sum of the first difference value and the second difference value of the current pixel, or the sum of the absolute values of the first difference value and the second difference value of the current pixel.
[0043] Specifically, Figure 4 The schematic diagram of the process of obtaining the flatness of the current pixel in the first embodiment of the present application is shown. For the convenience of description, the x direction and the y direction mentioned below refer to the first direction and the second direction perpendicular to the first direction respectively. First, the pixel at the position (i, j) in the image is selected as the current pixel, and the grayscale difference value of the current pixel at the position (i, j) in the x direction and the y direction is calculated, that is, the first difference value and the second difference value of the current pixel are grad x (i,j) and grad y (i,j), the specific calculation formula is as follows:
[0044] grad x (i,j)=I i,j+1 -Iij
[0045] grad y (i,j)=I i+1,j -I ij
[0046] After that, the flatness quantization result at (i, j) is obtained:
[0047] S ij =max{|grad x (i,j)|,|grad y (i,j)|}
[0048] In the first embodiment of the present application, the flatness quantization value is the maximum value between the first difference value and the second difference value of the current pixel. Figure 4 As shown, the grad at the current pixel position (i, j) can be calculated x (i,j)=2,grad y =1; flatness quantization value S ij =2. Similarly, we can get S i+1,j =8.
[0049] In the second embodiment of the present application, other quantization methods may be used to quantify the flatness of the current pixel. First, pixels adjacent to the current pixel in the horizontal direction and the vertical direction are also selected as adjacent pixels, and then the first difference value and the second difference value of the current pixel in the x direction and the y direction at (i, j) are calculated. The specific calculation formula is as follows:
[0050] grad x (i,j)=I i,j+1 -I ij
[0051] grad y (i,j)=I i+1,j -I ij
[0052] Next, the square sum of the first difference value and the second difference value of the current pixel is selected as the flatness quantization result at (i, j), that is:
[0053] S ij =(grad x (i,j)) 2 +(grad y (i,j)) 2
[0054] In the third embodiment of the present application, other quantization methods may be used to quantify the flatness of the current pixel. First, pixels adjacent to the current pixel in the horizontal direction and the vertical direction are also selected as adjacent pixels, and the first difference value and the second difference value in the x direction and the y direction of the current pixel at (i, j) are calculated. The specific calculation formula is as follows:
[0055] grad x (i,j)=I i,j+1 -I ij
[0056] grad y (i,j)=I i+1,j -I ij
[0057] Afterwards, the absolute value sum of the first difference value and the second difference value of the current pixel is selected as the flatness quantization result at (i, j), that is:
[0058] S ij =|grad x (i,j)|+|(grad y (i,j))|
[0059] It should be noted that in different embodiments, there are multiple methods for obtaining the flatness quantization value of the current pixel. In the embodiments of the present application, only the above three quantization methods are described in detail. Other quantization methods can also be used in the specific implementation process, and the present application does not limit this. At the same time, in the above three embodiments, in the process of calculating the first difference value and the second difference value, the pixels adjacent to the current pixel in the horizontal direction and the vertical direction are selected as adjacent pixels. In some other embodiments, other pixels can also be selected as adjacent pixels of the current pixel, and the present application does not limit this. For example, the grayscale difference on the two diagonals including the current pixel can also be selected as the first difference value and the second difference value of the current pixel, respectively, so as to calculate the specific calculation formula of the first difference value and the second difference value in the x direction and the y direction of the current pixel at (i, j) as follows:
[0060] grad x (i,j)=I i+1,j+1 -I i,j
[0061] grad y (i,j)=I i,j+1 -I i+1,j
[0062] In some embodiments, when the right edge of the image is encountered, the grayscale difference value grad in the x direction of the current pixel at the right edge is set to x(i, j) = 0, that is, the first difference value is 0; similarly, when encountering the lower boundary of the image, the grayscale difference value grad in the y direction of the pixel at the lower boundary is set y (i, j)=0, that is, the second difference value is 0.
[0063] In some embodiments, after the grayscale values of all pixels in the frame of image are acquired, the flatness of each pixel may be quantified in sequence.
[0064] S3: Compare the flatness of the current pixel with a preset flatness threshold. If the flatness of the current pixel is less than the preset flatness threshold, the current pixel is in a flat area; otherwise, the current pixel is in a non-flat area.
[0065] In the first embodiment of the present application, the preset flatness threshold is a fixed threshold. Specifically, the threshold S is selected th =5. If S ij ≤S th , then the current pixel is considered to be in a flat area, D ij =1,; if S ij >S th , then the current pixel is considered to be in a non-flat area, D ij =0. Specifically expressed as:
[0066]
[0067] Combination Figure 5 In the embodiment of the present application, the pixel located at the position (i, j) is in a flat area, and the pixel located at the position (i+1, j) is in a non-flat area.
[0068] In the second embodiment of the present application, the preset flatness threshold is a fixed threshold. Specifically, the threshold S is selected th =40. If S ij ≤S th , then the current pixel is considered to be in a flat area, D ij =1; if S ij >S th , then the current pixel is considered to be in a non-flat area, D ij =0. Specifically expressed as:
[0069]
[0070] In the third embodiment of the present application, the preset flatness threshold is a fixed threshold. th =8. If S ij ≤S th , then the current pixel is considered to be in a flat area, D ij =1,; if Sij >S th , then the current pixel is considered to be in a non-flat area, D ij =0. Specifically expressed as:
[0071]
[0072] It should be noted that, in the embodiments of the present application, th The selection is only for the convenience of expression. In practical applications, a suitable threshold can be selected according to the actual situation, and this application does not limit this.
[0073] In some other embodiments, the preset flatness threshold is an adaptive threshold of the block where the current pixel is located. In practical applications, in order to reduce storage overhead and simplify and efficiently implement the algorithm, a fixed threshold is generally used. However, this does not mean that the method based on the adaptive threshold of flatness of blocks is not applicable. When the preset flatness threshold is the adaptive threshold of the block where the current pixel is located, it is only necessary to add more row buffers to store the required data. For example, if the block size is selected to be m*n, m≥1, n≥1. When a buffer is used to store the grayscale values of the next row of pixels, at least m-1 row buffers are required.
[0074] The method of comparing the flatness of the current pixel with a preset flatness threshold comprises the following steps: dividing the image into blocks; obtaining an adaptive threshold of the block where the current pixel is located as a preset flatness threshold; comparing a flatness quantization value of the current pixel with the adaptive threshold of the block where the current pixel is located; if the flatness quantization value of the current pixel is less than the adaptive threshold of the block where the current pixel is located, it is considered that the current pixel is in a flat area, otherwise it is considered that the current pixel is in a non-flat area.
[0075] Specifically, the image is divided into blocks, and the block size is m*n, m≥1, n≥1. The same threshold S is used in the same block. th The process of comparing the flatness quantization value of the current pixel with the adaptive threshold of the block where the current pixel is located is the same as that of the first embodiment of the present application, and will not be described in detail here.
[0076] In some embodiments, the adaptive threshold of the block where the current pixel is located is one or a combination of the average grayscale, the maximum grayscale, the minimum grayscale, the grayscale contrast and the grayscale uniformity of the block where the current pixel is located.
[0077] S4: Preset a grayscale set, in which the dynamic false contour quantization value of the pixel corresponding to each grayscale value in the grayscale set is greater than a preset dynamic false contour threshold.
[0078] In the embodiment of the present application, firstly, the DFC between any two gray levels is quantized according to the subfield weight sequence and encoding method of the n-subfield (n≥8) display method and combined with the DFC generation mechanism to obtain the DFC quantization value; then, the set to be corrected is obtained according to the DFC quantization value.
[0079] S5: Determine whether the grayscale value of the current pixel in the flat area is within a preset grayscale set. If the grayscale value of the current pixel is within the preset grayscale set, the current pixel needs to be grayscale corrected, otherwise, no processing is performed.
[0080] S6: Using the error diffusion method to perform grayscale correction on the current pixel whose grayscale value is within the preset grayscale set.
[0081] The grayscale correction of the pixel requiring grayscale correction by using the error diffusion method comprises the following steps: using the error diffusion method to correct the grayscale value of the current pixel to a grayscale value that does not belong to a preset grayscale set and is closest to the grayscale value of the current pixel.
[0082] In a specific embodiment, for steps S4-S6, for example, in the case of 256 gray levels, a subfield weight sequence of 16:16:32:16:32:16:8:4:2:1:32:16:32:16:16 is adopted, and a subfield scheme implemented in a certain encoding method is adopted. The DFC value between any two gray levels is quantized by using a dynamic integration method, so as to obtain a distribution diagram of the DFC value, such as Figure 6 Afterwards, a grayscale with a higher DFC quantization value is selected and placed in the set to be corrected. In one embodiment, the selected grayscale set to be corrected is: [126, 127, 128, 129, 159, 160, 161, 162, 190, 191, 192, 193, 222, 223, 224, 225]. When the current pixel is in a flat area and the grayscale value is 161, since the grayscale value of the current pixel belongs to the set to be corrected, the grayscale value of the current pixel needs to be corrected.
[0083] Next, the grayscale value that does not belong to the preset grayscale set and is closest to the grayscale value of the current pixel is selected as the correction value, so the correction value is 163, and the difference between the error correction result and the grayscale value of the current pixel is calculated. i,j = 2 is stored in the register, and the gray value of the current pixel at (i, j) can be corrected before subsequent image processing or storage in the device. Therefore, if Figure 7 As shown, it is equivalent to that the jth unit in the buffer is vacant. Then the pixel I obtained by scanning is i+1,j To cover I i,j ,like Figure 8 shown.
[0084] In some embodiments, after the grayscale value of the current pixel is corrected to a grayscale value that does not belong to the preset grayscale set and is closest to the grayscale value of the current pixel, the corrected error of the current pixel is propagated to its adjacent pixel points. For example, it can be propagated to the pixel points on the right side, the bottom side, the lower right side, and the lower left side. In the embodiment of the present disclosure, the diffusion method is:
[0085]
[0086] It satisfies α+β+γ+θ=1.
[0087] According to the above correction, the grayscale value of the current pixel after correction is 163, but there is a certain difference between the correction result and the original value of the grayscale value of the current pixel. Therefore, it is necessary to diffuse the error through its adjacent pixels.
[0088]
[0089] Reference Fig. 9 , except I i+1,j+1 The error is still stored in the register, and the gray value data of the next pixel is obtained at this time. i+1,j+1 And add the register error e i,j ,Right now:
[0090] I i+1,j+1 =I i+1,j+1 +e i,j
[0091] Get I after adding the error i+1,j+1 .
[0092] After the above steps S1-S6, the corrected current pixel grayscale value can be obtained, and then Fig.10 As shown, the above operation is repeated for the next pixel. After performing the above steps for a frame image, a processed frame image is obtained.
[0093] In some embodiments, scanning a frame of image may be performed by traversing each pixel in the image row by row, wherein the pixel-by-pixel traversal is performed from left to right, from top to bottom, or in a serpentine traversal manner.
[0094] The present application determines whether subsequent processing is required by judging the flatness information of the position of the current scanning pixel, thereby avoiding the use of the error diffusion method in the halftone technology in the non-flat area where the DFC phenomenon cannot be observed, retaining the original contour and texture information of the image, improving the image quality, and at the same time improving the image processing efficiency.
[0095] Furthermore, the image display method based on flatness analysis provided by the present application determines whether the grayscale value of the current pixel belongs to a preset grayscale set before correction. The error diffusion method is used to correct the grayscale only when the current pixel belongs to the preset grayscale set. This allows the error diffusion method to be used to more accurately process pixels that may cause severe DFC phenomena.
[0096] The present application also provides an electronic device, comprising: one or more processors; a memory for storing executable instructions; wherein the one or more processors are configured to call the executable instructions stored in the memory to execute the image display method based on flatness analysis.
[0097] The present application also provides a computer-readable storage medium on which computer program instructions are stored. When the computer program instructions are executed by a processor, the image display method based on flatness analysis is implemented.
[0098] The present application also provides a computer program product, including a computer-readable code, or a non-volatile computer-readable storage medium carrying the computer-readable code. When the computer-readable code runs in an electronic device, a processor in the electronic device executes the image display method based on flatness analysis.
[0099] The image display method, electronic device, storage medium and sequence product based on flatness analysis of the present application can reduce image quality loss while suppressing DFC phenomenon by using the error diffusion method in halftone technology, and has the advantages of simplicity and low hardware implementation cost.
[0100] It is understood that the structures illustrated in the embodiments of the present application do not constitute specific limitations on the image display method, electronic device, storage medium, and program product based on flatness analysis. In other embodiments of the present application, more or fewer components than shown in the figure may be included, or some components may be combined, or some components may be split, or different component arrangements may be provided. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.
[0101] The various embodiments of the mechanism disclosed in the present application can be implemented in hardware, software, firmware or a combination of these implementation methods. The embodiments of the present application can be implemented as a computer program or program code executed on a programmable system, which includes at least one processor, a storage system (including volatile and non-volatile memory and / or storage elements), at least one input device and at least one output device.
[0102] Program code can be applied to input instructions to perform the functions described in this application and generate output information. The output information can be applied to one or more output devices in a known manner.
[0103] Program code can be implemented with high-level programming language or target area-oriented programming language to communicate with the processing system. When necessary, program code can also be implemented with assembly language or machine language. In fact, the mechanism described in this application is not limited to the scope of any specific programming language. In either case, the language can be a compiled language or an interpreted language.
[0104] In some cases, the disclosed embodiments may be implemented in hardware, firmware, software, or any combination thereof. The disclosed embodiments may also be implemented as instructions carried or stored on one or more temporary or non-temporary machine-readable (e.g., computer-readable) storage media, which may be read and executed by one or more processors. For example, instructions may be distributed over a network or through other computer-readable media. Therefore, machine-readable media may include any mechanism for storing or transmitting information in a machine (e.g., computer) readable form, including, but not limited to, floppy disks, optical disks, optical disks, read-only memories (CD-ROMs), magneto-optical disks, read-only memories (ROMs), random access memories (RAMs), erasable programmable read-only memories (EPROMs), electrically erasable programmable read-only memories (EEPROMs), magnetic or optical cards, flash memory, or a tangible machine-readable memory for transmitting information (e.g., carrier waves, infrared signals, digital signals, etc.) using the Internet in electrical, optical, acoustic, or other forms of propagation signals. Therefore, machine-readable media include any type of machine-readable media suitable for storing or transmitting electronic instructions or information in a machine (e.g., computer) readable form.
[0105] In the accompanying drawings, some structural or method features may be shown in a specific arrangement and / or order. However, it should be understood that such a specific arrangement and / or order may not be required. Instead, in some embodiments, these features may be arranged in a manner and / or order different from that shown in the illustrative drawings. In addition, the inclusion of structural or method features in a particular figure does not mean that such features are required in all embodiments, and in some embodiments, these features may not be included or may be combined with other features.
[0106] It should be noted that the units / modules mentioned in the various device embodiments of the present application are all logical units / modules. Physically, a logical unit / module can be a physical unit / module, or a part of a physical unit / module, or can be implemented as a combination of multiple physical units / modules. The physical implementation method of these logical units / modules themselves is not the most important. The combination of functions implemented by these logical units / modules is the key to solving the technical problems proposed by the present application. In addition, in order to highlight the innovative part of the present application, the above-mentioned device embodiments of the present application do not introduce units / modules that are not closely related to solving the technical problems proposed by the present application, which does not mean that there are no other units / modules in the above-mentioned device embodiments.
[0107] The above description is only an embodiment of the present application and does not limit the patent scope of the present application. Any equivalent structure or equivalent process transformation made using the contents of the specification and drawings of this application, such as the mutual combination of technical features between the embodiments, or direct or indirect application in other related technical fields, are included in the patent protection scope of the present application.
Claims
1. An image display method based on flatness analysis, characterized in that: Includes steps: Acquire a frame of image and scan it to obtain the grayscale value of the current pixel in the image; Obtaining the flatness of the current pixel according to the grayscale change between the current pixel and the adjacent pixels; comparing the flatness of the current pixel with a preset flatness threshold, if the flatness of the current pixel is less than the preset flatness threshold, the current pixel is in a flat area, otherwise, the current pixel is in a non-flat area; Preset a grayscale set, wherein the dynamic false contour quantization value of the pixel corresponding to each grayscale value in the grayscale set is greater than a preset dynamic false contour threshold; Determine whether the grayscale value of the current pixel in the flat area is within the preset grayscale set. If the grayscale value of the current pixel is within the preset grayscale set, the current pixel needs to be grayscale corrected, otherwise, no processing is performed; The error diffusion method is used to perform grayscale correction on the current pixel whose grayscale value is within the preset grayscale set.
2. The image display method based on flatness analysis according to claim 1, characterized in that: The step of obtaining the flatness of the current pixel according to the grayscale change between the current pixel and adjacent pixels comprises the following steps: Obtaining a grayscale difference value between a current pixel and an adjacent pixel in a first direction as a first difference value of the current pixel, and obtaining a grayscale difference value between the current pixel and an adjacent pixel in a second direction perpendicular to the first direction as a second difference value of the current pixel, wherein the adjacent pixels of the current pixel include pixels adjacent to the current pixel in a row, pixels adjacent to the current pixel in a column, and pixels adjacent to the current pixel diagonally; A flatness quantization value of a position where the current pixel is located is obtained according to the first difference value and the second difference value of the current pixel.
3. The image display method based on flatness analysis according to claim 2, characterized in that: Also includes the steps: When the rightmost pixel in each row of pixels is used as the current pixel, the first difference value is set to 0; When the bottommost pixel in each column of pixels is used as the current pixel, the second difference value is set to 0.
4. The image display method based on flatness analysis according to claim 3, characterized in that: The flatness quantization value includes: a maximum value of the first difference value and the second difference value of the current pixel, a square sum of the first difference value and the second difference value of the current pixel, and a sum of absolute values of the first difference value and the second difference value of the current pixel.
5. The image display method based on flatness analysis according to claim 4, characterized in that: The step of comparing the flatness of the current pixel with a preset flatness threshold comprises the following steps: Dividing the image into a plurality of regions; Obtaining the adaptive threshold of the block where the current pixel is located as the preset flatness threshold; Compare the flatness quantization value of the current pixel with the adaptive threshold of the block where the current pixel is located; If the flatness quantization value of the current pixel is less than the adaptive threshold of the block where the current pixel is located, the current pixel is considered to be in a flat area, otherwise the current pixel is considered to be in a non-flat area.
6. The image display method based on flatness analysis according to claim 5, characterized in that: The adaptive threshold of the block where the current pixel is located is one or a combination of the average grayscale, the maximum grayscale, the minimum grayscale, the grayscale contrast and the grayscale uniformity of the block where the current pixel is located.
7. The image display method based on flatness analysis according to claim 1, characterized in that: The grayscale correction of the pixel requiring grayscale correction by using the error diffusion method comprises the following steps: The error diffusion method is used to correct the grayscale value of the current pixel to a grayscale value that does not belong to the preset grayscale set and is closest to the grayscale value of the current pixel.
8. An electronic device, characterized in that: include: one or more processors; a memory for storing executable instructions; The one or more processors are configured to call the executable instructions stored in the memory to execute the method according to any one of claims 1 to 7.
9. A computer-readable storage medium having computer program instructions stored thereon, characterized in that: When the computer program instructions are executed by a processor, the method according to any one of claims 1 to 7 is implemented.
10. A computer program product comprising computer readable code, or a non-volatile computer readable storage medium carrying computer readable code, characterized in that: When the computer readable code is executed in an electronic device, a processor in the electronic device executes the method according to any one of claims 1 to 7.
