Image processing method, device, electronic device and computer storage medium

By using a benchmark lookup table to store the transformation matrix in image processing, the problems of low efficiency and decreased accuracy caused by large LUT data volume are solved, achieving efficient and accurate image processing.

CN111784558BActive Publication Date: 2024-11-22VIVO MOBILE COMM CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202010558331.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-06-18
Publication Date
2024-11-22
Estimated Expiration
2040-06-18

AI Technical Summary

Technical Problem

In existing technologies, the large amount of data in LUTs leads to low image processing efficiency, while simplifying LUTs results in a decrease in image processing accuracy, making it difficult to balance efficiency and accuracy.

Method used

By using a reference display lookup table, a transformation matrix is ​​stored to represent the RGB value conversion relationship between the source and target storage regions, without needing to store all RGB values ​​in the target display lookup table. Image processing is then performed using the transformation matrix.

Benefits of technology

While reducing the amount of stored data, it improves the overall efficiency of image processing and ensures the accuracy of image processing without destroying the continuity of the color space.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN111784558B_ABST
    Figure CN111784558B_ABST
Patent Text Reader

Abstract

The present application provides an image processing method, device, electronic device and computer storage medium, wherein the reference target display lookup table stores a conversion matrix, and no longer needs to store all the RGB values ​​in the target display lookup table, so that the stored data is reduced. On the basis of the reduction of the stored data, the amount of data acquisition can be reduced, and the overall time of image processing can be shortened, thereby improving the overall efficiency of image processing. In addition, since the conversion matrix corresponding to the RGB value of each pixel can characterize the conversion relationship between the RGB value of each pixel and the corresponding RGB value, the RGB value of each pixel is converted based on the conversion relationship between the RGB value of each pixel and the corresponding RGB value, which can ensure that the RGB value of each pixel is converted without destroying the continuity of the color space, thereby ensuring the conversion accuracy and improving the accuracy of image processing.
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, electronic device and computer storage medium. Background Art

[0002] In the field of image processing, LUT (Look-Up-Table) is used to store RGB values ​​obtained by transforming original RGB values ​​based on certain requirements, for example, RGB values ​​obtained by transforming original RGB values ​​based on filter effect requirements. The image processing system reads LUT and adjusts the RGB values ​​in the image to be processed according to LUT to convert the image to be processed into an image different from the image to be processed.

[0003] However, currently, the maximum number of RGB values ​​in the LUT is 256*256*256. It can be seen that the amount of data stored in the LUT is large. The large amount of data will cause the image processing system to spend a long time reading the LUT, which will in turn reduce the overall efficiency of image processing.

[0004] In order to solve the above problems, the LUT is usually simplified, but the simplified LUT will lead to a decrease in the accuracy of image processing. It can be seen that the existing technology has the problem that the efficiency and accuracy of image processing cannot be achieved at the same time. Summary of the invention

[0005] In order to solve the above technical problems, the embodiments of the present application provide an image processing method, device, electronic device and computer storage medium to achieve the purpose of ensuring the efficiency and accuracy of image processing at the same time. The technical solution is as follows:

[0006] On one hand, the present application provides an image processing method, comprising:

[0007] Acquire an image to be processed, wherein the image to be processed includes a plurality of pixels;

[0008] Using a reference display lookup table, respectively determining a conversion matrix corresponding to each pixel, the conversion matrix being used to characterize a conversion relationship between RGB values ​​of a source storage area and a target storage area, the source storage area being composed of a plurality of storage locations in the source display lookup table, and the target storage area being composed of a plurality of storage locations in the target display lookup table corresponding to the plurality of storage locations in the source display lookup table; wherein at least one conversion matrix is ​​stored in the reference display lookup table;

[0009] Based on the conversion matrix corresponding to the RGB value of each pixel, the RGB value of each pixel is converted to obtain the target RGB value corresponding to each pixel, thereby obtaining the target image.

[0010] Optionally, the conversion matrix is ​​constructed by the following steps:

[0011] Get a source display lookup table storing all RGB values ​​of the RGB color space;

[0012] Respectively adjusting each RGB value in the source display lookup table to an RGB value that meets the set requirements, and using the display lookup table storing the RGB values ​​that meet the set requirements as the target display lookup table;

[0013] Using the same division method, the storage locations in the source display lookup table and the target display lookup table are respectively divided into a set number of storage areas, wherein the storage area consists of at least two storage locations;

[0014] For a first storage area in the source display lookup table, the conversion matrix is ​​determined according to an RGB value of the first storage area and an RGB value of a second storage area; wherein the first storage area is composed of at least two storage locations in the source display lookup table, and the second storage area is a storage area in the target display lookup table corresponding to the first storage area in the source display lookup table.

[0015] Optionally, the setting requirement is a set filter effect requirement.

[0016] Optionally, the set number is 512.

[0017] Optionally, the using a reference display lookup table to respectively determine a conversion matrix corresponding to each of the pixels includes:

