Image processing method and device and video processing equipment

By calculating the bias compensation matrix and the interval scaling matrix, and combining the target conversion matrix for linear mapping, the problem of reducing accuracy and wasting resources in color space conversion and linear image processing in the prior art is solved, and efficient Image processing.

CN114493987BActive Publication Date: 2024-12-17XIAN NOVASTAR TECH
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202011175605.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-10-27
Publication Date
2024-12-17
Estimated Expiration
2040-10-27

AI Technical Summary

Technical Problem

Existing video processing equipment has problems of reduced accuracy and waste of computing resources during color space conversion and linear image processing, mainly due to the lack of integration and modular processing of functions.

Method used

By calculating the offset compensation matrix, interval scaling matrix and target conversion matrix based on the color space type and value range type of the initial image and the target image, combining the calculation results of these matrices to provide conversion coefficients, and perform linear mapping processing to achieve color space conversion. Modular processing reduces computational volume and improves accuracy.

Benefits of technology

Modular processing of sixteen CSC conversion relationships is realized, saving storage resources, simplifying the color space conversion process, and improving the accuracy and efficiency of image processing.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114493987B_ABST
    Figure CN114493987B_ABST
Patent Text Reader

Abstract

The embodiment of the present invention discloses an image processing method and apparatus and a video processing device. The method includes, for example: obtaining a bias compensation matrix according to the color space value range type and color space type of an initial image and the color space value range type and color space type of a target image; obtaining an interval scaling matrix according to the color space value range type of the initial image and the color space value range type of the target image; obtaining a target conversion matrix according to the color space type of the initial image, the color space type of the target image and linear image processing parameters; providing a bias addition matrix and combining the calculation results of the bias compensation matrix, the interval scaling matrix and the target conversion matrix to obtain conversion coefficients; and performing linear mapping processing on the initial image based on the conversion coefficients to obtain a target image. The embodiment of the present invention can save resources and improve image processing accuracy by summarizing the color space conversion process and modularizing it.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

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

[0002] As far as video processing equipment is concerned, CSC (Color Space Convert) and linear image processing are both essential functions, and the linear image processing function in most cases requires the support of the color space conversion function because it must be performed in a specific color space.

[0003] CSC is the conversion of a color representation in a certain color space to another color space. In the field of video signal processing, it mainly converts the video data source signal to match the color space of the display device. Therefore, it involves the conversion of four commonly used color spaces in the broadcast video field, namely RGB Limited, YUV Limited, RGB Full and YUVFull. Among them, RGB represents the color space based on the three channels of red (R), green (G) and blue (B); YUV represents the color space based on the three channels of brightness (Y) and color deviation (U, V); Limited is the abbreviation of Limited Range, which is a color space value range. Under 8-bit color representation, the value range of R, G, B, and Y channels is 16-235, and the value range of U and V is 16-240, so it can be called a channel limited grayscale value range; Full is the abbreviation of Full Range, which is another color space value range. Under 8-bit color representation, the value range of all channels is 0-255, so it can be called a channel full grayscale value range. These four color spaces can be converted to each other through linear mapping relationships. For example, the conversion relationship between RGB Full and YUV Full is shown in the following formula:

[0004]

[0005] The four color spaces can be converted to each other by a method similar to the above formula. Each conversion mode can be composed of a 3×3 conversion matrix and a 3×1 bias matrix.

[0006] The linear image processing module is also composed of a conversion matrix and a bias matrix according to its different functions, but the bias matrix is ​​not necessary. For example, the brightness adjustment in the RGB Full space can be expressed as:

[0007]

[0008] Among them, L represents the ratio of brightness adjustment, and the bias matrix does not need to be involved.

[0009] The brightness adjustment in RGB Limited space can be expressed as:

[0010]

[0011] It requires the involvement of a bias matrix.

[0012] The process of color space conversion and linear image processing in existing video processing equipment is to connect these individual modules in series through specific rules to achieve the required functions. For a single CSC, the corresponding color conversion module is used directly. If image processing is required, it is first converted to the color space required for image processing and then converted to the output color space. In short, the existing technical solution is just a simple superposition of CSC and linear image processing functions, without considering building a specific architecture to integrate the functions, which easily leads to problems such as reduced accuracy and waste of computing resources. Summary of the invention

[0013] Therefore, in order to overcome at least some of the defects and shortcomings of the prior art, embodiments of the present invention provide an image processing method, an image processing apparatus, and a video processing device.

