Image processing method, device, equipment and storage medium

By determining the target pixel value based on the average grayscale value and grayscale trend of pixel points in the electronic ink screen, the boundary problem in the red, white and black images is solved, and the gradient effect and clear display of the image are achieved.

CN114494469BActive Publication Date: 2024-11-15BOE TECHNOLOGY GROUP CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202210112883.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-01-29
Publication Date
2024-11-15
Estimated Expiration
2042-01-29

AI Technical Summary

Technical Problem

When displaying images in the electronic ink screen, due to the boundary problems between adjacent pixel points in the red, white and black images, the image is severely deformed and cannot clearly reflect the image content.

Method used

By determining the target pixel sample group from multiple pixel sample groups based on the average grayscale value of n pixel points adjacent to each other in the image to be processed, the target pixel sample is determined, and based on the target pixel sample and the initial pixel value, from multiple The target pixel value is determined in each alternative color, and the initial pixel value is converted to improve boundary problems.

Benefits of technology

The boundary problem of the image is improved, so that the converted image visually presents a gradient effect, and improves the image's clarity and display quality.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114494469B_ABST
    Figure CN114494469B_ABST
Patent Text Reader

Abstract

The present application discloses an image processing method, device, equipment and storage medium, belonging to the field of image processing technology. The method comprises: determining a target pixel sample group from a plurality of pixel sample groups based on the average grayscale value of n adjacent pixels in a first image to be processed, determining a target pixel sample from the target pixel sample group based on the grayscale value of each pixel in the n pixels, determining the target pixel value of the n pixels from the pixel values ​​corresponding to a plurality of candidate colors based on the target pixel sample and the initial pixel value of the n pixels, and converting the initial pixel value of the n pixels in the first image into the corresponding target pixel value. Since the grayscale trend of the n sample pixels included in the target pixel sample is the same as the grayscale trend of the n adjacent pixels in the first image. Therefore, the grayscale between the determined target pixel values ​​of the n pixels presents a certain trend.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of image processing technology, and in particular to an image processing method, device, equipment and storage medium. Background Art

[0002] Before the electronic ink screen displays an image, the image needs to be processed to obtain a red, white and black image, and then display the red, white and black image. In the related art, due to the boundary problem between adjacent pixels in the red, white and black image, the red, white and black image is severely deformed, and thus cannot clearly reflect the image content. Therefore, how to process the image has become a problem that needs to be solved urgently. Summary of the invention

[0003] The present application provides an image processing method, apparatus, device and storage medium. The technical solution is as follows:

[0004] In one aspect, an image processing method is provided, the method comprising:

[0005] Based on the average grayscale value of n adjacent pixel points in the first image to be processed, determining a target pixel sample group from a plurality of pixel sample groups, wherein each pixel sample group in the plurality of pixel sample groups includes at least one pixel sample, each pixel sample includes n sample pixel points, the average grayscale values ​​of pixel samples in different pixel sample groups are different, and the average grayscale values ​​of pixel samples in the same pixel sample group are the same;

[0006] Based on the grayscale value of each pixel point in the n pixel points, determine a target pixel sample from at least one pixel sample included in the target pixel sample group, wherein the grayscale trend of the n sample pixel points included in the target pixel sample is the same as the grayscale trend of the n pixel points;

[0007] Determining target pixel values ​​of the n pixels from pixel values ​​corresponding to a plurality of candidate colors based on the target pixel samples and the initial pixel values ​​of the n pixels;

[0008] The initial pixel values ​​of the n pixels in the first image are converted into corresponding target pixel values.

[0009] Optionally, determining the target pixel sample group from a plurality of pixel sample groups based on an average grayscale value of n adjacent pixel points in the first image to be processed includes:

[0010] Determine a target average grayscale range in which the average grayscale values ​​of the n pixels are located from a plurality of average grayscale ranges, wherein the plurality of average grayscale ranges are formed by the average grayscale values ​​corresponding to the plurality of pixel sample groups;

[0011] A pixel sample group corresponding to the lower limit of the target average grayscale range is determined as the target pixel sample group.

[0012] Optionally, determining the target pixel sample group from a plurality of pixel sample groups based on an average grayscale value of n adjacent pixel points in the first image to be processed includes:

[0013] Determine a difference between an average grayscale value corresponding to each pixel sample group in the plurality of pixel sample groups and an average grayscale value of the n pixels;

[0014] A pixel sample group with the smallest difference value among the multiple pixel sample groups is determined as the target pixel sample group.

[0015] Optionally, the multiple candidate colors include a first candidate color and a second candidate color without hue, a pixel value of each of the n sample pixel points is a pixel value of the first candidate color or the second candidate color, and each pixel sample in the target pixel sample group corresponds to a grayscale trend mark, and the grayscale trend mark is used to indicate the grayscale trend of the n sample pixel points included in the pixel sample;

[0016] The step of determining a target pixel sample from at least one pixel sample included in the target pixel sample group based on the grayscale value of each pixel in the n pixels comprises:

[0017] Sorting the n pixel points according to the magnitude relationship of the grayscale values ​​of the n pixel points to obtain a sorting result;

[0018] Based on a first number and a second number corresponding to the target pixel sample group, determining the grayscale trend marks of the n pixel points according to the sorting result, the first number being the number of sample pixel points of the first candidate color among the n sample pixel points, and the second number being the number of sample pixel points of the second candidate color among the n sample pixel points;

[0019] A pixel sample whose grayscale trend mark is the same as the grayscale trend marks of the n pixels among at least one pixel sample included in the target pixel sample group is determined as the target pixel sample.

[0020] Optionally, the multiple candidate colors include a first candidate color without hue and a second candidate color, and a pixel value of each sample pixel point in the n sample pixel points is a pixel value of the first candidate color or the second candidate color;

[0021] The step of determining a target pixel sample from at least one pixel sample included in the target pixel sample group based on the grayscale value of each pixel in the n pixels comprises:

[0022] Sorting the n pixel points according to the magnitude relationship of the grayscale values ​​of the n pixel points to obtain a sorting result;

[0023] Based on a first number and a second number corresponding to the target pixel sample group, determining whether the color of each pixel point among the n pixel points is the first candidate color or the second candidate color according to the sorting result, the first number being the number of sample pixel points of the first candidate color among the n sample pixel points, and the second number being the number of sample pixel points of the second candidate color among the n sample pixel points;

[0024] According to the color determination results of the n pixel points, the target pixel sample is determined from at least one pixel sample included in the target pixel sample group.

[0025] Optionally, the plurality of candidate colors further comprises a third candidate color having a hue;

[0026] The step of determining the target pixel values ​​of the n pixels from the pixel values ​​corresponding to the multiple candidate colors based on the target pixel sample and the initial pixel values ​​of the n pixels comprises:

[0027] For any pixel point among the n pixel points, determining whether an initial pixel value of the any pixel point satisfies a pixel condition of the third candidate color;

[0028] When the initial pixel value of any pixel point satisfies the pixel condition of the third candidate color, the pixel value corresponding to the third candidate color is determined as the target pixel value of any pixel point;

[0029] When the initial pixel value of any pixel point does not satisfy the pixel condition of the third candidate color, the pixel value of the sample pixel point at the position corresponding to any pixel point in the target pixel sample is determined as the target pixel value of any pixel point.

[0030] Optionally, the first image includes multiple groups of pixels, each group of pixels includes n pixels, and the method further includes:

[0031] A second image is obtained, wherein the second image includes the multiple groups of pixel points, and the initial pixel value of each pixel point in the multiple groups of pixel points in the first image has been converted into a corresponding target pixel value.

[0032] Optionally, n is 4.

[0033] In another aspect, an image processing device is provided, the device comprising:

[0034] A first determination module is used to determine a target pixel sample group from a plurality of pixel sample groups based on an average grayscale value of n adjacent pixel points in a first image to be processed, wherein each pixel sample group in the plurality of pixel sample groups includes at least one pixel sample, each pixel sample includes n sample pixel points, the average grayscale values ​​of pixel samples in different pixel sample groups are different, and the average grayscale values ​​of pixel samples in the same pixel sample group are the same;

[0035] a second determining module, configured to determine a target pixel sample from at least one pixel sample included in the target pixel sample group based on the grayscale value of each pixel in the n pixels, wherein the grayscale trend of the n sample pixels included in the target pixel sample is the same as the grayscale trend of the n pixels;

[0036] A third determination module, configured to determine target pixel values ​​of the n pixels from pixel values ​​corresponding to a plurality of candidate colors based on the target pixel sample and the initial pixel values ​​of the n pixels;

[0037] A conversion module is used to convert the initial pixel values ​​of the n pixel points in the first image into corresponding target pixel values.

[0038] Optionally, the first determining module is specifically configured to:

[0039] Determine a target average grayscale range in which the average grayscale values ​​of the n pixels are located from a plurality of average grayscale ranges, wherein the plurality of average grayscale ranges are formed by the average grayscale values ​​corresponding to the plurality of pixel sample groups;

[0040] A pixel sample group corresponding to the lower limit of the target average grayscale range is determined as the target pixel sample group.

[0041] Optionally, the first determining module is specifically configured to:

[0042] Determine a difference between an average grayscale value corresponding to each pixel sample group in the plurality of pixel sample groups and an average grayscale value of the n pixels;

[0043] A pixel sample group with the smallest difference value among the multiple pixel sample groups is determined as the target pixel sample group.