[0018] For each pixel in the image to be processed, determining a first storage location of the RGB value of the pixel in the source display lookup table;

[0019] Determine a storage area in the reference display lookup table corresponding to the first storage location;

[0020] The conversion matrix stored in the storage area is used as the first conversion matrix corresponding to the pixel.

[0021] Optionally, the using a reference display lookup table to respectively determine a conversion matrix corresponding to each of the pixels includes:

[0022] For each pixel in the image to be processed, determining a first storage location of the RGB value of the pixel in the source display lookup table;

[0023] For each target RGB value having a set relationship with the RGB value of each pixel in the image to be processed, determining a second storage location of the target RGB value in the source display lookup table;

[0024] Determine a first storage area corresponding to the first storage position and a second storage area corresponding to the second storage position in the reference display lookup table;

[0025] A conversion matrix obtained by performing a weighted summation on the conversion matrix stored in the first storage area and the conversion matrix stored in the second storage area is used as a first conversion matrix corresponding to the pixel.

[0026] Another aspect of the present application provides an image processing device, comprising:

[0027] An acquisition module, used for acquiring an image to be processed, wherein the image to be processed includes a plurality of pixels;

[0028] a determination module, configured to determine, using a reference display lookup table, a conversion matrix corresponding to each of the pixels, the conversion matrix being used to characterize a conversion relationship between RGB values ​​of a source storage area and a target storage area, the source storage area being composed of a plurality of storage locations in the source display lookup table, and the target storage area being composed of a plurality of storage locations in the target display lookup table corresponding to the plurality of storage locations in the source display lookup table; wherein the reference display lookup table stores at least one conversion matrix;

[0029] The conversion module is used to convert the RGB values ​​of each pixel based on the conversion matrix corresponding to the RGB value of each pixel, so as to obtain the target RGB value corresponding to each pixel, thereby obtaining the target image.

[0030] Optionally, the device further comprises:

[0031] Building blocks for:

[0032] Get a source display lookup table storing all RGB values ​​of the RGB color space;

[0033] Respectively adjusting each RGB value in the source display lookup table to an RGB value that meets the set requirements, and using the display lookup table storing the RGB values ​​that meet the set requirements as the target display lookup table;

[0034] Using the same division method, the storage locations in the source display lookup table and the target display lookup table are respectively divided into a set number of storage areas, wherein the storage area consists of at least two storage locations;

[0035] For a first storage area in the source display lookup table, the conversion matrix is ​​determined according to an RGB value of the first storage area and an RGB value of a second storage area; wherein the first storage area is composed of at least two storage locations in the source display lookup table, and the second storage area is a storage area in the target display lookup table corresponding to the first storage area in the source display lookup table.

[0036] Optionally, the setting requirement is a set filter effect requirement.

[0037] Optionally, the set number is 512.

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

[0039] For each pixel in the image to be processed, determining a first storage location of the RGB value of the pixel in the source display lookup table;

[0040] Determine a storage area in the reference display lookup table corresponding to the first storage location;

[0041] The conversion matrix stored in the storage area is used as the first conversion matrix corresponding to the pixel.

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

[0043] For each pixel in the image to be processed, determining a first storage location of the RGB value of the pixel in the source display lookup table;

[0044] For each target RGB value having a set relationship with the RGB value of each pixel in the image to be processed, determining a second storage location of the target RGB value in the source display lookup table;

[0045] Determine a first storage area corresponding to the first storage position and a second storage area corresponding to the second storage position in the reference display lookup table;

[0046] A conversion matrix obtained by performing a weighted summation on the conversion matrix stored in the first storage area and the conversion matrix stored in the second storage area is used as a first conversion matrix corresponding to the pixel.

[0047] A third aspect of the present application provides an electronic device, including:

[0048] A memory for storing at least one set of instructions;

[0049] The processor is used to call and execute the instruction set in the memory, and execute each step of the image processing method as described in any one of the above by executing the instruction set.

[0050] A computer storage medium stores a computer program, wherein the computer program is executed by a processor to implement each step of the image processing method as described in any one of the above.

[0051] Compared with the prior art, the beneficial effects of this application are:

[0052] In the present application, the reference target display lookup table stores a conversion matrix for characterizing the conversion relationship between the RGB values ​​of the first storage area in the source display lookup table and the second storage area in the target display lookup table, and no longer needs to store all the RGB values ​​in the target display lookup table, so that the stored data is reduced. On the basis of reducing the stored data, the amount of data acquisition can be reduced, and the overall time of image processing can be shortened, thereby improving the overall efficiency of image processing.

[0053] Furthermore, since the conversion matrix corresponding to the RGB value of each pixel can characterize the conversion relationship between the RGB value of each pixel and the corresponding RGB value, the RGB value of each pixel is converted based on the conversion relationship between the RGB value of each pixel and the corresponding RGB value, it can be ensured that the RGB value of each pixel is converted without destroying the continuity of the color space, thereby ensuring the conversion accuracy and improving the accuracy of image processing. BRIEF DESCRIPTION OF THE DRAWINGS