[0014] Specifically, an image processing method proposed in an embodiment of the present invention, for example, includes: obtaining a bias compensation matrix according to the color space value range type and color space type of an initial image and the color space value range type and color space type of a target image; obtaining an interval scaling matrix according to the color space value range type of the initial image and the color space value range type of the target image; obtaining a target conversion matrix according to the color space type of the initial image, the color space type of the target image and linear image processing parameters; providing a bias addition matrix and combining the calculation results of the bias compensation matrix, the interval scaling matrix and the target conversion matrix to obtain conversion coefficients; and, performing linear mapping processing on the initial image based on the conversion coefficients to obtain the target image.

[0015] The image processing method of the embodiment of the present invention modularizes the color space conversion process by summarizing it, so that the sixteen CSC conversion relationships in the prior art can be implemented by these modular steps, saving storage resources; furthermore, the linear image processing function is divided into multiple categories based on the color space in which it is located, and the positions for adding multiple categories of image processing sub-modules are reserved in the color space conversion architecture, so that the color space conversion architecture supports the implementation of linear image processing functions; in addition, through the modules for digital signal and linear unbiased data conversion (bias compensation and bias addition) and the color space value range type conversion module (interval scaling) in the architecture, the intermediate color space conversion process is simplified to color space type conversion, reducing the amount of calculation on the link and improving the accuracy.

[0016] In one embodiment of the present invention, obtaining a target conversion matrix according to the color space type of the initial image, the color space type of the target image and linear image processing parameters includes: obtaining a first sub-conversion matrix according to the color space type of the initial image and a first color space type; obtaining a second sub-conversion matrix according to first linear image processing parameters for performing image processing in a color space corresponding to the first color space type in the linear image processing parameters; obtaining a third sub-conversion matrix according to the first color space type and the second color space type; obtaining a fourth sub-conversion matrix according to second linear image processing parameters for performing image processing in a color space corresponding to the second color space type in the linear image processing parameters; obtaining a fifth sub-conversion matrix according to the second color space type and the color space type of the target image; and, performing matrix operations on the first sub-conversion matrix, the second sub-conversion matrix, the third sub-conversion matrix, the fourth sub-conversion matrix and the fifth sub-conversion matrix in the order listed to obtain the target conversion matrix.

[0017] In one embodiment of the present invention, obtaining a target conversion matrix according to the color space type of the initial image, the color space type of the target image and linear image processing parameters includes: obtaining a first sub-conversion matrix according to the color space type of the initial image and the color space type required by the linear image processing parameters; obtaining a second sub-conversion matrix according to the linear image processing parameters; obtaining a third sub-conversion matrix according to the color space type required by the linear image processing parameters and the color space type of the target image; and, performing matrix operations on the first sub-conversion matrix, the second sub-conversion matrix and the third sub-conversion matrix in sequence in the order listed to obtain the target conversion matrix.

[0018] In one embodiment of the present invention, the target conversion matrix and the interval scaling matrix perform matrix operations before the offset addition matrix and the offset compensation matrix, and the interval scaling matrix performs matrix operations before or after the target conversion matrix and the offset compensation matrix.

[0019] In one embodiment of the present invention, the first color space type is RGB, the first linear image processing parameter is selected from a brightness adjustment parameter, a saturation adjustment parameter and a color temperature adjustment parameter, the second color space type is YUV, and the second linear image processing parameter is selected from a contrast adjustment parameter and a hue adjustment parameter; or, the first color space type is YUV, the first linear image processing parameter is selected from a contrast adjustment parameter and a hue adjustment parameter, the second color space type is RGB, and the second linear image processing parameter is selected from a brightness adjustment parameter, a saturation adjustment parameter and a color temperature adjustment parameter.

[0020] In addition, another embodiment of the present invention provides an image processing method, which includes: obtaining a bias compensation matrix based on the color space value range type and color space type of the initial image and the color space value range type and color space type of the target image; obtaining an interval scaling matrix based on the color space value range type of the initial image and the color space value range type of the target image; obtaining a target conversion matrix based on the color space type of the initial image and the color space type of the target image; providing a bias addition matrix and combining the calculation results of the bias compensation matrix, the interval scaling matrix and the target conversion matrix to obtain conversion coefficients; and, performing linear mapping processing on the initial image based on the conversion coefficients to obtain the target image.

[0021] The image processing method of the embodiment of the present invention modularizes the color space conversion process by summarizing it, so that the sixteen CSC conversion relationships in the prior art can be implemented by these modular steps, saving storage resources; furthermore, through the modules for digital signal and linear unbiased data conversion (bias compensation and bias addition) and the color space value range type conversion module (interval scaling) in the architecture, the intermediate color space conversion process is simplified to color space type conversion, reducing the amount of calculation on the link and improving the accuracy.

