Image processing method and image processing device
By using the classification method in image processing to associate the pixels of the original image to the target coordinate set and pixel coordinates, the problem of color performance degradation when converting high bit numbers to low bit numbers is solved, achieving good performance in devices with limited memory. Color performance and bandwidth savings.
Patent Information
- Application Number
- CN202310322570.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-03-29
- Publication Date
- 2024-10-01
AI Technical Summary
In some applications, high-bit-number pixels need to be converted into low-bit-number pixels to save memory. Especially in electronic devices with limited memory, how to maintain the color performance of images is an issue that technicians urgently want to improve.
By obtaining the pixels of the original image, using the first and second classification methods to associate them with the target coordinate set and target pixel coordinates, the pixel coordinates are replaced to generate an adjusted image so that its color performance is close to the original image.
It is possible to greatly maintain the color performance of the image while reducing the number of pixel bits. It is suitable for electronic devices with limited memory and saves image transmission bandwidth.
Smart Images

Figure CN118741066A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to an image processing technology, and in particular to an image processing method and an image processing device. Background Art
[0002] With the advancement of technology, the use of display screens to display color images has been widely used in people's lives. The color image displayed by the display screen is composed of multiple pixels, and the pixel value of each pixel includes color channel components corresponding to multiple different color channels. It is known that the more bits of these pixel values, the more color types these pixels have, and the higher the color saturation of the image can be. However, in some application scenarios, there are situations where the number of bits of pixel values needs to be sacrificed. For example, when an external device transmits the pixels of an image to a display screen via a signal transmission interface (such as SPI, i8080 or m6800), in order to save memory or match the output format, it is necessary to convert high-bit pixels into low-bit pixels. For example, converting the RGB888 format with a saturation of 24 bits into the RGB444 format with a saturation of 12 bits or the RGB565 format with a saturation of 16 bits. In particular, for electronic devices with limited memory (such as wearable devices), it is cost-effective to control the number of pixel bits within a range by slightly sacrificing the color performance of the image. Under the premise of reducing the number of pixel bits, how to maintain the color performance of the image as much as possible is a problem that those skilled in the art are eager to improve. Summary of the invention
[0003] The invention relates to an image processing method and an image processing device, which can largely maintain the color displayed by the original image after the pixel bit reduction processing of the adjusted image.
[0004] An embodiment of the present invention provides an image processing method, comprising the following steps. Acquire an original image including a plurality of pixels, wherein the plurality of pixels include a first pixel. Record N target pixel coordinates, wherein the N target pixel coordinates form M target coordinate sets, wherein M and N are integers greater than 0. According to the original pixel coordinates of the first pixel, associate the first pixel to a first target coordinate set in the M target coordinate sets using a first classification method. Map the first pixel to one of the N target pixel coordinates in the first target coordinate set using a second classification method. Replace the original pixel coordinates of the first pixel with one of the N target pixel coordinates to convert the original image into an adjusted image.
[0005] An embodiment of the present invention provides an image processing device, which includes a storage device and a processing circuit. The storage device records N target pixel coordinates, wherein the N target pixel coordinates form M target coordinate sets. M and N are integers greater than 0. The processing circuit is coupled to the storage device and configured to perform the following operations. An original image including a plurality of pixels is acquired, wherein the plurality of pixels include a first pixel. According to the original pixel coordinates of the first pixel, the first pixel is associated with a first target coordinate set in the M target coordinate sets using a first classification method. The first pixel is mapped to one of the N target pixel coordinates in the first target coordinate set using a second classification method. The original pixel coordinates of the first pixel are replaced with one of the N target pixel coordinates to convert the original image into an adjusted image.
[0006] Based on the above, in the embodiment of the present invention, the first classification method is first used to associate the pixels of the original image with one of the M target coordinate sets, and the second classification method is then used to associate the pixels of the original image with one of the target pixel coordinates in one of the M target coordinate sets. Thus, the high-bit original image can be converted into a low-bit adjusted image, and the adjusted image is composed of N target pixel coordinates. Based on this, the color expression of the adjusted image after pixel bit reduction can be close to the color expression of the original image. BRIEF DESCRIPTION OF THE DRAWINGS
[0007] In order to make the above-mentioned objects, features and advantages of the present invention more clearly understood, the specific embodiments of the present invention are described in detail below in conjunction with the accompanying drawings, wherein:
[0008] Figure 1 is a block diagram of an image processing device according to an embodiment of the present invention;
[0009] Figure 2 is a flow chart of an image processing method according to an embodiment of the present invention;
[0010] Figure 3 is a schematic diagram of an example of M target coordinate sets and N target pixel coordinates according to an embodiment of the present invention;
[0011] Figure 4 is a schematic diagram of mapping pixels of an original image to one of N target pixel coordinates according to an embodiment of the present invention;
[0012] Figure 5 is a flow chart of converting raw pixel coordinates of a first pixel into classified pixel coordinates corresponding to a first target coordinate set according to an embodiment of the present invention;
[0013] Figure 6 is a schematic diagram of a dither matrix according to an embodiment of the present invention;
[0014] Figure 7 is a flow chart of mapping classified pixel coordinates to one of N target pixel coordinates according to an embodiment of the present invention. DETAILED DESCRIPTION
[0015] Reference will now be made in detail to exemplary embodiments of the present invention, examples of which are illustrated in the accompanying drawings. Whenever possible, the same reference numerals are used in the drawings and the description to refer to the same or like parts.
[0016] Figure 1 is a block diagram of an image processing device according to an embodiment of the present invention. Figure 1 , the image processing device 100 includes a storage device 110 and a processing circuit 120 .
[0017] The storage device 110 is used to store data such as images, instructions, program codes, software components, etc. It can be, for example, any type of fixed or removable random access memory (RAM), read-only memory (ROM), flash memory, hard disk or other similar devices, integrated circuits or combinations thereof.
[0018] The processing circuit 120 may be a central processing unit (CPU), or other programmable general-purpose or special-purpose microprocessor, digital signal processor (DSP), programmable controller, application specific integrated circuit (ASIC), programmable logic device (PLD), integrated circuit or other similar devices or combinations of these devices. In different embodiments, the relevant operations of the processing circuit 120 may be implemented as software, firmware or hardware using general programming languages (such as C or C++), hardware description languages (such as Verilog HDL or VHDL) or other suitable programming languages. In some embodiments, the software (or firmware) may be stored in the storage device 110 so that the processing circuit 120 can access / execute the programming codes of the software (or firmware) to perform the relevant functions.
[0019] Figure 2 is a flowchart of an image processing method according to an embodiment of the present invention. Figure 2 The method of this embodiment is applicable to the image processing device 100 of the above-mentioned embodiment. The following describes the detailed steps of this embodiment in conjunction with the various components in the image processing device 100.
[0020] In step S210, the processing circuit 120 obtains an original image including a plurality of pixels, wherein the plurality of pixels of the original image include a first pixel. The original pixel coordinates of each pixel in the original image include channel components of a plurality of color channels. For example, in the RGB color space, the original pixel coordinates of each pixel in the original image may include a red (R) channel component, a green (G) channel component, and a blue (B) channel component. In some embodiments, each channel component of the original pixel coordinates of each pixel may be represented by a plurality of binary bits. For example, in the RGB color space, assuming that each channel component of the original pixel coordinates is represented by 8 bits, each pixel in the original image is represented by 24 bits. In addition, the first pixel may be any pixel in the original image.
[0021] In step S220 , the storage device 110 records N target pixel coordinates. Specifically, the N target pixel coordinates are recorded in the storage device 110 so that the processing circuit 120 can convert the original image into an adjusted image composed of the N target pixel coordinates.
[0022] In some embodiments, each pixel in the original image has P bits, and N is less than or equal to 2P. For example, if the original image is in RGB888 format, each pixel in the original image has P=24 bits, and the number of target pixel coordinates N is less than or equal to 2P. In addition, in some embodiments, the N target pixel coordinates can be represented by Q bits, and Q is less than P. In some embodiments, 2Q is greater than or equal to N. It can be seen that the number of colors in the original image will be greater than the number of colors in the adjusted image, and the number of pixel bits in the original image will be higher than the number of pixel bits in the adjusted image. It can be seen that the processing circuit 120 can convert the original image with a larger number of colors and a higher number of pixel bits into an adjusted image with a smaller number of colors and a lower number of pixel bits. For example, the processing circuit 120 can convert the original image composed of 224 pixels into an adjusted image composed of 210 pixels. Alternatively, the processing circuit 120 can convert the original image in RGB888 format into a 16-colour adjusted image in CLUT4 format.
[0023] It should be noted that these N target pixel coordinates can form M target coordinate sets, wherein M and N are integers greater than 0. Each of the M target coordinate sets includes at least two of the N target pixel coordinates. In other words, these N target pixel coordinates can be grouped into M target coordinate sets, each target coordinate set including a portion of the N target pixel coordinates. However, the present invention does not limit the number of target coordinate sets and the number of target pixel coordinates included therein, and it can be designed according to practical applications. In some embodiments, under the RGB color coordinates, at least two target pixel coordinates in each target coordinate set are arranged in a collinear manner.
[0024] For example, Figure 3 is a schematic diagram of an example of M target coordinate sets and N target pixel coordinates according to an embodiment of the present invention. Figure 3 , assuming that the processing circuit 120 can convert the original image in RGB888 format into a 16-color adjusted image in CLUT4 format, then N=16 target pixel coordinates C1~C16 can form M=7 target coordinate sets S1~S7. Among them, the target coordinate set S1 includes target pixel coordinates C1, C12, C16 and C2, which are (0,0,0), (128,128,128), (192,192,192) and (255,255,255) respectively. The target coordinate set S2 includes target pixel coordinates C1, C9 and C4, which are (0,0,0), (128,0,0) and (255,0,0) respectively. The target coordinate set S3 includes target pixel coordinates C1, C11 and C7, which are (0,0,0), (0,128,0) and (0,255,0) respectively. The target coordinate set S4 includes target pixel coordinates C1, C14 and C8, which are (0, 0, 0), (0, 0, 128) and (0, 0, 255). The target coordinate set S5 includes target pixel coordinates C1, C10 and C3, which are (0, 0, 0), (128, 128, 0) and (255, 255, 0). The target coordinate set S6 includes target pixel coordinates C1, C13 and C6, which are (0, 0, 0), (128, 0, 128) and (255, 0, 255). The target coordinate set S7 includes target pixel coordinates C1, C15 and C5, which are (0, 0, 0), (0, 128, 128) and (0, 255, 255). However, Figure 3 This is only an exemplary description and is not intended to limit the present invention. In other embodiments, the processing circuit 120 may convert the original image conforming to the RGB888 format into an adjusted image with 32 colors, 64 colors, 128 colors, 256 colors, or other color numbers. Correspondingly, the number N of target pixel coordinates may be 32, 64, 128, 256, or other values.
[0025] In step S230, the processing circuit 120 associates the first pixel with a first target coordinate set in the M target coordinate sets based on the original pixel coordinates of the first pixel using a first classification method. The processing circuit 120 may associate each pixel in the original image with one of the M target coordinate sets using the first classification method. In some embodiments, the processing circuit 120 may classify the first pixel into one of the M target coordinate sets based on a first dithering process. Figure 3 For example, the processing circuit 120 may classify the first pixel into one of seven target coordinate sets.
[0026] In step S240, the processing circuit 120 maps the first pixel to one of the N target pixel coordinates in the first target coordinate set using the second classification method. The processing circuit 120 may map each pixel in the original image to one of the target pixel coordinates in a corresponding target coordinate set using the second classification method. In some embodiments, the processing circuit 120 may classify the first pixel into one of the target pixel coordinates in the first target coordinate set according to the second dithering process.
[0027] See also Figure 4 , which is a schematic diagram of mapping pixels of an original image to one of N target pixel coordinates according to an embodiment of the present invention. Figure 4 For example, two target coordinate sets, class A and class B, are used. Class A includes three target pixel coordinates A1, A2, and A3, and class B includes three target pixel coordinates B1, B2, and B3. The processing circuit 120 may associate the original pixel coordinates 41 of the first pixel with the target coordinate set class A through the first classification method, and obtain the classified pixel coordinates 42 corresponding to the target coordinate set class A. Then, the processing circuit 120 may map the classified pixel coordinates 42 to the target pixel coordinates A2 according to the second classification method. Alternatively, Figure 3 For example, after the processing circuit 120 can classify the first pixel into a target coordinate set S1 among the seven target coordinate sets, the processing circuit 120 can map the first pixel to one of the target pixel coordinates C1, C12, C16 and C2 in the target coordinate set S1.
[0028] In step S250, the processing circuit 120 replaces the original pixel coordinates of the first pixel with one of the N target pixel coordinates to convert the original image into an adjusted image. That is, after the processing circuit 120 determines a target pixel coordinate corresponding to each pixel, the processing circuit 120 can replace the original pixel coordinates of each pixel with the corresponding target pixel coordinates to generate an adjusted image with a smaller number of colors. Correspondingly, in the case where the adjusted image is composed of N target pixel coordinates, the processing circuit 120 can obtain the pixel bits of each pixel on the adjusted image. It can be seen that the number of pixel bits of each pixel on the adjusted image is less than the number of pixel bits of each pixel on the original image. For example, assuming that the processing circuit 120 converts the original image in RGB888 format into a 16-color adjusted image in CLUT4 format, the number of pixel bits of the original image is 24 and the number of pixel bits of the adjusted image is 4.
[0029] The following will further describe possible implementations of the processing circuit 120 mapping the pixels of the original image to one of the N target pixel coordinates according to the original pixel coordinates.
[0030] In some embodiments, the processing circuit 120 may first convert the original pixel coordinates of the first pixel into classified pixel coordinates corresponding to the first target coordinate set, and then map the classified pixel coordinates to one of the N target pixel coordinates.
[0031] Figure 5 is a flow chart of converting the original pixel coordinates of a first pixel into classified pixel coordinates corresponding to a first target coordinate set according to an embodiment of the present invention. Figure 5 , in step S231, the processing circuit 120 obtains a first change threshold corresponding to the first pixel. In some embodiments, the processing circuit 120 may obtain the first change threshold based on a dither matrix (also called a domain value matrix) and the pixel position of the first pixel. In more detail, the processing circuit 120 may determine the first change threshold corresponding to each pixel position based on an m*m dither matrix, where m may be 2, 3, 4 or 8. The m*m dither matrix records m*m preset change thresholds. By tiling multiple m*m dither matrices on the original image, and these dither matrices do not overlap with each other, each pixel position on the original image can correspond to a preset change threshold. The operation of this part is similar to the operation of the existing sequential dithering algorithm, and will not be repeated here.
[0032] For example, Figure 6 is a schematic diagram of a dither matrix according to an embodiment of the present invention. Figure 6, the processing circuit 120 may use an 8*8 dither matrix DM1 to obtain a preset change threshold corresponding to each pixel position. Here, the 8*8 dither matrix DM1 may also be referred to as a Bayer matrix. For example, there are multiple pixels on the original image that correspond to the same preset change threshold 0.
[0033] Then, the processing circuit 120 may calculate a first variable threshold corresponding to the first pixel based on the preset variable threshold corresponding to the first pixel. In some embodiments, the processing circuit 120 may multiply the preset variable threshold corresponding to the first pixel by a configurable coefficient coef, which is, for example, a value between 2 and 4, to obtain the first variable threshold corresponding to the first pixel. In this case, the first variable threshold will be between 0 and 64*coef. Alternatively, in other embodiments, the processing circuit 120 may multiply the preset variable threshold corresponding to the first pixel by the maximum channel component in the original pixel coordinates of the first pixel, and then divide the above product by 64 to obtain the first variable threshold corresponding to the first pixel. In this case, the first variable threshold will be between 0 and the maximum channel component.
[0034] In step S232, the processing circuit 120 associates the first pixel with the first target coordinate set according to the first change threshold and the comparison reference value, and converts the original pixel coordinates of the first pixel into classified pixel coordinates corresponding to the first target coordinate set. Figure 4 As shown, the processing circuit 120 may convert the original pixel coordinates 41 of the first pixel into classified pixel coordinates 42 corresponding to the target coordinate set class A. Specifically, step S232 may be implemented as steps S2321 to S2323.
[0035] In step S2321, the processing circuit 120 determines a comparison reference value based on the maximum channel component in the original pixel coordinates of the first pixel. In some embodiments, the comparison reference value is the maximum channel component in the original pixel coordinates. For example, the original pixel coordinates of the first pixel are (x, y, z) and the maximum channel component is the red channel component x, that is, x>y and x>z. Under this condition, the processing circuit 120 can use the red channel component x as the comparison reference value. Alternatively, in some embodiments, the comparison reference value is the maximum channel component in the original pixel coordinates plus or minus a preset value. In some embodiments, the comparison reference value is the maximum channel component in the original pixel coordinates multiplied by a preset coefficient. The above-mentioned preset values and preset coefficients can be designed according to actual application conditions, and the present invention is not limited to this.
[0036] Afterwards, the processing circuit 120 may add the corresponding first variable threshold to the other channel components in the original pixel coordinates that are not the maximum channel component. The processing circuit 120 will compare the sum of the other channel components in the original pixel coordinates of the first pixel with the first variable threshold and the comparison reference value. For example, the original pixel coordinates of the first pixel are (x, y, z) and the maximum channel component is the red channel component x, that is, x>y and x>z. The processing circuit 120 may add the first variable threshold corresponding to the first pixel to the green channel component y and the blue channel component z of the original pixel coordinates. Then, the processing circuit 120 will compare the sum of the green channel component y of the original pixel coordinates with the first variable threshold and the comparison reference value, and compare the sum of the blue channel component z of the original pixel coordinates with the first variable threshold and the comparison reference value.
[0037] In step S2322, when the sum of the channel component of the original pixel coordinates of the first pixel and the first variable threshold is greater than or equal to the comparison reference value, the processing circuit 120 converts the channel component into the first preset component value of the classified pixel coordinates. In different embodiments, the first preset component value may be the maximum channel component of the original pixel coordinates or the average value of multiple channel components. For example, the original pixel coordinates of the first pixel are (x, y, z) and the maximum channel component is the red channel component x. When the sum of the green channel component y of the original pixel coordinates of the first pixel and the first variable threshold is greater than or equal to the red channel component x (i.e., the comparison reference value), the processing circuit 120 may convert the green channel component y into the maximum channel component and obtain a new green channel component x of the classified pixel coordinates. When the sum of the blue channel component z of the original pixel coordinates of the first pixel and the first variable threshold is greater than or equal to the red channel component x (i.e., the comparison reference value), the processing circuit 120 may convert the blue channel component z into the maximum channel component and obtain a new blue channel component x of the classified pixel coordinates.
[0038] In step S2323, when the sum of the channel component of the original pixel coordinates of the first pixel and the first change threshold is less than the comparison reference value, the processing circuit 120 converts the channel component to a second preset component value of the classified pixel coordinates. The first preset component value is greater than the second preset component value. In some embodiments, the second preset component value may be 0. For example, the original pixel coordinates of the first pixel are (x, y, z) and the maximum channel component is the red channel component x. When the sum of the green channel component y of the original pixel coordinates of the first pixel and the first change threshold is less than the red channel component x (i.e., the comparison reference value), the processing circuit 120 may convert the green channel component y to zero and obtain a new green channel component 0 of the classified pixel coordinates. When the sum of the blue channel component z of the original pixel coordinates of the first pixel and the first change threshold is less than the red channel component x (i.e., the comparison reference value), the processing circuit 120 may convert the blue channel component z to zero and obtain a new blue channel component 0 of the classified pixel coordinates.
[0039] It can be seen that, based on steps S2321 to S2323, the original pixel coordinates of each pixel in the original image will be converted into classified pixel coordinates corresponding to a certain target coordinate set. For example, assuming that the original pixel coordinates of the first pixel are (172, 183, 200) and the first change threshold of the first pixel is 20, then the original pixel coordinates of the first pixel are (172, 183, 200) and will be converted into classified pixel coordinates (0, 200, 200) according to the above operation. For example, assuming that the original pixel coordinates of the first pixel are (172, 183, 200) and the first change threshold of the first pixel is 32, then the original pixel coordinates of the first pixel are (172, 183, 200) and will be converted into classified pixel coordinates (200, 200, 200) according to the above operation.
[0040] That is, assuming that the original pixel coordinates of the first pixel are (x, y, z) and the maximum channel component is the red channel component x, the processing circuit 120 may convert the original pixel coordinates (x, y, z) into one of the classified pixel coordinates (x, x, x), (x, x, 0), (x, 0, x), (x, 0, 0). The classified pixel coordinates (x, x, x), (x, x, 0), (x, 0, x), (x, 0, 0) correspond to different target coordinate sets. Figure 3 For example, the classified pixel coordinates (x, x, x) correspond to a target coordinate set S1 including target pixel coordinates C1, C12, C16 and C2. The classified pixel coordinates (x, x, 0) correspond to a target coordinate set S5 including target pixel coordinates C1, C10 and C3. The classified pixel coordinates (x, 0, x) correspond to a target coordinate set S6 including target pixel coordinates C1, C13 and C6. The classified pixel coordinates (x, 0, 0) correspond to a target coordinate set S2 including target pixel coordinates C1, C9 and C4. Similarly, assuming that the original pixel coordinates of the first pixel are (x, y, z) and the maximum channel component is the green channel component y, the processing circuit 120 may convert the original pixel coordinates (x, y, z) into one of the classified pixel coordinates (y, y, y), (y, y, 0), (0, y, 0), (0, y, y). That is, the processing circuit 120 may convert the original pixel coordinates of the first pixel into classified pixel coordinates corresponding to the first target coordinate set through the first dithering process.
[0041] In some embodiments, the processing circuit 120 may map the classified pixel coordinates to one of the target pixel coordinates in the first target coordinate set according to the distance between the classified pixel coordinates and the target pixel coordinates in the first target coordinate set. The classified pixel coordinate may be mapped to the target pixel coordinate with the shortest distance therebetween.
[0042] In some embodiments, the processing circuit 120 may map the classified pixel coordinates to one of a plurality of target pixel coordinates in the first target coordinate set through a second dithering process. Figure 7 is a flowchart of mapping classified pixel coordinates to one of N target pixel coordinates according to an embodiment of the present invention. Figure 7 , in step S241, the processing circuit 120 obtains the second variable threshold corresponding to the first pixel. In some embodiments, the processing circuit 120 may obtain the second variable threshold based on the dither matrix and the pixel position of the first pixel. In more detail, the processing circuit 120 may determine the second variable threshold corresponding to each pixel position based on the s*s dither matrix, where s may be 2, 3, 4 or 8. The s*s dither matrix records s*s preset variable thresholds. By tiling multiple s*s dither matrices on the original image, and these dither matrices do not overlap with each other, each pixel position on the original image can correspond to a preset variable threshold. Then, the processing circuit 120 may obtain the second variable threshold corresponding to the first pixel based on the preset variable threshold corresponding to the first pixel. The operation of this part is similar to Figure 5 The operation of step S231 is not described in detail here. It should be noted that the dither matrix used in step S231 of the first dithering process may be the same as or different from the dither matrix used in step S241 of the second dithering process.
[0043] In step S242, the processing circuit 120 maps the classified pixel coordinates to one of the N target pixel coordinates in the first target coordinate set according to the second variable threshold. Specifically, the processing circuit 120 may add the first preset component value (e.g., the maximum channel component) of the classified pixel coordinates to the second variable threshold. Thereafter, the processing circuit 120 may map the classified pixel coordinates to a certain target pixel coordinate in the first target coordinate set according to the sum between the first preset component value (e.g., the maximum channel component) of the classified pixel coordinates and the second variable threshold. The processing circuit 120 may compare the sum between the first preset component value (e.g., the maximum channel component) of the classified pixel coordinates and the second variable threshold with the channel component of each target pixel coordinate in the first target coordinate set, and map the classified pixel coordinates to a certain target pixel coordinate in the first target coordinate set according to the comparison result.
[0044] For example, assume that the classified pixel coordinates are (x, 0, 0) and the target pixel coordinates in the first target coordinate set are (0, 0, 0), (128, 0, 0), and (255, 0, 0), respectively. When the sum of the first preset component value x of the classified pixel coordinates and the second change threshold is less than 128, the processing circuit 120 maps the classified pixel coordinates to the target pixel coordinates (0, 0, 0) in the first target coordinate set. When the sum of the first preset component value x of the classified pixel coordinates and the second change threshold is greater than or equal to 128 and less than 255, the processing circuit 120 maps the classified pixel coordinates to the target pixel coordinates (128, 0, 0) in the first target coordinate set. When the sum of the first preset component value x of the classified pixel coordinates and the second change threshold is greater than or equal to 255, the processing circuit 120 maps the classified pixel coordinates to the target pixel coordinates (255, 0, 0) in the first target coordinate set.
[0045] In summary, in the embodiment of the present invention, by mapping multiple pixels of the original image to N target pixel coordinates, an adjusted image consisting of N target pixel coordinates can be generated. After one or two dithering processes, multiple pixels of the original image can be mapped to N target pixel coordinates. Therefore, the embodiment of the present invention can adjust the original image with a high bit number to an adjusted image with a low bit number, thereby greatly saving image transmission bandwidth and being very suitable for electronic devices with limited memory, and can make the color performance quality of the adjusted image good and close to the original image.
[0046] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention 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 replace some or all of the technical features therein with equivalents. 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 invention.
Claims
1. An image processing method, characterized in that: The method comprises: Acquire an original image including a plurality of pixels, wherein the plurality of pixels include a first pixel; Recording N target pixel coordinates, wherein the N target pixel coordinates form M target coordinate sets, wherein M and N are integers greater than 0; Associating the first pixel to a first target coordinate set among the M target coordinate sets using a first classification method according to the original pixel coordinates of the first pixel; Mapping the first pixel to one of the N target pixel coordinates in the first target coordinate set using a second classification method; and The original pixel coordinate of the first pixel is replaced with one of the N target pixel coordinates to convert the original image into an adjusted image.
2. The image processing method according to claim 1, characterized in that: Each of the plurality of pixels has P bits, and N is less than or equal to 2P.
3. The image processing method according to claim 1, characterized in that: Each of the M target coordinate sets includes at least two of the N target pixel coordinates.
4. The image processing method according to claim 1, characterized in that: The step of associating the first pixel to the first target coordinate set of the M target coordinate sets using the first classification method according to the original pixel coordinates of the first pixel comprises: acquiring a first change threshold corresponding to the first pixel; and The first pixel is associated with the first target coordinate set according to the first change threshold and a comparison reference value, and the original pixel coordinates of the first pixel are converted into classified pixel coordinates corresponding to the first target coordinate set.
5. The image processing method according to claim 4, characterized in that: The step of associating the first pixel to the first target coordinate set in the M target coordinate sets using the first classification method according to the original pixel coordinates of the first pixel also includes: The comparison reference value is determined according to a maximum channel component in the original pixel coordinates of the first pixel.
6. The image processing method according to claim 4, characterized in that: The step of obtaining the first change threshold corresponding to the first pixel includes: The first change threshold is obtained according to the dither matrix and the pixel position of the first pixel.
7. The image processing method according to claim 4, characterized in that: The steps of associating the first pixel to the first target coordinate set according to the first change threshold and the comparison reference value, and converting the original pixel coordinates of the first pixel to the classified pixel coordinates corresponding to the first target coordinate set include: When the sum of the channel component of the original pixel coordinates of the first pixel and the first change threshold is greater than or equal to the comparison reference value, converting the channel component to a first preset component value of the classified pixel coordinates; and When the sum of the channel component of the original pixel coordinates of the first pixel and the first change threshold is less than the comparison reference value, the channel component is converted into a second preset component value of the classified pixel coordinates, wherein the first preset component value is greater than the second preset component value.
8. The image processing method according to claim 4, characterized in that: The step of mapping the first pixel to one of the N target pixel coordinates in the first target coordinate set using the second classification method comprises: acquiring a second change threshold corresponding to the first pixel; and According to the second change threshold, the classified pixel coordinates are mapped to one of the N target pixel coordinates in the first target coordinate set.
9. The image processing method according to claim 8, characterized in that: The step of acquiring the second change threshold corresponding to the first pixel comprises: The second change threshold is obtained according to the dither matrix and the pixel position of the first pixel.
10. An image processing device, characterized in that: include: A storage device for recording N target pixel coordinates, wherein the N target pixel coordinates form M target coordinate sets, wherein M and N are integers greater than 0; as well as The processing circuit is coupled to the storage device and is configured to: Acquire an original image including a plurality of pixels, wherein the plurality of pixels include a first pixel; Associating the first pixel to a first target coordinate set among the M target coordinate sets using a first classification method according to the original pixel coordinates of the first pixel; Mapping the first pixel to one of the N target pixel coordinates in the first target coordinate set using a second classification method; as well as The original pixel coordinate of the first pixel is replaced with one of the N target pixel coordinates to convert the original image into an adjusted image.
11. The image processing device according to claim 10, characterized in that: Each of the plurality of pixels has P bits, and N is less than or equal to 2P.
12. The image processing device according to claim 10, characterized in that: Each of the M target coordinate sets includes at least two of the N target pixel coordinates.
13. The image processing device according to claim 10, characterized in that: The processing circuit is configured to: acquiring a first change threshold corresponding to the first pixel; and The first pixel is associated with the first target coordinate set according to the first change threshold and a comparison reference value, and the original pixel coordinates of the first pixel are converted into classified pixel coordinates corresponding to the first target coordinate set.
14. The image processing device according to claim 13, characterized in that: The processing circuit is configured to: The comparison reference value is determined according to a maximum channel component in the original pixel coordinates of the first pixel.
15. The image processing device according to claim 13, characterized in that: The processing circuit is configured to: The first change threshold is obtained according to the dither matrix and the pixel position of the first pixel.
16. The image processing device according to claim 13, characterized in that: The processing circuit is configured to: When the sum of the channel component of the original pixel coordinates of the first pixel and the first change threshold is greater than or equal to the comparison reference value, converting the channel component to a first preset component value of the classified pixel coordinates; as well as When the sum of the channel component of the original pixel coordinates of the first pixel and the first change threshold is less than the comparison reference value, the channel component is converted into a second preset component value of the classified pixel coordinates, wherein the first preset component value is greater than the second preset component value.
17. The image processing device according to claim 13, characterized in that: The processing circuit is configured to: acquiring a second change threshold corresponding to the first pixel; and According to the second change threshold, the classified pixel coordinates are mapped to one of the N target pixel coordinates in the first target coordinate set.
18. The image processing device according to claim 17, characterized in that: The processing circuit is configured to: The second change threshold is obtained according to the dither matrix and the pixel position of the first pixel.
