Image processing method, device, non-volatile storage medium and computer equipment

By adjusting the adjacent color values ​​and reading order of pixel points in the image processing method, combining the jitter algorithm and the FRC algorithm, the color distortion and flicker problems caused by the jitter algorithm of the video image are solved, and the image display effect is improved.

CN118864299BActive Publication Date: 2024-12-27LEYARD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411325804.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-09-23
Publication Date
2024-12-27
Estimated Expiration
2044-09-23

AI Technical Summary

Technical Problem

Existing video image jitter algorithms can easily cause color distortion and flicker when adjusting the image color depth, especially in rapidly changing scenarios, which cannot effectively solve the problem of poor image display effect.

Method used

By obtaining the initial color value of pixel points in the initial image, determining the adjacent pixel points according to the arrangement order, and adjusting the color value of adjacent pixel points, combining the jitter algorithm and the FRC algorithm, selecting the close color value at the target color depth, and in turn Read adjacent color values ​​to display the target image.

Benefits of technology

It has achieved the improvement of the video image display effect, made up for the defects caused by single algorithm processing, solved the problem of color distortion, and improved the display quality of the image.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118864299B_ABST
    Figure CN118864299B_ABST
Patent Text Reader

Abstract

The present invention discloses an image processing method, device, non-volatile storage medium and computer equipment. The method comprises: obtaining initial color values ​​corresponding to each of a plurality of pixels in an initial image; determining adjacent pixels corresponding to each of the plurality of pixels according to the arrangement order of the plurality of pixels in the initial image; adjusting the initial color values ​​corresponding to the adjacent pixels corresponding to each of the plurality of pixels according to the initial color values ​​corresponding to each of the plurality of pixels, and obtaining new color values ​​corresponding to each of the plurality of pixels; selecting two adjacent color values ​​close to the new color values ​​corresponding to each of the plurality of pixels from the color values ​​corresponding to the target color depth; and reading two adjacent color values ​​corresponding to each of the plurality of pixels in sequence according to a preset reading order, and displaying the target image. The present invention solves the technical problem that the image display effect is poor due to the phenomenon of color distortion caused by adjusting the color depth of the image.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of image processing, and in particular to an image processing method, an apparatus, a non-volatile storage medium and a computer device. Background Art

[0002] Dither algorithm is a commonly used technology in the field of image processing, which is mainly used to convert high color depth images into low color depth images. In the existing technology, there are many implementation methods of video image dithering algorithms, such as space-based Error Diffusion Dithering algorithm and time-based FRC (Frame Rate Control) algorithm.

[0003] However, using a single video image dithering algorithm may cause problems such as image color distortion and strong sense of color transition fragmentation. For example, using only the error diffusion dithering algorithm may not provide the best effect for certain types of images, such as images with more high-frequency details. In some cases, especially in areas with smoother color transitions, the error diffusion dithering algorithm may even cause color distortion; using only the FRC algorithm may introduce flickering or other time domain artifacts, especially in fast-changing scenes. Since the FRC algorithm relies on the visual persistence effect of the human eye, it may not be as good as the high color depth effect supported by the hardware in some cases.

[0004] To address the above-mentioned problems, no effective solution has been proposed yet. Summary of the invention

[0005] The embodiments of the present invention provide an image processing method, apparatus, non-volatile storage medium and computer equipment to at least solve the technical problem that when adjusting the color depth of an image, the image is distorted in color, resulting in poor image display effect.

[0006] According to one aspect of an embodiment of the present invention, there is provided an image processing method, comprising: obtaining initial color values ​​corresponding to each of a plurality of pixels in an initial image, wherein the initial color values ​​are color values ​​corresponding to an initial color depth; determining adjacent pixels corresponding to each of the plurality of pixels according to an arrangement order of the plurality of pixels in the initial image; adjusting the initial color values ​​corresponding to adjacent pixels corresponding to each of the plurality of pixels according to the initial color values ​​corresponding to each of the plurality of pixels to obtain new color values ​​corresponding to each of the plurality of pixels; selecting two adjacent color values ​​close to the new color values ​​corresponding to each of the plurality of pixels from the color values ​​corresponding to a target color depth; and reading two adjacent color values ​​corresponding to each of the plurality of pixels in sequence according to a preset reading order to display a target image.

[0007] Optionally, adjacent pixel points corresponding to each of the multiple pixel points are determined according to an arrangement order of the multiple pixel points in the initial image, including: determining a selection method of the adjacent pixel points corresponding to each of the multiple pixel points according to a preset pixel adjustment order; and determining the adjacent pixel points corresponding to each of the multiple pixel points based on the arrangement order and the selection method.

[0008] Optionally, according to the initial color values ​​corresponding to each of the multiple pixel points, the initial color values ​​corresponding to the adjacent pixel points corresponding to each of the multiple pixel points are adjusted to obtain new color values ​​corresponding to each of the multiple pixel points, including: according to the initial color values ​​corresponding to each of the multiple pixel points, in accordance with a preset pixel adjustment order, color diffusion values ​​corresponding to the adjacent pixel points corresponding to each of the multiple pixel points are determined in sequence; according to the color diffusion values ​​corresponding to the adjacent pixel points corresponding to each of the multiple pixel points, the initial color values ​​corresponding to the adjacent pixel points corresponding to each of the multiple pixel points are adjusted to obtain new color values ​​corresponding to each of the multiple pixel points.

[0009] Optionally, according to the initial color values ​​corresponding to each of the multiple pixel points, according to a preset pixel adjustment order, the color diffusion values ​​corresponding to the adjacent pixel points corresponding to each of the multiple pixel points are determined in sequence, including: based on the initial color values ​​corresponding to each of the multiple pixel points, determining the intermediate color values ​​corresponding to each of the multiple pixel points; calculating the difference between the initial color values ​​corresponding to each of the multiple pixel points and the intermediate color values ​​corresponding to each of the multiple pixel points; calculating the product of the difference corresponding to each of the multiple pixel points and a preset ratio to obtain the color diffusion values ​​corresponding to the adjacent pixel points corresponding to each of the multiple pixel points.

[0010] Optionally, based on the initial color values ​​corresponding to the multiple pixels, intermediate color values ​​corresponding to the multiple pixels are determined, including: based on the target color depth, multiple color intervals are determined; among the multiple color intervals, the color intervals corresponding to the initial color values ​​corresponding to the multiple pixels are determined; and the intermediate values ​​of the color intervals corresponding to the multiple pixels are determined as the intermediate color values ​​corresponding to the multiple pixels.

[0011] Optionally, according to a preset reading order, two adjacent color values ​​corresponding to each of the multiple pixels are read in sequence to display a target image, including: determining the quantity ratio of the two adjacent color values ​​corresponding to each of the multiple pixels based on the new color values ​​corresponding to each of the multiple pixels and the two adjacent color values ​​corresponding to each of the multiple pixels; determining the read quantity of the two adjacent color values ​​corresponding to each of the multiple pixels based on the quantity ratio of the two adjacent color values ​​corresponding to each of the multiple pixels; based on the read quantity of the two adjacent color values ​​corresponding to each of the multiple pixels, read the two adjacent color values ​​corresponding to each of the multiple pixels in sequence according to the reading order to display the target image.