[0054] 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 paying creative labor.

[0055] Figure 1 is a flow chart of an image processing method provided in Example 1 of the present application;

[0056] FIG. 2( a ) is a schematic diagram of a storage structure of a target display lookup table provided by the present application;

[0057] FIG2( b ) is a schematic diagram of a storage structure of a reference display lookup table provided by the present application;

[0058] Figure 3 is a flow chart of a construction process of a conversion matrix provided by the present application;

[0059] Figure 4 is a flow chart of an image processing method provided in Example 2 of the present application;

[0060] Figure 5is a flowchart of an image processing method provided in Example 3 of the present application;

[0061] Figure 6 It is a schematic diagram of the logical structure of an image processing device provided by the present application. DETAILED DESCRIPTION

[0062] At present, the method commonly used by those skilled in the art to simplify LUT is: divide multiple RGB values ​​in LUT into multiple groups, and select one RGB value from each group of RGB values ​​in LUT according to a certain selection method as the representative value of the group of RGB values, and form a new LUT by the representative values ​​of each group of RGB values ​​to complete the simplification of LUT. For example, LUT includes 256*256*256 RGB values, with each 8 RGB values ​​as a group, and select one RGB value from a group as the RGB value to be used, and finally obtain 32*32*32 RGB values. Although the amount of data stored in LUT is reduced, more RGB values ​​are lost, resulting in discontinuity of the color space corresponding to LUT. Based on LUT with discontinuous color space, processing images will affect the accuracy of image processing. In order to improve the above problems, the inventors found that under the premise of ensuring the continuity of color space, if the amount of data is reduced, the accuracy of image processing can also be guaranteed to be higher. Therefore, the present application provides an image processing method, and the image processing method provided by the present application is described in detail below.

[0063] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.

[0064] like Figure 1 FIG. 1 is a flowchart of an image processing method provided in Embodiment 1 of the present application. The method may include the following steps:

[0065] Step S11, obtaining an image to be processed, where the image to be processed includes a plurality of pixels;

[0066] In this embodiment, the method of obtaining the image to be processed is not limited. Optionally, the image to be processed can be an image containing multiple pixels collected by a collection device, or an image containing multiple pixels obtained through other methods and channels, such as user upload, network download, etc.

[0067] Step S12: using the reference display lookup table, respectively determine the conversion matrix corresponding to each pixel.

[0068] The reference display lookup table stores at least one conversion matrix, which is used to characterize the conversion relationship between the RGB values ​​of the source storage area and the target storage area, wherein the source storage area is composed of a plurality of storage locations in the source display lookup table, and the target storage area is composed of a plurality of storage locations in the target display lookup table corresponding to the plurality of storage locations in the source display lookup table.

[0069] The source display lookup table can be understood as: a display lookup table that at least includes the RGB values ​​of all pixels in the image to be processed. Preferably, the source display lookup table includes all RGB values ​​of the RGB color space, that is, 256*256*256 RGB values.

[0070] The target display lookup table can be understood as a display lookup table obtained by performing some conversion on each RGB value in the source display lookup table. The number of storage locations in the target display lookup table is the same as the number of storage locations in the source display lookup table, and the distribution of storage locations in the target display lookup table is the same as the distribution of storage locations in the source display lookup table. Under the premise that the number and distribution of storage locations are the same, the RGB values ​​in the corresponding storage locations of the target display lookup table and the source display lookup table are also corresponding. For example, the source display lookup table includes 256*256*256 storage locations, each storage location stores a different RGB value, and the storage location in the target display lookup table corresponding to the source display lookup table also includes 256*256*256 storage locations, and the RGB value stored in each storage location is obtained by converting the RGB value stored in the storage location corresponding to the source display lookup table.

[0071] It can be understood that in the reference display lookup table, the storage area corresponding to the target storage area in the target display lookup table stores the conversion matrix rather than all the RGB values ​​in the target storage area. As shown in FIG2(a), 1 represents the target display lookup table, 10 represents the target storage area, 101 represents the storage position, and 1011 represents the RGB value. Each storage position 101 in the target display lookup table 1 stores an RGB value 1011 respectively, and the target storage area 10 composed of multiple storage positions 101 stores multiple RGB values ​​1011; as shown in FIG2(b), 2 represents the reference display lookup table, 20 represents the storage area corresponding to the target storage area 10, 201 represents the storage position in the storage area 20 corresponding to the target storage area 10, and 2011 represents the conversion matrix. The storage area 20 corresponding to the target storage area 10 in the reference display lookup table 2 stores a conversion matrix 2011, and the conversion matrix 2011 is used to characterize the conversion relationship between the RGB values ​​of the source storage area and the target storage area 10.

[0072] Since the source display lookup table contains at least the RGB values ​​of all pixels of the image to be processed, the conversion matrix in the reference display lookup table can cover the conversion relationship of the RGB values ​​of all pixels of the image to be processed. By using a pre-constructed reference display lookup table storing at least one conversion matrix, the conversion matrix corresponding to each pixel can be determined respectively.