[0022] Furthermore, an image processing device provided by an embodiment of the present invention, for example, includes: a bias compensation module, used to obtain a bias compensation matrix according to the color space value range type and color space type of the initial image and the color space value range type and color space type of the target image; an interval scaling module, used to obtain an interval scaling matrix according to the color space value range type of the initial image and the color space value range type of the target image; a space type conversion and image processing module, used to obtain a target conversion matrix according to the color space type of the initial image, the color space type of the target image and linear image processing parameters; a bias adding module, used to provide a bias adding matrix and obtain conversion coefficients by combining the calculation results of the bias compensation matrix, the interval scaling matrix and the target conversion matrix; and an image processing module, used to perform linear mapping processing on the initial image based on the conversion coefficients to obtain the target image.

[0023] The image processing device of the embodiment of the present invention summarizes the color space conversion process and divides it into multiple modules, so that the sixteen CSC conversion relationships in the prior art can be implemented by these modules, saving storage resources; furthermore, the linear image processing function is divided into multiple categories based on the color space in which it is located, and the positions for adding multiple categories of image processing sub-modules are reserved in the color space conversion architecture, so that the color space conversion architecture supports the implementation of linear image processing functions; in addition, through the modules for digital signal and linear unbiased data conversion (bias compensation module and bias addition module) and the color space value range type conversion module (interval scaling module) in the architecture, the intermediate color space conversion process is simplified to color space type conversion, reducing the amount of calculation on the link and improving the accuracy.

[0024] In addition, another embodiment of the present invention provides an image processing device, for example, including: a bias compensation module, used to obtain a bias compensation matrix according to the color space value range type and color space type of the initial image and the color space value range type and color space type of the target image; an interval scaling module, used to obtain an interval scaling matrix according to the color space value range type of the initial image and the color space value range type of the target image; a space type conversion module, used to obtain a target conversion matrix according to the color space type of the initial image and the color space type of the target image; a bias adding module, used to provide a bias adding matrix and obtain conversion coefficients by combining the operation results of the bias compensation matrix, the interval scaling matrix and the target conversion matrix; and an image processing module, used to perform linear mapping processing on the initial image based on the conversion coefficients to obtain the target image.

[0025] The image processing device of the embodiment of the present invention summarizes the color space conversion process and divides it into multiple modules, so that the sixteen CSC conversion relationships in the prior art can be implemented by these modules, saving storage resources; furthermore, through the modules for digital signal and linear unbiased data conversion (bias compensation module and bias addition module) and the color space value range type conversion module (interval scaling module) in the architecture, the intermediate color space conversion process is simplified to color space type conversion, reducing the amount of calculation on the link and improving the accuracy.

[0026] Finally, a video processing device provided by an embodiment of the present invention, for example, includes: a processor; and a programmable logic device, electrically connected to the processor; wherein the processor and the programmable logic device are used to jointly execute the image processing method described in any of the foregoing embodiments, and the processor is specifically used to generate the conversion coefficient and transmit the conversion coefficient to the programmable logic device, so that the programmable logic device performs the linear mapping processing on the initial image based on the conversion coefficient to obtain the target image.

[0027] In one embodiment of the present invention, each of the color space value range type of the initial image and the color space value range type of the target image is RGB or YUV, and each of the color space value range type of the initial image and the color space value range type of the target image is a channel limited grayscale value range (Limited) or a channel full grayscale value range (Full).

[0028] It can be seen from the above that the technical solutions of various embodiments of the present invention may have one or more of the following advantages: the embodiments of the present invention modularize the color space conversion process by summarizing it, so that the sixteen CSC conversion relationships in the prior art can be implemented by these modules, saving storage resources; furthermore, the linear image processing function is divided into multiple categories based on the color space in which it is located, and the positions for adding multiple categories of image processing sub-modules are reserved in the color space conversion architecture, so that the color space conversion architecture supports the implementation of linear image processing functions; in addition, through the modules for digital signal and linear unbiased data conversion and the color space value range type conversion module in the architecture, the intermediate color space conversion process is simplified to color space type conversion, reducing the amount of calculation on the link and improving the accuracy. BRIEF DESCRIPTION OF THE DRAWINGS

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

[0030] Figure 1 The present invention is a schematic diagram of a flowchart of an image processing method according to an embodiment of the present invention.

[0031] Figure 2 A schematic diagram of the structure of a video processing device proposed in an embodiment of the present invention.

[0032] Figure 3 Schematic diagram of the conversion relationship between RGB / YUV and Limited / Full according to an embodiment of the present invention.

[0033] Figure 4 for Figure 2 A schematic diagram of a specific module structure of a video processing device is shown.