[0012] Optionally, based on the new color values ​​corresponding to each of the multiple pixels and the two adjacent color values ​​corresponding to each of the multiple pixels, the quantity ratios of the two adjacent color values ​​corresponding to each of the multiple pixels are determined, including: respectively calculating the difference between the two adjacent color values ​​corresponding to each of the multiple pixels and the new color values ​​corresponding to the multiple pixels as the first difference between the two adjacent color values ​​corresponding to each of the multiple pixels; calculating the difference between the two adjacent color values ​​corresponding to each of the multiple pixels as the second difference between the multiple pixels; and determining the quantity ratios of the two adjacent color values ​​corresponding to each of the multiple pixels based on the ratio of the first difference between the two adjacent color values ​​corresponding to each of the multiple pixels to the second difference between the multiple pixels.

[0013] Optionally, an initial video is obtained; the initial video is divided into multiple frames of images, wherein the initial image is one frame of the multiple frames of images; the multiple frames of images are sequentially subjected to the above-mentioned step of sequentially reading two adjacent color values ​​corresponding to each of the multiple pixels according to a preset reading order, and displaying the target image, displaying multiple frames of target images, and obtaining a target video.

[0014] According to another aspect of an embodiment of the present invention, an image processing device is also provided, including: an acquisition module, used to acquire initial color values ​​corresponding to each of a plurality of pixels in an initial image, wherein the initial color values ​​are color values ​​corresponding to an initial color depth; a determination module, used to determine adjacent pixel points corresponding to each of the plurality of pixels according to an arrangement order of the plurality of pixels in the initial image; an adjustment module, used to adjust the initial color values ​​corresponding to adjacent pixel points corresponding to each of the plurality of pixels according to the initial color values ​​corresponding to each of the plurality of pixels, so as to obtain new color values ​​corresponding to each of the plurality of pixels; a selection module, used to select two adjacent color values ​​close to the new color values ​​corresponding to each of the plurality of pixels from the color values ​​corresponding to a target color depth; and a reading module, used to read two adjacent color values ​​corresponding to each of the plurality of pixels in sequence according to a preset reading order, so as to display a target image.

[0015] According to another aspect of an embodiment of the present invention, a non-volatile storage medium is provided. The non-volatile storage medium includes a stored program, wherein when the program is running, the device where the non-volatile storage medium is located is controlled to execute any one of the above-mentioned image processing methods.

[0016] According to yet another aspect of an embodiment of the present invention, a computer device is provided. The computer device includes a processor, and the processor is used to run a program. When the program is run, any one of the above-mentioned image processing methods is executed.

[0017] According to yet another aspect of the embodiments of the present invention, a computer program product is provided, including a computer program, and when the computer program is executed by a processor, any one of the above-mentioned image processing methods is implemented.

[0018] In an embodiment of the present invention, an image processing method is adopted, by obtaining initial color values ​​corresponding to multiple pixels in an initial image, wherein the initial color values ​​are color values ​​corresponding to the initial color depth; determining adjacent pixels corresponding to the multiple pixels according to the arrangement order of the multiple pixels in the initial image; adjusting the initial color values ​​corresponding to the adjacent pixels corresponding to the multiple pixels according to the initial color values ​​corresponding to the multiple pixels to obtain new color values ​​corresponding to the multiple pixels; selecting two adjacent color values ​​close to the new color values ​​corresponding to the multiple pixels from the color values ​​corresponding to the target color depth; and reading two adjacent color values ​​corresponding to the multiple pixels in sequence according to a preset reading order to display the target image, thereby achieving the purpose of combining the dithering algorithm with the FRC algorithm to make up for the defects caused by using a single algorithm to process the image, thereby achieving the technical effect of improving the display effect of the video image, and further solving the technical problem of poor image display effect caused by color distortion caused by adjusting the color depth of the image. BRIEF DESCRIPTION OF THE DRAWINGS

[0019] The drawings described herein are used to provide a further understanding of the present invention and constitute a part of this application. The exemplary embodiments of the present invention and their descriptions are used to explain the present invention and do not constitute an improper limitation of the present invention. In the drawings:

[0020] Figure 1 A hardware structure block diagram of a computer terminal for implementing an image processing method is shown;

[0021] Figure 2 is a flowchart of an image processing method provided according to an embodiment of the present invention;

[0022] Figure 3 is a flowchart of a method for processing video color depth according to an optional embodiment of the present invention;

[0023] Figure 4 is a structural block diagram of an image processing device provided according to an embodiment of the present invention. DETAILED DESCRIPTION

[0024] In order to enable those skilled in the art to better understand the scheme of the present invention, the technical scheme in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present invention.

[0025] It should be noted that the terms "first", "second", etc. in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.

[0026] According to an embodiment of the present invention, an image processing method embodiment is provided. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and although a logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that shown here.

[0027] The method embodiment provided in the first embodiment of the present application can be executed in a mobile terminal, a computer terminal or a similar computing device. Figure 1 FIG. 1 shows a hardware structure block diagram of a computer terminal for implementing an image processing method. Figure 1 As shown, the computer terminal 10 may include one or more (102a, 102b, ..., 102n are used to illustrate) processors (the processor may include but is not limited to a processing device such as a microprocessor MCU or a programmable logic device FPGA), a memory 104 for storing data. In addition, it may also include: a display, an input / output interface (I / O interface), a universal serial bus (USB) port (which may be included as one of the ports of the BUS bus), a network interface, a power supply and / or a camera. It can be understood by those skilled in the art that Figure 1 The structure shown is only for illustration and does not limit the structure of the above electronic device. Figure 1 More or fewer components as shown, or with Figure 1Different configurations shown.

[0028] It should be noted that the one or more processors and / or other data processing circuits described above may generally be referred to herein as "data processing circuits". The data processing circuits may be embodied in whole or in part as software, hardware, firmware, or any other combination thereof. In addition, the data processing circuit may be a single independent processing module, or may be incorporated in whole or in part into any of the other components in the computer terminal 10. As described in the embodiments of the present application, the data processing circuit acts as a processor control (e.g., selection of a variable resistor terminal path connected to an interface).

[0029] The memory 104 can be used to store software programs and modules of application software, such as program instructions / data storage devices corresponding to the image processing method in the embodiment of the present invention. The processor executes various functional applications and data processing by running the software programs and modules stored in the memory 104, that is, the image processing method of the above-mentioned application is realized. The memory 104 may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some examples, the memory 104 may further include a memory remotely arranged relative to the processor, and these remote memories may be connected to the computer terminal 10 via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.

[0030] The display may be, for example, a touch screen liquid crystal display (LCD) that enables a user to interact with a user interface of the computer terminal 10 .

[0031] Figure 2 is a flow chart of an image processing method according to an embodiment of the present invention. Figure 2 As shown, the method comprises the following steps:

[0032] Step S201, obtaining initial color values ​​corresponding to a plurality of pixel points in an initial image, wherein the initial color value is a color value corresponding to an initial color depth.