[0073] In this embodiment, there is no restriction on the method of obtaining the reference display lookup table. For example, the reference display lookup table can be pre-built and stored locally, so that the reference display lookup table can be quickly obtained when needed, thereby improving the acquisition efficiency.

[0074] Of course, when an image processing task needs to be performed, the reference display lookup table can also be obtained from the server to save local storage space.

[0075] Alternatively, when an image processing task needs to be executed, a reference display lookup table may be temporarily constructed according to a set construction template.

[0076] Step S13: based on the conversion matrix corresponding to the RGB value of each pixel, convert the RGB value of each pixel to obtain the target RGB value corresponding to each pixel, thereby obtaining the target image.

[0077] In this embodiment, the RGB value of each pixel can be converted using the following relationship:

[0078]

[0079] A represents the transformation matrix corresponding to a pixel in the image to be processed. Represents the RGB value of the pixel in the image to be processed. Indicates the target RGB value corresponding to the pixel.

[0080] It should be noted that the number of columns of the transformation matrix A is Of course, the number of columns of the transformation matrix A may not be equal to 3. In the case where the number of columns of the transformation matrix A is greater than 3, Adjust to a matrix with the same number of rows as the number of columns of the transformation matrix A. For example, if the number of columns of the transformation matrix A is 4, Adjust to

[0081] In the present application, the reference target display lookup table stores a conversion matrix for characterizing the conversion relationship between the RGB values ​​of the first storage area in the source display lookup table and the second storage area in the target display lookup table, and no longer needs to store all the RGB values ​​in the target display lookup table, so that the stored data is reduced. On the basis of reducing the stored data, the amount of data acquisition can be reduced, and the overall time of image processing can be shortened, thereby improving the overall efficiency of image processing.

[0082] Furthermore, since the conversion matrix corresponding to the RGB value of each pixel can characterize the conversion relationship between the RGB value of each pixel and the corresponding RGB value, the RGB value of each pixel is converted based on the conversion relationship between the RGB value of each pixel and the corresponding RGB value, it can be ensured that the RGB value of each pixel is converted without destroying the continuity of the color space, thereby ensuring the conversion accuracy and improving the accuracy of image processing.

[0083] It is understandable that the reference display lookup table only needs to store the conversion matrix, and the reference display lookup table can be used to convert the RGB values ​​of each pixel of the image to be processed to improve the overall efficiency of image processing and the accuracy of image processing. There is no restriction on the method of obtaining the conversion matrix. For example, the conversion matrix can be pre-constructed or obtained from a server. Among them, when it is necessary to construct a conversion matrix, the conversion matrix can be constructed in the following manner:

[0084] like Figure 3 As shown, the construction process of the transformation matrix can include the following steps:

[0085] Step S121: Obtain a source display lookup table storing all RGB values ​​in the RGB color space.

[0086] The total RGB values ​​of the RGB color space are 256*256*256 different RGB values. Accordingly, the source display lookup table includes 256*256*256 storage locations, each of which stores one RGB value.

[0087] Step S122: adjust each RGB value in the source display lookup table to an RGB value that meets the set requirements, and use the display lookup table storing the RGB values ​​that meet the set requirements as the target display lookup table.

[0088] In this embodiment, the setting requirements can be set as needed. Specifically, the setting requirements can be set to, but not limited to: set filter effect requirements, such as black and white filter requirements or negative filter requirements. Of course, the setting requirements can also be set to set beauty effect requirements, such as skin resurfacing requirements or freckle removal requirements.

[0089] The filter effect requirement can be understood as the requirement of setting color and / or brightness effect by mapping the RGB value of a pixel to another RGB value.

[0090] The requirements for beautification effects can be understood as: achieving the set beautification effects by performing noise reduction or filtering on the RGB values ​​of pixels.

[0091] It can be understood that the target display lookup table and the source display lookup table have the same number of storage locations and the same distribution.

[0092] Step S123: using the same division method, the storage locations in the source display lookup table and the target display lookup table are divided into a set number of storage areas, each storage area consisting of at least two storage locations.

[0093] By using the same division method, the storage locations of the source display lookup table and the target display lookup table are divided into a set number of storage areas, respectively, which can ensure that the storage locations of the source display lookup table and the target display lookup table are divided, and the storage areas obtained are in a one-to-one correspondence, thereby ensuring the accuracy of subsequent operation processing.

[0094] The set number can be set as needed and is not limited in this embodiment. Of course, the set number can be set based on the acceptable degree of image distortion. Setting the set number based on the acceptable degree of image distortion can avoid excessive distortion after the image is converted and improve the accuracy of image processing.

[0095] The set number can be set to but not limited to: 8*8*8=512.

[0096] When the number of settings is set to 512, compared with the LUT containing 32*32*32 RGB in the prior art, the reference display lookup table stores less data and has a higher image processing efficiency.

[0097] Step S124: for the first storage area in the source display lookup table, determine a conversion matrix according to the RGB value of the first storage area and the RGB value of the second storage area.