[0034] Figure 5 A schematic diagram of the structure of another video processing device proposed in an embodiment of the present invention.

[0035] Figure 6 for Figure 5 A schematic diagram of a specific module structure of a video processing device is shown.

[0036] Figure 7 A schematic flowchart of another image processing method provided by an embodiment of the present invention.

[0037] Figure 8 for Figure 6 A schematic diagram of a submodule structure of the space type conversion and image processing module shown.

[0038] Fig. 9 for Figure 5 Another specific module structure diagram of the video processing device is shown.

[0039] Fig.10 for Figure 6 A schematic diagram of another submodule composition of the space type conversion and image processing module is shown.

[0040] Fig.11 for Figure 6 A schematic diagram of another submodule structure of the space type conversion and image processing module is shown.

[0041] Fig.12 for Figure 6 A schematic diagram of another submodule structure of the space type conversion and image processing module is shown. DETAILED DESCRIPTION

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

[0043] The following embodiment of the present invention designs a CSC architecture that can integrate color space conversion and linear image processing functions. The architecture can realize the mutual conversion function of four color spaces commonly used in the broadcast video field. At the same time, the architecture can support the addition of linear image processing sub-modules on RGB color space and YUV color space to solve the technical problems of low integration, waste of resources, and poor accuracy caused by too long links in the prior art.

[0044] See also Figure 1 An image processing method provided by an embodiment of the present invention, for example, includes the following steps S11, S13, S15, S17 and S19.

[0045] S11: obtaining a bias compensation matrix according to the color space value range type and color space type of the initial image and the color space value range type and color space type of the target image;

[0046] S13: obtaining an interval scaling matrix according to the color space value range type of the initial image and the color space value range type of the target image;

[0047] S15: Obtaining a target conversion matrix according to the color space type of the initial image and the color space type of the target image;

[0048] S17: providing an offset addition matrix and combining the operation results of the offset compensation matrix, the interval scaling matrix and the target conversion matrix to obtain conversion coefficients;

[0049] S19: Performing linear mapping processing on the initial image based on the conversion coefficient to obtain the target image.

[0050] To facilitate a clearer understanding of the image processing method of this embodiment, Figure 2 , Figure 3 and Figure 4 Give an example.

[0051] Specifically, Figure 2As shown, the video processing device 100 includes a processor 101 and a programmable logic device 103 electrically connected to the processor 101. The processor 101 here is, for example, an embedded processor based on ARM, and the programmable logic device 103 is, for example, an FPGA (Field Programmable Gate Array) device. The processor 101 performs color space conversion according to the color space type and color space value range type of the input initial image and the color space type and color space value range type of the target image to generate conversion coefficients (corresponding to steps S11, S13, S15 and S17), and transmits the conversion coefficients to the programmable logic device 103, so that the programmable logic device 103 performs linear mapping processing (here, simple color space conversion) on the initial image to obtain the target image (corresponding to step S19). The color space of the initial image is, for example, RGB Limited, RGB Full, YUV Limited or YUV Full, and the color space of the target image is, for example, RGB Limited, RGB Full, YUV Limited or YUV Full; in this example, each color space is divided into two physical quantities, one is the color space type such as RGB and YUV, and the other is the color space value range type such as Limited and Full; accordingly, the combination of the color space type and color space value range type of the initial image input to the processor 101 and the color space type and color space value range type of the target image can be called a color space conversion mode, so that the processor 101 generates the conversion coefficient according to the input color space conversion mode and transmits it to the programmable logic device 103.

[0052] like Figure 3As shown, the color space conversion is divided into two modules, namely, the conversion module between the color space types RGB / YUV and the conversion module between the color space value range types Limited / Full. Through these two modules, the original sixteen conversion relationships are divided into two conversion relationships of four types each. Among them, the conversion matrix between RGB / YUV is, for example, a 3×3 coefficient matrix; the conversion matrix between Limited / Full is a 3×1 bias matrix and a 3×3 coefficient matrix. The 3×3 coefficient matrix is ​​used to scale the intervals of the three channels respectively, so it is a diagonal matrix. From the characteristics of the conversion matrix between Limited / Full, it can be seen that the functions of the 3×3 coefficient matrix and the 3×1 bias matrix can be completely separated. Therefore, the conversion between Limited / Full can be further divided into two sub-modules: namely, the bias compensation module 1011, which is used to provide a 3×1 bias matrix, and the interval scaling module 1013, which is used to provide a 3×3 diagonal matrix. In this way, the interval scaling module 1013 can execute step S13 to obtain an interval scaling matrix, such as a 3×3 diagonal matrix, according to the color space value range type of the initial image and the color space value range type of the target image.