[0033] In this step, the initial image can be a single image or a frame of an image in a video, and the initial color value obtained is the color value corresponding to the initial color depth, where the color value refers to the RGB value, which is a numerical representation for representing color based on three basic colors: red, green, and blue. The format of the RGB color value can be expressed as (r, g, b), where 'r' represents the red component, 'g' represents the green component, and 'b' represents the blue component. The value of each component can range from 0 to 255, where 0 represents the minimum intensity of the color component and 255 represents the maximum intensity. For example, pure red can be represented by (255, 0, 0), pure green can be represented by (0, 255, 0), and pure blue can be represented by (0, 0, 255).

[0034] The color depth of an image, also known as the number of color bits or bit depth, refers to the number of colors that can be represented by each pixel in a digital image. The color depth is measured in bits and determines the types of colors that can be represented in an image. The higher the color depth, the richer the colors of the image that can be represented and the finer the details. For example, 1-bit color depth corresponds to only two colors, usually black and white, and an image with 1-bit color depth is presented as a binary image; 8-bit color depth can represent 256 (2^8) colors. Images with 8-bit color depth are suitable for some simple graphics and icons, but the colors may not be rich enough for color photos. At different color depths, due to the different types of colors that can be displayed, the corresponding RGB values ​​used to represent colors are also different. For example, at high color depths, the value of each RGB component can be any one from 0 to 255. However, at low color depths, due to the limited types of colors that can be displayed, the value of each RGB component can only be selected from 0 to 255.

[0035] Step S202: determining adjacent pixel points corresponding to each of the plurality of pixel points according to the arrangement order of the plurality of pixel points in the initial image.

[0036] In this step, in the initial image, the pixels are usually arranged in the form of a matrix, so there are multiple ways to select the adjacent pixels in the matrix. For example, the points at the lower left, directly below, lower right and directly right of the target pixel can be selected as the adjacent pixels of the target pixel, or the points at the directly left, lower left, directly below and lower right can be selected as the adjacent pixels of the target pixel. Specifically, the selection method of the adjacent pixels can be determined by the diffusion matrix corresponding to the algorithm. Different algorithms correspond to different diffusion matrices, and the order of adjusting the color values ​​of the pixels corresponding to different diffusion matrices is also different.

[0037] Step S203, adjusting the initial color values ​​corresponding to the adjacent pixels corresponding to the plurality of pixels according to the initial color values ​​corresponding to the plurality of pixels, to obtain new color values ​​corresponding to the plurality of pixels.

[0038] In this step, the adjustment of the initial color value can be implemented based on a spatial dithering algorithm. For example, an error diffusion dithering algorithm can be used to work by distributing the quantization error of a pixel proportionally to the surrounding pixels to reduce the impact of the quantization error on the visual quality of the image, which helps to mix colors more smoothly, thereby creating the illusion of more colors; a regular dithering algorithm can also be used, and a periodic, determined dithering matrix is ​​used in the dithering process. The dithering matrix can also be called a dithering template. By placing the dithering matrix in a sub-region of the target image, each pixel in the region corresponds to each threshold in the dithering matrix one by one, and the final display value of the pixel is determined by comparing the pixel value with the threshold; a random dithering algorithm can also be used to simulate more color levels by randomly adding noise to the image. The dithering value of each pixel is generated by a random number generator, and these random numbers are usually based on a certain probability distribution.

[0039] Step S204 , selecting two adjacent color values ​​close to the new color values ​​corresponding to the plurality of pixels from the color values ​​corresponding to the target color depth.

[0040] In this step, the number of color values ​​that can be obtained at the target color depth is less than the number of color values ​​that can be obtained at the initial color depth. Therefore, in order to convert the new color values ​​corresponding to each of the multiple pixels at the initial color depth to the target color depth, the new color values ​​that are closest to each of the multiple pixels at the target color depth can be selected. Based on the intervals of the color values ​​at the target color depth, the intervals corresponding to the new color values ​​can be obtained, each interval corresponding to a color value at the target color depth, and the interval corresponding to the new color value and the adjacent nearest interval are determined, and the color values ​​corresponding to the two intervals at the target color depth are selected as two adjacent color values. Therefore, two adjacent color values ​​of different sizes can be mixed to display a color effect similar to the new color values ​​corresponding to each of the multiple pixels.

[0041] Step S205 , reading two adjacent color values ​​corresponding to each of the plurality of pixels in sequence according to a preset reading order, and displaying a target image.

[0042] In this step, the target image is displayed by reading two different color values ​​in sequence, which is based on the principle of the FRC algorithm. The FRC (Frame Rate Control) algorithm, i.e., the frame rate control algorithm, is a pixel jitter algorithm widely used in display technology. It mainly uses the physiological characteristics of visual inertia of the human eye and realizes the display of the target color value through temporal color mixing technology, so that a display effect similar to that under a higher color depth can be achieved at a low color depth. The core of the FRC algorithm is to use the visual inertia of the human eye to brightness changes. When the color value of the pixel point in the image changes rapidly in a short period of time, the human eye will not immediately perceive this change, but will average the rapidly changing color value signal to perceive an image with an intermediate color value. The color mixing can be achieved by alternately displaying different color values ​​between multiple frames, and the visual persistence effect of the human eye is used to increase the color depth perceived by the human eye. Therefore, two adjacent color values ​​can be displayed in sequence according to a preset order, so that the human eye can perceive the required intermediate color value, wherein the preset order can be random, or can be determined according to the size of the color value, or can be determined according to the number of two color values.

[0043] Through the above steps, the purpose of combining the dithering algorithm and the FRC algorithm to make up for the defects caused by using a single algorithm to process the image is achieved, thereby achieving the technical effect of improving the video image display effect, and further solving the technical problem of poor image display effect caused by color distortion when adjusting the color depth of the image.

[0044] As an optional embodiment, adjacent pixel points corresponding to each of the multiple pixel points are determined according to the arrangement order of the multiple pixel points in the initial image, including: determining a selection method for the adjacent pixel points corresponding to each of the multiple pixel points according to a preset pixel adjustment order; and determining the adjacent pixel points corresponding to each of the multiple pixel points based on the arrangement order and the selection method.

[0045] Optionally, there are multiple options for the adjustment order of pixels. For example, a row-by-row and column-by-column adjustment order can be used, which is the most direct and common adjustment order. Starting from the upper left corner of the image, it is adjusted downward row by row, and each pixel in each row is adjusted from left to right. A spiral adjustment order can also be used, starting from the center of the image, and adjusting each pixel in a spiral manner outward. This adjustment order can help diffuse the error more evenly, but it is relatively complex to implement. The adjustment order can also be customized according to specific needs. For example, according to the specific features or needs of the image, you can choose to adjust a certain area of ​​the image first, and then adjust other areas. The choice of adjustment order can affect the effect and performance of the algorithm. In practical applications, it is necessary to select a suitable order based on specific needs and image features.

[0046] According to different adjustment orders, in order to avoid affecting the pixels that have been adjusted, the method of selecting adjacent pixels is also different. For example, when the adjustment order starts from the upper left corner of the image, adjusts row by row downward, and adjusts each pixel from left to right in each row, in order not to affect the last adjusted pixel, the adjacent pixels that can be selected are the lower left, directly below, lower right, and directly right; when the adjustment order starts from the upper right corner of the image, adjusts row by row downward, and adjusts each pixel from right to left in each row, the adjacent pixels that can be selected are directly left, lower left, directly below, and lower right.