[0044] Optionally, the multiple candidate colors include a first candidate color and a second candidate color without hue, a pixel value of each of the n sample pixel points is a pixel value of the first candidate color or the second candidate color, and each pixel sample in the target pixel sample group corresponds to a grayscale trend mark, and the grayscale trend mark is used to indicate the grayscale trend of the n sample pixel points included in the pixel sample;

[0045] The second determining module is specifically used for:

[0046] Sorting the n pixel points according to the magnitude relationship of the grayscale values ​​of the n pixel points to obtain a sorting result;

[0047] Based on a first number and a second number corresponding to the target pixel sample group, determining the grayscale trend marks of the n pixel points according to the sorting result, the first number being the number of sample pixel points of the first candidate color among the n sample pixel points, and the second number being the number of sample pixel points of the second candidate color among the n sample pixel points;

[0048] A pixel sample whose grayscale trend mark is the same as the grayscale trend marks of the n pixels among at least one pixel sample included in the target pixel sample group is determined as the target pixel sample.

[0049] Optionally, the multiple candidate colors include a first candidate color without hue and a second candidate color, and a pixel value of each sample pixel point in the n sample pixel points is a pixel value of the first candidate color or the second candidate color;

[0050] The second determining module is specifically used for:

[0051] Sorting the n pixel points according to the magnitude relationship of the grayscale values ​​of the n pixel points to obtain a sorting result;

[0052] Based on a first number and a second number corresponding to the target pixel sample group, determining whether the color of each pixel point among the n pixel points is the first candidate color or the second candidate color according to the sorting result, the first number being the number of sample pixel points of the first candidate color among the n sample pixel points, and the second number being the number of sample pixel points of the second candidate color among the n sample pixel points;

[0053] According to the color determination results of the n pixel points, the target pixel sample is determined from at least one pixel sample included in the target pixel sample group.

[0054] Optionally, the plurality of candidate colors further comprises a third candidate color having a hue;

[0055] The third determination module is specifically used for:

[0056] For any pixel point among the n pixel points, determining whether an initial pixel value of the any pixel point satisfies a pixel condition of the third candidate color;

[0057] When the initial pixel value of any pixel point satisfies the pixel condition of the third candidate color, the pixel value corresponding to the third candidate color is determined as the target pixel value of any pixel point;

[0058] When the initial pixel value of any pixel point does not satisfy the pixel condition of the third candidate color, the pixel value of the sample pixel point at the position corresponding to any pixel point in the target pixel sample is determined as the target pixel value of any pixel point.

[0059] Optionally, the first image includes multiple groups of pixels, each group of pixels includes n pixels, and the device further includes:

[0060] The acquisition module is used to obtain a second image, wherein the second image includes the multiple groups of pixel points, and the initial pixel value of each pixel point in the multiple groups of pixel points in the first image has been converted into a corresponding target pixel value.

[0061] Optionally, n is 4.

[0062] On the other hand, an image processing device is provided, which includes a memory and a processor, wherein the memory is used to store a computer program, and the processor is used to execute the computer program stored in the memory to implement the steps of the above-mentioned image processing method.

[0063] On the other hand, a non-transitory computer-readable storage medium is provided, wherein a computer program is stored in the storage medium, and when the computer program is executed by a processor, the steps of the above-mentioned image processing method are implemented.

[0064] On the other hand, a computer program product comprising instructions is provided. When the instructions are executed on a computer, the computer executes the steps of the above-mentioned image processing method.

[0065] The technical solution provided by this application can at least bring the following beneficial effects:

[0066] Since the grayscale trend of the n sample pixels included in the target pixel sample is the same as the grayscale trend of the n adjacent pixels in the first image to be processed, the grayscales between the target pixel values ​​of the n pixels determined according to the grayscale trend of the n sample pixels present a certain trend. In this way, the boundary problem of the n pixels in the second image can be improved, so that the second image presents a gradual effect visually. BRIEF DESCRIPTION OF THE DRAWINGS

[0067] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.

[0068] Figure 1 is a flow chart of an image processing method provided by an embodiment of the present application;

[0069] Figure 2 is a schematic diagram of a pixel sample group provided in an embodiment of the present application;

[0070] Figure 3 is a schematic diagram of determining a target pixel sample provided by an embodiment of the present application;

[0071] Figure 4 is a schematic diagram of another method for determining target pixel samples provided by an embodiment of the present application;

[0072] Figure 5 is a schematic diagram of an image conversion result provided by an embodiment of the present application;

[0073] Figure 6 is a structural schematic diagram of an image processing device provided in an embodiment of the present application;

[0074] Figure 7 It is a structural diagram of a mobile terminal provided in an embodiment of the present application. DETAILED DESCRIPTION

[0075] In order to make the objectives, technical solutions and advantages of the embodiments of the present application clearer, the implementation methods of the present application will be further described in detail below in conjunction with the accompanying drawings.

[0076] Before explaining the image processing method provided in the embodiment of the present application in detail, the terms and application scenarios involved in the embodiment of the present application are first introduced.

[0077] To facilitate understanding, the terms involved in the embodiments of the present application are first explained.

[0078] Pixels: Pixels are small squares in an image. These small squares have a clear position and an assigned pixel value. The color and position of the small squares determine how the image appears.

[0079] RGB color space: RGB color space is a color standard in the industry. Various colors are obtained by changing the three components of R (Red), G (Green), and B (Blue) and superimposing them on each other. RGB represents the colors of the three components of red, green, and blue. This standard covers almost all colors that can be perceived by human vision and is one of the most widely used color spaces.

[0080] Grayscale: Use black tones to represent objects, that is, use black as the base color and use black of different saturations to display images.

[0081] Next, the application scenarios involved in the embodiments of the present application are introduced.

[0082] The image processing method provided in the embodiment of the present application can be applied to a variety of scenarios. For example, in the scenario where an electronic ink screen displays an image, a colored first image is usually converted into a second image in red, white and black to display the second image. However, in the process of processing the first image, due to the boundary problem between adjacent pixels in the red, white and black image, the converted second image is severely deformed, thereby failing to clearly reflect the image content. Therefore, the image processing method provided in the embodiment of the present application can be used to process the first image to be processed to obtain the second image. In this way, the boundary problem of the n pixels can be improved, so that the converted second image visually presents a gradient effect.

[0083] The image processing method provided in the embodiment of the present application can be executed by an image processing device, which can be a terminal device such as a fixed terminal, a mobile terminal, etc. Among them, the terminal device can be any electronic product that can interact with the user through one or more methods such as a keyboard, a touch pad, a touch screen, a remote control, voice interaction or a handwriting device, such as a PC (Personal Computer), a mobile phone, a smart phone, a PDA (Personal Digital Assistant), a PPC (Pocket PC), a tablet computer, etc.

[0084] Those skilled in the art should understand that the above-mentioned application scenarios and image processing devices are only examples, and other existing or future application scenarios and image processing devices, if applicable to the embodiments of the present application, should also be included in the protection scope of the embodiments of the present application and are included here by reference.

[0085] It should be noted that the application scenarios described in the embodiments of the present application are intended to more clearly illustrate the technical solutions of the embodiments of the present application, and do not constitute a limitation on the technical solutions provided in the embodiments of the present application. Ordinary technicians in this field can know that with the emergence of new application scenarios, the technical solutions provided in the embodiments of the present application are also applicable to similar technical problems.

[0086] Next, the image processing method provided in the embodiment of the present application is explained in detail.

[0087] Figure 1 This is a flowchart of an image processing method provided in an embodiment of the present application. Please refer to Figure 1 , the method comprises the following steps.

[0088] Step 101: Based on the average grayscale value of n adjacent pixel points in a first image to be processed, a target pixel sample group is determined from a plurality of pixel sample groups, each pixel sample group in the plurality of pixel sample groups includes at least one pixel sample, each pixel sample includes n sample pixel points, the average grayscale values ​​of pixel samples in different pixel sample groups are different, and the average grayscale values ​​of pixel samples in the same pixel sample group are the same.

[0089] The execution subject of the embodiments of the present application may be a terminal device such as a fixed terminal or a mobile terminal. For the sake of ease of description, a mobile terminal is taken as an example for introduction below.

[0090] The mobile terminal determines the grayscale value of each pixel in n adjacent pixels in the first image to be processed, and determines the average grayscale value of the n pixels. Then, based on the average grayscale value of the n pixels, a target pixel sample group is determined from a plurality of pixel sample groups.

[0091] As an example, the mobile terminal may determine the grayscale value of any pixel among the n pixels according to the following formula (1).

[0092] gray=(R+G+B) / 3 (1)

[0093] In the above formula (1), gray represents the grayscale value of any pixel, R represents the R component of the initial pixel value of any pixel, G represents the G component of the initial pixel value of any pixel, and B represents the B component of the initial pixel value of any pixel.

[0094] In some embodiments, before the mobile terminal processes the first image, it is also necessary to load the folder where the first image is located to obtain the storage path of the first image. The mobile terminal obtains the first image based on the storage path of the first image. Of course, the mobile terminal can also obtain the first image in other ways.

[0095] After the mobile terminal acquires the first image, the mobile terminal may also acquire the pixel width, pixel height, and R component, G component, and B component of the initial pixel value of each pixel in the first image, where the pixel width refers to the number of pixels included in the width direction of the first image, and the pixel height refers to the number of pixels included in the height direction of the first image. Of course, the mobile terminal may also acquire other data, for example, if the first image is an image in PNG format, the mobile terminal may also acquire the transparency of the first image.