[0053] In addition, for the YUV color space type, the digital signal itself has a 128 offset on the U and V channels, so a 3×1 offset matrix [0,128,128] is required. T To compensate, the bias matrix [0,128,128] T It can be linearly superimposed with the 3×1 bias matrix in the conversion matrix between Limited / Full, and is therefore also provided by the bias compensation module 1011. In this way, the bias compensation module 1011 can execute step S11 to obtain a bias compensation matrix such as the linear superposition result matrix of the two 3×1 bias matrices mentioned above according to the color space value range type and color space type of the initial image and the color space value range type and color space type of the target image.

[0054] As for Figure 4 The space type conversion module 1015 and the offset adding module 1017 in the embodiment can respectively perform steps S15 and S17. Figure 1 and Figure 4, the bias compensation module 1011, the interval scaling module 1013, the space type conversion module 1015 and the bias addition matrix are used to provide the bias compensation matrix, the interval scaling matrix, the target conversion matrix and the bias addition matrix respectively; in addition, the bias compensation module 1011 provides the bias compensation matrix to the interval scaling module 1013, and the interval scaling module 1013 performs a matrix operation on the bias compensation matrix and the interval scaling matrix to obtain a first operation result, which is passed to the space type conversion module 1015, and then the space type conversion module 1015 performs a matrix operation on the target conversion matrix and the first operation result to obtain a second operation result, and then the bias addition module 1017 performs a matrix operation on the bias addition matrix and the second operation result to obtain the conversion coefficient. In this example, a bias addition module 1017 is added at the end, which is similar to the initial bias compensation module 1011, and a bias is added to ensure that the output data is a correct digital signal.

[0055] As mentioned above, linear image processing functions usually need to be performed based on linear unbiased data. Linear unbiased data means that the data can reasonably and accurately reflect the physical quantity it represents, and the essence of bias compensation is to convert digital signals into linear unbiased data. Figure 4 The bias compensation module 1011 and the bias addition module 1017, which are used to provide the bias compensation matrix and the bias addition matrix respectively, are placed at both ends of the process to ensure that the data in the middle process is linear and unbiased data, thereby avoiding frequent bias compensation and addition during the color space conversion process before image processing.

[0056] The interval scaling module 1013 provides a diagonal matrix. Since its essence is to realize the interval size conversion between the color space value range type Limited / Full, there are usually only two options, namely Limited to Full, or Full to Limited, and these two diagonal matrices are inverse matrices of each other. Due to the nature of the diagonal matrix, it can be exchanged with other coefficient matrices at will. If there are multiple interval scalings in the entire link, the modules will cancel each other out, and there are only two situations in the end: a) only one interval scaling module that is not canceled out is left; b) all interval scaling modules are canceled out. Therefore, the color space conversion process before linear image processing does not need to consider the interval scaling module. In the entire link, the interval scaling module only needs to perform one interval scaling from the initial image color space to the target image color space. In this way, only a color space type conversion submodule needs to be added before the linear image processing submodule.

[0057] like Figure 5As shown in FIG. 1 , the processor 101 of the video processing device 100 inputs not only the color space conversion mode but also the linear image processing parameters. Figure 5 In the embodiment, the processor 101 performs color space conversion and linear image processing according to the color space type and color space value range type of the input initial image, the color space type and color space value range type of the target image and the linear image processing parameters to generate conversion coefficients, and transmits the conversion coefficients to the programmable logic device 103, so that the programmable logic device 103 performs linear mapping processing (here, color space conversion and linear image processing) on ​​the initial image to obtain the target image. Accordingly, as Figure 6 As shown, the processor 101 includes a bias compensation module 1011, an interval scaling module 1013, a space type conversion and image processing module 1016 and a bias adding module 1017 which are connected in sequence, and the programmable logic device 103 includes an image processing module 1031 connected to the bias adding module 1017.

[0058] In accordance with the above, Figure 5 The video processing device 100 shown may perform the following operations: Figure 7 The image processing method shown, for example, comprises the steps of:

[0059] S71, obtaining a bias compensation matrix according to the color space value range type and color space type of the initial image and the color space value range type and color space type of the target image;

[0060] S73, obtaining an interval scaling matrix according to the color space value range type of the initial image and the color space value range type of the target image;

[0061] S75, obtaining a target conversion matrix according to the color space type of the initial image, the color space type of the target image, and linear image processing parameters;

[0062] S77, providing an offset addition matrix and combining the operation results of the offset compensation matrix, the interval scaling matrix and the target conversion matrix to obtain conversion coefficients;