[0047] As an optional embodiment, according to the initial color values ​​corresponding to each of the multiple pixel points, the initial color values ​​corresponding to the adjacent pixel points corresponding to each of the multiple pixel points are adjusted to obtain new color values ​​corresponding to each of the multiple pixel points, including: according to the initial color values ​​corresponding to each of the multiple pixel points, in accordance with a preset pixel adjustment order, the color diffusion values ​​corresponding to the adjacent pixel points corresponding to each of the multiple pixel points are determined in sequence; according to the color diffusion values ​​corresponding to the adjacent pixel points corresponding to each of the multiple pixel points, the initial color values ​​corresponding to the adjacent pixel points corresponding to each of the multiple pixel points are adjusted to obtain new color values ​​corresponding to each of the multiple pixel points.

[0048] Optionally, the adjustment of the initial color values ​​of each of the multiple pixel points can be achieved by an error diffusion algorithm. Specifically, first, according to a preset adjustment order, the first point is extracted for processing; then, based on the initial color depth and the target color depth, the color diffusion value of the first point can be determined; then, the color diffusion value is diffused to the initial color values ​​of the selected adjacent pixel points; finally, according to the preset adjustment order, each pixel point in the image is adjusted from the first point in turn, and finally a new color value corresponding to each pixel point can be obtained.

[0049] As an optional embodiment, according to the initial color values ​​corresponding to each of the multiple pixels, in accordance with a preset pixel adjustment order, the color diffusion values ​​corresponding to the adjacent pixels corresponding to each of the multiple pixels are determined in sequence, including: based on the initial color values ​​corresponding to each of the multiple pixels, determining the intermediate color values ​​corresponding to each of the multiple pixels; calculating the difference between the initial color values ​​corresponding to each of the multiple pixels and the intermediate color values ​​corresponding to each of the multiple pixels; calculating the product of the difference corresponding to each of the multiple pixels and a preset ratio to obtain the color diffusion values ​​corresponding to the adjacent pixels corresponding to each of the multiple pixels.

[0050] Optionally, determining the color diffusion values ​​corresponding to adjacent pixels can be achieved by calculating the quantization error. First, multiple color intervals can be determined based on the target color depth. Within the multiple intervals, the intervals corresponding to the initial color values ​​corresponding to the multiple pixels are determined, and then the intermediate values ​​of the corresponding intervals can be used as the intermediate color values ​​corresponding to the intervals. Select the intermediate color value corresponding to the initial color value of the first pixel; then, subtract the intermediate color value from the initial color value to obtain an error value. It should be noted that the error value can be a positive number or a negative number; finally, multiply the error value by a preset ratio to obtain the color diffusion value corresponding to each adjacent pixel, where different algorithms have different corresponding ratios. For example, the Floyd-Steinberg algorithm can be used, and the diffusion ratio used is expressed in the form of a matrix as follows:

[0051] *7 / 16

[0052] 3 / 16 5 / 16 1 / 16

[0053] Among them, “*” represents the pixel to be adjusted, and “7 / 16”, “3 / 16”, “5 / 16” and “1 / 16” represent the diffusion ratios corresponding to adjacent pixel points, that is, the preset ratios.

[0054] As an optional embodiment, based on the initial color values ​​corresponding to the multiple pixels, the intermediate color values ​​corresponding to the multiple pixels are determined, including: based on the target color depth, determining multiple color intervals; determining, among the multiple color intervals, the color intervals corresponding to the initial color values ​​corresponding to the multiple pixels; and determining the intermediate values ​​of the color intervals corresponding to the multiple pixels as the intermediate color values ​​corresponding to the multiple pixels.

[0055] Optionally, the color value range of each channel number is 0~255, but the types of colors that can be represented at different color depths are different. For example, for an image with a color depth of 2 bits, although the color value range of a channel is 0~255, 0~255 needs to be divided into 4 intervals, and each interval will only represent one color to meet the color depth requirements. For another example, if the color depth is 4 bits, 0~255 needs to be divided into 16 intervals. Therefore, multiple color intervals can be determined based on the target color depth, and then the middle value of each color interval can be used as the middle color value corresponding to the interval. By determining the color intervals corresponding to the initial color values ​​corresponding to each of the multiple pixels, the middle color values ​​corresponding to each of the multiple pixels can be determined, thereby achieving the purpose of converting the color depth.

[0056] As an optional embodiment, according to a preset reading order, two adjacent color values ​​corresponding to each of the multiple pixels are read in sequence to display a target image, including: determining the respective quantity ratios of the two adjacent color values ​​corresponding to each of the multiple pixels based on the new color values ​​corresponding to each of the multiple pixels and the two adjacent color values ​​corresponding to each of the multiple pixels; determining the respective read quantities of the two adjacent color values ​​corresponding to each of the multiple pixels based on the respective quantity ratios of the two adjacent color values ​​corresponding to each of the multiple pixels; based on the respective read quantities of the two adjacent color values ​​corresponding to each of the multiple pixels, read the two adjacent color values ​​corresponding to each of the multiple pixels in sequence according to the reading order to display the target image.

[0057] Optionally, based on the new color values ​​corresponding to each of the multiple pixels and the two adjacent color values ​​corresponding to each of the multiple pixels, the quantity ratio of the two color values ​​corresponding to each pixel can be calculated. Generally speaking, the two color values ​​are different, and the quantity ratios corresponding to each of them are also different, and the sum of the quantity ratios of the two color values ​​is 1. According to the quantity ratios of the two adjacent color values ​​and the total number of color values ​​that can be stored, the quantities corresponding to the two adjacent color values ​​can be calculated respectively, wherein the number of memories can be used as the total number occupied by the two adjacent color values, and a memory stores a color value corresponding to all pixels of a frame of image. Finally, according to the reading order, two different adjacent color values ​​are read out and displayed alternately, and the visual inertia of the human eye can be used to achieve a mixed color visual effect, and the target image at a low color depth is displayed, and the target image has a visual effect similar to the initial image at a high color depth.

[0058] As an optional embodiment, based on the new color values ​​corresponding to each of the multiple pixels and the two adjacent color values ​​corresponding to each of the multiple pixels, the quantity ratio of the two adjacent color values ​​corresponding to each of the multiple pixels is determined, including: respectively calculating the difference between the two adjacent color values ​​corresponding to each of the multiple pixels and the new color values ​​corresponding to the multiple pixels as the first difference corresponding to the two adjacent color values ​​corresponding to the multiple pixels; calculating the difference between the two adjacent color values ​​corresponding to each of the multiple pixels as the second difference corresponding to the multiple pixels; based on the ratio of the first difference between the two adjacent color values ​​corresponding to each of the multiple pixels to the second difference corresponding to the multiple pixels, the quantity ratio of the two adjacent color values ​​corresponding to each of the multiple pixels is determined.

[0059] Optionally, the difference between two adjacent color values ​​and the new color value, and the difference between two adjacent color values ​​can be calculated respectively; then, the ratio of the two differences corresponding to the two adjacent color values ​​is calculated respectively, that is, the difference between the two and the new color value / the difference between the two, to obtain the quantity ratio corresponding to the two adjacent color values.