[0096] As an example, the mobile terminal may create a three-dimensional array for the first image, the three-dimensional array including a width array, a height array, and an RGB three-dimensional array. The width array includes the pixel width of the first image, the height array includes the pixel height of the first image, and the RGB three-dimensional array includes the R component, the G component, and the B component of the initial pixel value of each pixel in the first image. If the first image is an image in PNG format, the RGB three-dimensional array also includes the transparency of the first image. At this time, the length of the RGB three-dimensional array of the first image is 4.

[0097] Generally, the pixel value of each pixel in the image is a negative integer. Therefore, after the mobile terminal acquires the first image, it can determine the R component, G component and B component of the initial pixel value of each pixel in the first image according to the following formula (2).

[0098] R=(pixel&0xff0000)>>16

[0099] G=(pixel&0xff00)>>8

[0100] B=(pixel&0xff) (2)

[0101] In the above formula (2), R represents the R component of the initial pixel value of any pixel in the first image, G represents the G component of the initial pixel value of any pixel, B represents the B component of the initial pixel value of any pixel, and pixel represents the pixel value of any pixel.

[0102] In the process of the mobile terminal acquiring the pixel value of each pixel in the first image, in order to determine the position of each pixel, the mobile terminal can also establish a coordinate system with a certain pixel in the first image as the origin to determine the position coordinates of each pixel in the first image. The position coordinates of each pixel in the first image are in units of pixels.

[0103] It should be noted that the value of n can be an integer greater than or equal to 3, and n can be expressed as N×M. Wherein, N and M are both positive integers, and the difference between N and M is not greater than the threshold. That is, for any n pixels in the first image that meet the above conditions, the mobile terminal can determine the average grayscale value of the n pixels according to the above method, and then determine the target pixel sample group from multiple pixel sample groups. For example, n is 4, and N and M are both 2. Or, n is 6, N is 2, and M is 3. For another example, n is 9, and N and M are both 3.

[0104] The threshold is used to define the relationship between the value of N and the value of M. If the difference between N and M is greater than the threshold, the number of pixels included in the width direction and the number of pixels included in the height direction of the n adjacent pixels in the first image differ greatly, resulting in the second image after conversion not being able to clearly reflect the image content. Therefore, the threshold is usually small to ensure that the number of pixels included in the width direction and the number of pixels included in the height direction of the n pixels differs little, thereby ensuring that the second image after conversion can clearly reflect the image content of the first image.

[0105] After the mobile terminal determines the average grayscale value of the n pixels according to the above method, the mobile terminal determines the target pixel sample group from the multiple pixel sample groups based on the average grayscale value of the n pixels. That is, the mobile terminal determines the target average grayscale range in which the average grayscale value of the n pixels is located from the multiple average grayscale ranges, the multiple average grayscale ranges are composed of the average grayscale values ​​corresponding to the multiple pixel sample groups, and determines the pixel sample group corresponding to the lower limit of the target average grayscale range as the target pixel sample group.

[0106] The mobile terminal stores a plurality of pixel sample groups, which correspond one to one with a plurality of average grayscale values. That is, different pixel sample groups correspond to different average grayscale values. Two adjacent average grayscale values ​​among the multiple average grayscale values ​​constitute an average grayscale range, the minimum value among the two adjacent average grayscale values ​​serves as the lower limit of the average grayscale range, and the maximum value among the two adjacent average grayscale values ​​serves as the upper limit of the average grayscale range. Therefore, after the mobile terminal determines the average grayscale value of the n pixels, the average grayscale value of the n pixels can be matched with the multiple average grayscale ranges to determine the average grayscale range in which the average grayscale value of the n pixels is located, and the average grayscale range is determined as the target average grayscale range. Then, the pixel sample group corresponding to the lower limit of the target average grayscale range is determined as the target pixel sample group.

[0107] For example, please refer to Figure 2 , Figure 2 is a schematic diagram of a pixel sample group provided by an embodiment of the present application. Figure 2In the example, n is 4, that is, N and M are both 2. The mobile terminal stores 5 pixel sample groups, and the average grayscale values ​​corresponding to the 5 pixel sample groups are 0, 64, 128, 192 and 256 respectively. The 4 average grayscale ranges formed by the 5 pixel sample groups are [0-64), [64-128), [128-192) and [192-256] respectively. Assume that the mobile terminal determines that the average grayscale value of 4 adjacent pixels in the first image is 60, and the average grayscale range of the average grayscale value 60 of the 4 pixels is [0-64), then the average grayscale range [0-64) is determined as the target average grayscale range. Then, the pixel sample group 1 corresponding to the lower limit 0 of the target average grayscale range [0-64) is determined as the target pixel sample group.

[0108] After determining the target average grayscale range in which the average grayscale value of the n pixels is located, the mobile terminal directly determines the pixel sample group corresponding to the lower limit of the target average grayscale range as the target pixel sample group without performing other operations, which can simplify the operation process and improve the operation speed. However, in the case where the average grayscale value of the n pixels is closer to the upper limit of the target average grayscale range, there may be a certain error in directly determining the pixel sample group corresponding to the lower limit of the target average grayscale range as the target pixel sample group. Regarding this issue, in an embodiment of the present application, in order to enable the converted second image to accurately reflect the image content of the first image, the value of n is usually not very large, so the error caused by the n pixels can be basically ignored.

[0109] The above method of determining the target pixel sample group is an example. In other embodiments, the mobile terminal may also determine the target pixel sample group in other ways. For example, the mobile terminal determines the difference between the average grayscale value corresponding to each pixel sample group in the multiple pixel sample groups and the average grayscale value of the n pixels, and determines the pixel sample group with the smallest difference in the multiple pixel sample groups as the target pixel sample group.

[0110] The mobile terminal stores a plurality of pixel sample groups, and the plurality of pixel sample groups correspond to a plurality of average grayscale values ​​one by one. That is, different pixel sample groups correspond to different average grayscale values. After the mobile terminal determines the average grayscale value of the n pixels, it determines the difference between the average grayscale value corresponding to each pixel sample group in the plurality of pixel sample groups and the average grayscale value of the n pixels, and determines the pixel sample group with the smallest difference in the plurality of pixel sample groups as the target pixel sample group.

[0111] For example, take n as 4, that is, N and M are both 2. The mobile terminal stores 5 pixel sample groups, and the average grayscale values ​​corresponding to the 5 pixel sample groups are 0, 64, 128, 192 and 256 respectively. Assume that the mobile terminal determines that the average grayscale value of 4 adjacent pixels in the first image is 60, and at this time, the difference between the average grayscale value 64 corresponding to pixel sample group 2 in the 5 pixel sample groups and the average grayscale value 60 of the 4 pixels is the smallest, which is only 4, then pixel sample group 2 is determined as the target pixel sample group.

[0112] The mobile terminal determines the pixel sample group with the smallest difference as the target pixel sample group by determining the difference between the average grayscale value corresponding to each pixel sample group and the average grayscale value of the n pixels. Although the operation process of determining the difference between the average grayscale values ​​is added, the target pixel sample group can be accurately determined from the multiple pixel sample groups to reduce errors and improve the display effect of the second image.

[0113] In some embodiments, the storage space of the mobile terminal may include an image information extraction area and an image buffer. The process of the mobile terminal acquiring the storage path of the first image and the three-dimensional array corresponding to the first image can be completed in the image information extraction area. The process of the mobile terminal determining the target pixel sample group from multiple pixel sample groups can be completed in the image buffer. That is, the mobile terminal executes the process of acquiring the storage path of the first image and the corresponding three-dimensional array in the image information extraction area, and executes the process of converting the first image into the second image in the image buffer. For example, the mobile terminal can process the first image in the image buffer through the image processing tool Graphics2D provided by the Java development language to obtain the second image. For different images to be processed, the image processing tool Graphics2D provided by the Java development language is the same.

[0114] Step 102: Based on the grayscale value of each pixel in the n pixels, determine a target pixel sample from at least one pixel sample included in the target pixel sample group, wherein the grayscale trend of the n sample pixels included in the target pixel sample is the same as the grayscale trend of the n pixels.

[0115] The multiple alternative colors include a first alternative color and a second alternative color without hue, the pixel value of each of the n sample pixel points is the pixel value of the first alternative color or the second alternative color, and each pixel sample in the target pixel sample group corresponds to a grayscale trend mark, which is used to indicate the grayscale trend of the n sample pixel points included in the pixel sample.

[0116] Among them, the grayscale value of the first candidate color and the grayscale value of the second candidate color have a size relationship, so the grayscale trend mark corresponding to the pixel sample is used to indicate the trend of the size relationship of the grayscale values ​​of the n sample pixel points included in the pixel sample. The trend of the size relationship of the grayscale values ​​of the n sample pixel points can be a trend of the grayscale values ​​of the n sample pixel points from small to large. Of course, the trend of the size relationship of the grayscale values ​​of the n sample pixel points can also be a trend of the grayscale values ​​of the n sample pixel points from large to small, which is not limited in the embodiments of the present application.

[0117] For example, the first candidate color is black, and the second candidate color is white. The grayscale value of black is 0, and the grayscale value of white is 255, and the grayscale value of black is less than the grayscale value of white. The grayscale trend mark corresponding to the pixel sample can be used to indicate the color trend of the n sample pixel points included in the pixel sample from black to white, and can also be used to indicate the color trend of the n sample pixel points from white to black.