[0063] S79, performing linear mapping processing on the initial image based on the conversion coefficient to obtain the target image.

[0064] The aforementioned steps S71, S73, S75 and S77 are, for example, executed in the processor 101, and the aforementioned step S79 is, for example, executed in the programmable logic device 103. Specifically, for example, Figure 6The offset compensation module 1011, the interval scaling module 1013, the space type conversion and image processing module 1016 and the offset adding module 1017 respectively perform the steps S71, S73, S75 and S77, and Figure 6 The image processing module 1031 shown in FIG. 104 executes the step S79. Figure 6 and Figure 7 It can be seen that the target conversion matrix and the interval scaling matrix are matrix operated before the offset addition matrix and the offset compensation matrix, and the interval scaling matrix is ​​matrix operated before the target conversion matrix and the offset compensation matrix.

[0065] Please refer to Figure 6 and Figure 8 The space type conversion and image processing module 1016 includes, for example: an initial image color space type to YUV conversion submodule 10160, a first image processing submodule 10162, a YUV to RGB conversion submodule 10164, a second image processing submodule 10166, and an RGB to target image color space type conversion submodule 10168. Figure 6 and Figure 8 It can be seen that after bias compensation and interval scaling, it is first converted to YUV space and image processing is performed on the YUV space. The first image processing submodule 10162 represents one or more image processing processes performed on the YUV space, such as contrast adjustment, hue adjustment, etc.; then it is converted to RGB space and image processing is performed on the RGB space. The second image processing submodule 10166 represents one or more image processing processes performed on the RGB space, such as brightness adjustment, saturation adjustment, color temperature adjustment, etc.; finally, it is converted to the color space type of the target image, and then the bias is added to output the digital signal. Figure 6 and Figure 8 All modules in the shown architecture support Bypass, which means that you can choose to skip certain sub-modules. For example, if you do not perform any image processing, you can skip the two color space type conversion sub-modules in the middle and directly perform type conversion from the color space of the initial image to the color space of the target image.

[0066] More specifically, Figure 8Each of the submodules shown may, for example, have the following functions: 1) the color space type of the initial image to YUV conversion submodule 10160 is used to obtain a first sub-conversion matrix according to the color space type of the initial image and the first color space type, 2) the first image processing submodule 10162 is used to obtain a second sub-conversion matrix according to the first linear image processing parameters for performing image processing in the color space corresponding to the first color space type in the linear image processing parameters, (3) the YUV to RGB conversion submodule 10164 is used to obtain a third sub-conversion matrix according to the first color space type and the second color space type; 4) the second image processing submodule 10166 is used to obtain a fourth sub-conversion matrix according to the second linear image processing parameters for performing image processing in the color space corresponding to the second color space type in the linear image processing parameters; and 5) the RGB to target image color space type conversion submodule 10168 is used to obtain a fifth sub-conversion matrix according to the second color space type and the color space type of the target image. In addition, the first sub-conversion matrix, the second sub-conversion matrix, the third sub-conversion matrix, the fourth sub-conversion matrix and the fifth sub-conversion matrix are sequentially subjected to matrix operations by corresponding sub-modules in the listed order to obtain the target conversion matrix.

[0067] In summary, the embodiment of the present invention summarizes the color space conversion process and divides it into four modules (see Figure 4 and Figure 6 The four modules in the processor 101 in the middle) are used to realize the sixteen CSC conversion relationships in the prior art by these four modules, thus saving storage resources; furthermore, the linear image processing function is divided into two categories based on the color space RGB / YUV in which it is located, and the positions for adding two types of image processing sub-modules are reserved in the color space conversion architecture, so that the color space conversion architecture supports the realization of linear image processing functions; in addition, through the modules for converting digital signals and linear unbiased data (bias compensation module 1011 and bias addition module 1017) and the Limited and Full color space value range type conversion module (interval scaling module 1013) in the architecture, the intermediate color space conversion process is simplified to the color space type conversion of RGB and YUV, thereby reducing the amount of calculation on the link and improving the image processing accuracy.

[0068] In addition, it is worth noting that in the overall architecture flow, the position of the interval scaling module 1013 is relatively free, except for Figure 6 As shown in the figure, before the space type conversion and image processing module 1016, it is also possible to Fig. 9As shown, it is placed before the offset adding module 1017 and after the space type conversion and image processing module 1016. In this case, the target conversion matrix and the interval scaling matrix are matrix operated before the offset adding matrix and the offset compensation matrix, and the interval scaling matrix is ​​matrix operated after the target conversion matrix and the offset compensation matrix.