[0098] The first storage area is composed of at least two storage locations in the source display lookup table, and the second storage area is a storage area in the target display lookup table corresponding to the first storage area in the source display lookup table.

[0099] The first storage area can be understood as: one of the storage areas in the source display lookup table.

[0100] Determining the conversion matrix according to the RGB values ​​of the first storage area and the RGB values ​​of the second storage area can be understood as: determining parameters characterizing the conversion relationship between the RGB values ​​of the first storage area and the second storage area, and using the matrix composed of the parameters characterizing the conversion relationship between the RGB values ​​of the first storage area and the second storage area as the conversion matrix.

[0101] In this embodiment, all parameters characterizing the conversion relationship between the RGB values ​​of the first storage area and the second storage area can be determined, and a matrix composed of all parameters characterizing the conversion relationship between the RGB values ​​of the first storage area and the second storage area is used as a conversion matrix. In this way, the comprehensiveness of the parameters characterizing the conversion relationship between the RGB values ​​can be ensured, thereby ensuring the accuracy of the conversion matrix.

[0102] However, the above method of determining the parameters of the conversion relationship between RGB values ​​has the problem of large amount of calculation and low efficiency. In order to solve the above problem and make the accuracy of the conversion matrix meet the accuracy requirements, a fitting algorithm can be used to determine the parameters for characterizing the conversion relationship between the RGB values ​​of the first storage area and the second storage area, and the matrix composed of the parameters for characterizing the conversion relationship between the RGB values ​​is used as the conversion matrix.

[0103] In this embodiment, there is no limitation on the fitting algorithm. For example, the fitting algorithm may be, but is not limited to, a least squares curve fitting algorithm implemented based on matrix operations (eg, matrix inverse operations).

[0104] By using a fitting algorithm to determine the parameters used to characterize the conversion relationship between the RGB values ​​of the first storage area in the source display lookup table and the second storage area in the target display lookup table, the accuracy of the parameters used to characterize the conversion relationship between the RGB values ​​of the first storage area in the source display lookup table and the second storage area in the target display lookup table can be guaranteed, thereby ensuring the accuracy of image conversion when performing image conversion based on the conversion matrix.

[0105] It should be noted that steps S121-S124 are the process of constructing one of the conversion matrices. When the source display lookup table is divided into multiple storage areas, the process of constructing the conversion matrix of each storage area can refer to steps S121-S124. When the conversion matrix of each storage area is constructed, all the constructed conversion matrices are stored in the reference display lookup table.

[0106] In this embodiment, when the set number is set to 512, compared with the LUT containing 32*32*32 RGB values ​​in the prior art, the reference display lookup table stores less data and has a higher efficiency in image processing. In addition, in the prior art, the LUT containing 32*32*32 RGB values ​​is determined by dividing multiple RGB values ​​in the LUT into multiple groups, and selecting one RGB value from each group of RGB values ​​in the LUT according to a certain selection method as a representative value of the group of RGB values. Based on the 512 conversion matrices stored in the reference display lookup table in this embodiment, the image is converted in a manner that ensures that the RGB value of each pixel is converted without destroying the continuity of the color space, thereby ensuring the conversion accuracy and improving the accuracy of image processing.

[0107] As another optional embodiment 2 of the present application, it is mainly a refinement of the image processing method described in the above embodiment 1, such as Figure 4 As shown, the method may include but is not limited to the following steps:

[0108] Step S21: Acquire an image to be processed, where the image to be processed includes a plurality of pixels.

[0109] The detailed process of step S21 can refer to the relevant introduction of step S11 in embodiment 1, which will not be repeated here.

[0110] Step S22: for each pixel in the image to be processed, determine the first storage position of the RGB value of the pixel in the source display lookup table.

[0111] Since the source display lookup table at least contains the RGB values ​​of all pixels in the image to be processed, the storage location of the RGB value of each pixel in the image to be processed can be found in the source display lookup table.

[0112] Each storage position in the source display lookup table corresponds to an index. If the index corresponding to each storage position is the RGB value of the RGB color space, the storage position in the source display lookup table corresponding to the RGB value of the pixel in the image to be processed can be directly used as the first storage position of the pixel's RGB value in the source display lookup table.

[0113] Step S23: Determine a storage area corresponding to the first storage position in the reference display lookup table.

[0114] The reference display lookup table stores at least one conversion matrix, which is used to characterize the conversion relationship between the RGB values ​​of the source storage area and the target storage area, wherein the source storage area is composed of a plurality of storage locations in the source display lookup table, and the target storage area is composed of a plurality of storage locations in the target display lookup table corresponding to the plurality of storage locations in the source display lookup table.

[0115] Since the conversion matrix in the reference display lookup table is used to characterize the conversion relationship between the RGB values ​​of the source storage area and the target storage area, the storage area where the conversion matrix in the reference display lookup table is located corresponds to the source storage area in the source display lookup table. Therefore, in the reference display lookup table, there is a storage area corresponding to the storage position in the source storage area in the source display lookup table. Based on this, after determining the first storage position, the storage area in the reference display lookup table corresponding to the first storage position can be determined.