[0118] In some embodiments, the mobile terminal sorts the n pixels according to the magnitude relationship of the grayscale values ​​of the n pixels to obtain a sorting result. Based on the first number and the second number corresponding to the target pixel sample group, the grayscale trend mark of the n pixels is determined according to the sorting result, the first number being the number of sample pixels of the first candidate color among the n sample pixels, and the second number being the number of sample pixels of the second candidate color among the n sample pixels. The pixel sample whose grayscale trend mark is the same as the grayscale trend mark of the n pixels in at least one pixel sample included in the target pixel sample group is determined as the target pixel sample.

[0119] Since the grayscale trend mark can indicate the trend of the grayscale values ​​of n sample pixels from large to small, and can also indicate the trend of the grayscale values ​​of the n sample pixels from small to large, in different situations, the process of the mobile terminal determining the target pixel sample from at least one pixel sample included in the target pixel sample group is different, so the following will be divided into the following two situations for explanation respectively.

[0120] In the first case, the grayscale trend mark is used to indicate the trend of the grayscale values ​​of n sample pixels from large to small. At this time, the mobile terminal sorts the n pixels in the order of the grayscale values ​​of the n pixels from large to small to obtain a sorting result. In the case where the grayscale value of the first candidate color is greater than the grayscale value of the second candidate color, according to the sorting result, the grayscale trend mark of the n pixels is drawn from the positions of the first number of pixels ranked first among the n pixels to the positions of other pixels. In the case where the grayscale value of the first candidate color is less than the grayscale value of the second candidate color, according to the sorting result, the grayscale trend mark of the n pixels is drawn from the positions of the second number of pixels ranked first among the n pixels to the positions of other pixels. Then, the pixel sample whose grayscale trend mark is the same as the grayscale trend mark of the n pixels in at least one pixel sample included in the target pixel sample group is determined as the target pixel sample.

[0121] It is worth noting that if the first number corresponding to the target pixel sample group is n and the second number is 0, it indicates that the target pixel sample group includes one pixel sample, and the pixel values ​​of the n sample pixel points included in the pixel sample are all pixel values ​​of the first alternative color. At this time, there is no grayscale trend for the n pixel points, so the pixel sample included in the target pixel sample group can be directly determined as the target pixel sample. Similarly, if the second number corresponding to the target pixel sample group is n and the first number is 0, it indicates that the target pixel sample group includes one pixel sample, and the pixel values ​​of the n sample pixel points included in the pixel sample are all pixel values ​​of the second alternative color. At this time, there is no grayscale trend for the n pixel points, so the pixel sample included in the target pixel sample group can be directly determined as the target pixel sample.

[0122] For example, please refer to Figure 3 , Figure 3 is a schematic diagram of determining a target pixel sample provided by an embodiment of the present application. Figure 3 In , assume that n is 4, the first candidate color is black, the second candidate color is white, the gray value of black is 0, the gray value of white is 255, and the gray value of black is less than the gray value of white. Assume that the mobile terminal Figure 2 The pixel sample group 2 in the target pixel sample group is determined as the target pixel sample group. The grayscale trend marks of the four pixel samples included in the target pixel sample group are as follows: Figure 3 As shown in the right figure. The first number corresponding to the target pixel sample group is 1, and the second number is 3. The mobile terminal sorts the four adjacent pixels in the first image in descending order of their grayscale values, and sorts the pixel with the largest grayscale value among the four pixels as 1, and sorts the pixel with the smallest grayscale value among the four pixels as 4. The sorting result is as follows: Figure 3According to the sorting result, the grayscale trend marks of the four pixels are drawn from the positions of the top three pixels among the four pixels to the positions of the other pixels. The drawn grayscale trend marks are shown as follows: Figure 3 Then, by comparing the grayscale trend marks of the four pixel points with the grayscale trend marks of the four pixel samples included in the target pixel sample group, it is determined Figure 3 The pixel samples in the dotted box in the right figure are the target pixel samples.

[0123] Based on the above description, the average grayscale values ​​of the pixel samples in different pixel sample groups are different, and the average grayscale values ​​of the pixel samples in the same pixel sample group are the same. Moreover, each pixel sample includes n sample pixels, and the pixel value of each sample pixel in the n sample pixels is the pixel value of the first alternative color or the second alternative color. Since the average grayscale value of the pixel sample is determined based on the grayscale value of each sample pixel in the n sample pixels included in the pixel sample, when the average grayscale values ​​of the pixel samples in the same pixel sample group are the same, the first number and the second number of the pixel samples in the same pixel sample group are the same. Therefore, one pixel sample group corresponds to a first number and a second number. That is, each pixel sample group in the multiple pixel sample groups corresponds to a first number and a second number.

[0124] In the second case, the grayscale trend mark is used to indicate the trend of the grayscale values ​​of the n sample pixels from small to large. At this time, the mobile terminal sorts the n pixels in the order of the grayscale values ​​of the n pixels from small to large to obtain a sorting result. In the case where the grayscale value of the first candidate color is greater than the grayscale value of the second candidate color, according to the sorting result, the grayscale trend mark of the n pixels is drawn from the positions of the second number of pixels ranked first among the n pixels to the positions of other pixels. In the case where the grayscale value of the first candidate color is less than the grayscale value of the second candidate color, according to the sorting result, the grayscale trend mark of the n pixels is drawn from the positions of the first number of pixels ranked first among the n pixels to the positions of other pixels. Then, the pixel sample whose grayscale trend mark is the same as the grayscale trend mark of the n pixels in at least one pixel sample included in the target pixel sample group is determined as the target pixel sample.

[0125] It is worth noting that if the first number corresponding to the target pixel sample group is n and the second number is 0, it indicates that the target pixel sample group includes one pixel sample, and the pixel values ​​of the n sample pixel points included in the pixel sample are all pixel values ​​of the first alternative color. At this time, there is no grayscale trend for the n pixel points, so the pixel sample included in the target pixel sample group can be directly determined as the target pixel sample. Similarly, if the second number corresponding to the target pixel sample group is n and the first number is 0, it indicates that the target pixel sample group includes one pixel sample, and the pixel values ​​of the n sample pixel points included in the pixel sample are all pixel values ​​of the second alternative color. At this time, there is no grayscale trend for the n pixel points, so the pixel sample included in the target pixel sample group can be directly determined as the target pixel sample.

[0126] For example, please refer to Figure 4 , Figure 4 FIG. 1 is another schematic diagram of determining target pixel samples provided by an embodiment of the present application. Figure 4 In , assume that n is 4, the first candidate color is black, the second candidate color is white, the gray value of black is 0, the gray value of white is 255, and the gray value of black is less than the gray value of white. Assume that the mobile terminal Figure 2 The pixel sample group 2 in the target pixel sample group is determined as the target pixel sample group. The grayscale trend marks of the four pixel samples included in the target pixel sample group are as follows: Figure 4 As shown in the middle right figure. The first number corresponding to the target pixel sample group is 1, and the second number is 3. The mobile terminal sorts the four adjacent pixels in the first image in ascending order of their grayscale values, and sorts the pixel with the smallest grayscale value among the four pixels as 1, and the pixel with the largest grayscale value among the four pixels as 4. The sorting result is shown in Figure 4 According to the sorting result, the grayscale trend marks of the four pixels are drawn from the position of the top pixel among the four pixels to the positions of the other pixels, and the grayscale trend marks of the four pixels are drawn as shown in FIG. Figure 4 Then, by comparing the grayscale trend marks of the four pixel points with the grayscale trend marks of the four pixel samples included in the target pixel sample group, it is determined Figure 4 The pixel samples in the dotted box in the right figure are the target pixel samples.

[0127] In the above two cases, the mobile terminal can make the grayscales between the target pixel values ​​of the n pixels present a certain trend by determining the pixel sample with the same grayscale trend mark as the target pixel sample in at least one pixel sample included in the target pixel sample group. In this way, the boundary problem of the n pixels in the second image can be improved, so that the second image visually presents a gradual effect.

[0128] It should be noted that in the above two cases, the trend of the grayscale values ​​of the n sample pixels and the order of the grayscale values ​​of the n pixels are consistent. That is, if the grayscale trend mark is used to indicate the trend of the grayscale values ​​of the n sample pixels from large to small, the mobile terminal sorts the n pixels in the order of the grayscale values ​​of the n pixels from large to small. If the grayscale trend mark is used to indicate the trend of the grayscale values ​​of the n sample pixels from small to large, the mobile terminal sorts the n pixels in the order of the grayscale values ​​of the n pixels from small to large. Of course, the trend of the grayscale values ​​of the n sample pixels and the order of the grayscale values ​​of the n pixels may also be inconsistent. That is, if the grayscale trend mark is used to indicate the trend of the grayscale values ​​of the n sample pixels from large to small, the mobile terminal sorts the n pixels in the order of the grayscale values ​​of the n pixels from small to large. If the grayscale trend mark is used to indicate the trend of the grayscale values ​​of the n sample pixels from small to large, the mobile terminal sorts the n pixels according to the grayscale values ​​of the n pixels from large to small.

[0129] The above-mentioned method of determining the target pixel sample is an example. In other embodiments, the mobile terminal can also determine the target pixel sample in other ways. For example, the mobile terminal sorts the n pixel points according to the size relationship of the grayscale values ​​of the n pixel points to obtain a sorting result, and based on the first number and the second number corresponding to the target pixel sample group, according to the sorting result, determines whether the color of each pixel point in the n pixel points is the first alternative color or the second alternative color, the first number is the number of sample pixel points of the first alternative color in the n sample pixel points, and the second number is the number of sample pixel points of the second alternative color in the n sample pixel points. According to the color determination result of the n pixel points, the target pixel sample is determined from at least one pixel sample included in the target pixel sample group.

