Electronic device and display control method thereof
Through index matrix technology, the pixel value distribution of electronic paper is optimized, which solves the problem that electronic paper cannot display grayscale, and realizes the continuous grayscale image display effect on electronic paper, improving visual experience and aesthetics.
Patent Information
- Application Number
- CN202411523585.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-30
- Publication Date
- 2024-11-26
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
Electronic paper can only display binary images in black and white, and cannot present other grayscales between black and white, lacking a sense of layering.
By introducing an index matrix, the index value is determined based on the position of each pixel point in the input image, and the output image is generated based on the pixel value and index value, and the pixel value distribution is optimized so that adjacent pixel points visually mix colors to present gray except black and white rank value to improve the display hierarchy.
The effect of displaying continuous grayscale images on binary devices such as electronic paper is realized, which improves visual experience and aesthetics, and makes up for the shortcomings of electronic paper in displaying continuous grayscale images.
Smart Images

Figure CN119025694A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of display control, and in particular to an electronic device and a display control method thereof. Background Art
[0002] Current electronic paper can only display binary images in black and white, which means that electronic paper cannot present other gray levels between black and white and lacks a sense of hierarchy. Summary of the invention
[0003] In view of this, the present application provides an electronic device and a display control method thereof, which can display other grayscales between black and white, improve the display layering, and solve the above technical problems.
[0004] In a first aspect, an embodiment of the present application provides a display control method, which is applied to an electronic device. The display control method includes: Obtain an input image; Obtaining an index matrix, wherein the index matrix includes a plurality of index values; Determine the index value corresponding to each pixel in the index matrix according to the position of each pixel in the input image; Determine the pixel value of each corresponding pixel point in the output image according to the pixel value of each pixel point in the input image and the corresponding index value to generate the output image; The display module of the electronic device is controlled to display the output image.
[0005] In a second aspect, an embodiment of the present application provides an electronic device, including a processor and a memory, wherein the memory stores a computer program, and the processor runs the computer program to execute the steps of the display control method described in the first aspect.
[0006] In a third aspect, an embodiment of the present application provides a computer-readable storage medium storing a computer program, wherein the computer program is run by a processor to execute the steps of the display control method described in the first aspect.
[0007] Therefore, in the present application, an index matrix is introduced, which includes multiple index values; then the index value corresponding to each pixel in the index matrix is determined according to the position of each pixel in the input image; then the pixel value of each corresponding pixel in the output image is determined according to the pixel value of each pixel in the input image and the corresponding index value to generate an output image, wherein the pixel points of the input image and the pixel points of the output image are in a one-to-one correspondence. It can be seen that although the input image is a continuous grayscale image and the output image is a binary or multi-valued non-continuous grayscale image, the pixel value of each corresponding pixel in the output image can be determined according to the pixel value of each pixel in the input image and its corresponding index value, and the pixel value distribution of each pixel in the output image is optimized, so that multiple adjacent pixels in the output image can present grayscale values other than black and white after visual color mixing, so that the displayed grayscale values of the corresponding areas of the input image and the output image are closer, and the image viewer will not obviously feel the limitation of using only two grayscales, so that the image displayed on a binary device or multi-value device such as electronic paper has the effect of displaying a continuous grayscale image in terms of viewing angle, which is closer to a continuous grayscale image, and can effectively improve the display effect of a binary device or multi-value device such as electronic paper, so that the viewer can visually feel the sense of hierarchy and continuity, achieve a better visual experience, and make it more practical and beautiful in actual applications. BRIEF DESCRIPTION OF THE DRAWINGS
[0008] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0009] Figure 1 This is a schematic diagram of a module of an electronic device in an embodiment of the present application; Figure 2 A flow chart showing a control method in an embodiment of the present application; Figure 3 This is a schematic diagram of a specific flow chart of step S23 of the display control method in an embodiment of the present application; Figure 4 This is a schematic diagram of a specific flow chart of step S24 of the display control method in one embodiment of the present application; Figure 5 This is a schematic diagram of a specific flow chart of step S242 of the display control method in an embodiment of the present application; Figure 6 This is a schematic diagram of a case where both the input image and the output image are face images when the spatial random dithering algorithm is used in the first embodiment of the present application; Figure 7 This is a schematic diagram of a case where both the input image and the output image are architectural images when the spatial disordered dithering algorithm is used in the first embodiment of the present application; Figure 8 This is a schematic diagram of a case where both the input image and the output image are face images when the spatial aggregation ordered dithering algorithm is used in the second embodiment of the present application; Fig. 9 This is a schematic diagram of a case where both the input image and the output image are architectural images when the spatial aggregation ordered dithering algorithm is used in the second embodiment of the present application; Fig.10 This is a schematic diagram of a case where both the input image and the output image are face images when the spatially separated ordered dithering algorithm is used in the third embodiment of the present application; Fig.11 This is a schematic diagram of a case where both the input image and the output image are architectural images when the spatially separated ordered dithering algorithm is used in the third embodiment of the present application; Fig.12 This is a module diagram of the processor controlling the display module in an embodiment of the present application.
[0010] Reference numerals: 100 - electronic equipment; 10- Processor; 20- memory; 30-display module; 21 - Register; 22-External memory; 11-threshold generation module; 12- Image generation module; 13-Multiplexer. DETAILED DESCRIPTION
[0011] In order to make the purpose, technical scheme and advantages of the embodiments of the present application clearer, the technical scheme of the embodiments of the present application is clearly and completely described below in conjunction with the drawings of the embodiments of the present application. Obviously, the described embodiments are only embodiments of a part of the present application, not all embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without making creative work should fall within the scope of protection of this application.
[0012] Unless otherwise defined, the technical or scientific terms used herein shall have the usual meaning as understood by a person of ordinary skill in the field to which this application belongs. The words "one", "an" or "the" and the like used in this application do not indicate a quantitative limitation, but are only used to indicate the presence of at least one. The words "include" or "comprise" and the like mean that the elements or objects appearing before the word include the elements or objects listed after the word and their equivalents, without excluding other elements or objects. The words "connect" or "connected" and the like are not limited to physical or mechanical connections, but may include electrical connections, whether direct or indirect.
[0013] Reference to "embodiments" herein means that a particular feature, structure, or characteristic described in conjunction with the embodiments may be included in at least one embodiment of the present application. The appearance of the phrase in various locations in the specification does not necessarily refer to the same embodiment, nor is it an independent or alternative embodiment that is mutually exclusive with other embodiments. It is explicitly and implicitly understood by those skilled in the art that the embodiments described herein may be combined with other embodiments.
[0014] Please refer to Figure 1 , Figure 1 Schematic diagram of a module of an electronic device 100 in an embodiment of the present application. The electronic device 100 may be, but is not limited to, a binary or multi-value device such as an e-book, a monochrome display device, or an electronic device such as a mobile phone or a tablet provided with a binary or multi-value device. Among them, a binary device may be, but is not limited to, an electronic paper, a monochrome display device, a black and white mode of a digital camera, or a device that can only display a binary image in black and white but cannot display a continuous grayscale image, and a multi-value device may be, but is not limited to, a device that can display grayscale images other than black and white but cannot display a continuous grayscale image. In this embodiment, the electronic device 100 is an electronic paper. The electronic device 100 includes a processor 10, a memory 20, and a display module 30. The processor 10 is connected to the memory 20 and the display module 30.
[0015] The processor 10 may be, but is not limited to, a central processing unit (CPU), other general-purpose processors, a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc.
[0016] The memory 20 may include a high-speed random access memory, and may also include a non-volatile memory, such as a hard disk, a memory, a plug-in hard disk, a Smart Media Card (SMC), a Secure Digital (SD) card, a flash card (Flash Card), multiple disk storage devices, flash memory devices, or other volatile solid-state storage devices.
[0017] The display module 30 is a display module for displaying binary images or multi-valued images, for example, a display module of electronic paper.
[0018] In some embodiments, the memory 20 stores a computer program, and the processor 10 runs the computer program to perform the steps of the display control method.
[0019] Please refer to Figure 2 , Figure 2 This is a flow chart showing a control method in an embodiment of the present application. It can be understood that: Figure 2 The steps can be adjusted in order or increased or decreased according to actual needs, and are not limited here. The display control method includes: Step S21: obtaining an input image; Step S22: obtaining an index matrix, wherein the index matrix includes a plurality of index values; Step S23: determining the index value corresponding to each pixel in the index matrix according to the position of each pixel in the input image; Step S24: determining the pixel value of each corresponding pixel point in the output image according to the pixel value of each pixel point in the input image and the corresponding index value to generate the output image; Step S25: controlling the display module 30 of the electronic device 100 to display the output image.
[0020] Therefore, in the present application, binary or multi-value devices such as electronic paper cannot display continuous grayscale images. The present application aims to convert continuous grayscale images (input images) into binary images (output images) for display by binary or multi-value devices such as electronic paper. Since the human eye has low-pass characteristics and perceptual similarity, where the low-pass characteristic means that the human eye can perform low-pass filtering on high-frequency signals, the binary image will present the effect of a continuous grayscale image at a normal observation distance; perceptual similarity means that the human eye will integrate similar areas or pixels to form a smoother visual experience, ignoring the specific grayscale value of a single pixel. Therefore, the present application optimizes the binarization algorithm, that is, introduces an index matrix, which includes multiple index values; then determines the index value corresponding to each pixel in the index matrix according to the position of each pixel in the input image; and then determines the index value corresponding to each pixel in the index matrix according to the pixel value of each pixel in the input image. The pixel value of each corresponding pixel point in the output image is determined by the value and the corresponding index value to generate the output image, wherein the pixel points of the input image are in one-to-one correspondence with the pixel points of the output image, and the pixel value distribution of each pixel point in the output image is optimized, so that multiple adjacent pixel points in the output image can present other grayscale values except black and white after visually mixing, so that the display grayscale values of the corresponding areas of the input image and the output image are closer, and the image viewer will not obviously feel the limitation of using only two grayscales, so that the image displayed on a binary device or multi-value device such as electronic paper has the effect of displaying a continuous grayscale image in terms of viewing angle, which is closer to a continuous grayscale image, and can effectively improve the display effect of a binary device or multi-value device such as electronic paper, so that the viewer can visually feel the sense of hierarchy and continuity, achieve a better visual experience, and make it more practical and beautiful in actual applications.
[0021] In some embodiments, the index matrix is an N×M matrix including multiple index values, that is, a matrix including N×M index values, and N and M are positive integers greater than or equal to 2, and N and M may be equal or unequal.
[0022] In some embodiments, N and M are equal, therefore, the index matrix may be a 2nd-order matrix, a 4th-order matrix, an 8th-order matrix, etc., which is not limited here.
[0023] In some embodiments, at least some of the multiple index values in the index matrix are different. In this embodiment, the index values in the index matrix are different, and the maximum value is less than or equal to N×M-1, and the minimum value is greater than or equal to zero.
[0024] For some examples, please refer to Figure 3 , Figure 3 This is a specific flow chart of step S23 of the display control method in an embodiment of the present application. It can be understood that, Figure 3The steps can be adjusted in order or increased or decreased according to actual needs, and are not limited here. When the index matrix is an N×M matrix, the position of each pixel in the input image includes a row value and a column value, and the step S23 includes: Step S231: performing a modulo operation on the row value of each pixel in the input image and the number of rows of the index matrix to obtain the number of rows of the index matrix corresponding to each pixel; Step S232: performing a modulo operation on the column value of each pixel in the input image and the number of columns of the index matrix to obtain the number of columns of the index matrix corresponding to each pixel; Step S233: determining the index value corresponding to each pixel in the index matrix according to the number of rows and columns of the index matrix.
[0025] In some embodiments, the formula corresponding to step S231 is the modulo operation imodN, where i is the number of rows, N is the number of rows of the index matrix, and imodN is the modulo operation of i on N. The formula corresponding to step S232 is jmodM, where j is the number of columns, M is the number of columns of the index matrix, and jmodM is the modulo operation of j on M.
[0026] In another embodiment, the formula corresponding to step S231 is a modulo operation, which is not limited here.
[0027] Therefore, in the present application, when the number of index values of the index matrix is less than the number of pixels in the input image and the output image, the index value corresponding to each pixel in the input image can be determined based on the modulo operation, so that the index matrix is miniaturized and the system memory is reduced.
[0028] In some embodiments, the input image is a continuous grayscale image, and the output image is a binary image. In other embodiments, the input image is a high grayscale image, and the output image is a low grayscale image, wherein the high grayscale image and the low grayscale image are relative concepts, and the number of displayed grayscale values of the high grayscale image is greater than the number of displayed grayscale values of the low grayscale image.
[0029] In some embodiments, the output image is a binary image, and each pixel of the output image can display 0 or 255. When the index matrix is a 2nd-order matrix, all the pixels of the output image are divided into a number of output pixel groups in order by rows and columns, and each output pixel group is also a 2nd-order matrix. Like the index matrix, each pixel of each output pixel group is in a one-to-one correspondence with each index value of the index matrix, so the pixel value of each pixel of the output pixel group is obtained by the index value of the corresponding position of the index matrix. Thus, the pixel value of each pixel of each output pixel group can be adjusted accordingly according to each index value of the index matrix, and the distribution of the pixel values of each pixel of the output image is optimized, so that the output image as a whole is closer to the display effect of a continuous grayscale image. Among them, when the index matrix is a 2nd-order matrix, when each pixel of each output pixel group is 0, the display grayscale value that can be presented visually is the mean of the sum of each pixel of the output pixel group, that is, 0. Similarly, when only one pixel in each output pixel group is 255 and the other three pixels are all 0, the visually displayed grayscale value is the sum of the pixel values of each pixel in the output pixel group and the average value, that is, 255 / 4=64. Similarly, when only two pixels in each output pixel group are 255 and the other two pixels are all 0, the visually displayed grayscale value is the sum of the pixel values of each pixel in the output pixel group and the average value, that is, 510 / 4=128. Similarly, each output pixel group can also have a display grayscale value of 192 or 255; for another example, when the index matrix is a 4th-order matrix, all the pixels of the output image are divided into a number of output pixel groups in order by rows and columns, and each output pixel group is also a 4th-order matrix. Like the index matrix, each pixel of each output pixel group has a one-to-one correspondence with each index value of the index matrix. Therefore, the pixel value of each pixel in the output pixel group is obtained by the index value of the corresponding position of the index matrix. Thus, the pixel values of each pixel point of each output pixel group can be adjusted accordingly according to each index value of the index matrix, so that the output image as a whole is closer to the display effect of a continuous grayscale image. Wherein, when the index matrix is a 4-order matrix, each output image group of the output image can visually present 17 kinds of display grayscale values, namely, 0, 16, 32, 48, 64, 80, 96, 112, 128, 144, 160, 176, 192, 208, 224, 240, 255; for another example, when the index matrix is an 8-order matrix, all the pixel points of the output image are divided into several output pixel groups in order by rows and columns, and each output pixel group is also an 8-order matrix, which is the same as the index matrix. Each pixel point of each output pixel group is in one-to-one correspondence with each index value of the index matrix. Therefore, the pixel value of each pixel point of the output pixel group is obtained by the index value of the corresponding position of the index matrix.Thus, the pixel values of each pixel point of each output pixel group can be adjusted accordingly according to each index value of the index matrix, so that the output image as a whole is closer to the display effect of a continuous grayscale image. Among them, when the index matrix is an 8-order matrix, there are 65 kinds of grayscale values that can be visually presented by the output image, namely, 0, 4, 8, 12, 16, 20, 24, 28, 32, 36, 40, 44, 48, 52, 56, 60, 64, 68, 72, 76, 80, 84, 88, 92, 96, 100, 104, 108, 112, 116, 128, 132, 136, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175 20, 124, 128, 132, 136, 140, 144, 148, 152, 156, 160, 164, 168, 172, 176, 180, 184, 188, 192, 196, 200, 204, 208, 212, 216, 220, 224, 228, 232, 236, 240, 244, 248, 252, 255.
[0030] Therefore, in the present application, the larger the order of the index matrix, the larger the number of grayscale values that the output image can visually present. The order of the index matrix is proportional to the number of grayscale values that the output image can visually present. Therefore, the order of the index matrix can be adjusted according to needs, thereby adjusting the number of grayscale values that the output image can visually present, thereby improving the display layering of the output image.
[0031] In addition, for the case where the index matrix is an N×M matrix, all pixels of the output image are divided into a number of output pixel groups in order by rows and columns, and each output pixel group is also an N×M matrix, which is the same as the index matrix. The output image can visually present N×M+1 display grayscale values, which are the same as above and will not be repeated here.
[0032] For some examples, please refer to Figure 4 , Figure 4 This is a specific flow chart of step S24 of the display control method in an embodiment of the present application. It can be understood that, Figure 4 The steps can be adjusted in order or increased or decreased according to actual needs, and are not limited here. Step S24 includes: Step S241: Calculate the threshold corresponding to each pixel point according to the index value corresponding to each pixel point in the input image; Step S242: Determine the pixel value of each corresponding pixel in the output image according to the comparison result between the pixel value of each pixel in the input image and its corresponding threshold value, so as to generate the output image.
[0033] Thus, firstly, the threshold value corresponding to each pixel point is calculated according to the index value corresponding to each pixel point in the input image. Therefore, each pixel point of the input image has a corresponding threshold value, and the size of the threshold value is related to the size of the index value corresponding to the pixel point of the input image in the index matrix; then, according to the comparison result of the pixel value of each pixel point in the input image and its corresponding threshold value, the pixel value of each corresponding pixel point in the output image is determined to generate the output image. Therefore, the value assigned to each pixel point in the output image is associated with the index value corresponding to the pixel point. According to the size of each index value of the index matrix, the value assigned to the corresponding pixel point in the output image can be adjusted, and the pixel value distribution of each pixel point in the output image is optimized, so that the output image is visually closer to the viewing effect of a continuous grayscale image, so that the viewer can visually feel the sense of hierarchy and continuity, and achieve a better visual experience. It can make up for the deficiency of the display module 30 in displaying continuous grayscale images to a certain extent, making it more practical and beautiful in practical applications.
[0034] In some embodiments, step S241 includes: The threshold value corresponding to each pixel point is obtained by performing an operation on the index value corresponding to each pixel point in the input image and the number of rows and columns of the index matrix.
[0035] Therefore, in the present application, the threshold value corresponding to each pixel in the input image can be obtained by performing calculations based on the index value corresponding to the pixel and the number of rows and columns of the index matrix. The calculation process is simple, the amount of calculation is small, and the calculation speed can be improved.
[0036] In some embodiments, the threshold corresponding to each pixel point is obtained by calculating the index value corresponding to each pixel point in the input image and the number of rows and columns of the index matrix, including: Obtaining a threshold value corresponding to each pixel by calculating the first calculation formula, the index value corresponding to each pixel, and the number of rows and columns of the index matrix; Wherein, the first operation formula is: , where i is the number of rows, j is the number of columns, N is the number of rows of the index matrix, M is the number of columns of the index matrix, i(imodN, jmodM) is the index matrix, imodN is the modulus operation of i on N, jmodM is the modulus operation of j on M, T(i, j) is the threshold corresponding to the pixel point in the i-th row and j-th column of the input image, and N and M are positive integers greater than or equal to 2.
[0037] In some embodiments, when the index matrix is an N-order matrix, the first calculation formula is: , where i is the number of rows, j is the number of columns, N is the order of the index matrix, i(imodN, jmodN) is the index matrix, imodN is the modulus operation of i on N, jmodN is the modulus operation of j on N, and T(i,j) is the threshold of the i-th row and j-th column.
[0038] Therefore, according to the above calculation formula, the threshold corresponding to each pixel in the input image can be calculated. The calculation process is simple, and a smaller index matrix can be used so that the row value i and column value j of each pixel in the input image can correspond to a specific index value in the index matrix after modulo operation, and then the threshold of the pixel is calculated by the ratio of the index value to the product of the number of rows and columns of the index matrix, which can reduce the size of the index matrix and reduce the space occupied by the index matrix.
[0039] It is understandable that in other embodiments, the pixel value of each corresponding pixel point in the output image can be directly obtained according to the pixel value of each pixel point in the input image and its corresponding index value, which is not limited here.
[0040] It is understandable that, in other embodiments, the first operation formula may be adjusted according to actual needs, for example, adjusting the value of the constant 0.5, etc., which is not limited here.
[0041] For some examples, please refer to Figure 5 , Figure 5 The specific flow chart of step S242 of the display control method in one embodiment of the present application is shown in FIG. Step S242 specifically includes: Step S2421: Determine whether the pixel value of each pixel in the input image is greater than the threshold corresponding to the pixel, if yes, proceed to step S2422, otherwise, proceed to step S2423; Step S2422: Determine that the pixel value of a corresponding pixel point in the output image is a first value; Step S2423: Determine a second pixel value of a corresponding pixel point in the output image, wherein the first value is different from the second value.
[0042] In some embodiments, the calculation formula of step S242 is: ; Among them, h(i, j) is the pixel value of the i-th row and j-th column of the output image, c(i, j) is the pixel value of the i-th row and j-th column of the input image, and T(i, j) is the threshold corresponding to the pixel point of the i-th row and j-th column of the input image.
[0043] In this embodiment, the first value is 255, and the second value is 0. In other embodiments, the first value is 0, and the second value is 255. In other embodiments, the first value and the second value may be other values, which are not limited here.
[0044] Therefore, in the present application, a continuous grayscale image (input image) can be converted into a binary image (output image) for display on binary or multi-value devices such as electronic paper. Moreover, by comparing the pixel values of the pixels and their corresponding thresholds, the operation process of converting the continuous grayscale image (input image) into a binary image (output image) can be simplified, thereby improving the image conversion efficiency.
[0045] In some embodiments, step S24 can be implemented by three algorithms, which specifically include a spatial disordered jitter algorithm, a spatial aggregation ordered jitter algorithm, and a spatial separation ordered jitter algorithm. Among them, the spatial disordered jitter algorithm refers to that the index values of the index matrix are randomly set and have no regularity. The spatial aggregation ordered jitter algorithm means that the index matrix is not a random matrix, but has a certain regularity, and the index value of the inner circle of the index matrix is less than the index value of the outer circle of the index matrix, so that the index matrix as a whole has an effect of aggregation from the outside to the inside. The spatial separation ordered jitter algorithm means that the index matrix is not a random matrix, but has a certain regularity, and the index values of each area of the index matrix are large and small, and the distribution is relatively uniform, that is, the values of each area of the index matrix from top to bottom and from left to right include index values greater than the preset value and index values less than or equal to the preset value.
[0046] The formulas of step S241 and step S242 corresponding to the three algorithms are the same. Specifically, when the index matrix is an N-order matrix, the first calculation formula of step S241 is: , where i is the number of rows, j is the number of columns, N is the order of the index matrix, i(imodN, jmodN) is the index matrix, imodN is the modulus operation of i on N, jmodN is the modulus operation of j on N, and T(i,j) is the threshold of the i-th row and j-th column.
[0047] Specifically, the calculation formula of S242 is: ; Among them, h(i,j) is the pixel value of the i-th row and j-th column of the output image, c(i,j) is the pixel value of the i-th row and j-th column of the input image, and T(i,j) is the threshold corresponding to the pixel point of the i-th row and j-th column of the input image.
[0048] The difference between these three algorithms lies in the different index matrices used by the three algorithms.
[0049] In some embodiments, the index matrix used by the spatial random dithering algorithm is a random matrix, as shown in the following example: .
[0050] In other embodiments, the index matrix may also be exemplified as: .
[0051] In some other embodiments, the order of the index matrix may also be 4, 8, etc.
[0052] Therefore, in the spatial random jitter algorithm, the index matrix is a random matrix, and the maximum value of the index matrix is less than or equal to N 2 -1, the minimum value is greater than or equal to 0, and the index values of the index matrix are different. In other embodiments, the index values of the index matrix may be partially the same.
[0053] Next, taking the pixel value of the pixel point in row 0 and column 0 of the input image as 64, the pixel value of the pixel point in row 0 and column 1 as 64, the pixel value of the pixel point in row 1 and column 0 as 64, and the pixel value of the pixel point in row 1 and column 1 as 64, the algorithm is described as follows: c(0,0)=64, c(0,1)=64, c(1,0)=64, c(1,1)=64.
[0054] Index Matrix = , then the order of index matrix i is N=2.
[0055] When calculating the threshold T corresponding to the pixel point in row 0 and column 0, i=0, j=0. According to imodN=0 and jmodN=0, we need to select the index value 1 in row 0 and column 0 in index matrix i. Therefore, .
[0056] The pixel h(0,0) is: ; It can be seen that the pixel value of pixel h(0,0) is 0.
[0057] When calculating the threshold T corresponding to the pixel point in row 0 and column 1, i=0, j=1. According to imodN=0 and jmodN=1, we need to select the index value 2 in row 0 and column 1 of the index matrix i. Therefore, ; The pixel h(0,1) is: ; It can be seen that the pixel value of pixel h(0,1) is 0.
[0058] When calculating the threshold T corresponding to the pixel point in the 1st row and 0th column, i=1, j=0. According to imodN=1 and jmodN=0, we need to select the index value 3 in the 1st row and 0th column of the index matrix i. Therefore, ; The pixel h(1,0) is: ; It can be seen that the pixel value of pixel h(1,0) is 0.
[0059] When calculating the threshold T corresponding to the pixel point in the first row and first column, i=1, j=1. According to imodN=1 and jmodN=1, we need to select the index value 0 in the first row and first column of the index matrix i. Therefore, ; The pixel h(1,1) is: ; It can be seen that the pixel value of pixel h(1,1) is 255.
[0060] It can be seen from this that although the pixel value of the pixel in row 0, column 0 of the input image is 64, the pixel value of the pixel in row 0, column 1 is 64, the pixel value of the pixel in row 1, column 0 is 64, and the pixel value of the pixel in row 1, column 1 is 64, and the pixel value of the pixel in row 0, column 0 of the output image is 0, the pixel value of the pixel in row 0, column 1 is 0, the pixel value of the pixel in row 1, column 0 is 0, and the pixel value of the pixel in row 1, column 1 is 255, but due to the low-pass characteristic of the human eye, when the binary image is observed at a normal observation distance, a visual effect of a continuous grayscale image will be presented. Therefore, the human eye sees the grayscale values of the pixel in row 0, column 0, row 0, column 1, row 1, column 0, and row 1, column 1 of the output image, which are the average of the pixel values of these four pixels, 64, which are grayscale values other than 0 and 255. Therefore, the output image can present more display grayscale values, making the output image more layered.
[0061] Please refer to Figure 6 , Figure 6 This is a schematic diagram of the case where both the input image and the output image are face images when the spatial random dithering algorithm is used in the first embodiment of the present application.
[0062] like Figure 6As shown, the upper left image is the input image, which is a face image, and the upper right image, lower left image and lower right image are the output images, respectively. Among them, the upper right image is the output image when the index matrix is a 2×2 matrix, the lower left image is the output image when the index matrix is a 4×4 matrix, and the lower right image is the output image when the index matrix is an 8×8 matrix. Figure 6 It can be seen that the image in the upper right corner has a poor sense of hierarchy, is fuzzy overall, and has more information loss. The image in the lower left corner has a better sense of hierarchy than the image in the upper right corner, is clearer overall than the image in the upper right corner, and has relatively less information loss. The image in the lower right corner has a better sense of hierarchy than the image in the lower left corner, is clearer overall than the image in the lower left corner, and has relatively less information loss. This is because the larger the order of the index matrix, the more grayscale values the output image can present as a whole, and the better the sense of hierarchy of the output image.
[0063] Please refer to Figure 7 , Figure 7 This is a schematic diagram of a case where both the input image and the output image are architectural pictures when the spatial random dithering algorithm is used in the first embodiment of the present application.
[0064] like Figure 7 As shown, the upper left picture is the input image, the input image is a building picture, the upper right picture, the lower left picture and the lower right picture are the output images respectively, among which the upper right picture is the output image when the index matrix is a 2×2 matrix, the lower left picture is the output image when the index matrix is a 4×4 matrix, and the lower right picture is the output image when the index matrix is an 8×8 matrix. Figure 7 It can be seen that the layering of the upper right picture is poor, the sky appears gray, the overall image is fuzzy, and the information loss is large. The layering of the lower left picture is better than that of the upper right picture, and the overall image is clearer than that of the upper right picture. The sky has a certain layering, but the transition is not natural enough, and the information loss is relatively small. The layering of the lower right picture is better than that of the lower left picture, the sky appears to have a better layering, the transition is more natural, and the overall image is clearer than the lower left picture, with relatively minimal information loss. This is because the larger the order of the index matrix, the more grayscale values the output image can present as a whole, and the better the layering of the output image.
[0065] Thus, in the first embodiment, the threshold value corresponding to each pixel point is calculated according to the index value corresponding to each pixel point in the input image, and the pixel value of each corresponding pixel point in the output image is determined according to the comparison result of the pixel value of each pixel point in the input image and its corresponding threshold value to generate the output image. Since the index matrix is a random matrix, the pixel value of each pixel point in the output image has little dependence on the selected index matrix, and only one index matrix needs to be pre-stored, which takes up little memory.
[0066] In the second embodiment, the index matrix used by the spatial aggregation ordered jitter algorithm is not a random matrix, but has a certain regularity, and the index value of the inner circle of the index matrix is smaller than the index value of the outer circle of the index matrix, so that the index matrix as a whole has the effect of aggregation from the outside to the inside. The example is as follows: When N=2, the index matrix I= ; When N=4, the index matrix I= ; When N=8, the index matrix I= .
[0067] As for the calculation method of calculating the threshold value of each pixel point of the input image according to the index matrix I, it is the same as the first embodiment, and the calculation method of determining the pixel value of each corresponding pixel point in the output image according to the comparison result of the pixel value of each pixel point in the input image and its corresponding threshold value to generate the output image is the same as the first embodiment and will not be repeated here.
[0068] Please refer to Figure 8 , Figure 8 This is a schematic diagram of a case where both the input image and the output image are face images when the spatial aggregation ordered dithering algorithm is used in the second embodiment of the present application.
[0069] like Figure 8 As shown, the upper left image is the input image, which is a face image, and the upper right image, lower left image and lower right image are the output images, respectively. Among them, the upper right image is the output image when the index matrix is a 2×2 matrix, the lower left image is the output image when the index matrix is a 4×4 matrix, and the lower right image is the output image when the index matrix is an 8×8 matrix. Figure 8 It can be seen that the layering of the upper right image is average, and the gathering effect is average. The layering of the lower left image is better than that of the upper right image, and the gathering effect is better than that of the upper right image. The layering of the lower right image is better than that of the lower left image, and the gathering effect is better than that of the lower left image. This is because the larger the order of the index matrix, the more grayscale values can be presented in the output image as a whole, and the better the layering of the output image will be. However, due to the use of a gathering index matrix, the larger the order of the index matrix, the better the gathering effect, and a certain artificial texture will appear.
[0070] Please refer to Fig. 9 , Fig. 9 This is a schematic diagram of a case where both the input image and the output image are architectural pictures when the spatial aggregation ordered dithering algorithm is used in the second embodiment of the present application.
[0071] like Fig. 9As shown, the upper left picture is the input image, the input image is a building picture, the upper right picture, the lower left picture and the lower right picture are the output images respectively, among which the upper right picture is the output image when the index matrix is a 2×2 matrix, the lower left picture is the output image when the index matrix is a 4×4 matrix, and the lower right picture is the output image when the index matrix is an 8×8 matrix. Fig. 9 It can be seen that the layering of the upper right picture is poor, and the sky looks gray. The layering of the lower left picture is better than that of the upper right picture, and the overall picture is clearer than that of the upper right picture. The sky has a certain layering, but the transition is not natural enough. The layering of the lower right picture is better than that of the lower left picture, and the sky looks better, the transition is more natural, and the overall picture is clearer than that of the lower left picture. This is because the larger the order of the index matrix, the more grayscale values the output image can present, and the better the layering of the output image, but because a clustering index matrix is used, the larger the order of the index matrix, the better the clustering effect, and a certain artificial texture will appear.
[0072] Therefore, the clustered index matrix used in the spatial aggregation ordered jitter algorithm has no obvious detail loss compared to the random threshold, and the design logic of the clustered index matrix is simpler.
[0073] In the third embodiment, the index matrix used by the spatial separation ordered dithering algorithm is not a random matrix, but has a certain regularity, that is, the values of each region of the index matrix are large and small, and the distribution is relatively uniform. An example is as follows: When N=2, the index matrix I= ; When N=4, the index matrix I= ; When N=8, the index matrix I= .
[0074] It can be understood that, in some embodiments, the index matrix is a low-order matrix, or the index matrix is a high-order matrix obtained by iterating a low-order matrix.
[0075] For example, when N=2, the index matrix I2(i, j) = .
[0076] According to the iterative formula I2(i, j) = , index matrix Self-indexing matrix Iteratively, the index matrix is Self-indexing matrix It is understandable that the index matrix According to the formula I2(i,j)= The index matrix of N=16 can be obtained by iteration, and so on, which will not be described in detail.
[0077] Please refer to Fig.10 , Fig.10 This is a schematic diagram of a case where both the input image and the output image are face images when the spatially separated ordered dithering algorithm is used in the third embodiment of the present application.
[0078] like Fig.10 As shown, the upper left image is the input image, which is a face image, and the upper right image, lower left image and lower right image are the output images, respectively. Among them, the upper right image is the output image when the index matrix is a 2×2 matrix, the lower left image is the output image when the index matrix is a 4×4 matrix, and the lower right image is the output image when the index matrix is an 8×8 matrix. Fig.10 It can be seen that the layering of the upper right corner image is average, but the outline of the face can also be seen. Compared with the spatial aggregation ordered jitter algorithm and the spatial disordered jitter algorithm, the information loss is less. The layering of the lower left corner image is better than that of the upper right corner image, and the information loss is less. The layering of the lower right corner image is better than that of the lower left corner image, and the information loss is less. This is because the larger the order of the index matrix, the more grayscale values can be presented in the output image as a whole, and the better the layering of the output image will be. Moreover, due to the use of a separate index matrix, the larger the order of the index matrix, the less information loss.
[0079] Please refer to Fig.11 , Fig.11 This is a schematic diagram of a case where both the input image and the output image are architectural pictures when the spatially separated ordered dithering algorithm is used in the third embodiment of the present application.
[0080] like Fig.11 As shown, the upper left picture is the input image, the input image is a building picture, the upper right picture, the lower left picture and the lower right picture are the output images respectively, among which the upper right picture is the output image when the index matrix is a 2×2 matrix, the lower left picture is the output image when the index matrix is a 4×4 matrix, and the lower right picture is the output image when the index matrix is an 8×8 matrix. Fig.11 It can be seen that the layering of the upper right picture is poor, and the sky looks gray. The layering of the lower left picture is better than that of the upper right picture, and the overall picture is clearer than that of the upper right picture. The sky has a certain layering, but the transition is not natural enough. The layering of the lower right picture is better than that of the lower left picture, and the sky looks better, the transition is more natural, and the overall picture is clearer than that of the lower left picture. This is because the larger the order of the index matrix, the more grayscale values the output image can present, and the better the layering of the output image. Moreover, due to the use of a separate index matrix, the larger the order of the index matrix, the less information loss.
[0081] Therefore, the spatially separated ordered dithering algorithm can obtain better grayscale amplitude quantization in a larger area; it can retain better detail information in a smaller area of the image and reduce artificial texture.
[0082] Please refer to Fig.12 , Fig.12 Schematic diagram of a module in which the processor 10 controls the display module 30 in an embodiment of the present application. Specifically, the memory 20 also includes a register 21 and an external memory 22. The processor 10 is connected to the register 21. The register 21 interacts with the external memory 22 via an APB (Advanced Peripheral Bus) bus, and reads the index matrix from the external memory 22 to the register 21 for temporary storage. It can be understood that the processor 10 is used to: Obtain an input image; Obtaining an index matrix, wherein the index matrix includes a plurality of index values; Determine the index value corresponding to each pixel in the index matrix according to the position of each pixel in the input image; Determine the pixel value of each corresponding pixel point in the output image according to the pixel value of each pixel point in the input image and the corresponding index value to generate the output image; The display module 30 of the electronic device 100 is controlled to display the output image.
[0083] Therefore, in the present application, an index matrix is introduced, which includes multiple index values; then the index value corresponding to each pixel in the index matrix is determined according to the position of each pixel in the input image; then the pixel value of each corresponding pixel in the output image is determined according to the pixel value of each pixel in the input image and the corresponding index value to generate an output image, wherein the pixel points of the input image and the pixel points of the output image are in a one-to-one correspondence. It can be seen that although the input image is a continuous grayscale image and the output image is a binary or multi-valued non-continuous grayscale image, the pixel value of each corresponding pixel in the output image can be determined according to the pixel value of each pixel in the input image and its corresponding index value, and the pixel value distribution of each pixel in the output image is optimized, so that multiple adjacent pixels in the output image can present grayscale values other than black and white after visual color mixing, so that the displayed grayscale values of the corresponding areas of the input image and the output image are closer, and the image viewer will not obviously feel the limitation of using only two grayscales, so that the image displayed on a binary device or multi-value device such as electronic paper has the effect of displaying a continuous grayscale image in terms of viewing angle, which is closer to a continuous grayscale image, and can effectively improve the display effect of a binary device or multi-value device such as electronic paper, so that the viewer can visually feel the sense of hierarchy and continuity, achieve a better visual experience, and make it more practical and beautiful in actual applications.
[0084] Specifically, the processor 10 includes a threshold generation module 11 and an image generation module 12. The threshold generation module 11 is connected to the register 21. The threshold generation module 11 has two input sources, one of which is an input image (one frame of the input video stream), and the other is an index matrix from the register 21. The threshold generation module 11 is used to determine an index value in the index matrix corresponding to each pixel point in the input image according to the position of the pixel point in the input image, and to calculate the threshold value corresponding to each pixel point according to the index value corresponding to each pixel point in the input image; the image generation module 12 is used to determine the pixel value of each corresponding pixel point in the output image according to the comparison result of the pixel value of each pixel point in the input image and its corresponding threshold value, so as to generate the output image (one frame of the output video stream).
[0085] Thus, first, the threshold value corresponding to each pixel point is calculated according to the index value corresponding to each pixel point in the input image. Therefore, each pixel point of the input image has a corresponding threshold value, and the size of the threshold value is related to the size of the index value corresponding to the pixel point of the input image in the index matrix; then, according to the comparison result of the pixel value of each pixel point in the input image and its corresponding threshold value, the pixel value of each corresponding pixel point in the output image is determined to generate the output image. Therefore, the assignment of each pixel point in the output image is associated with the index value corresponding to the pixel point. According to the size of each index value of the index matrix, the assignment of the corresponding pixel point in the output image can be adjusted, so that the output image is visually closer to the viewing effect of a continuous grayscale image, so that the viewer can visually feel the sense of hierarchy and continuity, and achieve a better visual experience. It can make up for the shortcomings of the display module 30 in displaying continuous grayscale images to a certain extent, making it more practical and beautiful in actual applications.
[0086] In some embodiments, the threshold generation module 11 is used to obtain the threshold corresponding to each pixel point by performing calculations based on the index value corresponding to each pixel point in the input image and the number of rows and columns of the index matrix.
[0087] Therefore, in the present application, the threshold value corresponding to each pixel in the input image can be obtained by performing calculations based on the index value corresponding to the pixel and the number of rows and columns of the index matrix. The calculation process is simple, the amount of calculation is small, and the calculation speed can be improved.
[0088] In some embodiments, the image generation module 12 is used to determine whether the pixel value of each pixel in the input image is greater than a threshold value corresponding to the pixel. If so, the pixel value of a corresponding pixel in the output image is determined to be a first value; if not, the pixel value of a corresponding pixel in the output image is determined to be a second value, and the first value is different from the second value.
[0089] Therefore, in the present application, a continuous grayscale image (input image) can be converted into a binary image (output image) for display on binary or multi-value devices such as electronic paper. Moreover, by comparing the pixel values of the pixels and their corresponding thresholds, the operation process of converting the continuous grayscale image (input image) into a binary image (output image) can be simplified, thereby improving the image conversion efficiency.
[0090] In some embodiments, the threshold generation module 11 and the image generation module 12 may use the aforementioned three algorithms, which will not be described in detail here.
[0091] In some embodiments, the processor 10 further includes a multiplexer 13. The multiplexer 13 is connected to the output end of the image generation module 12 and the input end of the threshold generation module 11. When the multiplexer 13 chooses to enable the dithering algorithm, the video stream is generated from the threshold generation module 11 through the image generation module 12 to generate an output video stream and is output through the multiplexer 13; when the multiplexer 13 chooses not to enable the dithering algorithm, the video stream is directly output from the multiplexer 13 without passing through the threshold generation module 11 and the image generation module 12.
[0092] Therefore, by using the multiplexer 13, it is possible to choose to perform dithering algorithm processing on the video stream or not, thereby increasing the diversity of the output video stream selectivity.
[0093] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0094] Those skilled in the art will appreciate that all or part of the steps in the various methods of the above embodiments may be completed by instructing related hardware through a program, and the program may be stored in a computer-readable memory, which may include a flash drive, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, etc.
[0095] An embodiment of the present application further provides a computer-readable storage medium storing a computer program, wherein the computer program is executed by a processor to perform the steps of the aforementioned display control method.
[0096] As described above, the above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present application.
Claims
1. A display control method, applied to an electronic device, wherein the electronic device comprises a display module, characterized in that: The display control method comprises: Obtain an input image; Obtaining an index matrix, wherein the index matrix includes a plurality of index values; Determine the index value corresponding to each pixel in the index matrix according to the position of each pixel in the input image; Determine the pixel value of each corresponding pixel point in the output image according to the pixel value of each pixel point in the input image and the corresponding index value to generate the output image; The display module of the electronic device is controlled to display the output image.
2. The display control method according to claim 1, characterized in that: The position of each pixel in the input image includes a row value and a column value, and determining the index value corresponding to each pixel in the index matrix according to the position of each pixel in the input image includes: Performing a modulo operation on the row value of each pixel in the input image and the number of rows of the index matrix to obtain the number of rows of the index matrix corresponding to each pixel; Performing a modulo operation on the column value of each pixel in the input image and the number of columns of the index matrix to obtain the number of columns of the index matrix corresponding to each pixel; The index value corresponding to each pixel in the index matrix is determined according to the number of rows and columns of the index matrix.
3. The display control method according to claim 1, characterized in that: The step of determining the pixel value of each corresponding pixel point in the output image according to the pixel value of each pixel point in the input image and the corresponding index value to generate the output image comprises: Calculating a threshold value corresponding to each pixel point according to the index value corresponding to each pixel point in the input image; According to the comparison result between the pixel value of each pixel point in the input image and its corresponding threshold value, the pixel value of each corresponding pixel point in the output image is determined to generate the output image.
4. The display control method according to claim 3, characterized in that: The step of calculating a threshold value corresponding to each pixel point according to an index value corresponding to each pixel point in the input image includes: The threshold value corresponding to each pixel point is obtained by performing an operation on the index value corresponding to each pixel point in the input image and the number of rows and columns of the index matrix.
5. The display control method according to claim 4, characterized in that: The step of obtaining a threshold value corresponding to each pixel point by calculating the index value corresponding to each pixel point in the input image and the number of rows and columns of the index matrix includes: Obtaining a threshold value corresponding to each pixel by calculating the first calculation formula, the index value corresponding to each pixel, and the number of rows and columns of the index matrix; Wherein, the first operation formula is: ,in, is the number of rows, is the number of columns, N is the number of rows of the index matrix, M is the number of columns of the index matrix I(imodN, jmodM), is the index matrix, imodN is the modulo operation of i on N, jmodM is the modulo operation of j on M, T(i, j) is the threshold corresponding to the pixel point in the i-th row and j-th column of the input image, N and M are positive integers greater than or equal to 2, and N and M can be equal or unequal.
6. The display control method according to claim 3, characterized in that: Determining the pixel value of each corresponding pixel in the output image according to the comparison result of the pixel value of each pixel in the input image and the corresponding threshold value to generate the output image includes: When a comparison result between the pixel value of each pixel point in the input image and its corresponding threshold value is that the pixel value of a pixel point in the input image is greater than the threshold value corresponding to the pixel point, determining that the pixel value of a corresponding pixel point in the output image is a first value; When the comparison result between the pixel value of each pixel point in the input image and its corresponding threshold is that the pixel value of a pixel point in the input image is less than or equal to the threshold corresponding to the pixel point, a second value of the pixel value of a corresponding pixel point in the output image is determined, and the first value is different from the second value.
7. The display control method according to any one of claims 1 to 6, characterized in that: The index matrix is a random matrix; or, the index matrix is a regular matrix, and the regularity is that the values of the inner circle of the index matrix are smaller than the values of the outer circle of the index matrix; or, the index matrix is a regular matrix, and the regularity is that the values of each area of the index matrix from top to bottom and from left to right include index values greater than a preset value and index values less than or equal to the preset value.
8. The display control method according to claim 1, characterized in that: The index matrix is a low-order matrix, or the index matrix is a high-order matrix obtained by iterating a low-order matrix.
9. An electronic device, characterized in that: It comprises a display module, a processor and a memory, wherein the processor is connected to the display module and the memory, a computer program is stored in the memory, and the processor runs the computer program to execute the steps of the display control method described in any one of claims 1 to 8.
10. A computer-readable storage medium, characterized in that: A computer program is stored, and the computer program is executed by a processor to perform the steps of the display control method according to any one of claims 1 to 8.
Citation Information
Patent Citations
Image encryption method and device based on index matrix, terminal and storage medium
CN112260815A
Image processing method and device based on jitter processing, computer equipment and medium
CN113590071A
Cited By
Binary image hole filling method, device and equipment and readable storage medium
CN119559295A
Binary image hole filling method, device, equipment and readable storage medium
CN119559295B