[0116] Step S24: Use the conversion matrix stored in the storage area as the first conversion matrix corresponding to the pixel.

[0117] In the reference display lookup table, each storage area stores a corresponding conversion matrix. After determining the storage area corresponding to the first storage position in the reference display lookup table, the conversion matrix in the storage area corresponding to the first storage position in the reference display lookup table can be used as the first conversion matrix corresponding to the pixel.

[0118] Steps S22-S24 are a specific implementation of step S12 in Example 1.

[0119] Step S25 : based on the conversion matrix corresponding to the RGB value of each pixel, convert the RGB value of each pixel to obtain the target RGB value corresponding to each pixel, thereby obtaining the target image.

[0120] The detailed process of step S25 can refer to the relevant introduction of step S13 in embodiment 1, which will not be repeated here.

[0121] In this embodiment, the conversion matrix is ​​acquired through the correspondence between the RGB value and the storage position, and the correspondence between the storage position and the storage area, and the efficiency of the conversion matrix acquisition is ensured. When the efficiency of the conversion matrix acquisition is improved, the efficiency of image processing is further improved.

[0122] As another optional embodiment 3 of the present application, it is mainly a refinement of the image processing method described in the above embodiment 1, such as Figure 5 As shown, the method may include but is not limited to the following steps:

[0123] Step S31: Acquire an image to be processed, where the image to be processed includes a plurality of pixels.

[0124] The detailed process of step S31 can refer to the relevant introduction of step S11 in embodiment 1, which will not be repeated here.

[0125] Step S32: for each pixel in the image to be processed, determine the first storage position of the RGB value of the pixel in the source display lookup table.

[0126] The detailed process of step S32 can refer to the relevant introduction of step S22 in embodiment 2, which will not be repeated here.

[0127] Step S33: for each target RGB value that has a set relationship with the RGB value of each pixel in the image to be processed, determine a second storage position of the target RGB value in the source display lookup table.

[0128] The set relationship can be set as needed, and is not limited in this embodiment. For example, the set relationship can be set but is not limited to: an adjacent relationship.

[0129] For each target RGB value that has a set relationship with the RGB value of each pixel in the image to be processed, the detailed process of determining the second storage position of the target RGB value in the source display lookup table can also be referred to the relevant introduction of step S22 in Example 2, which will not be repeated here.

[0130] Step S34: Determine a first storage area corresponding to the first storage position and a second storage area corresponding to the second storage position in the reference display lookup table.

[0131] The reference display lookup table stores at least one conversion matrix, which is used to characterize the conversion relationship between the RGB values ​​of the source storage area and the target storage area, wherein the source storage area is composed of a plurality of storage locations in the source display lookup table, and the target storage area is composed of a plurality of storage locations in the target display lookup table corresponding to the plurality of storage locations in the source display lookup table.

[0132] Since the conversion matrix in the reference display lookup table is used to characterize the conversion relationship between the RGB values ​​of the source storage area and the target storage area, the storage area where the conversion matrix in the reference display lookup table is located corresponds to the source storage area in the source display lookup table. Therefore, in the storage area where the conversion matrix in the reference display lookup table is located, there is a storage location corresponding to the storage location in the source storage area in the source display lookup table. Based on this, after determining the first storage location and the second storage location, the first storage area corresponding to the first storage location and the second storage area corresponding to the second storage location in the reference display lookup table can be determined.

[0133] Step S35: Perform a weighted summation on the conversion matrix stored in the first storage area and the conversion matrix stored in the second storage area, and use the obtained conversion matrix as the first conversion matrix corresponding to the pixel.

[0134] In the reference display lookup table, each storage area stores a corresponding conversion matrix. After the first storage area and the second storage area are determined, the conversion matrix can be obtained in the first storage area and the second storage area.

[0135] The weighted summation of the conversion matrix stored in the first storage area and the conversion matrix stored in the second storage area can be understood as: adding the result obtained by multiplying the conversion matrix stored in the first storage area by the first weight and the result obtained by multiplying the conversion matrix stored in the second storage area by the second weight.

[0136] Steps S32-S35 are a specific implementation of step S12 in Example 1.

[0137] Step S36: based on the conversion matrix corresponding to the RGB value of each pixel, convert the RGB value of each pixel to obtain the target RGB value corresponding to each pixel, thereby obtaining the target image.

[0138] The detailed process of step S36 can refer to the relevant introduction of step S13 in embodiment 1, which will not be repeated here.

[0139] In this embodiment, in addition to respectively determining and obtaining the conversion matrix corresponding to the RGB value of each pixel in the image to be processed, the conversion matrix corresponding to the RGB value having a set relationship with the RGB value of each pixel in the image to be processed is also respectively determined and obtained, and the obtained conversion matrix is ​​weighted summed to achieve the fusion of multiple conversion matrices. On this basis, the RGB value is converted using the target conversion matrix. Compared with the method of converting the RGB value only using the conversion matrix corresponding to the RGB value of the pixel in the image to be processed, the conversion is smoother.