[0130] Since the mobile terminal can sort the n pixels in descending order of their grayscale values, and can also sort the n pixels in descending order of their grayscale values, in different situations, the process of the mobile terminal determining the target pixel sample from at least one pixel sample included in the target pixel sample group is different, so the following will be divided into the following two situations for explanation respectively.

[0131] In the first case, the mobile terminal sorts the n pixels in descending order of their grayscale values ​​to obtain a sorting result. When the grayscale value of the first candidate color is greater than the grayscale value of the second candidate color, according to the sorting result, the colors of the first number of pixels ranked first among the n pixels are determined as the first candidate color, and the colors of the other pixels are determined as the second candidate color. When the grayscale value of the first candidate color is less than the grayscale value of the second candidate color, according to the sorting result, the colors of the second number of pixels ranked first among the n pixels are determined as the second candidate color, and the colors of the other pixels are determined as the first candidate color. Then, according to the color determination result of the n pixels, the target pixel sample is determined from at least one pixel sample included in the target pixel sample group.

[0132] It is worth noting that if the first number corresponding to the target pixel sample group is n and the second number is 0, it indicates that the target pixel sample group includes one pixel sample, and the colors of the n sample pixel points included in the pixel sample are all the first candidate colors. At this time, the pixel sample included in the target pixel sample group can be directly determined as the target pixel sample. Similarly, if the second number corresponding to the target pixel sample group is n and the first number is 0, it indicates that the target pixel sample group includes one pixel sample, and the colors of the n sample pixel points included in the pixel sample are all the second candidate colors. At this time, the pixel sample included in the target pixel sample group can be directly determined as the target pixel sample.

[0133] For example, n is 4, the first candidate color is black, the second candidate color is white, the grayscale value of black is 0, the grayscale value of white is 255, and the grayscale value of black is less than the grayscale value of white. Figure 2 The pixel sample group 2 in the mobile terminal is determined as the target pixel sample group, and the first number corresponding to the pixel sample group 2 is 1, and the second number is 3. The mobile terminal sorts the four pixel points in descending order of the grayscale values ​​of the four pixel points, and according to the sorting result, the colors of the top three pixel points in the four pixel points are determined to be white, and the colors of the other pixel points are determined to be black. Then, the pixel samples are compared with each other in the pixel sample group 2 to determine the target pixel sample.

[0134] In the second case, the mobile terminal sorts the n pixels in the order of the grayscale values ​​of the n pixels from small to large to obtain a sorting result. When the grayscale value of the first candidate color is greater than the grayscale value of the second candidate color, according to the sorting result, the colors of the second number of pixels ranked first among the n pixels are determined as the second candidate color, and the colors of the other pixels are determined as the first candidate color. When the grayscale value of the first candidate color is less than the grayscale value of the second candidate color, according to the sorting result, the colors of the first number of pixels ranked first among the n pixels are determined as the first candidate color, and the colors of the other pixels are determined as the second candidate color. Then, according to the color determination result of the n pixels, the target pixel sample is determined from at least one pixel sample included in the target pixel sample group.

[0135] It is worth noting that if the first number corresponding to the target pixel sample group is n and the second number is 0, it indicates that the target pixel sample group includes one pixel sample, and the colors of the n sample pixel points included in the pixel sample are all the first candidate colors. At this time, the pixel sample included in the target pixel sample group can be directly determined as the target pixel sample. Similarly, if the second number corresponding to the target pixel sample group is n and the first number is 0, it indicates that the target pixel sample group includes one pixel sample, and the colors of the n sample pixel points included in the pixel sample are all the second candidate colors. At this time, the pixel sample included in the target pixel sample group can be directly determined as the target pixel sample.

[0136] For example, n is 4, the first candidate color is black, the second candidate color is white, the grayscale value of black is 0, the grayscale value of white is 255, and the grayscale value of black is less than the grayscale value of white. Assume that the mobile terminal determines pixel sample group 2 as the target pixel sample group, the first number corresponding to pixel sample group 2 is 1, and the second number is 3. The mobile terminal sorts the 4 pixels in the order of the grayscale values ​​of the 4 pixels from small to large, and according to the sorting result, the color of the top pixel among the 4 pixels is determined as black, and the colors of the other pixels are determined as white. Then, it is compared with each pixel sample in pixel sample group 2 to determine the target pixel sample.

[0137] Based on the above description, the pixel value of each sample pixel point in the n sample pixel points in the pixel sample is the pixel value of the first candidate color or the second candidate color. Therefore, in the above two cases, by determining whether the color of each pixel point in the n pixel points is the first candidate color or the second candidate color, the color determination result of the n pixel points is obtained, and then the target pixel sample can be accurately determined from the at least one pixel sample included in the target pixel sample group.

[0138] Step 103: based on the target pixel samples and the initial pixel values ​​of the n pixels, determine the target pixel values ​​of the n pixels from the pixel values ​​corresponding to a plurality of candidate colors.

[0139] The multiple candidate colors also include a third candidate color with a hue. For any pixel point among the n pixel points, it is determined whether an initial pixel value of the any pixel point satisfies a pixel condition of the third candidate color. If the initial pixel value of the any pixel point satisfies the pixel condition of the third candidate color, the pixel value corresponding to the third candidate color is determined as the target pixel value of the any pixel point. If the initial pixel value of the any pixel point does not satisfy the pixel condition of the third candidate color, the pixel value of the sample pixel point at the corresponding position of the any pixel point in the target pixel sample is determined as the target pixel value of the any pixel point.

[0140] Since the pixel condition of the third alternative color is used to determine whether the color of any pixel belongs to the third alternative color, if the initial pixel value of any pixel satisfies the pixel condition of the third alternative color, it indicates that the color of any pixel belongs to the third alternative color. Therefore, the pixel value corresponding to the third alternative color is determined as the target pixel value of any pixel. If the initial pixel value of any pixel does not satisfy the pixel condition of the third alternative color, it indicates that the color of any pixel does not belong to the third alternative color. In the case where the color of any pixel does not belong to the third alternative color, since the multiple alternative colors include the first alternative color and the second alternative color in addition to the third alternative color, and the pixel value of each sample pixel in the target pixel sample is the pixel value of the first alternative color or the second alternative color. Therefore, the pixel value of the sample pixel at the corresponding position of any pixel in the target pixel sample is determined as the target pixel value of any pixel.

[0141] Since the first candidate color and the second candidate color do not have hue, the grayscale value of the first candidate color and the grayscale value of the second candidate color have a size relationship, and the third candidate color has a hue, so the grayscale value of the third candidate color is between the grayscale value of the first candidate color and the grayscale value of the second candidate color. In addition, since the grayscale values ​​of the n sample pixel points included in the target pixel sample have a trend of a size relationship, when the initial pixel value of a certain pixel point meets the pixel condition of the third candidate color, it indicates that the grayscale value of the pixel point is between the grayscale value of the first candidate color and the grayscale value of the second candidate color. At this time, after the target pixel value of the pixel point is determined as the pixel value corresponding to the third candidate color, there is still a trend of a size relationship between the grayscale values ​​of the n pixel points.

[0142] For example, the first candidate color is black, the second candidate color is white, and the third candidate color is red. At this time, the minimum grayscale value of black is 0, the maximum grayscale value of white is 255, and the grayscale value of red is between the grayscale value of black and the grayscale value of white, which is 85. The grayscale values ​​of the n sample pixels included in the target pixel sample have a trend of the magnitude relationship of the grayscale values. Therefore, when the initial pixel value of a certain pixel meets the pixel condition of the third candidate color, it indicates that the grayscale value of the pixel is between the grayscale value of black and the grayscale value of white. At this time, after the target pixel value of the pixel is determined to be red, the grayscale values ​​of the n pixels still have a trend of the magnitude relationship of the grayscale values.

[0143] Among them, the pixel condition of the third alternative color is set in advance. Moreover, the pixel condition of the third alternative color can also be adjusted according to different needs. In actual application, the third alternative color may only include the third alternative color, and may also include other colors close to the third alternative color. For example, the first alternative color is black, the second alternative color is white, and the third alternative color is red. Only red can be classified as red, and other colors can be classified as black or white. Alternatively, red and orange close to red can be classified as red, and other colors can be classified as black or white. Alternatively, red and pink close to red can be classified as red, and other colors can be classified as black or white. When different colors are classified as red, the pixel conditions of the third alternative color are different. For example, when red and orange, which is close to red, are classified as red, the pixel condition of the third alternative color is (R≥G&&R≥B&&G≥B&&G-B<200&&R-G>15); when red and pink, which is close to red, are classified as red, the pixel condition of the third alternative color is (R≥G&&R≥B&&B≥G&&B-G<50&&R-G>50).

[0144] Step 104: converting the initial pixel values ​​of the n pixels in the first image into corresponding target pixel values.

[0145] After the mobile terminal determines the target pixel value of each of the n pixels in the first image according to the above method, the target pixel values ​​of the n pixels are input into the DrawRect function to obtain a data stream output by the DrawRect function, which corresponds to the target color of the n pixels.