[0060] As an optional embodiment, an initial video is obtained; the initial video is divided into multiple frames of images, wherein the initial image is one frame of the multiple frames of images; the multiple frames of images are sequentially subjected to the above-mentioned step of sequentially reading two adjacent color values ​​corresponding to each of the multiple pixels according to a preset reading order, and displaying the target image, displaying multiple frames of target images, and obtaining the target video.

[0061] Optionally, in this embodiment, the processing method for a frame of image can be applied to a video. For example, the video to be processed is divided into multiple frames of images, starting from the first frame of image, the image processing steps in the above embodiment are sequentially performed to obtain each frame of processed image, and finally the color values ​​corresponding to the pixels are sequentially read, and the processed multiple frames of image are displayed to obtain the final target video.

[0062] As an optional embodiment, the present invention provides a process for processing the color depth of an image in a video frame by frame. Figure 3 is a flowchart of a method for processing video color depth according to an optional embodiment of the present invention. Figure 3 As shown, the specific steps are as follows:

[0063] S1: Capture the first frame of the video.

[0064] S2: Determine the color depth of the image and the required color depth. For example, the color depth of the image is 8 bits and the required color depth is 4 bits.

[0065] S3: Extract the first point in the upper left corner of the image and perform error diffusion processing.

[0066] S31: Calculate the RGB value corresponding to the RGB value of the point at the low color depth. For example, the initial color value of the point in the R channel is 12, which is between 0 and 15 at the 8-bit color depth, and the color value interval corresponding to the 4-bit color depth is the first interval. Therefore, the color value corresponding to the point at the low color depth is 0, that is, the middle color value.

[0067] S32: When converting from a high color depth to a low color depth, an error value is generated, and the original value - conversion value = error value. For example, the initial color value is 12, and the conversion value, that is, the intermediate color value is 0, so the error value is 12-0=12.

[0068] S33: Error diffusion is performed in the form of error diffusion dithering and added to the original image RGB value. For example, assuming that the Floyd-Steinberg algorithm is used, the diffusion matrix is ​​as follows:

[0069] *7 / 16

[0070] 3 / 16 5 / 16 1 / 16

[0071] The error value of the first point is 12, and the initial color value of the point to the right of the first point is 13. According to the error diffusion principle, the error value is diffused to the point to the right in proportion, that is, the color value received by the point to the right is 12*(7 / 16)=21 / 4. Therefore, the updated color value of the point to the right is 13+21 / 4=73 / 4. Subsequent processing of the point to the right is based on the updated color value.

[0072] S34: Traverse all points in the image.

[0073] S4: After the above error diffusion processing, the new color value of each point is obtained, and the two color values ​​corresponding to the new color value of each point at the low color depth are selected, and the difference between the two and the original value (i.e., the new color value) is calculated respectively / the difference between the two = deviation ratio, assuming that the deviation ratio of one point is a, then the other should be 1-a. For example, based on the color value at 4-bit color depth, the range of the new color value is 0~15, such as the first point is 0, the second point is 1, the two color values ​​corresponding to the first point are 0 and 1, and the two color values ​​corresponding to the second point are 0 and 2, then the deviation ratios of the first point are 0 and 1, and the deviation ratios of the second point are 1 / 2 and 1 / 2 respectively.

[0074] S5: According to the deviation ratio calculated for each point, the two values ​​calculated for each point are alternately stored in the memory according to their respective deviation ratios * memory number n = storage number. For example, there are 4 memories in total, and the deviations of the second point are 1 / 2 and 1 / 2 respectively, then the corresponding storage numbers are 2 and 2, that is, the color value 0 is stored in 2 memories, and the color value 2 is also stored in 2 memories.

[0075] S6: Read the value of each memory in sequence for display. Each memory stores a close color value of all points of a frame of image. The reading order has little effect on the display result. By reading the value of each memory in sequence, the required low color depth image can be displayed.

[0076] S7: Traverse each frame.

[0077] It should be noted that, for the above-mentioned method embodiments, for the sake of simplicity, they are all described as a series of action combinations, but those skilled in the art should know that the present invention is not limited by the described action sequence, because according to the present invention, certain steps can be performed in other sequences or simultaneously. Secondly, those skilled in the art should also know that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily required by the present invention.

[0078] Through the description of the above implementation methods, those skilled in the art can clearly understand that the image processing method according to the above embodiment can be implemented by means of software plus a necessary general hardware platform, and of course can also be implemented by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present invention is essentially or the part that contributes to the prior art can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk), and includes a number of instructions for a terminal device (which can be a mobile phone, computer, server, or network device, etc.) to execute the methods described in each embodiment of the present invention.

[0079] According to an embodiment of the present invention, there is also provided an image processing device for implementing the above image processing method. Figure 4 is a structural block diagram of an image processing device provided according to an embodiment of the present invention. Figure 4 As shown, the image processing device includes: an acquisition module 41, a determination module 42, an adjustment module 43, a selection module 44 and a reading module 45. The image processing device is described below.

[0080] The acquisition module 41 is used to acquire initial color values ​​corresponding to a plurality of pixel points in the initial image, wherein the initial color value is a color value corresponding to an initial color depth.

[0081] The determination module 42 is connected to the acquisition module 41 and is used to determine the adjacent pixel points corresponding to each of the plurality of pixel points according to the arrangement order of the plurality of pixel points in the initial image.

[0082] The adjustment module 43 is connected to the determination module 42 and is used to adjust the initial color values ​​corresponding to the adjacent pixels corresponding to the multiple pixels according to the initial color values ​​corresponding to the multiple pixels to obtain new color values ​​corresponding to the multiple pixels.

[0083] The selection module 44 is connected to the adjustment module 43 and is used to select two adjacent color values ​​close to the new color values ​​corresponding to the multiple pixels from the color values ​​corresponding to the target color depth.

[0084] The reading module 45 is connected to the selecting module 44 and is used to read two adjacent color values ​​corresponding to each of the plurality of pixels in sequence according to a preset reading order to display a target image.

[0085] It should be noted that the acquisition module 41, the determination module 42, the adjustment module 43, the selection module 44 and the reading module 45 correspond to steps S201 to S205 in the embodiment, and the examples and application scenarios implemented by the multiple modules and the corresponding steps are the same, but are not limited to the contents disclosed in the above embodiment. It should be noted that the above modules as part of the device can be run in the computer terminal 10 provided in the embodiment.

[0086] An embodiment of the present invention may provide a computer device. Optionally, in this embodiment, the computer device may be located in at least one network device among multiple network devices of a computer network. The computer device includes a memory and a processor.

[0087] Among them, the memory can be used to store software programs and modules, such as program instructions / modules corresponding to the image processing method and device in the embodiment of the present invention. The processor executes various functional applications and data processing by running the software programs and modules stored in the memory, that is, realizing the above-mentioned image processing method. The memory may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some instances, the memory may further include a memory remotely arranged relative to the processor, and these remote memories may be connected to the computer terminal via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.