[0069] Furthermore, in the overall architecture flow, there is no strict order in which the first and second image processing submodules 10162 and 10166 are processed. Therefore, the architecture flow of the embodiment of the present invention can also be designed as follows: Fig.10 As shown, the space type conversion and image processing module 1016 includes a color space type to RGB conversion submodule 10161 of the initial image, a second image processing submodule 10166, an RGB to YUV conversion submodule 10163, a first image processing submodule 10162 and a YUV to target image color space type conversion submodule 10165 which are connected in sequence.

[0070] In addition, it is worth mentioning that, in other embodiments, the step S75 includes, for example, sub-steps: i) obtaining a first sub-conversion matrix according to the color space type of the initial image and the color space type required by the linear image processing parameters; ii) obtaining a second sub-conversion matrix according to the linear image processing parameters; iii) obtaining a third sub-conversion matrix according to the color space type required by the linear image processing parameters and the color space type of the target image; and iv) performing matrix operations on the first sub-conversion matrix, the second sub-conversion matrix and the third sub-conversion matrix in the order listed to obtain the target conversion matrix. Accordingly, the aforementioned space type conversion and image processing module 1016 can be used Fig.11 The color space type of the initial image is shown and connected in sequence to the YUV conversion submodule 10160, the first image processing submodule 10162 and the YUV to target image color space type conversion submodule 10165, or using Fig.12 The color space type of the initial image to RGB conversion submodule 10161, the second image processing submodule 10166 and the RGB to target image color space type conversion submodule 10168 are shown and connected in sequence. In short, in this embodiment, the color space type required by the linear image processing parameters input to the processor 101 is one of YUV and RGB.

[0071] It is worth noting that, in other embodiments, Figure 4The offset compensation module 1011, the interval scaling module 1013, the space type conversion module 1015, the offset adding module 1017 and the image processing module 1031 shown as software modules constitute a specific implementation of the image processing device of the embodiment of the present invention, and the offset compensation module 1011, the interval scaling module 1013, the space type conversion module 1015, the offset adding module 1017 and the image processing module 1031 are connected in sequence according to the listed order, wherein the space type conversion module 1015 and the interval scaling module 1013 can be mutually located. Alternatively, Figure 6 and Fig. 9 The offset compensation module 1011, interval scaling module 1013, space type conversion and image processing module 1016, offset adding module 1017 and image processing module 1031 shown as software modules constitute other specific implementations of the image processing device of the embodiment of the present invention.

[0072] It can also be understood that the image processing method and the image processing apparatus described in the aforementioned embodiments of the present invention are not limited to application to the aforementioned video processing device 100 including the processor 101 and the programmable logic device 103, and can also be applied to one or more other hardware and software devices having color space conversion functions or color space conversion and linear image processing functions, such as devices configured with one or more of a CPU, MCU, FPGA, ASIC, ARM, etc.

[0073] Furthermore, other embodiments of the present invention provide an image processing system, which includes, for example, a memory and a processor connected to the memory. The memory may be, for example, a non-volatile memory, on which a computer program is stored. The processor may be, for example, an embedded processor, which executes the image processing method in the aforementioned embodiment when running the computer program. As for the specific working process and technical effects of the image processing system in this embodiment, please refer to the relevant description of the aforementioned embodiment.

[0074] In addition, other embodiments of the present invention further provide a computer-readable storage medium. The computer-readable storage medium is, for example, a non-volatile memory, such as: a magnetic medium (such as a hard disk, a floppy disk, and a magnetic tape), an optical medium (such as a CDROM disk and a DVD), a magneto-optical medium (such as an optical disk), and a hardware device specially constructed to store and execute computer-executable instructions (such as a read-only memory (ROM), a random access memory (RAM), a flash memory, etc.). The computer-readable storage medium stores computer-executable instructions. The computer-readable storage medium can be executed by one or more processors or processing devices to implement the image processing method in the aforementioned embodiment.

[0075] In addition, it can be understood that the aforementioned embodiments are only exemplary descriptions of the present invention. Under the premise that the technical features do not conflict, the structures do not contradict, and the purpose of the present invention is not violated, the technical solutions of the various embodiments can be arbitrarily combined and used in combination.

[0076] It is worth noting that in the several embodiments provided by the present invention, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic, for example, the division of units is only a logical function division, and there may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be an indirect coupling or communication connection through some interfaces, devices or units, which can be electrical, mechanical or other forms.

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

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

[0079] The above-mentioned integrated unit implemented in the form of a software functional unit can be stored in a computer-readable storage medium. The above-mentioned software functional unit is stored in a storage medium, including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform some steps of the methods of various embodiments of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (Read-Only Memory, referred to as ROM), random access memory (Random Access Memory, referred to as RAM), disk or optical disk and other media that can store program codes.