[0146] The mobile terminal may determine the target pixel values ​​of all pixels in the first image and convert the initial pixel values ​​of all pixels in the first image to the corresponding target pixel values, or may only determine the initial pixel values ​​of some pixels in the first image and convert the initial pixel values ​​of some pixels in the first image to the corresponding target pixel values. If the mobile terminal converts the initial pixel values ​​of all pixels in the first image to the corresponding target pixel values, the initial pixel values ​​of every n pixels in the first image are converted in sequence according to the above steps 101-104. At this time, after the mobile terminal traverses n pixels each time, it is necessary to convert the initial pixel values ​​of the n pixels to the corresponding target pixel values. Then, it is determined whether the traversal of all pixels in the first image is completed. If the traversal of all pixels in the first image is completed, the second image is output. If the traversal of all pixels in the first image is not completed, the target pixel values ​​of the other n pixels that have not been traversed in the first image are determined according to the above steps 101-104 until all pixels in the first image are traversed, and then the second image is output. That is, the first image includes multiple groups of pixels, each group of pixels includes n pixels, and after the initial pixel value of each pixel in the multiple groups of pixels in the first image is converted into a corresponding target pixel value, the second image can be obtained.

[0147] There are many implementations for the mobile terminal to determine whether the traversal of all pixel points in the first image is completed. For example, based on the above description, the position coordinates of each pixel point in the first image are in units of pixel points. If there is a pixel point whose position coordinates are equal to the pixel width and pixel height of the first image among the n pixel points currently traversed, it indicates that the n pixel points currently traversed are the last n pixel points in the first image to be processed. That is, the traversal of the first image is completed, and the mobile terminal outputs the second image. For another example, if the mobile terminal traverses to the current n pixel points, the number of traversals of the mobile terminal is equal to the total number of traversals of the first image, it indicates that the current n pixel points are the last n pixel points in the first image to be processed. That is, the traversal of the first image is completed, and the mobile terminal outputs the second image.

[0148] Among them, the total number of traversals of the first image can be determined based on the pixel width of the first image and the value of n, and can also be determined based on the pixel height of the first image and the value of n. Of course, the total number of traversals of the first image can also be determined in other ways, and the embodiments of the present application are not limited to this. Assume that the pixel width of the first image is 800 pixels, and n is 4, then 2 pixels are taken horizontally each time the traversal is performed. At this time, the total number of traversals of the first image is 400 times.

[0149] For example, please refer to Figure 5 , Figure 5is a schematic diagram of an image conversion result provided by an embodiment of the present application. Figure 5 In the figure, the left image is an image obtained by converting after determining the target pixel value of each pixel point in the first image by other methods, and the right image is an image obtained by converting after determining the target pixel value of each pixel point in the first image by the method provided by the present application. Figure 5 By comparing the left image with the right image in the figure, it can be seen that by determining the target pixel values ​​of the n adjacent pixel points in the first image through the method provided in the embodiment of the present application, certain boundary problems of the first image can be eliminated.

[0150] It should be noted that the number of pixels in the first image is not necessarily an integer multiple of n. That is, after taking the n pixels as a whole and determining the target pixel value according to the above method, there may still be some pixels on the edge of the first image that cannot form n pixels. The corresponding target pixel values ​​of these pixels can be determined in other ways, and the embodiments of the present application do not limit this.

[0151] In the embodiment of the present application, since the grayscale trend of the n sample pixels included in the target pixel sample is the same as the grayscale trend of the n adjacent pixels in the first image to be processed, the grayscale between the target pixel values ​​of the n pixels determined according to the grayscale trend of the n sample pixels presents a certain trend. In this way, the boundary problem of the n pixels in the second image can be improved, so that the second image visually presents a gradual effect.

[0152] Figure 6 This is a schematic diagram of the structure of an image processing device provided by an embodiment of the present application. The image processing device can be implemented by software, hardware or a combination of both to become part or all of the image processing equipment. Figure 6 The device includes: a first determination module 601, a second determination module 602, a third determination module 603 and a conversion module 604.

[0153] The first determination module 601 is used to determine a target pixel sample group from a plurality of pixel sample groups based on the average grayscale value of n adjacent pixel points in the first image to be processed, wherein each pixel sample group in the plurality of pixel sample groups includes at least one pixel sample, each pixel sample includes n sample pixel points, the average grayscale values ​​of pixel samples in different pixel sample groups are different, and the average grayscale values ​​of pixel samples in the same pixel sample group are the same. The detailed implementation process refers to the corresponding contents in the above-mentioned embodiments, which will not be repeated here.

[0154] The second determination module 602 is used to determine a target pixel sample from at least one pixel sample included in the target pixel sample group based on the grayscale value of each pixel in the n pixels, and the grayscale trend of the n sample pixels included in the target pixel sample is the same as the grayscale trend of the n pixels. The detailed implementation process refers to the corresponding content in the above embodiments, which will not be repeated here.

[0155] The third determination module 603 is used to determine the target pixel value of the n pixels from the pixel values ​​corresponding to the multiple candidate colors based on the target pixel sample and the initial pixel values ​​of the n pixels. The detailed implementation process refers to the corresponding content in the above embodiments, which will not be repeated here.

[0156] The conversion module 604 is used to convert the initial pixel values ​​of the n pixels in the first image into corresponding target pixel values. The detailed implementation process refers to the corresponding content in the above embodiments, which will not be repeated here.

[0157] Optionally, the first determining module 601 is specifically configured to:

[0158] Determine a target average grayscale range in which the average grayscale values ​​of the n pixels are located from a plurality of average grayscale ranges, wherein the plurality of average grayscale ranges are formed by the average grayscale values ​​corresponding to the plurality of pixel sample groups;

[0159] The pixel sample group corresponding to the lower limit of the target average grayscale range is determined as the target pixel sample group.

[0160] Optionally, the first determining module 601 is specifically configured to:

[0161] Determine the difference between the average grayscale value corresponding to each pixel sample group in the multiple pixel sample groups and the average grayscale value of the n pixels;

[0162] A pixel sample group with the smallest difference among the multiple pixel sample groups is determined as a target pixel sample group.

[0163] Optionally, the multiple candidate colors include a first candidate color without hue and a second candidate color, the pixel value of each sample pixel point in the n sample pixel points is the pixel value of the first candidate color or the second candidate color, and each pixel sample in the target pixel sample group corresponds to a grayscale trend mark, and the grayscale trend mark is used to indicate the grayscale trend of the n sample pixel points included in the pixel sample;

[0164] The second determining module 602 is specifically used for:

[0165] Sorting the n pixel points according to the magnitude relationship of the grayscale values ​​of the n pixel points to obtain a sorting result;

[0166] Based on the first number and the second number corresponding to the target pixel sample group, according to the sorting result, determine the grayscale trend marks of the n pixel points, the first number being the number of sample pixel points of the first candidate color among the n sample pixel points, and the second number being the number of sample pixel points of the second candidate color among the n sample pixel points;

[0167] A pixel sample whose grayscale trend mark is the same as the grayscale trend marks of the n pixels among at least one pixel sample included in the target pixel sample group is determined as the target pixel sample.

[0168] Optionally, the multiple candidate colors include a first candidate color without hue and a second candidate color, and a pixel value of each sample pixel point in the n sample pixel points is a pixel value of the first candidate color or the second candidate color;

[0169] The second determining module 602 is specifically used for:

[0170] Sorting the n pixel points according to the magnitude relationship of the grayscale values ​​of the n pixel points to obtain a sorting result;

[0171] Based on the first number and the second number corresponding to the target pixel sample group, determining whether the color of each pixel point in the n pixel points is the first candidate color or the second candidate color according to the sorting result, the first number is the number of sample pixel points of the first candidate color in the n sample pixel points, and the second number is the number of sample pixel points of the second candidate color in the n sample pixel points;

[0172] According to the color determination results of the n pixels, a target pixel sample is determined from at least one pixel sample included in the target pixel sample group.

[0173] Optionally, the plurality of candidate colors further comprises a third candidate color having a hue;

[0174] The third determining module 603 is specifically used for:

[0175] For any pixel point among the n pixel points, determining whether an initial pixel value of the any pixel point satisfies a pixel condition of a third candidate color;

[0176] When the initial pixel value of any pixel point meets the pixel condition of the third candidate color, the pixel value corresponding to the third candidate color is determined as the target pixel value of the any pixel point;

[0177] When the initial pixel value of any pixel does not satisfy the pixel condition of the third candidate color, the pixel value of the sample pixel at the position corresponding to the any pixel in the target pixel sample is determined as the target pixel value of the any pixel.

[0178] Optionally, the first image includes multiple groups of pixels, each group of pixels includes n pixels, and the device further includes:

[0179] The obtaining module is used to obtain a second image, wherein the second image includes the multiple groups of pixel points, and the initial pixel value of each pixel point in the multiple groups of pixel points in the first image has been converted into a corresponding target pixel value.

[0180] Optionally, n is 4.

[0181] In the embodiment of the present application, since the grayscale trend of the n sample pixels included in the target pixel sample is the same as the grayscale trend of the n adjacent pixels in the first image to be processed, the grayscale between the target pixel values ​​of the n pixels determined according to the grayscale trend of the n sample pixels presents a certain trend. In this way, the boundary problem of the n pixels in the second image can be improved, so that the second image visually presents a gradual effect.

[0182] It should be noted that: when the image processing device provided in the above embodiment performs image processing, only the division of the above functional modules is used as an example. In actual applications, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the device is divided into different functional modules to complete all or part of the functions described above. In addition, the image processing device provided in the above embodiment and the image processing method embodiment belong to the same concept, and the specific implementation process is detailed in the method embodiment, which will not be repeated here.

