Processing method and system for special-effect color card
By converting the color mapping table of the special effects color card into a LUT image and performing downsampling, the problem of large storage space of the special effects color card is solved, more efficient image processing and transmission is achieved, and processing efficiency and performance are improved.
Patent Information
- Application Number
- CN202410992453.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-23
- Publication Date
- 2024-10-29
AI Technical Summary
The storage space of existing special effects color cards is huge, which results in long client parsing and loading times, reduces image processing efficiency, and is not conducive to network transmission and color calculation.
Convert the color mapping table of the special effects color card into a LUT image, downsample it, and use the three primary colors (red, green, and blue) for slicing and sampling to reduce storage space and calculation density.
It significantly reduces the size and decoding time of the color card, improves the image processing efficiency, and reduces the resource package size and download time without losing the image effect.
Smart Images

Figure CN118869898A_ABST
Abstract
Description
Technical Field
[0001] The present application belongs to the field of image processing, and more specifically, to a method and system for processing special effect color cards. Background Art
[0002] As the most widely used image processing algorithm component in image processing software and short video shooting scenes, filters have a key impact on the core application indicators of the software, such as submission, conversion, penetration and playback. Therefore, the quality of the filter performance will directly affect the use of color card filters by special effects creators.
[0003] Each pixel in each image is composed of three colors. The essence of the video special effects color card effect is to map each pixel to a new color, mapping each color in the original image to another color, so as to achieve the purpose of image color effect transformation. The value range of each color is generally 0-255. For example, the three colors of the color card are RGB. According to RGB as the three-dimensional matrix of the xyz coordinate axis, the three dimensions of the matrix are 0-255 respectively. Each value represents the brightness value of a color. According to the use of 8 bits for each data in the matrix, the color card storage space is huge, which will occupy 256*256*256*8bit storage space. As a result, in the actual application process, it takes a long time for the client to parse and load such a large image, which greatly reduces the efficiency of the special effects color card filter for image processing. At the same time, such a large volume of color card images is not conducive to network transmission and color calculation. Summary of the invention
[0004] In view of the defects of the prior art, the purpose of this application is to provide a color card processing method and system, which aims to solve the problem that the existing image corresponding color card storage space is huge, resulting in a long time spent on client parsing and loading images, and the special effect color card filter has low efficiency in image processing.
[0005] To achieve the above objectives, in a first aspect, the present application provides a method for processing a special effect color card, which specifically comprises the following steps:
[0006] S1: Make the color mapping table corresponding to the special effect color card into a three-dimensional matrix with three primary colors as xyz coordinate axes; wherein the three primary colors include a first three primary color element, a second three primary color element and a third three primary color element; and the value range of the xyz axis is the pixel value range of the three primary colors;
[0007] S2: Slice the three-dimensional matrix in the z-axis direction corresponding to the third three-primary color element, and convert the three-dimensional matrix into a LUT image; wherein the number of small squares in the LUT image is the number of values of the third three-primary color element; each small square represents a pixel value of the third three-primary color element, and the horizontal axis and vertical axis of each small square correspond to the first three-primary color element and the second three-primary color element respectively; wherein the visual object is least sensitive to the third three-primary color element;
[0008] It should be pointed out here that the visual object is the observer of the image, which corresponds to the human eye in existing practical applications;
[0009] S3: Downsample the small squares in the LUT image to complete the processing of the special effect color card.
[0010] Further preferably, S1 and S2 perform the three-dimensional matrix every 2 n Pixel value sampling.
[0011] It should be pointed out here that generally every 4 pixel values are sampled on the xyz axis of the three-dimensional matrix, so that the data density of the sampled three-dimensional matrix is reduced to 1 / 4 of the original three-dimensional matrix on each axis, and the corresponding matrix volume of the special effect color card will also be reduced to 1 / 4 3 ;
[0012] Further preferably, the three primary colors are red, green and blue; the first three primary color elements are red, the second three primary color elements are green, and the third three primary color elements are blue; or the first three primary color elements are green, the second three primary color elements are red, and the third three primary color elements are blue.
[0013] It should be noted here that the first three primary color elements and the second three primary color elements can be green and red respectively, and the present application only limits the third three primary color element to blue.
[0014] In the second aspect, the present application provides a corresponding image filter processing method based on the special effect color card processing method provided above, which specifically includes the following steps:
[0015] Obtain the pixel value corresponding to each pixel in the image to be processed by the filter, and obtain the image processed by the special effect filter according to the color conversion table between the original color card and the special effect color card, or adopt the addressing color conversion method based on the special effect color card; wherein the original color card is the color card corresponding to the image to be processed by the filter;
[0016] The method for obtaining the color conversion table between the original color card and the special effect color card includes the following steps:
[0017] Step 1: Find the corresponding small square in the LUT image according to the pixel value of the third three-primary color element in the i-th coordinate point of the original color card corresponding to the image to be filtered; let the initial value of i be 0;
[0018] Step 2: Find the coordinates corresponding to the first three primary color elements and the second three primary color elements of the i-th coordinate point on the primary color card in the small square obtained in step 1;
[0019] Step 3: According to the coordinates of the first three primary color elements and the second three primary color elements in the special effect color card and the small square obtained in step 1, obtain the color in the special effect color card corresponding to the i-th coordinate point in the original color card;
[0020] Step 4: Let i=i+1, go to step 1, until the coordinate points of all original color cards are traversed, and the color conversion table between the original color card and the special effect color card is obtained;
[0021] The addressing color conversion method is adopted based on the special effect color card, including the following steps:
[0022] Step 1: Find the corresponding small square in the LUT image according to the pixel value of the third three-primary color element in the pixel point of the filter image to be processed; let the initial value of i be 0;
[0023] Step 2: Find the coordinates corresponding to the first three primary color elements and the second three primary color elements of the pixel point of the filter image to be processed in the small square obtained in step 1;
[0024] Step 3: According to the coordinates of the first three primary color elements and the second three primary color elements in the special effect color card and the small square obtained in step 1, obtain the color in the special effect color card corresponding to the pixel point of the filter image to be processed;
[0025] Step 4: Let i=i+1, go to step 1, and continue until all pixels of the filter image to be processed are traversed to obtain the image processed by the special effect filter.
[0026] It should be pointed out here that in this application, as long as the same filter processing is performed on the image, it is only necessary to obtain the color conversion table between the original color card and the special effect color card once, which can greatly improve the efficiency of image filter processing.
[0027] Further preferably, the image filter processing method runs in a GPU.
[0028] It should be pointed out here that since the GPU is responsible for intensive algorithm calculations, running the image filter processing method on the GPU will greatly improve the computing performance, but this application includes but is not limited to image filter processing on the GPU.
[0029] Further preferably, the calculation formula for finding the small square in the special effect color card is:
[0030] y sq1 =f(f(p b *N sq *2) / N h )
[0031] xsq1 =f(p b *N sq )-y sq1 *N w
[0032] y sq2 =f(c(p b *N sq *2) / N h )
[0033] x sq2 =c(p b *N sq )-y sq2 *N w
[0034] Among them, (x sq1 ,y sq1 ) and (x sq2 ,y sq2 ) are the horizontal and vertical coordinates of two adjacent small squares, the horizontal coordinate represents the row where the small square is located, and the vertical coordinate represents the column where the small square is located; p b is the pixel value of the third three-primary color element in the i-th coordinate point of the primary color card; N sq The total number of small blocks - 1, the numbering of small blocks starts from 0; N w and N h is the number of small squares in rows and columns; f is the floor function, which means rounding down; c is the ceil function, which means rounding up; N w and N h Take 2 m , m is an integer.
[0035] It should be pointed out here that due to the downsampling operation involved in the acquisition of the special effects color card in this application, when searching for small squares according to the blue pixel value in the original color card, there is a high probability that the small squares are not located on a certain small square. At this time, two adjacent small squares between which the pixel values of the third three primary color elements are located are selected.
[0036] Further preferably, the coordinate calculation formula corresponding to the first three primary color elements and the second three primary color elements of the ith coordinate point of the primary color card or the ith pixel point in the image to be processed by the filter in the small square is:
[0037]
[0038]
[0039]
[0040]
[0041] Among them, (xnew1 ,y new1 ) and (x new2 ,y new2 ) are the coordinates of the first three primary color elements and the second three primary color elements of the i-th coordinate point of the primary color card in two adjacent small squares; w i and h i They are the width and height of the special effects color card respectively.
[0042] It should be pointed out here that since this step is executed in the GPU, it is necessary to establish a two-dimensional coordinate for the special effect color card. The horizontal and vertical coordinates of each small square represent the pixel values of the first three primary color elements and the second three primary color elements. According to the arrangement order of the small squares, the two-dimensional coordinates are reconstructed in the GPU, w i and h i They are the width and height of the special effect color card respectively. The width and height here are the concepts of two-dimensional coordinates constructed in the GPU.
[0043] Further preferably, the color in the special effect color card corresponding to the i-th coordinate point in the original color card or the i-th pixel point in the image to be processed by the filter is:
[0044] C 1 =t2D(C map ,(x new1 ,y new1 ))
[0045] C 2 =t2D(C map ,(x new2 ,y new2 ))
[0046] fC=mix(C 1 ,C 2 ,fr(p b *N sq ))
[0047] Among them, t2D is the abbreviation of texture2d function, which means converting the current coordinate texture read into pixel value; map is the input color card texture; mix is the mixing function, which converts C 1 ,C 2 According to fr(p b *N sq ) values are mixed; fr is the abbreviation of the function fract, which means returning the decimal part of the floating point number in the parameter; t2D, mix, and fr are the abbreviations of GPU rendering API; C 1 , C 2 is the color of the i-th coordinate point in the original color card in the two small squares; fC is the color in the special effect color card corresponding to the i-th coordinate point in the original color card.
[0048] In a third aspect, the present application provides a special effect color card processing system, including:
[0049] A three-dimensional coordinate construction module is used to make the color mapping table corresponding to the special effect color card into a three-dimensional matrix using three primary colors as xyz coordinate axes; wherein the three primary colors include a first three primary color element, a second three primary color element and a third three primary color element; and the value range of the xyz axis is the pixel value range of the three primary colors;
[0050] The LUT image construction module is used to slice the three-dimensional matrix in the z-axis direction corresponding to the third three-primary color element, and convert the three-dimensional matrix into a LUT image; wherein the number of small squares in the LUT image is the number of values of the third three-primary color element, and each small square represents a pixel value of the third three-primary color element; the horizontal axis and the vertical axis of each small square correspond to the first three-primary color element and the second three-primary color element respectively; wherein the visual object is least sensitive to the third three-primary color element;
[0051] The LUT image downsampling module is used to downsample the small squares in the LUT image to complete the processing of the special effect color card.
[0052] Further preferably, the processing system of the special effect color card also includes a three-dimensional matrix down-sampling module for sampling every 2n pixel values of the three-dimensional matrix.
[0053] Further preferably, the three primary colors in the three-dimensional coordinate construction module, the LUT image construction module and the LUT image downsampling module are red, green and blue; the first three primary color elements are red, the second three primary color elements are green, and the third three primary color elements are blue; or the first three primary color elements are green, the second three primary color elements are red, and the third three primary color elements are blue.
[0054] In a fourth aspect, the present application provides an image filter processing system, comprising: a color conversion table construction module or an addressing color conversion module, an initial image acquisition module and a filter processing image storage module;
[0055] The initial image acquisition module is used to obtain the pixel value corresponding to each pixel point in the image to be processed by the filter;
[0056] The filter-processed image storage module is used to obtain images processed by special effect filters;
[0057] The color conversion table construction module is used to store and construct the color conversion table between the primary color card and the special effect color card; it includes: a first small square search unit, a first two primary color coordinate search unit and a first color acquisition unit;
[0058] The first small square search unit is used to search for a corresponding small square in the LUT image according to the pixel value of the third three-primary color element in the original color card coordinate point;
[0059] The first two-primary color coordinate search unit is used to search for coordinates corresponding to the first three primary color elements and the second three primary color elements of the primary color card coordinate point in the small square obtained by the small square search unit;
[0060] The first color acquisition unit is used to acquire the color in the special effect color card corresponding to the coordinate point in the original color card according to the coordinates of the first three primary color elements and the second three primary color elements in the special effect color card and the small square acquired by the small square search unit;
[0061] The addressing color conversion module is used to adopt the image to be processed by the filter and perform addressing color conversion based on the special effect color card; it includes: a second small square search unit, a second two-primary color coordinate search unit and a second color acquisition unit;
[0062] The second small square search unit is used to search for a corresponding small square in the LUT image according to the pixel value of the third three-primary color element in the pixel point of the filter image to be processed;
[0063] The second two-primary color coordinate search unit is used to search the coordinates corresponding to the first three primary color elements and the second three primary color elements of the pixel point in the filter image to be processed in the small square obtained by the small square search unit;
[0064] The second color acquisition unit is used to obtain the color in the special effect color card corresponding to the pixel point of the filter image according to the coordinates of the first three primary color elements and the second three primary color elements in the special effect color card and the small square obtained by the small square search unit.
[0065] Further preferably, the image filter processing system is arranged in a GPU.
[0066] Further preferably, the calculation formula of the small squares in the first small square search unit and the second small square search unit is:
[0067] y sq1 =f(f(p b *N sq *2) / N h )
[0068] x sq1 =f(p b *N sq )-y sq1 *N w
[0069] y sq2 =f(c(p b *N sq *2) / N h )
[0070] x sq2 =c(p b *N sq )-ysq2 *N w
[0071] Among them, (x sq1 ,y sq1 ) and (x sq2 ,y sq2 ) are the horizontal and vertical coordinates of the two adjacent small squares found, the horizontal coordinate represents the row where the small square is located, and the vertical coordinate represents the column where the small square is located; p b N is the pixel value of the third three primary color element in the i-th coordinate point of the original color card or the i-th pixel point in the image to be processed by the filter; sq The total number of small blocks - 1, the numbering of small blocks starts from 0; N w and N h is the number of small squares in rows and columns; f is the floor function, which means rounding down; c is the ceil function, which means rounding up; N w and N h Take 2 m , m is an integer.
[0072] Further preferably, the coordinate calculation formulas corresponding to the first three primary color elements and the second three primary color elements in the first two primary color coordinate search unit and the second two primary color coordinate search unit in the small square are:
[0073]
[0074]
[0075]
[0076]
[0077] Among them, (x new1 ,y new1 ) and (x new2 ,y new2 ) are respectively the coordinates of the first three primary color elements and the second three primary color elements of the i-th coordinate point of the primary color card or the i-th pixel point in the image to be processed by the filter in two adjacent small squares; w i and h i They are the width and height of the special effects color card respectively.
[0078] Further preferably, the color in the special effect color card corresponding to the i-th coordinate point in the color card in the color acquisition unit is:
[0079] C 1 =t2D(C map ,(x new1 ,y new1 ))
[0080] C 2=t2D(C map ,(x new2 ,y new2 ))
[0081] fC=mix(C 1 ,C 2 ,fr(p b *N sq ))
[0082] Among them, t2D is the abbreviation of texture2d function, which means converting the current coordinate texture read into pixel value; map is the input color card texture; mix is the mixing function, which converts C 1 ,C 2 According to fr(p b *N sq ) values are mixed; fr is the abbreviation of the function fract, which means returning the decimal part of the floating point number in the parameter; t2D, mix, and fr are the abbreviations of GPU rendering API; C 1 , C 2 is the color of the i-th coordinate point in the original color card or the i-th pixel in the image to be processed by the filter in the two small squares; fC is the color in the special effect color card corresponding to the i-th coordinate point in the original color card or the i-th pixel in the image to be processed by the filter.
[0083] In a fifth aspect, the present application provides an electronic device comprising: at least one memory for storing programs; and at least one processor for executing the programs stored in the memory. When the programs stored in the memory are executed, the processor is used to execute the method described in the first aspect or a further preferred implementation of the first aspect.
[0084] In a sixth aspect, the present application provides a computer-readable storage medium, which stores a computer program. When the computer program runs on a processor, the processor executes the method described in the first aspect or a further preferred implementation of the first aspect.
[0085] In a seventh aspect, the present application provides a computer program product, which, when executed on a processor, enables the processor to execute the method described in the first aspect or a further preferred implementation of the first aspect.
[0086] In an eighth aspect, the present application provides an electronic device comprising: at least one memory for storing programs; and at least one processor for executing the programs stored in the memory. When the program stored in the memory is executed, the processor is used to execute the method described in the second aspect or a further preferred implementation of the second aspect.
[0087] In a ninth aspect, the present application provides a computer-readable storage medium storing a computer program. When the computer program runs on a processor, the processor executes the method described in the second aspect or a further preferred implementation of the second aspect.
[0088] In a tenth aspect, the present application provides a computer program product, which, when executed on a processor, enables the processor to execute the method described in the second aspect or a further preferred implementation of the second aspect.
[0089] It can be understood that the beneficial effects of the fifth to seventh aspects mentioned above can be found in the relevant description of the first aspect mentioned above, and will not be repeated here.
[0090] It can be understood that the beneficial effects of the eighth to tenth aspects mentioned above can be found in the relevant description of the first aspect mentioned above, and will not be repeated here.
[0091] In general, the above technical solutions conceived by this application have the following beneficial effects compared with the prior art:
[0092] The present application provides a method for processing a special effect color card, wherein a three-dimensional matrix is sliced in the z-axis direction corresponding to the third three primary color elements, and the three-dimensional matrix is converted into a LUT image; then the small squares in the LUT image are downsampled to complete the processing of the color card; based on the three colors of RGB, the human eye is most sensitive to red and green, and least sensitive to blue; therefore, based on this principle, the volume of the special effect color card is significantly reduced and the decoding time is significantly shortened without obvious loss of image effect.
[0093] The present application provides a method for processing a special effect color card, wherein a three-dimensional matrix is processed every 2 n By sampling the pixel values, the size of the special effect color card can be significantly reduced, and the color card decoding time can be shortened.
[0094] The present application provides an image filter processing method, wherein a method for obtaining a color conversion table between a primary color card and a special effect color card is provided. As long as the same filter processing is performed on the image, the color conversion table between the primary color card and the special effect color card only needs to be obtained once, which can greatly improve the efficiency of image filter processing.
[0095] The present application provides an image filter processing method, which runs in a GPU. Since the GPU is responsible for intensive algorithm calculations, running the image filter processing method on the GPU will greatly improve the computing performance. BRIEF DESCRIPTION OF THE DRAWINGS
[0096] Figure 1 is a flow chart of an image filter processing method provided in an embodiment of the present application;
[0097] Figure 2 It is an RGB three-dimensional color mapping matrix diagram provided in an embodiment of the present application;
[0098] Figure 3 is a schematic diagram of a two-dimensional optimized color card provided in an embodiment of the present application;
[0099] Figure 4 This is an example diagram of existing color addressing conversion provided by an embodiment of the present application;
[0100] Figure 5 is a flowchart of image color card effect processing provided by an embodiment of the present application;
[0101] Figure 6 This is a comparison chart of the special effect color card filters provided in the embodiments of the present application; DETAILED DESCRIPTION
[0102] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0103] In the embodiments of the present application, words such as "exemplary" or "for example" are used to indicate examples, illustrations or descriptions. Any embodiment or design described as "exemplary" or "for example" in the embodiments of the present application should not be interpreted as being more preferred or more advantageous than other embodiments or designs. Specifically, the use of words such as "exemplary" or "for example" is intended to present related concepts in a specific way.
[0104] In the description of the embodiments of the present application, unless otherwise specified, “plurality” means two or more than two.
[0105] The following are the technical terms involved in this application:
[0106] Pixel: It is the smallest information unit that constitutes an image. It is usually square or circular, with a size of about 0.26 mm. Multiple pixels are arranged in an orderly manner in a two-dimensional grid to form an image. Pixel is just a size unit of resolution. The larger the pixel, the higher the resolution, the clearer the photo, and the larger the output photo size. Image resolution is the image size and size that can be selected by a digital camera. The unit is dpi. Common ones are 640*480, 1024*768, 1600*1200, and 2048*1536. In the two sets of numbers in the image, the former is the image width and the latter is the image height. The multiplication of the two gives the image pixels. The aspect ratio is generally 4:3.
[0107] Pixel value: the brightness or reflection density information of each pixel in the image. Grayscale value is the color value of each pixel in the image, ranging from 0 to 255.
[0108] The RGB color model is a color standard in the industry. It obtains a variety of colors by changing the three color channels of red, green, and blue and superimposing them on each other. RGB stands for the colors of the three channels 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 systems.
[0109] Each pixel of an image can be represented by a unique color (R, G, B), where the range of RGB is 0 to 255; 0 represents the darkest and 255 represents the brightest.
[0110] Special effects color card coloring (also called filter): Here we take the RGB color space as an example. In the RGB color space, each pixel in each image is composed of these three elements; the color of a pixel (R, G, B) can be regarded as a coordinate point in a three-dimensional space; the essence of the video special effects color card effect is to color map each pixel. The color transformation is simply understood as the mapping of one coordinate point in three-dimensional space to another coordinate point, that is, the pixel value corresponding to each pixel of the original image (the value range of each element in the pixel value is the value range of initial red, initial green and initial blue) is mapped to the pixel value corresponding to each pixel after the special effects color card filter (the value range of each element in the pixel value is the value range of target red, target green and target blue); traverse each pixel in the original image once, and the special effects color card effect of the entire image is realized;
[0111] It should be pointed out here that for the color card used in the original image, the value range of each color of the initial red, initial green and initial blue is generally 0-255; therefore, the pixel value of the original image has 256*256*256, a total of 16777216 combinations; the pixel value of any pixel in the original image must be one of the 16777216 combinations; and the pixel value of the corresponding pixel after the special effect color card filter must also be in the 16777216 combinations.
[0112] Example 1
[0113] like Figure 1 As shown, the present application provides an image filter processing method, which specifically includes the following steps:
[0114] D1: Figure 2 As shown, the color mapping table of 16777216 combinations is made into a three-dimensional matrix using RGB as the xyz coordinate axis respectively; wherein the xyz coordinate system is a Cartesian coordinate system;
[0115] The three dimensions of the matrix are 0-255, and the value of each dimension represents a color brightness value. If each data in the matrix is stored using 8 bits, that is, one byte, taking the special effect color card of 256*256*256 pixels as an example, a total of about 67M storage space is required. In actual use, it takes a long time for the client to parse and load such a large image.
[0116] D2: Every four pixel values (usually 2 n ) sampling, that is, each RGB channel maps 4 continuous three-dimensional coordinates into 1 target coordinate. After sampling, the data density of the three dimensions is reduced to 0-63 (256 / 4); therefore, the storage space of the original color card matrix is reduced from 67M to 1M, and the volume is greatly reduced;
[0117] D3: Slice the three-dimensional matrix along the z-axis (blue pixel axis) into 64 initial blocks representing different blue pixel values to construct a LUT map; then arrange the 64 initial blocks according to the x- and y-axis corresponding to the red pixel axis and the green pixel axis, that is, 8 small blocks on the horizontal axis and 8 small blocks on the vertical axis, and finally combine them into a 8*8 two-dimensional large block. Each initial block is a 64*64 LUT image, and a color card with a resolution of 512*512 is constructed, which is exactly equal to 64*64*64; a mapping relationship from (old R, old G, old B) to (new R, new G, new B) can be represented; that is, the actual pixel value coordinates of the image are represented as (old R, old G, old B), and the color of the pixel at this coordinate is represented as (new R, new G, new B), realizing a one-to-one correspondence in the mapping table;
[0118] More specifically, from the perspective of each initial block, each initial block actually represents a complete mapping from (old R, oldG) to (new R, new G); where the pixel coordinate (x, y) represents (old R, old G), and the RG value of the color of the pixel target coordinate represents (new R, new G);
[0119] For example, assuming (old R, old G) = (100, 150), then the target coordinates are (100 / 4, 150 / 4) = (25, 37);
[0120] If the target pixel value corresponding to the coordinate (25,37) in the LUT image is (213,88), then (new R, new G) = (213,88); that is, the mapping relationship from (old R, old G) = (100,150) to (new R, new G) = (213,88) is completed;
[0121] So far, the mapping of the R channel and the G channel has been completed. The 64 initial squares are arranged from left to right and from top to bottom, numbered 0 to 63. (old B) can be mapped to one of the initial square grids;
[0122] For example, (old B) = (50), the final color falls on (50 / 4) = (12) grids; but note that (12) here is not (new B), (12) is still just the coordinate of the LUT image, and (new B) is the B value of the color corresponding to the coordinate (12);
[0123] D4: The 512*512 LUT image obtained in D3 is further downsampled, and the initial blocks are reduced from 64 slice blocks to 32 slice blocks (target blocks), thus forming the following Figure 3 The color card results shown; compared with the color card sampled in S2, the data addressing density of the red and green pixel axes is not significantly reduced, while the addressing density of the blue pixel axis is reduced by half;
[0124] It should be pointed out here that this application converts the complex three-dimensional coordinate matrix operation problem into a simple two-dimensional color addressing problem, that is, the current colors R, G and B correspond to x, y and the small square number in the two-dimensional color card diagram respectively; complete the final color conversion; Figure 4 A schematic diagram of the color conversion process is given; Figure 4 The left side of the middle is the original image color, and the middle image is the color conversion color card. The original image on the left is mapped to the new image color on the right according to the color conversion color card;
[0125] D5: Performing color conversion on the image to be processed. The entire color conversion method specifically includes the following steps: obtaining the coordinates of each pixel point in the image, and determining the corresponding target block of the LUT image after downsampling according to the z coordinate (old B);
[0126] Determine the coordinates of (old R, old G) in the corresponding target block after the LUT image is downsampled, and use the pixel value corresponding to the coordinates as the final color;
[0127] It should be noted here that since the LUT image is downsampled, the target block calculated according to (oldB) may be a decimal, so the colors of the two adjacent target blocks and need to be mixed; the coordinate calculation formula of the adjacent target blocks in the special effect color card after downsampling is as follows:
[0128] y sq1 =f(f(p b *N sq *2) / N h )
[0129] x sq1 =f(p b *N sq )-y sq1 *N w
[0130] y sq2 =f(c(p b *N sq *2) / N h )
[0131] x sq2 =c(p b *N sq )-y sq2 *N w
[0132] Among them, (x sq1 ,y sq1 ) and (x sq2 ,y sq2 ) are the horizontal and vertical coordinates of the two adjacent target blocks finally calculated, such as the block in the third row and fourth column or the block in the third row and third column; p b The Blue pixel value of each pixel (between 0.0 and 1.0 after normalization); N sq The total number of small blocks - 1, the numbering of small blocks starts from 0; N w and N h is the number of 2D color card target blocks in the horizontal and vertical directions; f is the floor function, rounded down; c is the ceil function, rounded up; in this embodiment, N w is 4, N h is 8;
[0133] After the target square is determined, the next step is to combine the red pixel value and the green pixel value of each pixel to finally determine the final coordinate (x new1 ,y new1 ) and the adjacent target square pixel after conversion (x new2 ,y new2 ); the calculation process is as follows:
[0134]
[0135]
[0136]
[0137]
[0138] Among them, p r and p gare the red and green coordinates of each pixel respectively; w i and h i are the width and height of the special effect color card image respectively; in this application, w i is 256, h i is 512; change the width and height of the color card;
[0139] Further preferably, the method of coordinate addressing and color mixing specifically comprises the following steps:
[0140] The final coordinates (x new1 ,y new1 ) and (x new2 ,y new2 );
[0141] According to the calculated value of each pixel, the final coordinate to be addressed is used to query the color of the current color card;
[0142] C 1 =t2D(C map ,(x new1 ,y new1 ))
[0143] C 2 =t2D(C map ,(x new2 ,y new2 ))
[0144] fC=mix(C 1 ,C 2 ,fr(p b *N sq ))
[0145] Among them, t2D is the abbreviation of texture2d function, which means converting the current coordinate texture read into pixel value; map is the input color card texture; mix is the mixing function, which converts C 1 ,C 2 According to fr(p b *N sq ) values are mixed; fr is the abbreviation of the function fract, which means returning the decimal part of the floating point number in the parameter; t2D, mix, and fr are the abbreviations of GPU rendering API; C 1 , C 2 is the image pixel color obtained by addressing the calculated color coordinates; fC is the final mixed image processing result.
[0146] It should be noted here that S3 slices the blue pixel axis and S4 downsamples the blue slices because in the human eye, there are mainly three types of photoreceptor cells that perceive long-wave (L) red, medium-wave (M) green, and short-wave (S) blue, and the ratio of these three types of photoreceptor cells is 40:20:1; that is, green photoreceptor cells are the most, red photoreceptor cells are the second, and blue photoreceptor cells are the least; therefore, it can be considered that for the three colors of RGB, the human eye is most sensitive to red and green, and least sensitive to blue; therefore, based on this principle, a color card filter processing method is proposed.
[0147] In this embodiment, the pixel value corresponding to each pixel point of the original image is addressed in the special effect color card and then the color conversion is performed. This method is less efficient than establishing a color conversion table between the original color card and the special effect color card and then performing an image filter. However, it is a mainstream image filter processing method. In practical applications, it is intuitively understood that the GPU obtains an image, the client selects a filter color card, and the GPU outputs the image after the filter processing. Therefore, the above embodiment uses the pixel value corresponding to each pixel point on the direct image to address the color conversion in the special effect color card; a more efficient way is: the GPU obtains the original color card corresponding to the image, and matches the three pixel values corresponding to the coordinate points in the original color card with the three different pixel values corresponding to the coordinate points in the special effect color card. When filtering the image, after the pixel value of each pixel point is obtained, it can be directly searched according to the color conversion table for filter processing. When multiple images are subjected to the same filter processing, only one addressing is required.
[0148] Example 2
[0149] Based on the special effect color card acquisition method provided above, the present application accordingly provides an image filter processing method based on a color conversion table, which specifically includes the following steps:
[0150] Step 1: Find the corresponding small square in the LUT image according to the pixel value of the third three-primary color element in the i-th coordinate point of the original color card corresponding to the image; let the initial value of i be 0;
[0151] Step 2: Find the coordinates corresponding to the first three primary color elements and the second three primary color elements of the i-th coordinate point on the primary color card in the small square obtained in step 1;
[0152] Step 3: According to the coordinates of the first three primary color elements and the second three primary color elements in the special effect color card and the small square obtained in step 1, obtain the color in the special effect color card corresponding to the i-th coordinate point in the original color card;
[0153] Step 4: Let i=i+1, go to step 1, until the coordinate points of all original color cards are traversed, and the color conversion table between the original color card and the special effect color card is obtained;
[0154] Step 5: Obtain the pixel value corresponding to each pixel in the image to be processed by the filter, and obtain the image processed by the special effect filter according to the color conversion table between the original color card and the special effect color card.
[0155] Example 3
[0156] like Figure 5 As shown, the present application accordingly provides an image filter processing method based on addressing color conversion, which specifically includes the following steps:
[0157] Step 1: Find the corresponding small square in the LUT image according to the pixel value of the third three-primary color element in the pixel point of the filter image to be processed; let the initial value of i be 0;
[0158] Step 2: Find the coordinates corresponding to the first three primary color elements and the second three primary color elements of the pixel point of the filter image to be processed in the small square obtained in step 1;
[0159] Step 3: According to the coordinates of the first three primary color elements and the second three primary color elements in the special effect color card and the small square obtained in step 1, obtain the color in the special effect color card corresponding to the pixel point of the filter image to be processed;
[0160] Step 4: Let i=i+1, go to step 1, and continue until all pixels of the filter image to be processed are traversed to obtain the image processed by the special effect filter.
[0161] It should be pointed out here that in actual production work, since mobile devices are usually composed of two parts: CPU (Central Processing Unit) and GPU (Graphic Processing Unit), the CPU is responsible for logical calculations and the GPU is responsible for intensive algorithm calculations; therefore, if the color adjustment process of the color card is transferred from the CPU to the GPU, the computing performance will inevitably be greatly improved; however, this application includes but is not limited to image filter processing on the GPU.
[0162] Example 4
[0163] The present application provides a special effect color card processing system, including:
[0164] A three-dimensional coordinate construction module is used to make the color mapping table corresponding to the special effect color card into a three-dimensional matrix using three primary colors as xyz coordinate axes; wherein the three primary colors include a first three primary color element, a second three primary color element and a third three primary color element; and the value range of the xyz axis is the pixel value range of the three primary colors;
[0165] The LUT image construction module is used to slice the three-dimensional matrix in the z-axis direction corresponding to the third three-primary color element, and convert the three-dimensional matrix into a LUT image; wherein the number of small squares in the LUT image is the number of values of the third three-primary color element, and each small square represents a pixel value of the three-primary color element; the horizontal axis and the vertical axis of each small square correspond to the first three-primary color element and the second three-primary color element respectively; wherein the object is least sensitive to the third three-primary color element;
[0166] The LUT image downsampling module is used to downsample the small squares in the LUT image to complete the processing of the color card.
[0167] Further preferably, the processing system of the special effect color card further includes a three-dimensional matrix downsampling module for performing a three-dimensional matrix downsampling operation every 2 n Pixel value sampling.
[0168] Further preferably, the three primary colors in the three-dimensional coordinate construction module, the LUT image construction module and the LUT image downsampling module are red, green and blue; the first three primary color elements are red, the second three primary color elements are green, and the third three primary color elements are blue; or the first three primary color elements are green, the second three primary color elements are red, and the third three primary color elements are blue.
[0169] Example 5
[0170] The present application provides an image filter processing system, comprising: a color conversion table construction module or an addressing color conversion module, an initial image acquisition module and a filter-processed image storage module;
[0171] The initial image acquisition module is used to obtain the pixel value corresponding to each pixel point in the image to be processed by the filter;
[0172] The filter-processed image storage module is used to obtain images processed by special effect filters;
[0173] The color conversion table construction module is used to store and construct the color conversion table between the primary color card and the special effect color card; it includes: a first small square search unit, a first two primary color coordinate search unit and a first color acquisition unit;
[0174] The first small square search unit is used to search for a corresponding small square in the LUT image according to the pixel value of the third three-primary color element in the original color card coordinate point;
[0175] The first two-primary color coordinate search unit is used to search for coordinates corresponding to the first three primary color elements and the second three primary color elements of the primary color card coordinate point in the small square obtained by the small square search unit;
[0176] The first color acquisition unit is used to acquire the color in the special effect color card corresponding to the coordinate point in the original color card according to the coordinates of the first three primary color elements and the second three primary color elements in the special effect color card and the small square acquired by the small square search unit;
[0177] The addressing color conversion module is used to use the image to be filtered and perform addressing color conversion based on the special effect color card; it includes: a second small square search unit, a second two-primary color coordinate search unit and a second color acquisition unit;
[0178] The second small square search unit is used to search for a corresponding small square in the LUT image according to the pixel value of the third three-primary color element in the pixel point of the filter image to be processed;
[0179] The second two-primary color coordinate search unit is used to search the coordinates corresponding to the first three primary color elements and the second three primary color elements of the pixel point in the filter image to be processed in the small square obtained by the small square search unit;
[0180] The second color acquisition unit is used to acquire the color in the special effect color card corresponding to the pixel point of the filter image according to the coordinates of the first three primary color elements and the second three primary color elements in the special effect color card and the small square acquired by the small square search unit.
[0181] Further preferably, the image filter processing system is arranged in a GPU.
[0182] The calculation formula for finding the small square in the special effect color card is:
[0183] y sq1 =f(f(p b *N sq *2) / N h )
[0184] x sq1 =f(p b *N sq )-y sq1 *N w
[0185] y sq2 =f(c(p b *N sq *2) / N h )
[0186] x sq2 =c(p b *N sq )-y sq2 *N w
[0187] Among them, (x sq1 ,y sq1 ) and (x sq2 ,ysq2 ) are the horizontal and vertical coordinates of two adjacent small squares, the horizontal coordinate represents the row where the small square is located, and the vertical coordinate represents the column where the small square is located; p b is the pixel value of the third three-primary color element in the i-th coordinate point of the primary color card; N sq The total number of small blocks - 1, the numbering of small blocks starts from 0; N w and N h is the number of small squares in rows and columns; f is the floor function, which means rounding down; c is the ceil function, which means rounding up; N w and N h Take 2m, where m is an integer.
[0188] It should be pointed out here that due to the downsampling operation involved in the acquisition of the special effects color card in this application, when searching for small squares according to the blue pixel value in the original color card, there is a high probability that the small squares are not located on a certain small square. At this time, two adjacent small squares between which the pixel values of the third three primary color elements are located are selected.
[0189] Further preferably, the coordinate calculation formula corresponding to the first three primary color elements and the second three primary color elements of the ith coordinate point of the primary color card or the ith pixel point in the image to be processed by the filter in the small square is:
[0190]
[0191]
[0192]
[0193]
[0194] Among them, (x new1 ,y new1 ) and (x new2 ,y new2 ) are the coordinates of the first three primary color elements and the second three primary color elements of the i-th coordinate point of the primary color card in two adjacent small squares; w i and h i They are the width and height of the special effects color card respectively.
[0195] It should be pointed out here that since this step is executed in the GPU, it is necessary to establish a two-dimensional coordinate for the special effect color card. The horizontal and vertical coordinates of each small square represent the pixel values of the first three primary color elements and the second three primary color elements. According to the arrangement order of the small squares, the two-dimensional coordinates are reconstructed in the GPU, w i and h i They are the width and height of the special effect color card respectively. The width and height here are the concepts of two-dimensional coordinates constructed in the GPU.
[0196] Further preferably, the color in the special effect color card corresponding to the i-th coordinate point in the original color card or the i-th pixel point in the image to be processed by the filter is:
[0197] C 1 =t2D(C map ,(x new1 ,y new1 ))
[0198] C 2 =t2D(C map ,(x new2 ,y new2 ))
[0199] fC=mix(C 1 ,C 2 ,fr(p b *N sq ))
[0200] Among them, t2D is the abbreviation of texture2d function, which means to convert the read current coordinate texture into pixel value; C map is the input color card texture; mix is the mixing function, which converts C 1 ,C 2 According to fr(p b *N sq ) values are mixed; fr is the abbreviation of the function fract, which means returning the decimal part of the floating point number in the parameter; t2D, mix, and fr are the abbreviations of GPU rendering API; C 1 , C 2 is the color of the i-th coordinate point in the original color card in the two small squares; fC is the color in the special effect color card corresponding to the i-th coordinate point in the original color card.
[0201] Example 6
[0202] like Figure 6 As shown in the figure, the left image in the three groups of images is the effect before optimization, and the right image is the effect after optimization. It can be seen that there is no perceptual difference in image quality before and after optimization in shopping malls, cities, and natural landscapes;
[0203] Comparing the pixels again, there are differences in the blue color component of the two images. Since the human eye is least sensitive to blue, and the camera resolution of mainstream short videos such as Kuaishou and Douyin is basically between 540p and 1080p; therefore, at this loss level, there is no obvious difference in the effect experience for the human eye.
[0204] Without significant loss of effect, the size of the color card image is significantly reduced, and the decoding time is significantly shortened; Table 1 shows the optimization results of different color card sizes and the decoding performance test results of the same color card before and after optimization. It can be seen that after optimization, the resource package size is greatly reduced, with an average optimization of 43.14%. The reduction in size will also optimize the resource package download time; using images with more optimized size also has a certain optimization in decoding speed. After comparison, the average optimization is 1.68ms, and the optimization ratio is 6.7%;
[0205] Table 1
[0206]
[0207] In summary, compared with the prior art, the present application has the following advantages:
[0208] In practical applications, the special effects color card filter optimization method proposed in this application can significantly reduce the size of resource packages and optimize decoding time in terms of performance indicators. At the same time, it can bring about a series of performance improvements such as reduced resource download time, optimization of special effects first frame loading, and optimization of resource package parsing time. In terms of business indicators, it can reduce broadband costs and increase the coverage of special effects color card models. In addition, this method can not only be used for special effects color cards, but also for color processing algorithms, such as color transformation based on RGB three channels, mapping and other effects, and has good reusability and strong scalability.
[0209] It should be understood that the above-mentioned system is used to execute the methods in the above-mentioned embodiments. The implementation principles and technical effects of the corresponding program modules in the system are similar to those described in the above-mentioned methods. The working process of the system can refer to the corresponding process in the above-mentioned method and will not be repeated here.
[0210] Based on the method in the above embodiment, an embodiment of the present application provides an electronic device. The device may include: at least one memory for storing programs and at least one processor for executing the programs stored in the memory. When the program stored in the memory is executed, the processor is used to execute the method described in the above embodiment.
[0211] Based on the method in the above embodiment, an embodiment of the present application provides a computer-readable storage medium, which stores a computer program. When the computer program runs on a processor, the processor executes the method in the above embodiment.
[0212] Based on the method in the above embodiment, an embodiment of the present application provides a computer program product. When the computer program product runs on a processor, the processor executes the method in the above embodiment.
[0213] It is understandable that the processor in the embodiments of the present application may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field programmable gate arrays (FPGA) or other programmable logic devices, transistor logic devices, hardware components or any combination thereof. A general-purpose processor may be a microprocessor or any conventional processor.
[0214] The method steps in the embodiments of the present application can be implemented by hardware, or by a processor executing software instructions. The software instructions can be composed of corresponding software modules, and the software modules can be stored in random access memory (Random Access Memory, RAM), flash memory, read-only memory (Read-Only Memory, ROM), programmable read-only memory (Programmable Rom, PROM), erasable programmable read-only memory (Erasable PROM, EPROM), electrically erasable programmable read-only memory (Electrically EPROM, EEPROM), registers, hard disks, mobile hard disks, CD-ROMs or any other form of storage medium known in the art. An exemplary storage medium is coupled to the processor so that the processor can read information from the storage medium and write information to the storage medium. Of course, the storage medium can also be a component of the processor. The processor and the storage medium can be located in an ASIC.
[0215] In the above embodiments, it can be implemented in whole or in part 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. When the computer program instructions are loaded and executed on a computer, the process or function described in the embodiment of the present application is generated in whole or in part. The computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable system. The computer instructions may be stored in a computer-readable storage medium or transmitted through the computer-readable storage medium. The computer instructions may be transmitted from a website site, a computer, a server or a data center to another website site, a computer, a server or a data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium may be any available medium that a computer can access or a data storage device such as a server or a data center that includes one or more available media integrated. The available medium may be a magnetic medium, (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., a solid-state drive (SSD)), etc.
[0216] It should be understood that the various numerical numbers involved in the embodiments of the present application are only used for the convenience of description and are not used to limit the scope of the embodiments of the present application.
[0217] It will be easily understood by those skilled in the art that the above description is only a preferred embodiment of the present application and is not intended to limit the present application. Any modifications, equivalent substitutions and improvements made within the spirit and principles of the present application shall be included in the scope of protection of the present application.
Claims
1. A method for processing a special effect color card, characterized in that: The following steps are involved: S1: Make the color mapping table corresponding to the special effect color card into a three-dimensional matrix with three primary colors as xyz coordinate axes; wherein the three primary colors include a first three primary color element, a second three primary color element and a third three primary color element; and the value range of the xyz axis is the pixel value range of the three primary colors; S2: Slice the three-dimensional matrix in the z-axis direction corresponding to the third three-primary color element, and convert the three-dimensional matrix into a LUT image; wherein the number of small squares in the LUT image is the number of values of the third three-primary color element, and each small square represents a pixel value of the third three-primary color element; the horizontal axis and the vertical axis of each small square correspond to the first three-primary color element and the second three-primary color element respectively; wherein the visual object is least sensitive to the third three-primary color element; S3: Downsample the small squares in the LUT image to complete the processing of the special effect color card.
2. The processing method according to claim 1, characterized in that: S1 and S2 perform every 2 n Pixel value sampling.
3. The processing method according to claim 1 or 2, characterized in that: The three primary colors are red, green and blue; the first three primary color elements are red, the second three primary color elements are green, and the third three primary color elements are blue; or the first three primary color elements are green, the second three primary color elements are red, and the third three primary color elements are blue.
4. An image filter processing method based on any one of the processing methods of claims 1 to 3, characterized in that: The specific steps include: Obtain the pixel value corresponding to each pixel in the image to be processed by the filter, and obtain the image processed by the special effect filter according to the color conversion table between the original color card and the special effect color card, or adopt the addressing color conversion method based on the special effect color card; wherein the original color card is the color card corresponding to the image to be processed by the filter; The method for obtaining the color conversion table between the original color card and the special effect color card includes the following steps: Step 1: According to the pixel value of the third three-primary color element in the i-th coordinate point of the original color card corresponding to the image to be filtered, find the corresponding small square in the LUT image; let the initial value of i be 0; Step 2: Find the coordinates corresponding to the first three primary color elements and the second three primary color elements of the i-th coordinate point on the primary color card in the small square obtained in step 1; Step 3: According to the coordinates of the first three primary color elements and the second three primary color elements in the special effect color card and the small square obtained in step 1, obtain the color in the special effect color card corresponding to the i-th coordinate point in the original color card; Step 4: Let i=i+1, go to step 1, until all the coordinate points of the original color cards are traversed, and the color conversion table between the original color card and the special effect color card is obtained; The addressing color conversion method is adopted based on the special effect color card, including the following steps: Step 1: According to the pixel value of the third three-primary color element in the pixel point of the filter image to be processed, find the corresponding small square in the LUT image; let the initial value of i be 0; Step 2: Find the coordinates corresponding to the first three primary color elements and the second three primary color elements of the pixel point of the filter image to be processed in the small square obtained in step 1; Step 3: According to the coordinates of the first three primary color elements and the second three primary color elements in the special effect color card and the small square obtained in step 1, obtain the color in the special effect color card corresponding to the pixel point of the filter image to be processed; Step 4: Let i=i+1, go to step 1, and continue until all pixels of the filter image to be processed are traversed to obtain the image processed by the special effect filter.
5. The image filter processing method according to claim 4, characterized in that: It runs on the GPU.
6. The image filter processing method according to claim 5, characterized in that: The calculation formula for finding the small square in the special effect color card is: y sq1 =f(f(p b *N sq *2) / N h ) x sq1 =f(p b *N sq )-y sq1 *N w y sq2 =f(c(p b *N sq *2) / N h ) x sq2 =c(p b *N sq )-y sq2 *N w Among them, (x sq1 ,y sq1 ) and (x sq2 ,y sq2 ) are the horizontal and vertical coordinates of the two adjacent small squares found, the horizontal coordinate represents the row where the small square is located, and the vertical coordinate represents the column where the small square is located; p b N is the pixel value of the third three primary color element in the i-th coordinate point of the original color card or the i-th pixel point in the image to be processed by the filter; sq The total number of small blocks - 1, the numbering of small blocks starts from 0; N w and N h is the number of small squares in rows and columns; f is the floor function, which rounds down; c is the ceil function, which rounds up; N w and N h Take 2 m , m is an integer.
7. The image filter processing method according to claim 6, characterized in that: The coordinate calculation formula of the first three primary color elements and the second three primary color elements of the i-th coordinate point of the original color card or the i-th pixel point in the image to be processed by the filter in the small square is: Among them, (x new1 ,y new1 ) and (x new2 ,y new2 ) are respectively the coordinates of the first three primary color elements and the second three primary color elements of the i-th coordinate point of the primary color card or the i-th pixel point in the image to be processed by the filter in two adjacent small squares; w i and h i They are the width and height of the special effects color card respectively.
8. The image filter processing method according to claim 7, characterized in that: The color in the special effect color card corresponding to the i-th coordinate point in the original color card or the i-th pixel point in the image to be processed by the filter is: C1=t2D(C map ,(x new1 ,y new1 )) C2=t2D(C map ,(x new2 ,y new2 )) fC=mix(C1,C2,fr(p b *N sq )) Among them, t2D is the abbreviation of texture2d function, which means to convert the read current coordinate texture into pixel value; C map is the input color card texture; mix is the mixing function, C1 and C2 are mixed according to fr(p b *N sq ) values are mixed; fr is the abbreviation of function fract, which means returning the decimal part of the floating point number in the parameter; t2D, mix, fr are the abbreviations of GPU rendering API; C1 and C2 are the colors of the i-th coordinate point in the original color card or the i-th pixel in the image to be processed by the filter in the two small squares; fC is the color in the special effect color card corresponding to the i-th coordinate point in the original color card or the i-th pixel in the image to be processed by the filter.
9. A processing system for special effect color cards, characterized in that: include: A three-dimensional coordinate construction module is used to make the color mapping table corresponding to the special effect color card into a three-dimensional matrix using three primary colors as xyz coordinate axes; wherein the three primary colors include a first three primary color element, a second three primary color element and a third three primary color element; and the value range of the xyz axis is the pixel value range of the three primary colors; The LUT image construction module is used to slice the three-dimensional matrix in the z-axis direction corresponding to the third three-primary color element, and convert the three-dimensional matrix into a LUT image; wherein the number of small squares in the LUT image is the number of values of the third three-primary color element, and each small square represents a pixel value of the third three-primary color element; the horizontal axis and the vertical axis of each small square correspond to the first three-primary color element and the second three-primary color element respectively; wherein the visual object is least sensitive to the third three-primary color element; The LUT image downsampling module is used to downsample the small squares in the LUT image to complete the processing of the special effect color card.
10. An image filter processing system, characterized in that: include: A color conversion table building module or an addressing color conversion module, an initial image acquisition module, and a filter-processed image storage module; The initial image acquisition module is used to obtain the pixel value corresponding to each pixel point in the image to be processed by the filter; The filter-processed image storage module is used to obtain images processed by special effect filters; The color conversion table construction module is used to store and construct the color conversion table between the primary color card and the special effect color card; it includes: a first small square search unit, a first two primary color coordinate search unit and a first color acquisition unit; The first small square search unit is used to search for a corresponding small square in the LUT image according to the pixel value of the third three-primary color element in the original color card coordinate point; The first two-primary color coordinate search unit is used to search for coordinates corresponding to the first three primary color elements and the second three primary color elements of the primary color card coordinate point in the small square obtained by the small square search unit; The first color acquisition unit is used to acquire the color in the special effect color card corresponding to the coordinate point in the original color card according to the coordinates of the first three primary color elements and the second three primary color elements in the special effect color card and the small square acquired by the small square search unit; The addressing color conversion module is used to use the image to be filtered and perform addressing color conversion based on the special effect color card; it includes: a second small square search unit, a second two-primary color coordinate search unit and a second color acquisition unit; The second small square search unit is used to search for a corresponding small square in the LUT image according to the pixel value of the third three-primary color element in the pixel point of the filter image to be processed; The second two-primary color coordinate search unit is used to search the coordinates corresponding to the first three primary color elements and the second three primary color elements of the pixel point in the filter image to be processed in the small square obtained by the small square search unit; The second color acquisition unit is used to acquire the color in the special effect color card corresponding to the pixel point of the filter image according to the coordinates of the first three primary color elements and the second three primary color elements in the special effect color card and the small square acquired by the small square search unit.