[0080] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims

1. An image processing method, characterized in that: include: Obtaining a bias compensation matrix according to the color space value range type and color space type of the initial image and the color space value range type and color space type of the target image; Obtaining an interval scaling matrix according to the color space value range type of the initial image and the color space value range type of the target image; Obtaining a target conversion matrix according to the color space type of the initial image, the color space type of the target image, and linear image processing parameters; Providing an offset addition matrix and combining the operation results of the offset compensation matrix, the interval scaling matrix and the target conversion matrix to obtain conversion coefficients; The target image is obtained by performing linear mapping processing on the initial image based on the conversion coefficient.

2. The image processing method according to claim 1, characterized in that: The step of obtaining a target conversion matrix according to the color space type of the initial image, the color space type of the target image and linear image processing parameters comprises: Obtaining a first sub-conversion matrix according to the color space type of the initial image and a first color space type; Obtaining a second sub-conversion matrix according to a first linear image processing parameter for performing image processing in a color space corresponding to the first color space type among the linear image processing parameters; Obtain a third sub-conversion matrix according to the first color space type and the second color space type; Obtaining a fourth sub-conversion matrix according to second linear image processing parameters for performing image processing in the color space corresponding to the second color space type in the linear image processing parameters; Obtain a fifth sub-conversion matrix according to the second color space type and the color space type of the target image; The target transformation matrix is ​​obtained by performing matrix operations on the first sub-transformation matrix, the second sub-transformation matrix, the third sub-transformation matrix, the fourth sub-transformation matrix and the fifth sub-transformation matrix in the order listed.

3. The image processing method according to claim 1, characterized in that: The step of obtaining a target conversion matrix according to the color space type of the initial image, the color space type of the target image and linear image processing parameters comprises: Obtaining a first sub-conversion matrix according to the color space type of the initial image and the color space type required by the linear image processing parameters; Obtaining a second sub-transformation matrix according to the linear image processing parameters; Obtaining a third sub-conversion matrix according to the color space type required by the linear image processing parameters and the color space type of the target image; The target transformation matrix is ​​obtained by performing matrix operations on the first sub-transformation matrix, the second sub-transformation matrix and the third sub-transformation matrix in the order listed.

4. The image processing method according to claim 1, wherein: The target conversion matrix and the interval scaling matrix perform matrix operations before the offset addition matrix and the offset compensation matrix, and the interval scaling matrix performs matrix operations before or after the target conversion matrix and the offset compensation matrix.

5. The image processing method according to claim 2, characterized in that: The first color space type is RGB, the first linear image processing parameter is selected from a brightness adjustment parameter, a saturation adjustment parameter, and a color temperature adjustment parameter, the second color space type is YUV, and the second linear image processing parameter is selected from a contrast adjustment parameter and a hue adjustment parameter; Alternatively, the first color space type is YUV, the first linear image processing parameter is selected from a contrast adjustment parameter and a hue adjustment parameter, the second color space type is RGB, and the second linear image processing parameter is selected from a brightness adjustment parameter, a saturation adjustment parameter and a color temperature adjustment parameter.

6. An image processing device, characterized in that: include: A bias compensation module, used for obtaining a bias compensation matrix according to the color space value range type and color space type of the initial image and the color space value range type and color space type of the target image; An interval scaling module, used for obtaining an interval scaling matrix according to the color space value range type of the initial image and the color space value range type of the target image; A space type conversion and image processing module, used for obtaining a target conversion matrix according to the color space type of the initial image, the color space type of the target image and linear image processing parameters; An offset adding module, used for providing an offset adding matrix and obtaining a conversion coefficient by combining the operation results of the offset compensation matrix, the interval scaling matrix and the target conversion matrix; An image processing module is used to perform linear mapping processing on the initial image based on the conversion coefficient to obtain the target image.

7. A video processing device, characterized in that: include: processor; as well as A programmable logic device, electrically connected to the processor; Wherein, the processor and the programmable logic device are used to jointly execute the image processing method as described in any one of claims 1 to 5, and the processor is specifically used to generate the conversion coefficient and transmit the conversion coefficient to the programmable logic device, so that the programmable logic device performs the linear mapping processing on the initial image based on the conversion coefficient to obtain the target image.

8. The video processing device according to claim 7, characterized in that: Each of the color space value range type of the initial image and the color space value range type of the target image is RGB or YUV, and each of the color space value range type of the initial image and the color space value range type of the target image is a channel-limited grayscale value range or a channel-full grayscale value range.