[0140] Next, the image processing device provided by the present application is introduced. The image processing device introduced below and the image processing method introduced above can be referenced to each other.

[0141] like Figure 6 As shown, the image processing device includes: an acquisition module 100, a determination module 200 and a conversion module 300.

[0142] The acquisition module 100 is used to acquire an image to be processed, where the image to be processed includes a plurality of pixels;

[0143] The determination module 200 is used to determine the conversion matrix corresponding to each pixel by using the reference display lookup table, the conversion matrix is ​​used to characterize the conversion relationship between the RGB values ​​of the source storage area and the target storage area, the source storage area is composed of a plurality of storage locations in the source display lookup table, and the target storage area is composed of a plurality of storage locations in the target display lookup table corresponding to the plurality of storage locations in the source display lookup table; wherein the reference display lookup table stores at least one conversion matrix;

[0144] The conversion module 300 is used to convert the RGB value of each pixel based on the conversion matrix corresponding to the RGB value of each pixel, so as to obtain the target RGB value corresponding to each pixel, thereby obtaining the target image.

[0145] In this embodiment, the image processing device may further include:

[0146] Building blocks for:

[0147] Get a source display lookup table storing all RGB values ​​of the RGB color space;

[0148] Respectively adjusting each RGB value in the source display lookup table to an RGB value that meets the set requirements, and using the display lookup table storing the RGB values ​​that meet the set requirements as the target display lookup table;

[0149] Using the same division method, the storage locations in the source display lookup table and the target display lookup table are respectively divided into a set number of storage areas, wherein the storage area consists of at least two storage locations;

[0150] For a first storage area in the source display lookup table, the conversion matrix is ​​determined according to an RGB value of the first storage area and an RGB value of a second storage area; wherein the first storage area is composed of at least two storage locations in the source display lookup table, and the second storage area is a storage area in the target display lookup table corresponding to the first storage area in the source display lookup table.

[0151] The setting requirements may include but are not limited to: setting filter effect requirements.

[0152] The set number may be but is not limited to 512.

[0153] In this embodiment, the determination module 200 may be specifically used for:

[0154] For each pixel in the image to be processed, determining a first storage location of the RGB value of the pixel in the source display lookup table;

[0155] Determine a storage area in the reference display lookup table corresponding to the first storage location;

[0156] The conversion matrix stored in the storage area is used as the first conversion matrix corresponding to the pixel.

[0157] The determination module 200 may also be specifically used for:

[0158] For each pixel in the image to be processed, determining a first storage location of the RGB value of the pixel in the source display lookup table;

[0159] For each target RGB value having a set relationship with the RGB value of each pixel in the image to be processed, determining a second storage location of the target RGB value in the source display lookup table;

[0160] Determine a first storage area corresponding to the first storage position and a second storage area corresponding to the second storage position in the reference display lookup table;

[0161] A conversion matrix obtained by performing a weighted summation on the conversion matrix stored in the first storage area and the conversion matrix stored in the second storage area is used as a first conversion matrix corresponding to the pixel.

[0162] In another embodiment of the present application, an electronic device is provided, which may include: a memory for storing at least one set of instruction sets;

[0163] The processor is used to call and execute the instruction set in the memory, and execute the steps of the image processing method introduced in any one of the method embodiments 1-3 by executing the instruction set.

[0164] In another embodiment of the present application, a computer storage medium is provided, on which a computer program is stored. The computer program is executed by a processor to implement the steps of the image processing method of any one of method embodiments 1-3.

[0165] It should be noted that each embodiment focuses on the differences from other embodiments, and the same or similar parts between the embodiments can be referred to each other. For the device embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.

[0166] Finally, it should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the presence of other identical elements in the process, method, article or device including the elements.

[0167] For the convenience of description, the above device is described in various units according to their functions. Of course, when implementing the present application, the functions of each unit can be implemented in the same or multiple software and / or hardware.

[0168] It can be known from the description of the above implementation methods that those skilled in the art can clearly understand that the present application can be implemented by means of software plus a necessary general hardware platform. Based on such an understanding, the technical solution of the present application can be essentially or partly contributed to the prior art in the form of a software product, which can be stored in a storage medium such as ROM / RAM, a magnetic disk, an optical disk, etc., and includes several instructions for enabling a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in the various embodiments of the present application or certain parts of the embodiments.

[0169] The above is a detailed introduction to an image processing method and device provided by the present application. Specific examples are used in this article to illustrate the principles and implementation methods of the present application. The description of the above embodiments is only used to help understand the method of the present application and its core idea. At the same time, for general technicians in this field, according to the idea of ​​the present application, there will be changes in the specific implementation method and application scope. In summary, the content of this specification should not be understood as a limitation on the present application.

Claims

