Disclosure of Invention
The application provides a mobile terminal and an image display method thereof, which can solve the problem of poor image display effect of the mobile terminal in the related art. The technical scheme is as follows:
in one aspect, a mobile terminal is provided that includes a processor and a color ink screen, the color ink screen including a plurality of different colored resist blocks; the processor is configured to:
traversing pixel points in a gray-scale image with a first gray-scale level, and determining a target gray-scale value of each traversed pixel point under a second gray-scale level and an error of the pixel point based on an initial gray-scale value of the pixel point, wherein the error of the pixel point is related to the initial gray-scale value of the pixel point, the second gray-scale level is less than the first gray-scale level, and one pixel point in the gray-scale image corresponds to one color resistance block in a plurality of color resistance blocks;
updating initial gray scale values of a plurality of target pixel points which are positioned in the neighborhood of the pixel point and are not traversed based on the error of the pixel point, wherein the colors of color resistance blocks corresponding to at least two target pixel points in the plurality of target pixel points are the same as the colors of the color resistance blocks corresponding to the pixel points;
and the color ink screen is used for displaying the gray-scale image of the second gray-scale level.
Optionally, the grayscale image includes a plurality of pixel points arranged in an array, the plurality of color resist blocks include three color resist blocks arranged in an array, the color resist blocks located in the same column, any two adjacent color resist blocks have different colors, the plurality of color resist blocks located in the same row are divided into a plurality of color resist block groups, each color resist block group includes three color resist blocks with the same color, and the color of any two adjacent color resist block groups is different; the processor is configured to:
traversing pixel points in the gray-scale image of the first gray-scale level line by line;
the plurality of target pixel points which are positioned in the neighborhood of the pixel point of the ith row and the jth column of the gray-scale image and are not traversed comprise:
a first target pixel point positioned on the ith row and the (j + 1) th column of the gray-scale image;
a second target pixel point positioned on the (i + 1) th row and the jth column of the gray-scale image;
a third target pixel point positioned in the (i + 1) th row and the (j + 1) th column of the gray-scale image;
a fourth target pixel point positioned on the (i + 2) th row and the jth column of the gray-scale image;
a fifth target pixel point positioned on the (i + 2) th row and the (j + 1) th column of the gray-scale image;
a sixth target pixel point positioned on the (i + 3) th row and the jth column of the gray-scale image;
seven target pixel points positioned on the (i + 3) th row and the (j + 1) th column of the gray-scale image;
wherein i and j are both positive integers.
Optionally, the processor is configured to:
updating the initial gray scale value of the first target pixel point to be the sum of the initial gray scale value of the first target pixel point and a first numerical value, wherein the first numerical value is the product of the error of the pixel point of the ith row and the jth column and a first coefficient;
updating the initial gray scale value of the second target pixel point to be the sum of the initial gray scale value of the second target pixel point and a second numerical value, wherein the second numerical value is the product of the error of the pixel point of the ith row and the jth column and a second coefficient;
updating the initial gray scale value of the third target pixel point to be the sum of the initial gray scale value of the third target pixel point and a third numerical value, wherein the third numerical value is the product of the error of the pixel point in the ith row and the jth column and a third coefficient;
updating the initial gray-scale value of the fourth target pixel point to be the sum of the initial gray-scale value of the fourth target pixel point and the second numerical value;
updating the initial gray scale value of the fifth target pixel point to be the sum of the initial gray scale value of the fifth target pixel point and a fourth numerical value, wherein the fourth numerical value is the product of the error of the pixel point of the ith row and the jth column and a fourth coefficient;
updating the initial gray-scale value of the sixth target pixel point to be the sum of the initial gray-scale value of the sixth target pixel point and the second numerical value;
updating the initial gray scale value of the seventh target pixel point to be the sum of the initial gray scale value of the seventh target pixel point and the fourth numerical value;
wherein the first coefficient is greater than the second coefficient, which is greater than the fourth coefficient;
the third coefficient is equal to the fourth coefficient;
alternatively, the third coefficient is greater than the first coefficient.
Optionally, if the color of the color block corresponding to the pixel point in the ith row and the jth column is the same as the color of the color block corresponding to the first target pixel point, the third coefficient is equal to the fourth coefficient;
and if the color of the color block corresponding to the pixel point of the ith row and the jth column is different from the color of the color block corresponding to the first target pixel point, the third coefficient is greater than the first coefficient.
Optionally, the grayscale image includes a plurality of pixel points arranged in an array, the plurality of color resist blocks include three color resist blocks with different colors and arranged in an array, the color resist blocks located in the same column are different in color of any two adjacent color resist blocks, the color resist blocks located in the same row are divided into a plurality of color resist block groups, each color resist block group includes three color resist blocks with the same color, and the color of any two adjacent color resist block groups is different; the processor is configured to:
traversing pixel points in the gray-scale image of the first gray-scale level row by row;
the plurality of target pixel points which are located in the field of pixel points of the ith row and the jth column of the gray-scale image and are not traversed comprise:
a first target pixel point positioned on the ith row and the (j + 1) th column of the gray-scale image;
a second target pixel point positioned on the (i + 1) th row and the (j-1) th column of the gray scale image;
a third target pixel point positioned on the (i + 1) th row and the jth column of the gray-scale image;
a fourth target pixel point positioned in the (i + 1) th row and the (j + 1) th column of the gray-scale image;
a fifth target pixel point positioned on the (i + 2) th row and the (j-1) th column of the gray-scale image;
a sixth target pixel point positioned on the (i + 2) th row and the jth column of the gray-scale image;
a seventh target pixel point positioned on the (i + 2) th row and the (j + 1) th column of the gray-scale image;
the eighth target pixel point is positioned on the (i + 3) th row and the (j-1) th column of the gray-scale image;
a ninth target pixel point positioned on the (i + 3) th row and the jth column of the gray-scale image;
a tenth target pixel point positioned in the (i + 3) th row and the (j + 1) th column of the gray-scale image;
wherein i and j are both positive integers.
Optionally, the processor is configured to:
updating the initial gray scale value of the first target pixel point to be the sum of the initial gray scale value of the first target pixel point and a fifth numerical value, wherein the fifth numerical value is the product of the error of the pixel point positioned in the ith row and the jth column and a fifth coefficient;
updating the initial gray scale value of the second target pixel point to be the sum of the initial gray scale value of the second target pixel point and a sixth numerical value, wherein the sixth numerical value is the product of the error of the pixel point of the ith row and the jth column and a sixth coefficient;
updating the initial gray scale value of the third target pixel point to be the sum of the initial gray scale value of the third target pixel point and a seventh numerical value, wherein the seventh numerical value is the product of the error of the pixel point of the ith row and the jth column of the gray scale image and a seventh coefficient;
updating the initial gray scale value of the fourth target pixel point to be the sum of the initial gray scale value of the fourth target pixel point and an eighth value, wherein the eighth value is the product of the error of the pixel point in the ith row and the jth column and the eighth coefficient;
updating the initial gray-scale value of the fifth target pixel point to be the sum of the initial gray-scale value of the fifth target pixel point and the sixth numerical value;
updating the initial gray-scale value of the sixth target pixel point to be the sum of the initial gray-scale value of the sixth target pixel point and the seventh numerical value;
updating the initial gray scale value of the seventh target pixel point to be the sum of the initial gray scale value of the seventh target pixel point and a ninth value, wherein the ninth value is the product of the error of the pixel point in the ith row and the jth column and a ninth coefficient;
updating the initial gray scale value of the eighth target pixel point to be the sum of the initial gray scale value of the eighth target pixel point and the sixth numerical value;
updating the initial gray-scale value of the ninth target pixel point to be the sum of the initial gray-scale value of the ninth target pixel point and the seventh numerical value;
updating the initial gray scale value of the tenth target pixel point to be the sum of the initial gray scale value of the tenth target pixel point and the ninth value;
wherein the sixth coefficient is less than the seventh coefficient, which is less than the fifth coefficient;
the eighth coefficient is equal to the ninth coefficient and the eighth coefficient is less than the sixth coefficient;
or, the fifth coefficient is smaller than the eighth coefficient, and the ninth coefficient is smaller than the sixth coefficient.
Optionally, if the color of the color block corresponding to the pixel point in the ith row and the jth column is the same as the color of the color block corresponding to the first target pixel point, the eighth coefficient is equal to the ninth coefficient, and the eighth coefficient is smaller than the sixth coefficient;
if the color of the color block corresponding to the pixel point in the ith row and the jth column is different from the color of the color block corresponding to the first target pixel point, the fifth coefficient is smaller than the eighth coefficient, and the ninth coefficient is smaller than the sixth coefficient.
Optionally, the second gray scale level is 2; the processor is configured to:
for each traversed pixel point, if the initial gray-scale value of the pixel point is smaller than a gray-scale value threshold, determining that the target gray-scale value of the pixel point is a first target numerical value, and determining that the error of the pixel point is the difference value between the initial gray-scale value of the pixel point and the first target numerical value;
if the initial gray-scale value of the pixel point is greater than or equal to the gray-scale value threshold, determining that the target gray-scale value of the pixel point is a second target value, and determining that the error of the pixel point is the difference value between the initial gray-scale value of the pixel point and the second target value;
wherein the second target value is greater than the first target value.
In another aspect, an image display method of a mobile terminal is provided, the mobile terminal including a color ink screen including a plurality of color blocks of different colors; the method comprises the following steps:
traversing pixel points in a gray-scale image with a first gray-scale level, and determining a target gray-scale value of each traversed pixel point under a second gray-scale level and an error of the pixel point based on an initial gray-scale value of the pixel point, wherein the error of the pixel point is related to the initial gray-scale value of the pixel point, the second gray-scale level is less than the first gray-scale level, and one pixel point in the gray-scale image corresponds to one color resistance block in a plurality of color resistance blocks;
updating initial gray scale values of a plurality of target pixel points which are positioned in the neighborhood of the pixel point and are not traversed based on the error of the pixel point, wherein the colors of color resistance blocks corresponding to at least two target pixel points in the plurality of target pixel points are the same as the colors of the color resistance blocks corresponding to the pixel points;
displaying the gray scale image of the second gray scale level.
Optionally, the grayscale image includes a plurality of pixel points arranged in an array, the plurality of color resist blocks include three color resist blocks arranged in an array, the color resist blocks located in the same column, any two adjacent color resist blocks have different colors, the plurality of color resist blocks located in the same row are divided into a plurality of color resist block groups, each color resist block group includes three color resist blocks with the same color, and the color of any two adjacent color resist block groups is different; the traversing of the pixel points in the gray-scale image of the first gray-scale level comprises:
traversing pixel points in the gray-scale image of the first gray-scale level row by row;
the plurality of target pixel points which are positioned in the neighborhood of the pixel point of the ith row and the jth column of the gray-scale image and are not traversed comprise:
a first target pixel point positioned on the ith row and the (j + 1) th column of the gray-scale image;
a second target pixel point positioned on the (i + 1) th row and the jth column of the gray-scale image;
a third target pixel point positioned in the (i + 1) th row and the (j + 1) th column of the gray-scale image;
a fourth target pixel point positioned on the (i + 2) th row and the jth column of the gray-scale image;
a fifth target pixel point positioned on the (i + 2) th row and the (j + 1) th column of the gray-scale image;
a sixth target pixel point positioned on the (i + 3) th row and the jth column of the gray-scale image;
seven target pixel points positioned on the (i + 3) th row and the (j + 1) th column of the gray-scale image;
wherein i and j are both positive integers.
In a further aspect, a computer-readable storage medium is provided, in which a computer program is stored which, when being executed by a processor, implements the image display method of a mobile terminal according to the above aspect.
In still another aspect, a computer program product containing instructions is provided, which when run on the computer, causes the computer to execute the image display method of the mobile terminal according to the above aspect.
The beneficial effect that technical scheme that this application provided brought includes at least:
the application provides a mobile terminal and an image display method thereof, wherein the mobile terminal can transmit errors of pixel points to a plurality of target pixel points in the neighborhood of the mobile terminal, and the colors of color blocking blocks corresponding to at least two target pixel points in the target pixel points are the same as the colors of the color blocking blocks corresponding to the pixel points. The mobile terminal can transmit the error of the pixel point to the target pixel point of the color block corresponding to the same color, so that the effect of updating the initial gray scale value of the adjacent target pixel point is achieved, the target gray scale value difference of the traversed adjacent pixel point under the second gray scale level number is larger, the situation that a single color area with a larger area exists after the gray scale image of the second gray scale level is displayed on the color ink screen is avoided, and the display effect of the gray scale image of the second gray scale level number is improved.
Detailed Description
To make the objects, technical solutions and advantages of the present application more clear, embodiments of the present application will be described in further detail below with reference to the accompanying drawings.
In the related art, a mobile terminal may include a color ink screen, which may display a color image. In the process of displaying a color image, in order to improve the refreshing effect of the image, the mobile terminal may convert a high grayscale image (i.e., an image with a higher grayscale level) into a low grayscale image (i.e., an image with a lower grayscale level), and then display the low grayscale image on its color ink screen.
The process of converting the high grayscale image (for example, a 256 grayscale image) into the low grayscale image (for example, a 2 grayscale image) by the mobile terminal may include: for each pixel point in the 256 gray-scale image, the mobile terminal may update the gray-scale value of the pixel point whose gray-scale value is greater than or equal to the specified threshold value in the gray-scale image to 0, and update the gray-scale value of the pixel point whose gray-scale value is less than the specified threshold value to 255. Then, the mobile terminal can display a 2-order image on the color ink screen based on the updated gray-scale value of the pixel point.
However, when the number of adjacent pixels with similar gray scale values in the 256 gray scale image is large, a single color region with a large area exists in the converted 2 gray scale image, which results in poor display effect of the 2 gray scale image.
The embodiment of the application provides an image display method of a mobile terminal, which can be applied to the mobile terminal, wherein the mobile terminal can comprise a color ink screen, the color ink screen can comprise a color film layer, and the color film layer can comprise a plurality of color blocking blocks with different colors. Referring to fig. 1, the method includes:
step 101, traversing pixel points in the gray scale image of the first gray scale level, and determining target gray scale values of the pixel points under the second gray scale level and errors of the pixel points for each traversed pixel point based on initial gray scale values of the pixel points.
The mobile terminal can acquire a gray scale image of a first gray scale level to be displayed and can traverse pixel points in the gray scale image of the first gray scale level. For each pixel point in the traversed gray-scale image, the mobile terminal may determine, based on the initial gray-scale value of the pixel point, a target gray-scale value of the pixel point at the second gray-scale level, and an error of the pixel point.
The error of the pixel is related to an initial gray level of the pixel, which is a brightness value of the pixel and may also be referred to as a gray value. One pixel point in the grayscale image corresponds to one color block of the plurality of color block. The second number of gray scale levels may be less than the first number of gray scale levels, for example the first number of gray scale levels may be 256 and the second number of gray scale levels may be 16, 4 or 2. The gray scale level of the gray scale image may refer to the number of brightness levels that each pixel point in the gray scale image can display. Therefore, the higher the gray scale level of the gray scale image is, the more the brightness level of the gray scale image can be displayed, and the better the display effect of the gray scale image is.
For example, if the gray scale level of a certain gray scale image is 256, each pixel in the gray scale image can display 256 different brightness levels, i.e., the gray scale value of each pixel can range from 0 to 255. If the gray scale level of a certain gray scale image is 2, each pixel point in the gray scale image can display 2 different brightness levels, i.e., the gray scale value of each pixel point can be 0 or 255.
102, updating initial gray-scale values of a plurality of target pixel points which are located in the neighborhood of the pixel points and are not traversed based on the errors of the pixel points.
After determining the error of the pixel point, the mobile terminal may update the initial gray scale value of the target pixel point that is located in the neighborhood of the pixel point and is not traversed, based on the error of the pixel point. Namely, the mobile terminal can transmit the error of the pixel point to a target pixel point which is adjacent to the pixel point and is not traversed so as to update the initial gray scale value of the target pixel point. The colors of the color blocking blocks corresponding to at least two target pixel points in the plurality of target pixel points are the same as the colors of the color blocking blocks corresponding to the pixel points.
And 103, displaying the gray-scale image of the second gray-scale level.
After each pixel point in the gray-scale image of the first gray-scale level is obtained by the mobile terminal, the gray-scale image of the second gray-scale level can be displayed after the target gray-scale value of the second gray-scale level is obtained. In the second gray-scale level gray-scale image, the gray-scale value of each pixel point may be the target gray-scale value determined by the mobile terminal through the execution of theabove steps 101 and 102.
In the embodiment of the present application, the color film layer may include a plurality of color blocking blocks with different colors, and the plurality of color blocking blocks may correspond to a plurality of pixel points in the grayscale image one to one. In the process of displaying the gray-scale image with the second gray-scale level, for each pixel point in the gray-scale image with the second gray-scale level, the mobile terminal can display the color of the color block corresponding to the pixel point. Therefore, the effect of displaying the color image on the color ink screen can be realized, and the image display effect of the mobile terminal is improved.
To sum up, the embodiment of the present application provides an image display method for a mobile terminal, where the mobile terminal may transmit an error of a pixel to a plurality of target pixels in its neighborhood, and colors of color blocks corresponding to at least two target pixels in the plurality of target pixels are the same as colors of color blocks corresponding to the pixels. That is, the mobile terminal can transmit the error of the pixel point to the target pixel point of the color block corresponding to the same color, so as to achieve the effect of updating the initial gray scale value of the adjacent target pixel point, so that the target gray scale value of the traversed adjacent pixel point under the second gray scale level has a larger difference, thereby avoiding the existence of a single color area with a larger area after the gray scale image of the second gray scale level is displayed on the color ink screen, and further improving the display effect of the gray scale image of the second gray scale level.
In the embodiment of the present application, for different second gray scale levels, the mobile terminal determines the target gray scale value of the pixel point in the gray scale image of the first gray scale level and the error manner of the pixel point are different. For example, in a scene with a second gray scale level of 16 or 4, for each pixel point in the traversed gray scale image with the first gray scale level, the mobile terminal may divide the initial gray scale value of the pixel point by the second gray scale level and round down, then may use a product of a numerical value obtained after rounding down and the second gray scale level as a target gray scale value of the pixel point, and use a difference value between the target gray scale value and the initial gray scale value of the pixel point as an error of the pixel point. In a scene where the second gray scale level is 2, for each pixel point in the traversed gray scale image of the first gray scale level, the mobile terminal may determine a target gray scale value of the pixel point and an error of the pixel point based on a gray scale value threshold.
In the embodiment of the present application, the second gray scale level is 2, and an image display method of the mobile terminal provided in the embodiment of the present application is exemplarily described. The method may be applied to a mobile terminal that may include a color ink screen that may include a color film layer that may include a plurality of differently colored resist blocks. Referring to fig. 2, the method may include:
step 201, traversing pixel points in the gray-scale image of the first gray-scale level, and detecting whether the initial gray-scale value of each pixel point is smaller than a gray-scale value threshold for each traversed pixel point.
The mobile terminal can acquire a gray scale image of a first gray scale level to be displayed and can traverse pixel points in the gray scale image of the first gray scale level. For each pixel point in the traversed gray-scale image, the mobile terminal can detect whether the initial gray-scale value of the pixel point is smaller than a gray-scale value threshold value. If the mobile terminal determines that the initial gray-scale value of the pixel point is smaller than the gray-scale threshold, step 202 may be executed. If the mobile terminal determines that the initial gray-scale value of the pixel point is greater than or equal to the gray-scale value threshold, step 204 may be executed.
The initial gray level is a brightness value of the pixel point, and may also be referred to as a gray level value. The gray scale value threshold may be half of the first gray scale level. For example, if the first gray scale level is 256, the gray scale value threshold may be 128. The gray scale level of the gray scale image may refer to the number of brightness levels that each pixel point in the gray scale image can display. Therefore, the higher the gray scale level of the gray scale image is, the more the brightness level of the gray scale image can be displayed, and the better the display effect of the gray scale image is. For example, if the gray scale level of a certain gray scale image is 256, each pixel point in the gray scale image can display 256 different brightness levels, i.e. the gray scale value of each pixel point can range from 0 to 255. If the gray scale level of a certain gray scale image is 2, each pixel point in the gray scale image can display 2 different brightness levels, that is, the gray scale value of each pixel point can be 0 or 255.
Step 202, determining the target gray level value of the pixel point under the second gray level number as the first target value.
If the mobile terminal determines that the initial gray-scale value of the currently traversed pixel point is smaller than the gray-scale value threshold, the mobile terminal may determine that the target gray-scale value of the pixel point under the second gray-scale level is the first target value. The first target value may be pre-stored in the mobile terminal, for example, the first target value may be 0.
Step 203, determining the error of the pixel point as the difference between the initial gray scale value of the pixel point and the first target value.
After determining that the target gray-scale value of the currently traversed pixel is the first target value, the mobile terminal may determine that the error of the pixel is a difference between the initial gray-scale value of the pixel and the first target value. That is, the error e of the pixel point satisfies: e-X-V. Wherein, X is the initial gray scale value of the pixel point, and V is the target gray scale value of the pixel point.
For example, assume that the first gray scale level is 256, the initial gray scale value of a pixel in the gray scale image at the first gray scale level is 96, the first target value is 0, and the gray scale threshold value is 128. Since 96 is less than 128, the mobile terminal may determine that the target gray-scale value of the pixel point at the second gray-scale level is 0, and then the mobile terminal determines that the error e of the pixel point is 96.
And 204, determining the target gray-scale value of the pixel point under the second gray-scale level number as a second target numerical value.
If the mobile terminal determines that the initial gray-scale value of the currently traversed pixel point is greater than or equal to the gray-scale value threshold, the mobile terminal may determine that the target gray-scale value of the pixel point at the second gray-scale level is the second target value. The second target value may be pre-stored in the mobile terminal, and the second target value is greater than the first target value, for example, the second target value may be 255.
Step 205, determining the error of the pixel point as the difference between the initial gray scale value of the pixel point and the second target value.
After determining that the target gray-scale value of the currently traversed pixel is the second target value, the mobile terminal may determine that the error of the pixel is the difference between the initial gray-scale value of the pixel and the second target value.
For example, assume that the first gray scale level is 256, the initial gray scale value of a pixel in the gray scale image at the first gray scale level is 207, the second target value is 255, and the threshold gray scale value is 128. Since 207 is greater than 255, the mobile terminal may determine that the target gray-scale value of the pixel point at the second gray-scale level is 255, and then the mobile terminal determines that the error of the pixel point is e-48.
And step 206, updating the initial gray-scale values of the target pixel points which are located in the neighborhood of the pixel points and are not traversed based on the errors of the pixel points.
After determining the error of the currently traversed pixel, the mobile terminal may update the initial gray-scale values of a plurality of target pixels that are located in the neighborhood of the pixel and are not traversed, based on the error of the pixel. Namely, the mobile terminal can transmit the error of the pixel point to a target pixel point which is adjacent to the pixel point and is not traversed so as to update the initial gray scale value of the target pixel point. The colors of the color blocking blocks corresponding to at least two target pixel points in the plurality of target pixel points are the same as the colors of the color blocking blocks corresponding to the pixel points.
Optionally, the gray-scale image of the first gray-scale level may include a plurality of pixel points arranged in an array, and one pixel point in the gray-scale image may correspond to one color block of a plurality of color blocks of different colors included in the mobile terminal. Accordingly, the color-resisting blocks with different colors can be arranged in an array.
In the embodiment of the present application, the color resist blocks with different colors and arranged in an array may include color resist blocks with at least two colors, for example, the color resist blocks with three different colors and arranged in an array may be included. In addition, in the color resist blocks arranged in the array, the color resist blocks in the same column may be different in any two adjacent color resist blocks. Among the color resist blocks arranged in the array, a plurality of color resist blocks positioned in the same row can be divided into a plurality of color resist block groups, each color resist block group can comprise three color resist blocks with different colors, and the colors of any two adjacent color resist block groups are different. That is, of the color resist blocks located in the same row, the color resist blocks every two color resist blocks are different in color
For example, referring to fig. 3, fig. 3 shows 81 color resist blocks arranged in an array. The 81 color-block blocks include a red (R) color-block, a green (G) color-block, and a blue (B) color-block. With continued reference to fig. 3, the colors of the 9 color-blocking blocks in the same column in the 81 color-blocking blocks are R, G, B, R, G, B, R, G and B in sequence, that is, the colors of the color-blocking blocks adjacent to the red color-blocking block are green and blue, respectively, the colors of the color-blocking blocks adjacent to the green color-blocking block are red and blue, respectively, and the colors of the color-blocking blocks adjacent to the blue color-blocking block are green and red, respectively.
Among the 81 color resist blocks, 9 color resist blocks located in the same row are divided into 3 color resistblock groups 01, and each color resistblock group 01 may include three color resist blocks of the same color. As can be seen from fig. 3, the color of the color resist block included in the first color resistblock group 01 of the 3 color resist block groups located in the same row is red, the color of the color resist block included in the second color resistblock group 01 is green, and the color of the color resist block included in the third color resistblock group 01 is blue.
In the embodiment of the application, since the grayscale image includes a plurality of pixel points arranged in an array, the mobile terminal may traverse the grayscale image row by row or may traverse the grayscale image column by column. If the mobile terminal traverses the pixel points in the gray-scale image of the first gray-scale level row by row, in the process of traversing the pixel points in the gray-scale image row by row, for each row of pixel points in the gray-scale image, the mobile terminal may traverse the pixel points row by row, for example, may traverse row by row in a left-to-right order, or may traverse row by row in a right-to-left order. In this traversal mode, the mobile terminal may update the initial gray scale value of the target pixel point that is located in the neighborhood of the pixel point and is not traversed based on the error of the pixel point, and the following two optional implementation modes are taken as examples in the embodiment of the present application to exemplarily explain the process of updating the initial gray scale value of the target pixel point that is located in the neighborhood of the pixel point and is not traversed by the mobile terminal.
In a first optional implementation manner, the plurality of target pixel points determined by the mobile terminal to be located in the neighborhood of the pixel point in the ith row and the jth column of the grayscale image and not traversed may include: the pixel structure comprises a first target pixel point positioned on the ith row, the jth +1 column of the gray-scale image, a second target pixel point positioned on the jth column, a third target pixel point positioned on the (i + 1) th row and the jth +1 column of the gray-scale image, a fourth target pixel point positioned on the ith +2 row and the jth +1 column of the gray-scale image, a fifth target pixel point positioned on the ith +3 row and the jth column of the gray-scale image, and a seventh target pixel point positioned on the (i + 3) th row and the jth +1 column of the gray-scale image. That is, the target pixel points of the pixel points determined by the mobile terminal can be located in the same column and the next column of the pixel points. Wherein i and j are both positive integers.
Then, the mobile terminal can update the initial gray-scale value of the first target pixel point to be the sum of the initial gray-scale value of the first target pixel point and the first numerical value, the initial gray-scale value of the second target pixel point may be updated to be the sum of the initial gray-scale value of the second target pixel point and the second value, the initial gray-scale value of the third target pixel point may be updated to be the sum of the initial gray-scale value of the third target pixel point and the third value, the initial gray-scale value of the fourth target pixel point may be updated to be the sum of the initial gray-scale value of the fourth target pixel point and the second value, the initial gray-scale value of the fifth target pixel point may be updated to be the sum of the initial gray-scale value of the fifth target pixel point and the fourth value, the initial gray-scale value of the sixth target pixel point may be updated to be the sum of the initial gray-scale value of the sixth target pixel point and the second value, and the initial gray scale value of the seventh target pixel point can be updated to be the sum of the initial gray scale value of the seventh target pixel point and the fourth numerical value.
Wherein, the first value can be the product of the error of the pixel in the ith row and the jth column and the first coefficient. The second value may be a product of an error of a pixel in the ith row and the jth column and the second coefficient. The third value may be a product of an error of the pixel in the ith row and the jth column and a third coefficient. The fourth value may be a product of an error of the pixel in the ith row and the jth column and a fourth coefficient. The first coefficient, the second coefficient, the third coefficient and the fourth coefficient may all be pre-stored in the mobile terminal, and a sum of the first coefficient, the second coefficient, the third coefficient and the fourth coefficient may be 1. And, the first coefficient may be greater than the second coefficient, and the second coefficient may be greater than the fourth coefficient. The third coefficient may be equal to the fourth coefficient; alternatively, the third coefficient may be greater than the first coefficient. For example, the first coefficient may be 3/8 or 3/16, the second coefficient may be 1/8, the third coefficient may be 1/12 or 13/48, and the fourth coefficient may be 1/12. The 1/12 represents one-tenth.
That is, the initial gray-scale value X of the first target pixel point1 Can satisfy the following conditions: x1 =X1 + e × a. Initial gray scale value X of second target pixel point2 Can satisfy the following conditions: x2 =X2 + e × b. Initial gray scale value X of third target pixel point3 Can satisfy the following conditions: x3 =X3 + e × c. Initial gray scale value X of fourth target pixel point4 Can satisfy the following conditions: x4 =X4 + e × b. Initial gray scale value X of fifth target pixel point5 Can satisfy the following conditions: x5 =X5 + e × d. The initial gray scale value X of the sixth target pixel point6 Can satisfy the following conditions: x6 =X6 + e × b. The initial gray scale value of the seventh target pixel point can satisfy: x7 =X7 +e×d。
Wherein, X1 Is the initial gray scale value, X, of the first target pixel point2 Is the initial gray scale value, X, of the second target pixel point3 Is the initial gray scale value, X, of the third target pixel point4 Is a third target pixel pointThe initial gray scale value of (a). X5 Is the initial gray scale value, X, of the fifth target pixel point6 Is the initial gray scale value, X, of the sixth target pixel point7 Is the initial gray scale value of the seventh target pixel point. a is the first coefficient, b is the second coefficient, c is the third coefficient, and d is the fourth coefficient.
In this embodiment of the application, the mobile terminal may determine values of the first coefficient and the third coefficient based on the color of the color blocking block corresponding to the pixel point in the ith row and the jth column that are traversed, and the color of the color blocking block corresponding to the first target pixel point. If the mobile terminal determines that the color of the color block corresponding to the pixel point in the ith row and the jth column is the same as the color of the color block corresponding to the first target pixel point, it may be determined that the third coefficient is equal to the fourth coefficient. In this case, the first coefficient may be larger than the second coefficient, and the second coefficient may be larger than the third coefficient and the fourth coefficient. For example, the first coefficient may be 3/8, the second coefficient may be 1/8, and the third coefficient and the fourth coefficient may both be 1/12.
If the mobile terminal determines that the color of the color block corresponding to the pixel point in the ith row and the jth column is different from the color of the color block corresponding to the first target pixel point, it may be determined that the third coefficient is greater than the first coefficient. In this case, the third coefficient may be greater than the first coefficient, the first coefficient may be greater than the second coefficient, and the second coefficient may be greater than the fourth coefficient. For example, the first coefficient may be 3/16, the second coefficient may be 1/8, the third coefficient may be 5/16, and the fourth coefficient may be 1/12.
Optionally, the mobile terminal may store in advance a corresponding relationship between the color and the position of a plurality of color blocks of different colors included in the color ink screen. For the pixel point traversing to the ith row and the jth column, the mobile terminal may first determine the position of the color block corresponding to the pixel point, and determine the position of the color block corresponding to the first target pixel point based on the position. Then, the mobile terminal may determine the color of the color block corresponding to the pixel point and the color of the color block corresponding to the first target pixel point based on the position of the color block corresponding to the pixel point, the position of the color block corresponding to the first target pixel point, and the correspondence between the color and the position. Then, the mobile terminal can detect whether the color of the color resistance block corresponding to the pixel point of the ith row and the jth column is the same as the color of the first target pixel point.
For example, referring to fig. 4, fig. 4 is a schematic diagram of a color block corresponding to a target pixel point according to an embodiment of the present application. Assume that the pixel point currently traversed by the mobile terminal is the pixel point in the 1 st row and the pixel point in the 2 nd column (i.e., i equals 1, and j equals 2). That is, the pixel points corresponding to the red color block in the 1 st row and the 2 nd column in the color block shown in fig. 4. Then, the mobile terminal may determine that the first target pixel point is a pixel point located in the 1 st row in the color resistance block shown in fig. 4, the pixel point corresponding to the red color resistance block in the 3 rd row, the second target pixel point is a pixel point located in the 2 nd row in fig. 4, the pixel point corresponding to the green color resistance block in the 2 nd row, the third target pixel point is a pixel point corresponding to the green color resistance block in the 2 nd row and the 3 rd row in fig. 4, the fourth target pixel point is a pixel point located in the 3 rd row in fig. 4, the pixel point corresponding to the blue color resistance block in the 2 nd row, the fifth target pixel point is a pixel point corresponding to the blue color resistance block in the 3 rd row and the 3 rd row in fig. 4, the sixth target pixel point is a pixel point located in the 4 th row in fig. 4, the pixel point corresponding to the red color resistance block in the 2 nd row, the seventh target pixel point is a pixel point located in the 4 th row in fig. 4, and the red color resistance block in the 3 rd row. Also, since the color of the color block of row 1, column 2 in fig. 4 is the same as the color block of row 1, column 3, the mobile terminal may determine that the first coefficient is 3/8, the second coefficient is 1/8, and the third coefficient and the fourth coefficient are both 1/12.
Suppose that the initial gray scale value of the pixel point of the currently traversed 1 st row and 2 nd column is 96, the initial gray scale value of the first target pixel point is 120, the initial gray scale value of the second target pixel point is 100, the initial gray scale value of the third target pixel point is 110, the initial gray scale value of the fourth target pixel point is 130, the initial gray scale value of the fifth target pixel point is 100, the initial gray scale value of the sixth target pixel point is 105, and the initial gray scale value of the seventh target pixel point is 110. The mobile terminal may determine that the target gray scale value of the pixel point is 0 and the error of the pixel point is 96.
The mobile terminal may update the initial gray-scale value of the first target pixel to 120+36 to 156, where 36 is the product of (3/8) and 96, update the initial gray-scale value 100 of the second target pixel to 100+12 to 112, where 12 is the product of (1/8) and 96, update the initial gray-scale value 110 of the third target pixel to 110+8 to 118, where 8 is the product of (1/12) and 96, update the initial gray-scale value 130 of the fourth target pixel to 130+12 to 142, update the initial gray-scale value 100 of the fifth target pixel to 100+8 to 108, update the initial gray-scale value 105 of the sixth target pixel to 105+12 to 117, and update the initial gray-scale value of the seventh target pixel to 110+8 to 118.
Referring to fig. 5, fig. 5 is a schematic diagram of another color block corresponding to a target pixel point according to an embodiment of the present application. Assume that the current pixel traversed by the mobile terminal is the 1 st row and the 3 rd column (i.e. i equals 1 and j equals 3). That is, the pixel points corresponding to the red color block in the 1 st row and the 3 rd column in the color block shown in fig. 4. Then, the mobile terminal may determine that the first target pixel point is a pixel point corresponding to the green color block in the 1 st row and the 4 th column in the color block shown in fig. 5, the second target pixel point is a pixel point corresponding to the green color block in the 2 nd row and the 3 rd column in fig. 4, the third target pixel point is a pixel point corresponding to the blue color block in the 2 nd row and the 4 th column in fig. 4, the fourth target pixel point is a pixel point corresponding to the blue color block in the 3 rd row and the 3 rd column in fig. 4, the fifth target pixel point is a pixel point corresponding to the red color block in the 3 rd row and the 4 th column in fig. 4, the sixth target pixel point is a pixel point corresponding to the red color block in the 4 th row and the 3 rd column in fig. 4, and the seventh target pixel point is a pixel point corresponding to the green color block in the 4 th row and the 4 th column in fig. 4. Also, since the color of the color block of row 1, column 3 in fig. 4 is different from the color of the color block of row 1, column 4, the mobile terminal may determine that the first coefficient is 3/16, the second coefficient is 1/8, the third coefficient is 13/48, and the fourth coefficient is 1/12.
Suppose that the initial gray scale value of the pixel point of the currently traversed 1 st row and 3 rd column is 96, the initial gray scale value of the first target pixel point is 120, the initial gray scale value of the second target pixel point is 100, the initial gray scale value of the third target pixel point is 110, the initial gray scale value of the fourth target pixel point is 130, the initial gray scale value of the fifth target pixel point is 100, the initial gray scale value of the sixth target pixel point is 105, and the initial gray scale value of the seventh target pixel point is 110. The mobile terminal may determine that the target gray scale value of the pixel point is 0 and the error of the pixel point is 96.
The mobile terminal may update the initial gray-scale value of the first target pixel to 120+18 to 138, where 18 is the product of (3/16) and 96, update the initial gray-scale value 100 of the second target pixel to 100+12 to 112, where 12 is the product of (1/8) and 96, update the initial gray-scale value 110 of the third target pixel to 110+26 to 118, where 26 is the product of (13/48) and 96, update the initial gray-scale value 130 of the fourth target pixel to 130+18 to 148, update the initial gray-scale value 100 of the fifth target pixel to 100+8 to 108, where 8 is the product of (1/12) and 96, update the initial gray-scale value 105 of the sixth target pixel to 105+12 to 117, and update the initial gray-scale value of the seventh target pixel to 110+8 to 118.
In a second optional implementation manner, the target pixel points that are determined by the mobile terminal and located in the neighborhood of the pixel point in the ith row and the jth column of the grayscale image and are not traversed may include: the pixel structure comprises first target pixel points positioned on an ith row and a jth +1 column of a gray-scale image, second target pixel points positioned on an i +1 row and a jth-1 column of the gray-scale image, third target pixel points positioned on an i +1 row and a jth column of the gray-scale image, fourth target pixel points positioned on an i +1 row and a jth +1 column of the gray-scale image, fifth target pixel points positioned on an i +2 row and a jth-1 column of the gray-scale image, sixth target pixel points positioned on an i +2 row and a jth +1 column of the gray-scale image, seventh target pixel points positioned on an i +3 row and an eighth target pixel point positioned on a j-1 column of the gray-scale image, ninth target pixel points positioned on an i +3 row and a jth column of the gray-scale image, tenth target pixel points positioned on an i +3 row and a j +1 column of the gray-scale image.
Then, the mobile terminal may update the initial gray scale value of the first target pixel point to the sum of the initial gray scale value of the first target pixel point and a fifth numerical value, may update the initial gray scale value of the second target pixel point to the sum of the initial gray scale value of the second target pixel point and a sixth numerical value, may update the initial gray scale value of the third target pixel point to the sum of the initial gray scale value of the third target pixel point and a seventh numerical value, may update the initial gray scale value of the fourth target pixel point to the sum of the initial gray scale value of the fourth target pixel point and an eighth numerical value, may update the initial gray scale value of the fifth target pixel point to the sum of the initial gray scale value of the fifth target pixel point and a sixth numerical value, may update the initial gray scale value of the sixth target pixel point to the sum of the initial gray scale value of the sixth target pixel point and a seventh numerical value, may update the initial gray scale value of the seventh target pixel point to the sum of the initial gray scale value of the seventh target pixel point and a ninth numerical value, the initial gray scale value of the eighth target pixel point may be updated to the sum of the initial gray scale value of the eighth target pixel point and the sixth numerical value, the initial gray scale value of the ninth target pixel point may be updated to the sum of the initial gray scale value of the ninth target pixel point and the seventh numerical value, and the initial gray scale value of the tenth target pixel point may be updated to the sum of the initial gray scale value of the tenth target pixel point and the ninth numerical value.
The fifth value may be a product of an error of a pixel located in the ith column and the jth row and a fifth coefficient, the sixth value may be a product of an error of a pixel located in the ith column and the jth row and a sixth coefficient, the seventh value may be a product of an error of a pixel located in the ith column and the jth row and a seventh coefficient of the gray-scale image, the eighth value may be a product of an error of a pixel located in the ith column and the jth row and an eighth coefficient, and the ninth value may be a product of an error of a pixel located in the ith column and the jth row and a ninth coefficient. The sixth coefficient may be smaller than the seventh coefficient, and the seventh coefficient may be smaller than the fifth coefficient. The eighth coefficient may be equal to the ninth coefficient and the eighth coefficient is less than the sixth coefficient; alternatively, the fifth coefficient may be smaller than the eighth coefficient, and the ninth coefficient may be smaller than the sixth coefficient. For example, the fifth coefficient may be 7/16 or 7/32, the sixth coefficient may be 3/48, the seventh coefficient may be 5/16, the eighth coefficient may be 1/48 or 11/48, and the ninth coefficient may be 1/48.
That is, the initial gray-scale value X of the first target pixel point1 Can satisfy:X1 =X1 + e × m. Initial gray scale value X of second target pixel point2 Can satisfy the following conditions: x2 =X2 + e × n. Initial gray scale value X of third target pixel point3 Can satisfy the following conditions: x3 =X3 + e × o. Initial gray scale value X of fourth target pixel point4 Can satisfy the following conditions: x4 =X4 + e × p. Initial gray scale value X of fifth target pixel point5 Can satisfy the following conditions: x5 =X5 + e × n. The initial gray scale value X of the sixth target pixel point6 Can satisfy the following conditions: x6 =X6 + e × o. The initial gray scale value of the seventh target pixel point can satisfy: x7 =X7 + e × q. The initial gray level X of the eighth target pixel point8 Can satisfy the following conditions: x8 =X8 + e × n. The initial gray level X of the ninth target pixel point9 Can satisfy the following conditions: x9 =X9 + e × o. The initial gray scale value of the tenth target pixel point can satisfy: x10 =X10 +e×q。
Wherein, X8 Is the initial gray scale value, X, of the eighth target pixel point9 Is the initial gray scale value, X, of the ninth target pixel point10 Is the initial gray scale value of the tenth target pixel point. m is the fifth coefficient, n is the sixth coefficient, o is the seventh coefficient, p is the eighth coefficient, q is the ninth coefficient.
In this embodiment of the application, the mobile terminal may determine values of the fifth coefficient and the seventh coefficient based on the color of the color blocking block corresponding to the pixel point traversing to the ith row and the jth column and the color of the color blocking block corresponding to the first target pixel point. If the mobile terminal determines that the color of the color block corresponding to the pixel point of the ith row and the jth column is the same as the color of the color block corresponding to the first target pixel point, it may be determined that the eighth coefficient is equal to the ninth coefficient, and the eighth coefficient is smaller than the sixth coefficient. In this case, the fifth coefficient may be larger than the seventh coefficient, the seventh coefficient may be larger than the sixth coefficient, and the sixth coefficient may be larger than the eighth coefficient and the ninth coefficient. For example, the fifth coefficient may be 7/16, the sixth coefficient may be 3/48, the seventh coefficient may be 5/16, and both the eighth coefficient and the ninth coefficient may be 1/48.
If the mobile terminal determines that the color of the color block corresponding to the pixel point of the ith row and the jth column is different from the color of the color block corresponding to the first target pixel point, it may be determined that the fifth coefficient is smaller than the eighth coefficient, and the ninth coefficient is smaller than the sixth coefficient. In this case, the eighth coefficient may be larger than the fifth coefficient, the fifth coefficient may be larger than the seventh coefficient, the seventh coefficient may be larger than the sixth coefficient, and the sixth coefficient may be larger than the ninth coefficient. For example, the fifth coefficient may be 7/32, the sixth coefficient may be 3/48, the seventh coefficient may be 5/48, the eighth coefficient may be 11/48, and the ninth coefficient may be 1/48.
For example, referring to fig. 6, fig. 6 is a schematic diagram of a color block corresponding to another target pixel point provided in the embodiment of the present application. Assume that the current pixel traversed by the mobile terminal is the pixel in row 1 and the pixel in column 2 (i.e., i equals 1 and j equals 2). That is, the pixel points corresponding to the red color block in the 1 st row and the 2 nd column in the color block shown in fig. 6. Then, the mobile terminal can determine that the first target pixel point is a pixel point corresponding to the red color block located in the 1 st row and the 3 rd column in the color block shown in fig. 6, the second target pixel point is a pixel point corresponding to the green color block located in the 2 nd row and the 1 st column in fig. 6, the third target pixel point is a pixel point corresponding to the green color block located in the 2 nd row and the 2 nd column in fig. 6, the fourth target pixel point is a pixel point corresponding to the green color block located in the 2 nd row and the 3 rd column in fig. 6, the fifth target pixel point is a pixel point corresponding to the blue color block located in the 3 rd row and the 1 st column in fig. 6, the sixth target pixel point is a pixel point corresponding to the blue color block located in the 3 rd row and the 2 nd column in fig. 6, the seventh target pixel point is a pixel point corresponding to the blue color block located in the 3 rd row and the 3 rd column in fig. 6, and the eighth target pixel point is a pixel point corresponding to the red color block located in the 4 th row and the 1 st column in fig. 6, the ninth target pixel point is a pixel point corresponding to the red color block located in the 4 th row and the 2 nd column in fig. 6, and the tenth target pixel point is a pixel point corresponding to the red color block located in the 4 th row and the 3 rd column in fig. 6. Also, since the color of the color block of row 1, column 2 in fig. 6 is the same as the color block of row 1, column 3, the mobile terminal may determine that the fifth coefficient is 7/16, the sixth coefficient is 3/48, the seventh coefficient is 5/48, and the eighth coefficient and the ninth coefficient are both 1/48.
Assume that the initial gray scale value of the currently traversed pixel point in the 1 st row and the 2 nd column is 96, the initial gray scale value of the first target pixel point is 120, the initial gray scale value of the second target pixel point is 108, the initial gray scale value of the third target pixel point is 100, the initial gray scale value of the fourth target pixel point is 110, the initial gray scale value of the fifth target pixel point is 80, the initial gray scale value of the sixth target pixel point is 130, the initial gray scale value of the seventh target pixel point is 100, the initial gray scale value of the eighth target pixel point is 90, the initial gray scale value of the ninth target pixel point is 105, and the initial gray scale value of the tenth target pixel point is 110. The mobile terminal may determine that the target gray scale value of the pixel point is 0 and the error of the pixel point is 96.
Then, the mobile terminal may update the initial gray scale value of the first target pixel point to 120+42 ═ 162, where 42 is the product of (7/16) and 96, update the initial gray scale value 108 of the second target pixel point to 108+6 ═ 108, where 6 is the product of (3/48) and 96, update the initial gray scale value 100 of the third target pixel point to 100+10 ═ 110, where 10 is the product of (5/48) and 96, update the initial gray scale value 110 of the fourth target pixel point to 110+2 ═ 112, where 2 is the product of (1/48) and 96, update the initial gray scale value 80 of the fifth target pixel point to 80+6 ═ 86, update the initial gray scale value 130 of the sixth target pixel point to 130+10 ═ 140, update the initial gray scale value of the seventh target pixel point to 100+2 ═ 102, update the initial gray scale value of the eighth target pixel point to 90+6 ═ 96, the initial gray scale value of the ninth target pixel point is updated to 105+10 to 115, and the initial gray scale value of the tenth target pixel point is updated to 110+2 to 112.
Referring to fig. 7, fig. 7 is a schematic diagram of a color block corresponding to another target pixel point according to an embodiment of the present application. Assume that the current pixel traversed by the mobile terminal is the 1 st row and the 3 rd column (i.e. i equals 1 and j equals 3). That is, the pixel points corresponding to the red color block in the 1 st row and the 3 rd column in the color block shown in fig. 7. Then, the mobile terminal can determine that the first target pixel point is a pixel point corresponding to the green color block located in the 1 st row and the 4 th column in the color block shown in fig. 7, the second target pixel point is a pixel point corresponding to the green color block located in the 2 nd row and the 2 nd column in fig. 7, the third target pixel point is a pixel point corresponding to the green color block located in the 2 nd row and the 3 rd column in fig. 7, the fourth target pixel point is a pixel point corresponding to the blue color block located in the 2 nd row and the 4 th column in fig. 7, the fifth target pixel point is a pixel point corresponding to the blue color block located in the 3 rd row and the 2 nd column in fig. 7, the sixth target pixel point is a pixel point corresponding to the blue color block located in the 3 rd row and the 3 rd column in fig. 7, the seventh target pixel point is a pixel point corresponding to the red color block located in the 3 rd row and the 4 th column in fig. 7, and the eighth target pixel point is a pixel point corresponding to the red color block located in the 4 th row and the 2 nd column in fig. 7, the ninth target pixel point is a pixel point located on the 4 th row and corresponding to the red color block on the 3 rd column in fig. 7, and the tenth target pixel point is a pixel point located on the 4 th row and corresponding to the green color block on the 4 th column in fig. 7. Also, since the color of the color block of row 1, column 3 in fig. 7 is the same as the color of the color block of row 1, column 4, the mobile terminal may determine that the fifth coefficient is 7/32, the sixth coefficient is 3/48, the seventh coefficient is 5/48, the eighth coefficient is 11/48, and the ninth coefficient is 1/48.
Assume that the initial gray scale value of the currently traversed pixel point in the 1 st row and the 2 nd column is 96, the initial gray scale value of the first target pixel point is 120, the initial gray scale value of the second target pixel point is 108, the initial gray scale value of the third target pixel point is 100, the initial gray scale value of the fourth target pixel point is 110, the initial gray scale value of the fifth target pixel point is 80, the initial gray scale value of the sixth target pixel point is 130, the initial gray scale value of the seventh target pixel point is 100, the initial gray scale value of the eighth target pixel point is 90, the initial gray scale value of the ninth target pixel point is 105, and the initial gray scale value of the tenth target pixel point is 110. The mobile terminal may determine that the target gray scale value of the pixel point is 0 and the error of the pixel point is 96.
Then, the mobile terminal may update the initial gray scale value of the first target pixel point to 120+21 ═ 162, where 21 is the product of (7/32) and 96, update the initial gray scale value 108 of the second target pixel point to 108+6 ═ 108, where 6 is the product of (3/48) and 96, update the initial gray scale value 100 of the third target pixel point to 100+10 ═ 110, where 10 is the product of (5/48) and 96, update the initial gray scale value 110 of the fourth target pixel point to 110+22 ═ 132, where 22 is the product of (11/48) and 96, update the initial gray scale value 80 of the fifth target pixel point to 80+6 ═ 86, update the initial gray scale value 130 of the sixth target pixel point to 130+10 ═ 140, update the initial gray scale value of the seventh target pixel point to 100+2 ═ 102, where 2 is the product of (1/48) and 96, update the initial gray scale value of the eighth target pixel point to 90 ═ 96, and updating the initial gray-scale value of the ninth target pixel point to 105+ 10-115, and updating the initial gray-scale value of the tenth target pixel point to 110+ 2-112.
And step 207, displaying the gray-scale image of the second gray-scale level.
After the mobile terminal completes traversal of the gray-scale image with the first gray-scale level, namely after the mobile terminal determines the target gray-scale value of each pixel point in the gray-scale image, the gray-scale image with the second gray-scale level can be displayed.
In the embodiment of the present application, the color film layer may include a plurality of color blocking blocks with different colors, and the plurality of color blocking blocks may correspond to a plurality of pixel points in the grayscale image one to one. In the process of displaying the gray-scale image with the second gray-scale level, for each pixel point in the gray-scale image with the second gray-scale level, the mobile terminal can display the color of the color block corresponding to the pixel point. Therefore, the effect of displaying the color image on the color ink screen can be realized, and the image display effect of the mobile terminal is improved.
Fig. 8 is a schematic diagram of a 2-grayscale image (i.e., a grayscale image with 2 grayscale levels) displayed by a mobile terminal in the related art, and fig. 9 is an image obtained by processing a 256-grayscale image (i.e., a grayscale image with 256 grayscale levels) corresponding to the 2-grayscale image shown in fig. 8 by using the method provided in the embodiment of the present application. As can be seen from fig. 8, in the 2-gray scale image displayed in the related art, there is a region with a single color and a large area, i.e., there is a color spot, which results in loss of image details, incomplete image display information, and poor display effect. As can be seen from comparison between fig. 8 and fig. 9, when the image display method of the mobile terminal provided in the embodiment of the present application is used to process the gray-scale image of the first gray-scale level to be displayed, color spots in the image are significantly reduced, and the image display effect is significantly improved.
It should be further noted that, the order of the steps of the image display method of the mobile terminal provided in the embodiment of the present application may be appropriately adjusted, and the steps may also be increased or decreased according to the situation. Those skilled in the art can easily conceive of various methods within the technical scope of the present disclosure, and therefore, the detailed description is omitted.
To sum up, the embodiment of the present application provides an image display method for a mobile terminal, where the mobile terminal may transmit an error of a pixel to a plurality of target pixels in a neighborhood of the mobile terminal, and colors of color blocks corresponding to at least two target pixels in the plurality of target pixels are the same as colors of color blocks corresponding to the pixel. The mobile terminal can transmit the error of the pixel point to the target pixel point of the color block corresponding to the same color, so that the effect of updating the initial gray scale value of the adjacent target pixel point is achieved, the target gray scale value difference of the traversed adjacent pixel point under the second gray scale level number is larger, the situation that a single color area with a larger area exists after the gray scale image of the second gray scale level is displayed on the color ink screen is avoided, and the display effect of the gray scale image of the second gray scale level number is improved.
Fig. 10 is a schematic structural diagram of a mobile terminal according to an embodiment of the present application. Referring to fig. 10, themobile terminal 110 includes aprocessor 1101 and acolor ink screen 1102, thecolor ink screen 1102 including a plurality of differently colored resist blocks. Theprocessor 1101 may be configured to:
traversing pixel points in the gray-scale image with the first gray-scale level, determining a target gray-scale value of each traversed pixel point under the second gray-scale level and an error of each pixel point based on an initial gray-scale value of the pixel point, wherein the error of each pixel point is related to the initial gray-scale value of the pixel point, the second gray-scale level is less than the first gray-scale level, and one pixel point in the gray-scale image corresponds to one color resistance block in a plurality of color resistance blocks;
updating initial gray scale values of a plurality of target pixel points which are positioned in the neighborhood of the pixel points and are not traversed based on errors of the pixel points, wherein the colors of color resistance blocks corresponding to at least two target pixel points in the plurality of target pixel points are the same as the colors of the color resistance blocks corresponding to the pixel points;
thecolor ink screen 1102 may be configured to display a gray scale image at a second gray scale level.
Optionally, the grayscale image includes a plurality of pixel points arranged in an array, the color resist blocks include color resist blocks of three different colors and arranged in an array, the color resist blocks located in the same column are different from each other in any two adjacent color resist blocks, the color resist blocks located in the same row are divided into a plurality of color resist block groups, each color resist block group includes three color resist blocks of the same color, and the colors of any two adjacent color resist block groups are different from each other. Theprocessor 1101 may be configured to:
traversing pixel points in the gray-scale image of the first gray-scale level row by row;
the plurality of target pixel points which are positioned in the neighborhood of the pixel point of the ith row and the jth column of the gray-scale image and are not traversed comprise:
the first target pixel point is positioned on the ith row and the (j + 1) th column of the gray scale image;
a second target pixel point positioned on the (i + 1) th row and the jth column of the gray-scale image;
a third target pixel point positioned in the (i + 1) th row and the (j + 1) th column of the gray-scale image;
a fourth target pixel point positioned on the (i + 2) th row and the jth column of the gray-scale image;
a fifth target pixel point positioned on the (i + 2) th row and the (j + 1) th column of the gray scale image;
a sixth target pixel point positioned on the (i + 3) th row and the jth column of the gray-scale image;
seven target pixel points positioned on the (i + 3) th row and the (j + 1) th column of the gray-scale image;
wherein i and j are both positive integers.
Optionally, theprocessor 1101 may be configured to:
updating the initial gray scale value of the first target pixel point to be the sum of the initial gray scale value of the first target pixel point and a first numerical value, wherein the first numerical value is the product of the error of the pixel point of the ith row and the jth column and a first coefficient;
updating the initial gray scale value of the second target pixel point to be the sum of the initial gray scale value of the second target pixel point and a second numerical value, wherein the second numerical value is the product of the error of the pixel point of the ith row and the jth column and a second coefficient;
updating the initial gray scale value of the third target pixel point to be the sum of the initial gray scale value of the third target pixel point and a third value, wherein the third value is the product of the error of the pixel point of the ith row and the jth column and a third coefficient;
updating the initial gray-scale value of the fourth target pixel point to be the sum of the initial gray-scale value of the fourth target pixel point and the second numerical value;
updating the initial gray scale value of the fifth target pixel point to be the sum of the initial gray scale value of the fifth target pixel point and a fourth numerical value, wherein the fourth numerical value is the product of the error of the pixel point of the ith row and the jth column and a fourth coefficient;
updating the initial gray-scale value of the sixth target pixel point to be the sum of the initial gray-scale value of the sixth target pixel point and the second numerical value;
updating the initial gray scale value of the seventh target pixel point to be the sum of the initial gray scale value of the seventh target pixel point and the fourth numerical value;
wherein the first coefficient is greater than the second coefficient, and the second coefficient is greater than the fourth coefficient;
the third coefficient is equal to the fourth coefficient;
alternatively, the third coefficient is greater than the first coefficient.
Optionally, if the color of the color block corresponding to the pixel point in the ith row and the jth column is the same as the color of the color block corresponding to the first target pixel point, the third coefficient is equal to the fourth coefficient; and if the color of the color block corresponding to the pixel point of the ith row and the jth column is different from the color of the color block corresponding to the first target pixel point, the third coefficient is greater than the first coefficient.
Optionally, the grayscale image includes a plurality of pixel points arranged in an array, the plurality of color-resisting blocks include color-resisting blocks arranged in an array of three different colors, the plurality of color-resisting blocks are located in the same column, the colors of any two adjacent color-resisting blocks are different, the plurality of color-resisting blocks located in the same row are divided into a plurality of color-resisting blocks, each color-resisting block includes three color-resisting blocks of the same color, and the colors of any two adjacent color-resisting blocks are different. Theprocessor 1101 may be configured to:
traversing pixel points in the gray-scale image of the first gray-scale level row by row;
the plurality of target pixel points which are located in the field of pixel points of the ith row and the jth column of the gray-scale image and are not traversed comprise:
a first target pixel point positioned on the ith row and the (j + 1) th column of the gray-scale image;
a second target pixel point positioned in the (i + 1) th row and the (j-1) th column of the gray-scale image;
a third target pixel point positioned on the (i + 1) th row and the jth column of the gray-scale image;
a fourth target pixel point positioned in the (i + 1) th row and the (j + 1) th column of the gray-scale image;
a fifth target pixel point positioned on the (i + 2) th row and the (j-1) th column of the gray-scale image;
a sixth target pixel point positioned on the (i + 2) th row and the jth column of the gray-scale image;
a seventh target pixel point positioned on the (i + 2) th row and the (j + 1) th column of the gray-scale image;
the eighth target pixel point is positioned on the (i + 3) th row and the (j-1) th column of the gray-scale image;
a ninth target pixel point positioned on the (i + 3) th row and the jth column of the gray-scale image;
a tenth target pixel point positioned on the (i + 3) th row and the (j + 1) th column of the gray scale image;
wherein i and j are both positive integers.
Optionally, theprocessor 1101 may be configured to:
updating the initial gray scale value of the first target pixel point to be the sum of the initial gray scale value of the first target pixel point and a fifth numerical value, wherein the fifth numerical value is the product of the error of the pixel point positioned in the ith row and the jth column and a fifth coefficient;
updating the initial gray scale value of the second target pixel point to be the sum of the initial gray scale value of the second target pixel point and a sixth numerical value, wherein the sixth numerical value is the product of the error of the pixel point of the ith row and the jth column and a sixth coefficient;
updating the initial gray scale value of the third target pixel point to be the sum of the initial gray scale value of the third target pixel point and a seventh numerical value, wherein the seventh numerical value is the product of the error of the pixel point of the ith row and the jth column of the gray scale image and a seventh coefficient;
updating the initial gray scale value of the fourth target pixel point to be the sum of the initial gray scale value of the fourth target pixel point and an eighth value, wherein the eighth value is the product of the error of the pixel point of the ith row and the jth column and an eighth coefficient;
updating the initial gray scale value of the fifth target pixel point to be the sum of the initial gray scale value of the fifth target pixel point and a sixth numerical value;
updating the initial gray scale value of the sixth target pixel point to be the sum of the initial gray scale value of the sixth target pixel point and the seventh numerical value;
updating the initial gray scale value of the seventh target pixel point to be the sum of the initial gray scale value of the seventh target pixel point and a ninth value, wherein the ninth value is the product of the error of the pixel point of the ith row and the jth column and a ninth coefficient;
updating the initial gray scale value of the eighth target pixel point to be the sum of the initial gray scale value of the eighth target pixel point and a sixth numerical value;
updating the initial gray scale value of the ninth target pixel point to be the sum of the initial gray scale value of the ninth target pixel point and the seventh numerical value;
updating the initial gray-scale value of the tenth target pixel point to be the sum of the initial gray-scale value of the tenth target pixel point and the ninth value;
wherein the sixth coefficient is smaller than the seventh coefficient, and the seventh coefficient is smaller than the fifth coefficient;
the eighth coefficient is equal to the ninth coefficient, and the eighth coefficient is smaller than the sixth coefficient;
or the fifth coefficient is smaller than the eighth coefficient, and the ninth coefficient is smaller than the sixth coefficient.
Optionally, if the color of the color block corresponding to the pixel point in the ith row and the jth column is the same as the color of the color block corresponding to the first target pixel point, the eighth coefficient is equal to the ninth coefficient, and the eighth coefficient is smaller than the sixth coefficient; and if the color of the color block corresponding to the pixel point of the ith row and the jth column is different from the color of the color block corresponding to the first target pixel point, the fifth coefficient is smaller than the eighth coefficient, and the ninth coefficient is smaller than the sixth coefficient.
Optionally, the second gray scale level is 2; theprocessor 1101 may be configured to:
for each traversed pixel point, if the initial gray-scale value of the pixel point is smaller than a gray-scale value threshold, determining that the target gray-scale value of the pixel point is a first target value, and determining that the error of the pixel point is the difference value between the initial gray-scale value of the pixel point and the first target value; if the initial gray-scale value of the pixel point is larger than or equal to the gray-scale value threshold, determining that the target gray-scale value of the pixel point is a second target value, and determining that the error of the pixel point is the difference value between the initial gray-scale value of the pixel point and the second target value; wherein the second target value is greater than the first target value.
To sum up, the embodiment of the present application provides a mobile terminal, where the mobile terminal can transmit an error of a pixel to a plurality of target pixels in a neighborhood of the mobile terminal, and colors of color blocks corresponding to at least two target pixels in the plurality of target pixels are the same as colors of color blocks corresponding to the pixel. The mobile terminal can transmit the error of the pixel point to the target pixel point of the color block corresponding to the same color, so that the effect of updating the initial gray scale value of the adjacent target pixel point is achieved, the target gray scale value difference of the traversed adjacent pixel point under the second gray scale level number is larger, the situation that a single color area with a larger area exists after the gray scale image of the second gray scale level is displayed on the color ink screen is avoided, and the display effect of the gray scale image of the second gray scale level number is improved.
As shown in fig. 11, themobile terminal 110 may further include: adisplay unit 130, a Radio Frequency (RF)circuit 150, anaudio circuit 160, a wireless fidelity (Wi-Fi)module 170, a bluetooth module 180, apower supply 190, acamera 121, and aprocessor 1101.
Thecamera 121 may be used to capture still pictures or video, among others. The object generates an optical picture through the lens and projects the optical picture to the photosensitive element. The photosensitive element may be a Charge Coupled Device (CCD) or a complementary metal-oxide-semiconductor (CMOS) phototransistor. The light sensitive elements convert the light signals into electrical signals which are then passed to theprocessor 1101 for conversion into digital picture signals.
Theprocessor 1101 is a control center of themobile terminal 110, connects various parts of the entire terminal using various interfaces and lines, performs various functions of themobile terminal 110 and processes data by running or executing software programs stored in thememory 140 and calling data stored in thememory 140. In some embodiments,processor 1101 may include one or more processing units; theprocessor 1101 may also integrate an application processor, which mainly handles operating systems, user interfaces, application programs, etc., and a baseband processor, which mainly handles wireless communications. It will be appreciated that the baseband processor described above may not be integrated into theprocessor 1101. In the present application, theprocessor 1101 may run an operating system and an application program, may control a user interface to display, and may implement the image display method of the mobile terminal provided in the embodiment of the present application. Additionally,processor 1101 is coupled to input unit anddisplay unit 130.
Thedisplay unit 130 may be used to receive input numeric or character information and generate signal inputs related to user settings and function control of themobile terminal 110, and optionally, thedisplay unit 130 may also be used to display Graphical User Interface (GUI) information input by or provided to the user and various menus of themobile terminal 110. Thedisplay unit 130 may include adisplay screen 131 disposed on the front surface of themobile terminal 110. Thedisplay screen 131 may be configured in the form of a liquid crystal display, a light emitting diode, or the like. Thedisplay unit 130 may be used to display various graphical user interfaces described herein.
Thedisplay unit 130 includes: adisplay screen 131 and atouch screen 132 disposed on the front of themobile terminal 110. Thedisplay screen 131 may be used to display preview pictures.Touch screen 132 may collect touch operations on or near by the user, such as clicking a button, dragging a scroll box, and the like. Thetouch screen 132 may be covered on thedisplay screen 131, or thetouch screen 132 and thedisplay screen 131 may be integrated to implement the input and output functions of themobile terminal 110, and after the integration, the touch screen may be referred to as a touch display screen for short.
Memory 140 may be used to store software programs and data. Theprocessor 1101 executes various functions of themobile terminal 110 and data processing by executing software programs or data stored in thememory 140. Thememory 140 may include high-speed random access memory and may also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other volatile solid state storage device.Memory 140 stores an operating system that enablesmobile terminal 110 to operate. Thememory 140 may store an operating system and various application programs, and may also store codes for executing the image display method of the mobile terminal according to the embodiment of the present application.
TheRF circuit 150 may be configured to receive and transmit signals during information transmission and reception or during a call, and may receive downlink data of a base station and then deliver the downlink data to theprocessor 1101 for processing; the uplink data may be transmitted to the base station. Typically, the RF circuitry includes, but is not limited to, an antenna, at least one amplifier, a transceiver, a coupler, a low noise amplifier, a duplexer, and the like.
Audio circuitry 160,speaker 161, andmicrophone 162 may provide an audio interface between a user andmobile terminal 110. Theaudio circuit 160 may transmit the electrical signal converted from the received audio data to thespeaker 161, and convert the electrical signal into a sound signal for output by thespeaker 161. Themobile terminal 110 may also be configured with a volume button for adjusting the volume of the sound signal. On the other hand, themicrophone 162 converts the collected sound signal into an electrical signal, converts the electrical signal into audio data after being received by theaudio circuit 160, and then outputs the audio data to theRF circuit 150 to be transmitted to, for example, another terminal or outputs the audio data to thememory 140 for further processing. In this application, themicrophone 162 may capture the voice of the user.
Wi-Fi belongs to a short-distance wireless transmission technology, and themobile terminal 110 may help a user to send and receive e-mails, browse webpages, access streaming media, and the like through the Wi-Fi module 170, which provides a wireless broadband internet access for the user.
And the Bluetooth module 180 is used for performing information interaction with other Bluetooth devices with Bluetooth modules through a Bluetooth protocol. For example, themobile terminal 110 may establish a bluetooth connection with a wearable electronic device (e.g., a smart watch) also equipped with a bluetooth module through the bluetooth module 180, so as to perform data interaction.
Mobile terminal 110 also includes a power supply 190 (e.g., a battery) for powering the various components. The power supply may be logically coupled to theprocessor 1101 through a power management system to manage charging, discharging, and power consumption functions through the power management system. Themobile terminal 110 may also be configured with a power button for powering on and off the terminal, and locking the screen.
Themobile terminal 110 may include at least onesensor 1110, such as amotion sensor 11101, adistance sensor 11102, afingerprint sensor 11103, and atemperature sensor 11104.Mobile terminal 110 may also be configured with other sensors such as gyroscopes, barometers, hygrometers, thermometers, and infrared sensors.
It can be clearly understood by those skilled in the art that, for convenience and brevity of description, the specific working processes of the mobile terminal and each device described above may refer to the corresponding processes in the foregoing method embodiments, and are not described herein again.
Fig. 12 is a block diagram of a software structure of a mobile terminal according to an embodiment of the present application. The layered architecture divides the software into several layers, each layer having a clear role and division of labor. The layers communicate with each other through a software interface. In some embodiments, the android system is divided into four layers, an application layer, an application framework layer, an android runtime (android) and system library, and a kernel layer from top to bottom.
The application layer may include a series of application packages. As shown in fig. 12, the application package may include camera, gallery, calendar, phone call, map, navigation, WLAN, bluetooth, music, video, short message, etc. applications. The application framework layer provides an Application Programming Interface (API) and a programming framework for the application programs of the application layer. The application framework layer includes a number of predefined functions.
As shown in FIG. 12, the application framework layers may include a window manager, content provider, view system, phone manager, resource manager, notification manager, and the like.
The window manager is used for managing window programs. The window manager can obtain the size of the display screen, judge whether a status bar exists, lock the screen, intercept the screen and the like.
The content provider is used to store and retrieve data and make it accessible to applications. The data may include video, pictures, audio, calls made and received, browsing history and bookmarks, phone books, etc.
The view system includes visual controls such as controls to display text, controls to display pictures, and the like. The view system may be used to build applications. The display interface may be composed of one or more views. For example, the display interface including the short message notification icon may include a view for displaying text and a view for displaying pictures.
The phone manager is used to provide communication functions of themobile terminal 110. Such as management of call status (including on, off, etc.).
The resource manager provides various resources for the application, such as localized strings, icons, pictures, layout files, video files, and the like.
The notification manager enables the application to display notification information in the status bar, can be used to convey notification-type messages, can disappear automatically after a short dwell, and does not require user interaction. Such as a notification manager used to inform download completion, message alerts, etc. The notification manager may also be a notification that appears in the form of a chart or scroll bar text at the top status bar of the system, such as a notification of a background running application, or a notification that appears on the screen in the form of a dialog window. For example, text information is prompted in the status bar, a prompt tone is given, the communication terminal vibrates, and an indicator light flashes.
The android run is composed of a core library and a virtual machine. android runtime is responsible for the scheduling and management of the android system.
The core library comprises two parts: one part is a function which needs to be called by java language, and the other part is a core library of android.
The application layer and the application framework layer run in a virtual machine. And executing java files of the application program layer and the application program framework layer into a binary file by the virtual machine. The virtual machine is used for performing the functions of object life cycle management, stack management, thread management, safety and exception management, garbage collection and the like.
The system library may include a plurality of functional modules. For example: surface managers (surface managers), media libraries (media libraries), three-dimensional graphics processing libraries (e.g., openGLES), 2D graphics engines (e.g., SGL), and the like.
The surface manager is used to manage the display subsystem and provide a fusion of the 2D and 3D layers for multiple applications.
The media library supports a variety of commonly used audio, video format playback and recording, and still picture files, etc. The media library may support a variety of audio-video encoding formats, such as: MPEG4, H.264, MP3, AAC, AMR, JPG, PNG, etc.
The three-dimensional graphic processing library is used for realizing three-dimensional graphic drawing, picture rendering, synthesis, layer processing and the like.
The 2D graphics engine is a drawing engine for 2D drawing.
The kernel layer is a layer between hardware and software. The inner core layer at least comprises a display driver, a camera driver, an audio driver and a sensor driver.
An embodiment of the present application provides a computer-readable storage medium, in which instructions are stored, and when the instructions are executed on a computer, the instructions cause the computer to execute an image display method of a mobile terminal provided in the above embodiment, for example, the method shown in fig. 1 or fig. 2.
Embodiments of the present application further provide a computer program product including instructions, which, when the computer program product runs on a computer, causes the computer to execute the image display method of the mobile terminal provided in the foregoing method embodiments, for example, the method shown in fig. 1 or fig. 2.
It will be understood by those skilled in the art that all or part of the steps for implementing the above embodiments may be implemented by hardware, or may be implemented by a program instructing relevant hardware, where the program may be stored in a computer-readable storage medium, and the above-mentioned storage medium may be a read-only memory, a magnetic disk or an optical disk, etc.
The above description is only exemplary of the present application and should not be taken as limiting the present application, and any modifications, equivalents, improvements and the like that are made within the spirit and principle of the present application should be included in the protection scope of the present application.