[0088] The processor can call the information and application stored in the memory through the transmission device to perform the following steps: obtain the initial color values ​​corresponding to each of the multiple pixel points in the initial image, wherein the initial color values ​​are the color values ​​corresponding to the initial color depth; determine the adjacent pixel points corresponding to each of the multiple pixel points according to the arrangement order of the multiple pixel points in the initial image; adjust the initial color values ​​corresponding to the adjacent pixel points corresponding to each of the multiple pixel points according to the initial color values ​​corresponding to each of the multiple pixel points to obtain new color values ​​corresponding to each of the multiple pixel points; select two adjacent color values ​​close to the new color values ​​corresponding to each of the multiple pixel points from the color values ​​corresponding to the target color depth; read the two adjacent color values ​​corresponding to each of the multiple pixel points in sequence according to a preset reading order to display the target image.

[0089] Optionally, the processor may also execute program code for the following steps: determining adjacent pixel points corresponding to each of the multiple pixel points according to an arrangement order of the multiple pixel points in the initial image, including: determining a method for selecting adjacent pixel points corresponding to each of the multiple pixel points according to a preset pixel adjustment order; determining adjacent pixel points corresponding to each of the multiple pixel points based on the arrangement order and the selection method.

[0090] Optionally, the processor may also execute program code for the following steps: adjusting initial color values ​​corresponding to adjacent pixels corresponding to each of the multiple pixels according to initial color values ​​corresponding to each of the multiple pixels to obtain new color values ​​corresponding to each of the multiple pixels, including: determining color diffusion values ​​corresponding to adjacent pixels corresponding to each of the multiple pixels in sequence according to a preset pixel adjustment order according to the initial color values ​​corresponding to each of the multiple pixels; adjusting initial color values ​​corresponding to adjacent pixels corresponding to each of the multiple pixels according to the color diffusion values ​​corresponding to adjacent pixels corresponding to each of the multiple pixels to obtain new color values ​​corresponding to each of the multiple pixels.

[0091] Optionally, the processor may also execute program code of the following steps: according to the initial color values ​​corresponding to each of the multiple pixels, according to a preset pixel adjustment order, sequentially determining the color diffusion values ​​corresponding to the adjacent pixels corresponding to each of the multiple pixels, including: determining the intermediate color values ​​corresponding to each of the multiple pixels based on the initial color values ​​corresponding to each of the multiple pixels; calculating the difference between the initial color values ​​corresponding to each of the multiple pixels and the intermediate color values ​​corresponding to each of the multiple pixels; calculating the product of the difference between the multiple pixels and a preset ratio to obtain the color diffusion values ​​corresponding to the adjacent pixels corresponding to each of the multiple pixels.

[0092] Optionally, the processor may also execute program code of the following steps: determining intermediate color values ​​corresponding to the multiple pixels based on initial color values ​​corresponding to the multiple pixels, including: determining multiple color intervals based on the target color depth; determining, among the multiple color intervals, the color intervals corresponding to the initial color values ​​corresponding to the multiple pixels; and determining the intermediate values ​​of the color intervals corresponding to the multiple pixels as the intermediate color values ​​corresponding to the multiple pixels.

[0093] Optionally, the processor may also execute program code for the following steps: reading two adjacent color values ​​corresponding to each of the multiple pixels in sequence according to a preset reading order, and displaying a target image, including: determining the respective quantity ratios of the two adjacent color values ​​corresponding to each of the multiple pixels based on the new color values ​​corresponding to each of the multiple pixels and the two adjacent color values ​​corresponding to each of the multiple pixels; determining the respective read quantities of the two adjacent color values ​​corresponding to each of the multiple pixels based on the respective quantity ratios of the two adjacent color values ​​corresponding to each of the multiple pixels; and reading the two adjacent color values ​​corresponding to each of the multiple pixels in sequence according to the reading order based on the respective read quantities of the two adjacent color values ​​corresponding to each of the multiple pixels, and displaying the target image.

[0094] Optionally, the processor may also execute program code for the following steps: determining the quantity ratio of the two adjacent color values ​​corresponding to the multiple pixels based on the new color values ​​corresponding to the multiple pixels and the two adjacent color values ​​corresponding to the multiple pixels, including: respectively calculating the difference between the two adjacent color values ​​corresponding to the multiple pixels and the new color values ​​corresponding to the multiple pixels as the first difference between the two adjacent color values ​​corresponding to the multiple pixels; calculating the difference between the two adjacent color values ​​corresponding to the multiple pixels as the second difference between the multiple pixels; determining the quantity ratio of the two adjacent color values ​​corresponding to the multiple pixels based on the ratio of the first difference between the two adjacent color values ​​corresponding to the multiple pixels to the second difference between the multiple pixels.

[0095] Optionally, the processor may also execute the program code of the following steps: obtaining an initial video; dividing the initial video into multiple frames of images, wherein the initial image is one frame of the multiple frames of images; performing the above steps of sequentially reading two adjacent color values ​​corresponding to multiple pixels in a preset reading order and displaying a target image on the multiple frames of images, displaying multiple frames of target images, and obtaining a target video.

[0096] According to an embodiment of the present invention, an image processing method is provided. The initial color values ​​corresponding to a plurality of pixels in an initial image are obtained, wherein the initial color values ​​are color values ​​corresponding to the initial color depth; the adjacent pixels corresponding to the plurality of pixels are determined according to the arrangement order of the plurality of pixels in the initial image; the initial color values ​​corresponding to the adjacent pixels corresponding to the plurality of pixels are adjusted according to the initial color values ​​corresponding to the plurality of pixels, so as to obtain new color values ​​corresponding to the plurality of pixels; two adjacent color values ​​close to the new color values ​​corresponding to the plurality of pixels are selected from the color values ​​corresponding to the target color depth; the two adjacent color values ​​corresponding to the plurality of pixels are read in sequence according to a preset reading order, and the target image is displayed, thereby achieving the purpose of combining the dithering algorithm with the FRC algorithm to make up for the defects caused by using a single algorithm to process the image, thereby achieving the technical effect of improving the display effect of the video image, and further solving the technical problem that the image display effect is poor due to the phenomenon of color distortion caused by adjusting the color depth of the image.

[0097] A person of ordinary skill in the art can understand that all or part of the steps in the various methods of the above embodiments can be completed by instructing the hardware related to the terminal device through a program, and the program can be stored in a non-volatile storage medium, and the storage medium may include: a flash drive, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, etc.

[0098] The embodiment of the present invention further provides a non-volatile storage medium. Optionally, in this embodiment, the non-volatile storage medium can be used to store the program code executed by the image processing method provided by the embodiment.

[0099] Optionally, in this embodiment, the non-volatile storage medium may be located in any computer terminal in a computer terminal group in a computer network, or in any mobile terminal in a mobile terminal group.

[0100] Optionally, in this embodiment, the non-volatile storage medium is configured to store program code for executing the following steps: obtaining initial color values ​​corresponding to each of a plurality of pixels in an initial image, wherein the initial color values ​​are color values ​​corresponding to an initial color depth; determining adjacent pixels corresponding to each of the plurality of pixels according to an arrangement order of the plurality of pixels in the initial image; adjusting initial color values ​​corresponding to adjacent pixels corresponding to each of the plurality of pixels according to the initial color values ​​corresponding to each of the plurality of pixels to obtain new color values ​​corresponding to each of the plurality of pixels; selecting two adjacent color values ​​close to the new color values ​​corresponding to each of the plurality of pixels from the color values ​​corresponding to the target color depth; and reading two adjacent color values ​​corresponding to each of the plurality of pixels in sequence according to a preset reading order to display a target image.