[0183] Figure 7 1 is a block diagram of a mobile terminal 700 provided in an embodiment of the present application. The mobile terminal 700 may be a portable mobile terminal, such as a smart phone, a tablet computer, an MP3 player (Moving Picture Experts Group Audio Layer III), an MP4 player (Moving Picture Experts Group Audio Layer IV), a laptop computer or a desktop computer. The mobile terminal 700 may also be referred to as a user device, a portable terminal, a laptop terminal, a desktop terminal or other names.

[0184] Typically, the mobile terminal 700 includes a processor 701 and a memory 702 .

[0185] The processor 701 may include one or more processing cores, such as a 4-core processor, an 8-core processor, etc. The processor 701 may be implemented in at least one hardware form of DSP (Digital Signal Processing), FPGA (Field-Programmable Gate Array), and PLA (Programmable Logic Array). The processor 701 may also include a main processor and a coprocessor. The main processor is a processor for processing data in the awake state, also known as a CPU (Central Processing Unit); the coprocessor is a low-power processor for processing data in the standby state. In some embodiments, the processor 701 may be integrated with a GPU (Graphics Processing Unit), which is responsible for rendering and drawing the content to be displayed on the display screen. In some embodiments, the processor 701 may also include an AI (Artificial Intelligence) processor, which is used to process computing operations related to machine learning.

[0186] The memory 702 may include one or more computer-readable storage media, which may be non-transitory. The memory 702 may also include a high-speed random access memory, and a non-volatile memory, such as one or more disk storage devices, flash memory storage devices. In some embodiments, the non-transitory computer-readable storage medium in the memory 702 is used to store at least one instruction, which is used to be executed by the processor 701 to implement the image processing method provided in the method embodiment of the present application.

[0187] In some embodiments, the mobile terminal 700 may further optionally include: a peripheral device interface 703 and at least one peripheral device. The processor 701, the memory 702 and the peripheral device interface 703 may be connected via a bus or a signal line. Each peripheral device may be connected to the peripheral device interface 703 via a bus, a signal line or a circuit board. Specifically, the peripheral device includes: at least one of a radio frequency circuit 704, a touch display screen 705, a camera 706, an audio circuit 707, a positioning component 708 and a power supply 709.

[0188] The peripheral device interface 703 may be used to connect at least one peripheral device related to I / O (Input / Output) to the processor 701 and the memory 702. In some embodiments, the processor 701, the memory 702, and the peripheral device interface 703 are integrated on the same chip or circuit board; in some other embodiments, any one or two of the processor 701, the memory 702, and the peripheral device interface 703 may be implemented on a separate chip or circuit board, which is not limited in this embodiment.

[0189] The radio frequency circuit 704 is used to receive and transmit RF (Radio Frequency) signals, also known as electromagnetic signals. The radio frequency circuit 704 communicates with the communication network and other communication devices through electromagnetic signals. The radio frequency circuit 704 converts the electrical signal into an electromagnetic signal for transmission, or converts the received electromagnetic signal into an electrical signal. Optionally, the radio frequency circuit 704 includes: an antenna system, an RF transceiver, one or more amplifiers, a tuner, an oscillator, a digital signal processor, a codec chipset, a user identity module card, etc. The radio frequency circuit 704 can communicate with other terminals through at least one wireless communication protocol. The wireless communication protocol includes but is not limited to: the World Wide Web, a metropolitan area network, an intranet, various generations of mobile communication networks (2G, 3G, 4G and 5G), a wireless local area network and / or a WiFi (Wireless Fidelity) network. In some embodiments, the radio frequency circuit 704 may also include circuits related to NFC (Near Field Communication), which is not limited in the embodiments of the present application.

[0190] The display screen 705 is used to display a UI (User Interface). The UI may include graphics, text, icons, videos, and any combination thereof. When the display screen 705 is a touch display screen, the display screen 705 also has the ability to collect touch signals on the surface or above the surface of the display screen 705. The touch signal can be input to the processor 701 as a control signal for processing. At this time, the display screen 705 can also be used to provide virtual buttons and / or virtual keyboards, also known as soft buttons and / or soft keyboards. In some embodiments, the display screen 705 can be one, and the front panel of the mobile terminal 700 is set; in other embodiments, the display screen 705 can be at least two, which are respectively set on different surfaces of the mobile terminal 700 or are folded; in some other embodiments, the display screen 705 can be a flexible display screen, which is set on the curved surface or folded surface of the mobile terminal 700. Even, the display screen 705 can also be set to a non-rectangular irregular shape, that is, a special-shaped screen. The display screen 705 can be made of materials such as LCD (Liquid Crystal Display), OLED (Organic Light-Emitting Diode, organic light-emitting diode).

[0191] The camera assembly 706 is used to capture images or videos. Optionally, the camera assembly 706 includes a front camera and a rear camera. Typically, the front camera is arranged on the front panel of the terminal, and the rear camera is arranged on the back of the terminal. In some embodiments, there are at least two rear cameras, which are any one of a main camera, a depth of field camera, a wide-angle camera, and a telephoto camera, so as to realize the fusion of the main camera and the depth of field camera to realize the background blur function, the fusion of the main camera and the wide-angle camera to realize panoramic shooting and VR (Virtual Reality) shooting function or other fusion shooting functions. In some embodiments, the camera assembly 706 may also include a flash. The flash can be a monochrome temperature flash or a dual-color temperature flash. A dual-color temperature flash refers to a combination of a warm light flash and a cold light flash, which can be used for light compensation at different color temperatures.

[0192] The audio circuit 707 may include a microphone and a speaker. The microphone is used to collect sound waves from the user and the environment, and convert the sound waves into electrical signals and input them into the processor 701 for processing, or input them into the radio frequency circuit 704 to achieve voice communication. For the purpose of stereo acquisition or noise reduction, there may be multiple microphones, which are respectively arranged at different parts of the mobile terminal 700. The microphone may also be an array microphone or an omnidirectional acquisition microphone. The speaker is used to convert the electrical signal from the processor 701 or the radio frequency circuit 704 into sound waves. The speaker may be a traditional film speaker or a piezoelectric ceramic speaker. When the speaker is a piezoelectric ceramic speaker, it can not only convert the electrical signal into sound waves audible to humans, but also convert the electrical signal into sound waves inaudible to humans for purposes such as ranging. In some embodiments, the audio circuit 707 may also include a headphone jack.

[0193] Positioning component 708 is used to locate the current geographical location of mobile terminal 700 to implement navigation or LBS (Location Based Service). Positioning component 708 can be a positioning component based on the US GPS (Global Positioning System), China's Beidou system or Russia's Galileo system.

[0194] The power supply 709 is used to power various components in the mobile terminal 700. The power supply 709 can be an alternating current, a direct current, a disposable battery, or a rechargeable battery. When the power supply 709 includes a rechargeable battery, the rechargeable battery can be a wired rechargeable battery or a wireless rechargeable battery. A wired rechargeable battery is a battery charged through a wired line, and a wireless rechargeable battery is a battery charged through a wireless coil. The rechargeable battery can also be used to support fast charging technology.

[0195] In some embodiments, the mobile terminal 700 further includes one or more sensors 710 , including but not limited to: an acceleration sensor 711 , a gyroscope sensor 712 , a pressure sensor 713 , a fingerprint sensor 714 , an optical sensor 715 , and a proximity sensor 716 .

[0196] The acceleration sensor 711 can detect the magnitude of acceleration on the three coordinate axes of the coordinate system established by the mobile terminal 700. For example, the acceleration sensor 711 can be used to detect the components of gravity acceleration on the three coordinate axes. The processor 701 can control the touch display screen 705 to display the user interface in a horizontal view or a vertical view according to the gravity acceleration signal collected by the acceleration sensor 711. The acceleration sensor 711 can also be used for collecting game or user motion data.

[0197] The gyro sensor 712 can detect the body direction and rotation angle of the mobile terminal 700, and the gyro sensor 712 can cooperate with the acceleration sensor 711 to collect the user's 3D actions on the mobile terminal 700. The processor 701 can implement the following functions based on the data collected by the gyro sensor 712: motion sensing (such as changing the UI according to the user's tilt operation), image stabilization during shooting, game control, and inertial navigation.

[0198] The pressure sensor 713 can be set on the side frame of the mobile terminal 700 and / or the lower layer of the touch display screen 705. When the pressure sensor 713 is set on the side frame of the mobile terminal 700, it can detect the user's holding signal of the mobile terminal 700, and the processor 701 performs left and right hand recognition or shortcut operation according to the holding signal collected by the pressure sensor 713. When the pressure sensor 713 is set on the lower layer of the touch display screen 705, the processor 701 controls the operability controls on the UI interface according to the user's pressure operation on the touch display screen 705. The operability controls include at least one of a button control, a scroll bar control, an icon control, and a menu control.

[0199] The fingerprint sensor 714 is used to collect the user's fingerprint, and the processor 701 identifies the user's identity based on the fingerprint collected by the fingerprint sensor 714, or the fingerprint sensor 714 identifies the user's identity based on the collected fingerprint. When the user's identity is identified as a trusted identity, the processor 701 authorizes the user to perform relevant sensitive operations, which include unlocking the screen, viewing encrypted information, downloading software, paying, and changing settings. The fingerprint sensor 714 can be set on the front, back, or side of the mobile terminal 700. When a physical button or a manufacturer logo is set on the mobile terminal 700, the fingerprint sensor 714 can be integrated with the physical button or the manufacturer logo.