1. An image processing method, characterized in that: include: Acquire an image to be processed, wherein the image to be processed includes a plurality of pixels; Using a reference display lookup table, respectively determine a conversion matrix corresponding to each of the pixels, the conversion matrix being used to characterize a conversion relationship between RGB values ​​of a source storage area and a target storage area, the source storage area being composed of a plurality of storage locations in a source display lookup table, and the target storage area being composed of a plurality of storage locations in a target display lookup table corresponding to the plurality of storage locations in the source display lookup table; wherein at least one conversion matrix is ​​stored in the reference display lookup table, and the source display lookup table is a display lookup table at least including RGB values ​​of all pixels in the image to be processed; Based on the conversion matrix corresponding to the RGB value of each pixel, the RGB value of each pixel is converted to obtain the target RGB value corresponding to each pixel, thereby obtaining the target image.

2. The method according to claim 1, characterized in that The transformation matrix is ​​constructed by the following steps: Get a source display lookup table storing all RGB values ​​of the RGB color space; Respectively adjusting each RGB value in the source display lookup table to an RGB value that meets the set requirements, and using the display lookup table storing the RGB values ​​that meet the set requirements as the target display lookup table; Using the same division method, the storage locations in the source display lookup table and the target display lookup table are respectively divided into a set number of storage areas, wherein the storage area consists of at least two storage locations; For a first storage area in the source display lookup table, the conversion matrix is ​​determined according to an RGB value of the first storage area and an RGB value of a second storage area; wherein the first storage area is composed of at least two storage locations in the source display lookup table, and the second storage area is a storage area in the target display lookup table corresponding to the first storage area in the source display lookup table.

3. The method according to claim 2, characterized in that The setting requirements are set filter effect requirements; The set number is 512.

4. The method according to any one of claims 1 to 3, characterized in that: The using the reference display lookup table to respectively determine the conversion matrix corresponding to each of the pixels comprises: For each pixel in the image to be processed, determining a first storage location of the RGB value of the pixel in the source display lookup table; Determine a storage area in the reference display lookup table corresponding to the first storage location; The conversion matrix stored in the storage area is used as the first conversion matrix corresponding to the pixel.

5. The method according to any one of claims 1 to 3, characterized in that: The using the reference display lookup table to respectively determine the conversion matrix corresponding to each of the pixels comprises: For each pixel in the image to be processed, determining a first storage location of the RGB value of the pixel in the source display lookup table; For each target RGB value having a set relationship with the RGB value of each pixel in the image to be processed, determining a second storage location of the target RGB value in the source display lookup table; Determine a first storage area corresponding to the first storage position and a second storage area corresponding to the second storage position in the reference display lookup table; A conversion matrix obtained by performing a weighted summation on the conversion matrix stored in the first storage area and the conversion matrix stored in the second storage area is used as a first conversion matrix corresponding to the pixel.

6. An image processing device, characterized in that: include: An acquisition module, used for acquiring an image to be processed, wherein the image to be processed includes a plurality of pixels; A determination module, used to determine the conversion matrix corresponding to each of the pixels by using a reference display lookup table, wherein the conversion matrix is ​​used to characterize the conversion relationship between the RGB values ​​of a source storage area and a target storage area, wherein the source storage area is composed of a plurality of storage locations in a source display lookup table, and the target storage area is composed of a plurality of storage locations in a target display lookup table corresponding to the plurality of storage locations in the source display lookup table; wherein at least one conversion matrix is ​​stored in the reference display lookup table, and the source display lookup table is a display lookup table including at least the RGB values ​​of all pixels in the image to be processed; The conversion module is used to convert the RGB values ​​of each pixel based on the conversion matrix corresponding to the RGB value of each pixel, so as to obtain the target RGB value corresponding to each pixel, thereby obtaining the target image.

7. The device according to claim 6, characterized in that The device also includes: Building blocks for: Get a source display lookup table storing all RGB values ​​of the RGB color space; Respectively adjusting each RGB value in the source display lookup table to an RGB value that meets the set requirements, and using the display lookup table storing the RGB values ​​that meet the set requirements as the target display lookup table; Using the same division method, the storage locations in the source display lookup table and the target display lookup table are respectively divided into a set number of storage areas, wherein the storage area consists of at least two storage locations; For a first storage area in the source display lookup table, the conversion matrix is ​​determined according to an RGB value of the first storage area and an RGB value of a second storage area; wherein the first storage area is composed of at least two storage locations in the source display lookup table, and the second storage area is a storage area in the target display lookup table corresponding to the first storage area in the source display lookup table.

8. The device according to claim 7, characterized in that The setting requirements are set filter effect requirements; The set number is 512.

9. An electronic device, characterized in that: include: A memory for storing at least one set of instructions; A processor is used to call and execute the instruction set in the memory, and execute the steps of the image processing method according to any one of claims 1 to 5 by executing the instruction set.

10. A computer storage medium, characterized in that: A computer program is stored thereon, and the computer program is executed by a processor to implement each step of the image processing method as described in any one of claims 1 to 5.