[0101] Optionally, in this embodiment, the non-volatile storage medium is configured to store program code for executing the following steps: determining adjacent pixel points corresponding to each of the multiple pixel points according to an arrangement order of the multiple pixel points in the initial image, including: determining a selection method for adjacent pixel points corresponding to each of the multiple pixel points according to a preset pixel adjustment order; determining adjacent pixel points corresponding to each of the multiple pixel points based on the arrangement order and the selection method.

[0102] Optionally, in this embodiment, the non-volatile storage medium is configured to store program code for executing the following steps: adjusting the initial color values ​​corresponding to the adjacent pixels corresponding to the multiple pixels according to the initial color values ​​corresponding to the multiple pixels, to obtain new color values ​​corresponding to the multiple pixels, including: determining the color diffusion values ​​corresponding to the adjacent pixels corresponding to the multiple pixels in sequence according to a preset pixel adjustment order according to the initial color values ​​corresponding to the multiple pixels; adjusting the initial color values ​​corresponding to the adjacent pixels corresponding to the multiple pixels according to the color diffusion values ​​corresponding to the adjacent pixels corresponding to the multiple pixels, to obtain new color values ​​corresponding to the multiple pixels.

[0103] Optionally, in this embodiment, the non-volatile storage medium is configured to store program code for executing the following steps: according to the initial color values ​​corresponding to each of the multiple pixels, in accordance with a preset pixel adjustment order, sequentially determining the color diffusion values ​​corresponding to the adjacent pixels corresponding to each of the multiple pixels, including: determining the intermediate color values ​​corresponding to each of the multiple pixels based on the initial color values ​​corresponding to each of the multiple pixels; calculating the difference between the initial color values ​​corresponding to each of the multiple pixels and the intermediate color values ​​corresponding to each of the multiple pixels; calculating the product of the difference corresponding to each of the multiple pixels and a preset ratio to obtain the color diffusion values ​​corresponding to the adjacent pixels corresponding to each of the multiple pixels.

[0104] Optionally, in this embodiment, the non-volatile storage medium is configured to store program code for executing the following steps: based on the initial color values ​​corresponding to the multiple pixels, determining the intermediate color values ​​corresponding to the multiple pixels, including: based on the target color depth, determining multiple color intervals; among the multiple color intervals, determining the color intervals corresponding to the initial color values ​​corresponding to the multiple pixels; determining the intermediate values ​​of the color intervals corresponding to the multiple pixels as the intermediate color values ​​corresponding to the multiple pixels.

[0105] Optionally, in this embodiment, the non-volatile storage medium is configured to store program code for executing the following steps: according to a preset reading order, reading two adjacent color values ​​corresponding to each of the multiple pixels in sequence to display a target image, including: determining the respective corresponding quantity ratios of the two adjacent color values ​​corresponding to each of the multiple pixels based on the new color values ​​corresponding to each of the multiple pixels and the two adjacent color values ​​corresponding to each of the multiple pixels; determining the respective corresponding read quantities of the two adjacent color values ​​corresponding to each of the multiple pixels based on the respective corresponding quantity ratios of the two adjacent color values ​​corresponding to each of the multiple pixels; based on the respective corresponding read quantities of the two adjacent color values ​​corresponding to each of the multiple pixels, reading the two adjacent color values ​​corresponding to each of the multiple pixels in sequence according to the reading order to display the target image.

[0106] Optionally, in this embodiment, the non-volatile storage medium is configured to store program code for executing the following steps: based on the new color values ​​corresponding to each of the multiple pixels and the two adjacent color values ​​corresponding to each of the multiple pixels, determine the quantity ratios of the two adjacent color values ​​corresponding to each of the multiple pixels, including: respectively calculating the difference between the two adjacent color values ​​corresponding to each of the multiple pixels and the new color values ​​corresponding to each of the multiple pixels as the first difference between the two adjacent color values ​​corresponding to each of the multiple pixels; calculating the difference between the two adjacent color values ​​corresponding to each of the multiple pixels as the second difference between the multiple pixels; determining the quantity ratios of the two adjacent color values ​​corresponding to each of the multiple pixels based on the ratio of the first difference between the two adjacent color values ​​corresponding to each of the multiple pixels to the second difference between the multiple pixels.

[0107] Optionally, in this embodiment, the non-volatile storage medium is configured to store program codes for executing the following steps: obtaining an initial video; dividing the initial video into multiple frames of images, wherein the initial image is one frame of the multiple frames of images; sequentially performing the above-mentioned steps of reading two adjacent color values ​​corresponding to multiple pixels in a preset reading order and displaying a target image on the multiple frames of images, displaying multiple frames of target images, and obtaining a target video.

[0108] An embodiment of the present invention also provides a computer program product, including a computer program. Optionally, in this embodiment, when the computer program is executed by a processor, it can achieve: obtaining initial color values ​​corresponding to multiple pixel points in an initial image, wherein the initial color values ​​are color values ​​corresponding to the initial color depth; determining adjacent pixel points corresponding to the multiple pixel points according to the arrangement order of the multiple pixel points in the initial image; adjusting the initial color values ​​corresponding to the adjacent pixel points corresponding to the multiple pixel points according to the initial color values ​​corresponding to the multiple pixel points, to obtain new color values ​​corresponding to the multiple pixel points; selecting two adjacent color values ​​close to the new color values ​​corresponding to the multiple pixel points from the color values ​​corresponding to the target color depth; and reading two adjacent color values ​​corresponding to the multiple pixel points in sequence according to a preset reading order to display the target image.

[0109] The serial numbers of the above embodiments of the present invention are only for description and do not represent the advantages or disadvantages of the embodiments.

[0110] In the above embodiments of the present invention, 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.

[0111] In the several embodiments provided in this application, it should be understood that the disclosed technical content can be implemented in other ways. Among them, the device embodiments described above are only schematic. For example, the division of the units can be a logical function division. There may be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of units or modules, which can be electrical or other forms.

[0112] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple units. Some or all of the units may be selected according to actual needs to achieve the purpose of the present embodiment.

[0113] In addition, each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.

[0114] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a non-volatile storage medium. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product. The computer software product is stored in a storage medium, including several instructions to enable a computer device (which can be a personal computer, server or network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), mobile hard disk, magnetic disk or optical disk and other media that can store program codes.

[0115] The above is only a preferred embodiment of the present invention. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principle of the present invention. These improvements and modifications should also be regarded as the scope of protection of the present invention.

Claims