[0200] The optical sensor 715 is used to collect the ambient light intensity. In one embodiment, the processor 701 can control the display brightness of the touch display screen 705 according to the ambient light intensity collected by the optical sensor 715. Specifically, when the ambient light intensity is high, the display brightness of the touch display screen 705 is increased; when the ambient light intensity is low, the display brightness of the touch display screen 705 is reduced. In another embodiment, the processor 701 can also dynamically adjust the shooting parameters of the camera assembly 706 according to the ambient light intensity collected by the optical sensor 715.

[0201] The proximity sensor 716, also called a distance sensor, is usually disposed on the front panel of the mobile terminal 700. The proximity sensor 716 is used to collect the distance between the user and the front of the mobile terminal 700. In one embodiment, when the proximity sensor 716 detects that the distance between the user and the front of the mobile terminal 700 is gradually decreasing, the processor 701 controls the touch display screen 705 to switch from the screen-on state to the screen-off state; when the proximity sensor 716 detects that the distance between the user and the front of the mobile terminal 700 is gradually increasing, the processor 701 controls the touch display screen 705 to switch from the screen-off state to the screen-on state.

[0202] Those skilled in the art will understand that Figure 7 The structure shown in the figure does not constitute a limitation on the mobile terminal 700, and may include more or less components than those shown in the figure, or combine certain components, or adopt a different component arrangement.

[0203] In some embodiments, a non-transitory computer-readable storage medium is also provided, in which a computer program is stored, and when the computer program is executed by a processor, the steps of the image processing method in the above embodiment are implemented. For example, the computer-readable storage medium can be a ROM, RAM, CD-ROM, magnetic tape, floppy disk, optical data storage device, etc.

[0204] It is worth noting that the computer-readable storage medium mentioned in the embodiments of the present application may be a non-volatile storage medium, in other words, a non-transitory storage medium.

[0205] It should be understood that all or part of the steps to implement the above embodiments can be implemented by software, hardware, firmware or any combination thereof. When implemented using software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. The computer instructions can be stored in the above-mentioned computer readable storage medium.

[0206] That is, in some embodiments, a computer program product including instructions is also provided, which, when executed on a computer, enables the computer to execute the steps of the above-mentioned image processing method.

[0207] It should be understood that the "at least one" mentioned herein refers to one or more, and "multiple" refers to two or more. In the description of the embodiments of the present application, unless otherwise specified, " / " means or, for example, A / B can mean A or B; "and / or" in this article is only a description of the association relationship of the associated objects, indicating that there can be three relationships, for example, A and / or B can mean: A exists alone, A and B exist at the same time, and B exists alone. In addition, in order to facilitate the clear description of the technical solutions of the embodiments of the present application, in the embodiments of the present application, the words "first", "second" and the like are used to distinguish the same items or similar items with basically the same functions and effects. Those skilled in the art can understand that the words "first", "second" and the like do not limit the quantity and execution order, and the words "first", "second" and the like do not limit them to be necessarily different.

[0208] The above-mentioned embodiments are provided for the present application and are not intended to limit the present application. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present application shall be included in the protection scope of the present application.

Claims

1. An image processing method, characterized in that: The method comprises: Based on the average grayscale value of n adjacent pixel points in the first image to be processed, determining a target pixel sample group from a plurality of pixel sample groups, wherein each pixel sample group in the plurality of pixel sample groups includes at least one pixel sample, each pixel sample includes n sample pixel points, the average grayscale values ​​of pixel samples in different pixel sample groups are different, and the average grayscale values ​​of pixel samples in the same pixel sample group are the same; Based on the grayscale value of each pixel point in the n pixel points, determine a target pixel sample from at least one pixel sample included in the target pixel sample group, wherein the grayscale trend of the n sample pixel points included in the target pixel sample is the same as the grayscale trend of the n pixel points; Determining target pixel values ​​of the n pixels from pixel values ​​corresponding to a plurality of candidate colors based on the target pixel samples and the initial pixel values ​​of the n pixels; The initial pixel values ​​of the n pixels in the first image are converted into corresponding target pixel values.

2. The method according to claim 1, characterized in that The step of determining a target pixel sample group from a plurality of pixel sample groups based on an average grayscale value of n adjacent pixel points in a first image to be processed includes: Determine a target average grayscale range in which the average grayscale values ​​of the n pixels are located from a plurality of average grayscale ranges, wherein the plurality of average grayscale ranges are formed by the average grayscale values ​​corresponding to the plurality of pixel sample groups; A pixel sample group corresponding to the lower limit of the target average grayscale range is determined as the target pixel sample group.

3. The method according to claim 1, characterized in that The step of determining a target pixel sample group from a plurality of pixel sample groups based on an average grayscale value of n adjacent pixel points in a first image to be processed includes: Determine a difference between an average grayscale value corresponding to each pixel sample group in the plurality of pixel sample groups and an average grayscale value of the n pixels; The pixel sample group with the smallest difference value among the multiple pixel sample groups is determined as the target pixel sample group.

4. The method according to claim 1, characterized in that The multiple candidate colors include a first candidate color and a second candidate color without hue, the pixel value of each sample pixel point in the n sample pixel points is the pixel value of the first candidate color or the second candidate color, and each pixel sample in the target pixel sample group corresponds to a grayscale trend mark, and the grayscale trend mark is used to indicate the grayscale trend of the n sample pixel points included in the pixel sample; The step of determining a target pixel sample from at least one pixel sample included in the target pixel sample group based on the grayscale value of each pixel in the n pixels comprises: Sorting the n pixel points according to the magnitude relationship of the grayscale values ​​of the n pixel points to obtain a sorting result; Based on a first number and a second number corresponding to the target pixel sample group, determining the grayscale trend marks of the n pixel points according to the sorting result, the first number being the number of sample pixel points of the first candidate color among the n sample pixel points, and the second number being the number of sample pixel points of the second candidate color among the n sample pixel points; A pixel sample whose grayscale trend mark is the same as the grayscale trend marks of the n pixels among at least one pixel sample included in the target pixel sample group is determined as the target pixel sample.

5. The method according to claim 1, characterized in that The multiple candidate colors include a first candidate color without hue and a second candidate color, and the pixel value of each sample pixel point in the n sample pixel points is the pixel value of the first candidate color or the second candidate color; The step of determining a target pixel sample from at least one pixel sample included in the target pixel sample group based on the grayscale value of each pixel in the n pixels comprises: Sorting the n pixel points according to the magnitude relationship of the grayscale values ​​of the n pixel points to obtain a sorting result; Based on a first number and a second number corresponding to the target pixel sample group, determining whether the color of each pixel point among the n pixel points is the first candidate color or the second candidate color according to the sorting result, the first number being the number of sample pixel points of the first candidate color among the n sample pixel points, and the second number being the number of sample pixel points of the second candidate color among the n sample pixel points; According to the color determination results of the n pixel points, the target pixel sample is determined from at least one pixel sample included in the target pixel sample group.

6. The method according to claim 4 or 5, characterized in that The plurality of candidate colors also includes a third candidate color having a hue; The step of determining the target pixel values ​​of the n pixels from the pixel values ​​corresponding to the multiple candidate colors based on the target pixel sample and the initial pixel values ​​of the n pixels comprises: For any pixel point among the n pixel points, determining whether an initial pixel value of the any pixel point satisfies a pixel condition of the third candidate color; When the initial pixel value of any pixel point satisfies the pixel condition of the third candidate color, the pixel value corresponding to the third candidate color is determined as the target pixel value of any pixel point; When the initial pixel value of any pixel point does not satisfy the pixel condition of the third candidate color, the pixel value of the sample pixel point at the position corresponding to any pixel point in the target pixel sample is determined as the target pixel value of any pixel point.

7. The method according to any one of claims 1 to 5, characterized in that: The first image includes multiple groups of pixels, each group of pixels includes n pixels, and the method further includes: A second image is obtained, wherein the second image includes the multiple groups of pixel points, and the initial pixel value of each pixel point in the multiple groups of pixel points in the first image has been converted into a corresponding target pixel value.

8. The method according to any one of claims 1 to 5, characterized in that: The n is 4.

9. An image processing device, characterized in that: The device comprises: A first determination module is used to determine a target pixel sample group from a plurality of pixel sample groups based on an average grayscale value of n adjacent pixel points in a first image to be processed, wherein each pixel sample group in the plurality of pixel sample groups includes at least one pixel sample, each pixel sample includes n sample pixel points, the average grayscale values ​​of pixel samples in different pixel sample groups are different, and the average grayscale values ​​of pixel samples in the same pixel sample group are the same; a second determining module, configured to determine a target pixel sample from at least one pixel sample included in the target pixel sample group based on the grayscale value of each pixel in the n pixels, wherein the grayscale trend of the n sample pixels included in the target pixel sample is the same as the grayscale trend of the n pixels; A third determination module, configured to determine target pixel values ​​of the n pixels from pixel values ​​corresponding to a plurality of candidate colors based on the target pixel sample and the initial pixel values ​​of the n pixels; A conversion module is used to convert the initial pixel values ​​of the n pixel points in the first image into corresponding target pixel values.

10. An image processing device, characterized in that: The image processing device comprises a memory and a processor, wherein the memory is used to store a computer program, and the processor is used to execute the computer program stored in the memory to implement the steps of any one of the methods described in claims 1-8.

11. A non-transitory computer-readable storage medium, characterized in that: The storage medium stores a computer program, and when the computer program is executed by a processor, the steps of any one of the methods of claims 1-8 are implemented.