1. An image processing method, characterized in that: include: Obtaining initial color values ​​corresponding to a plurality of pixel points in the initial image, wherein the initial color values ​​are color values ​​corresponding to the initial color depth; Determining adjacent pixel points corresponding to each of the plurality of pixel points according to an arrangement order of the plurality of pixel points in the initial image; According to the initial color values ​​corresponding to the plurality of pixels, the initial color values ​​corresponding to the adjacent pixels corresponding to the plurality of pixels are adjusted to obtain new color values ​​corresponding to the plurality of pixels; Selecting two adjacent color values ​​that are close to the new color values ​​corresponding to the plurality of pixels from the color values ​​corresponding to the target color depth; Reading two adjacent color values ​​corresponding to each of the plurality of pixel points in sequence according to a preset reading order to display a target image; The adjusting, according to the initial color values ​​corresponding to the plurality of pixels, the initial color values ​​corresponding to the adjacent pixels corresponding to the plurality of pixels to obtain the new color values ​​corresponding to the plurality of pixels comprises: determining, according to the initial color values ​​corresponding to the plurality of pixels, in sequence according to a preset pixel adjustment order, the color diffusion values ​​corresponding to the adjacent pixels corresponding to the plurality of pixels; adjusting, according to the color diffusion values ​​corresponding to the adjacent pixels corresponding to the plurality of pixels, the initial color values ​​corresponding to the adjacent pixels corresponding to the plurality of pixels to obtain the new color values ​​corresponding to the plurality of pixels; Among them, the color diffusion values ​​corresponding to the adjacent pixels corresponding to the multiple pixels are determined in sequence according to the preset pixel adjustment order based on the initial color values ​​corresponding to the multiple pixels, including: determining the intermediate color values ​​corresponding to the multiple pixels based on the initial color values ​​corresponding to the multiple pixels; calculating the difference between the initial color values ​​corresponding to the multiple pixels and the intermediate color values ​​corresponding to the multiple pixels; calculating the product of the difference corresponding to the multiple pixels and a preset ratio to obtain the color diffusion values ​​corresponding to the adjacent pixels corresponding to the multiple pixels.

2. The method according to claim 1, characterized in that The step of determining adjacent pixel points corresponding to each of the plurality of pixel points according to the arrangement order of the plurality of pixel points in the initial image comprises: Determining a method for selecting adjacent pixel points corresponding to each of the plurality of pixel points according to a preset pixel point adjustment order; Based on the arrangement order and the selection method, adjacent pixel points corresponding to each of the plurality of pixel points are determined.

3. The method according to claim 1, characterized in that The determining, based on the initial color values ​​corresponding to the plurality of pixels, the intermediate color values ​​corresponding to the plurality of pixels respectively, comprises: Based on the target color depth, determining a plurality of color intervals; Determine, among the multiple color intervals, the color intervals corresponding to the initial color values ​​corresponding to the multiple pixel points; Determine the middle values ​​of the color intervals corresponding to the multiple pixel points as the middle color values ​​corresponding to the multiple pixel points.

4. The method according to claim 1, characterized in that The method of sequentially reading two adjacent color values ​​corresponding to each of the plurality of pixel points according to a preset reading order to display a target image includes: Determine, based on the new color values ​​corresponding to each of the plurality of pixels and the two adjacent color values ​​corresponding to each of the plurality of pixels, the quantity proportions corresponding to each of the two adjacent color values ​​corresponding to each of the plurality of pixels; Determine the reading quantity corresponding to each of the two adjacent color values ​​corresponding to each of the multiple pixel points based on the quantity proportion corresponding to each of the two adjacent color values ​​corresponding to each of the multiple pixel points; Based on the reading quantities corresponding to the two adjacent color values ​​corresponding to the multiple pixel points, the two adjacent color values ​​corresponding to the multiple pixel points are read in sequence according to the reading order to display the target image.

5. The method according to claim 4, characterized in that The determining, based on the new color values ​​corresponding to the multiple pixels and the two adjacent color values ​​corresponding to the multiple pixels, the quantity proportions of the two adjacent color values ​​corresponding to the multiple pixels, includes: respectively calculating differences between two adjacent color values ​​corresponding to each of the plurality of pixels and new color values ​​corresponding to each of the plurality of pixels as first differences corresponding to the two adjacent color values ​​corresponding to each of the plurality of pixels; Calculate the difference between two adjacent color values ​​corresponding to each of the plurality of pixel points as the second difference corresponding to each of the plurality of pixel points; Based on the ratio of the first difference value corresponding to each of the two adjacent color values ​​corresponding to each of the multiple pixels to the second difference value corresponding to each of the multiple pixels, the quantity proportion of each of the two adjacent color values ​​corresponding to each of the multiple pixels is determined.

6. The method according to any one of claims 1 to 5, characterized in that: Also includes: Get the initial video; Dividing the initial video into multiple frames of images, wherein the initial image is one frame of the multiple frames of images; The above-mentioned step of sequentially reading two adjacent color values ​​corresponding to each of the multiple pixel points according to a preset reading order is performed on the multiple frames of images, and the step of displaying the target image is performed, and multiple frames of target images are displayed to obtain the target video.

7. An image processing device, characterized in that: include: An acquisition module, used to acquire initial color values ​​corresponding to a plurality of pixel points in an initial image, wherein the initial color values ​​are color values ​​corresponding to an initial color depth; A determination module, configured to determine adjacent pixel points corresponding to each of the plurality of pixel points according to an arrangement order of the plurality of pixel points in the initial image; An adjustment module, configured to adjust initial color values ​​corresponding to adjacent pixels corresponding to each of the plurality of pixels according to initial color values ​​corresponding to each of the plurality of pixels, so as to obtain new color values ​​corresponding to each of the plurality of pixels; A selection module, configured to select, from the color values ​​corresponding to the target color depth, two adjacent color values ​​close to the new color values ​​corresponding to the plurality of pixel points; A reading module, used for sequentially reading two adjacent color values ​​corresponding to each of the plurality of pixel points according to a preset reading order, and displaying a target image; The adjustment module is further used to determine, in sequence, the color diffusion values ​​corresponding to the adjacent pixels corresponding to the multiple pixels according to the initial color values ​​corresponding to the multiple pixels and in accordance with a preset pixel adjustment order; and to adjust the initial color values ​​corresponding to the adjacent pixels corresponding to the multiple pixels according to the color diffusion values ​​corresponding to the adjacent pixels corresponding to the multiple pixels, so as to obtain new color values ​​corresponding to the multiple pixels; The adjustment module is also used to determine the intermediate color values ​​corresponding to each of the multiple pixel points based on the initial color values ​​corresponding to each of the multiple pixel points; calculate the difference between the initial color values ​​corresponding to each of the multiple pixel points and the intermediate color values ​​corresponding to each of the multiple pixel points; calculate the product of the difference corresponding to each of the multiple pixel points and a preset ratio to obtain the color diffusion values ​​corresponding to each of the adjacent pixel points corresponding to each of the multiple pixel points.

8. A non-volatile storage medium, characterized in that: The non-volatile storage medium includes a stored program, wherein when the program is executed, the device where the non-volatile storage medium is located is controlled to execute the image processing method according to any one of claims 1 to 6.

9. A computer device, characterized in that: include: Memory and processor, The memory stores a computer program; The processor is used to execute the computer program stored in the memory, and when the computer program is run, the processor executes the image processing method according to any one of claims 1 to 6.

10. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the image processing method according to any one of claims 1 to 6 is implemented.

Citation Information

Patent Citations

  • Image processing method and device and storage medium

    CN115662332A

  • Target image generation method, electronic equipment and storage medium

    CN118486275A