CN109636863B - Color space conversion circuit - Google Patents

Color space conversion circuit Download PDF

Info

Publication number
CN109636863B
CN109636863B CN201811465643.8A CN201811465643A CN109636863B CN 109636863 B CN109636863 B CN 109636863B CN 201811465643 A CN201811465643 A CN 201811465643A CN 109636863 B CN109636863 B CN 109636863B
Authority
CN
China
Prior art keywords
data
module
color space
multiplication
function expression
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201811465643.8A
Other languages
Chinese (zh)
Other versions
CN109636863A (en
Inventor
张向飞
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Xinshijia Technology Beijing Co ltd
Original Assignee
Xinshijia Technology Beijing Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Xinshijia Technology Beijing Co ltd filed Critical Xinshijia Technology Beijing Co ltd
Priority to CN201811465643.8A priority Critical patent/CN109636863B/en
Publication of CN109636863A publication Critical patent/CN109636863A/en
Application granted granted Critical
Publication of CN109636863B publication Critical patent/CN109636863B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/90Determination of colour characteristics
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N9/00Details of colour television systems
    • H04N9/64Circuits for processing colour signals

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Multimedia (AREA)
  • Signal Processing (AREA)
  • Color Image Communication Systems (AREA)
  • Image Processing (AREA)

Abstract

The embodiment of the invention relates to the technical field of color space conversion, and discloses a color space conversion circuit. The color space conversion circuit includes: the first space conversion module, the second space conversion module and the third space conversion module are connected in sequence; the first space conversion module is used for acquiring LCH data of an input image and converting the LCH data of the input image into data of an LAB color space of a first color space; the second space conversion module is used for converting the L data, the A data and the B data in the first color space into data in an XYZ color space of a second color space; the third space conversion module is used for converting the X data, the Y data and the Z data in the second color space into data of an RGB color space. In the invention, the color space of the image is converted in the image processing through the digital circuit, and the real-time conversion is realized in the conversion process of the digital circuit.

Description

Color space conversion circuit
Technical Field
The embodiment of the invention relates to the technical field of color space conversion, in particular to a color space conversion circuit.
Background
The color space is the theoretical basis for color information research, quantifies colors from human subjective perception into specific expressions, and provides a powerful basis for recording and expressing colors by a computer. An image may be represented by different color spaces, the visual effect of which is the same. However, the selection of the color space has great influence on whether the color migration algorithm of the image is effective or not, and the accuracy of the color migration result can be ensured by selecting a proper color space. The color space used for color image processing must have both independence and uniformity. The independence means that three components of the color space are not affected, and the processing of a certain component does not cause the change of other components relative to the human eyes; uniformity refers to the fact that the same amount of variation can produce about the same change in visual importance for each component of the color space. Color space LCH (Lightness Chroma Hue) where L represents a Lightness value; c represents a saturation value; h represents the cylindrical coordinates of the hue angle value. L, C, H in LCH color space are independent, relatively suitable for carrying on the image processing.
However, the inventors found that at least the following problems exist in the prior art: in a real-time image processing system, in order to improve image quality, image data needs to be converted from a color space RGB (Red Green Blue) to a color space LCH, and in the process of performing color space conversion, the processing method flow is as follows: from the color space RGB to the color space XYZ, to the color space LAB (Lightness AB) and finally to the color space LCH. It should be noted that after the image processing is completed, the image data is converted from LCH to color space LAB, then converted to XYZ, and finally converted to color space RGB output. Since the coefficients in the color space conversion formula have decimal parts and the digital circuit system processes binary data, it is very difficult to develop a digital circuit processing system supporting decimal operation, and the cost is high, and the digital circuit system needs to perform fixed-point processing on the coefficients of the color space conversion and then perform color space conversion by using the data after fixed-point processing. In designing a real-time digital image processing system, when color space conversion is required, it is necessary to design a color space conversion digital circuit system capable of processing digital image data in real time.
It is to be noted that the information disclosed in the above background section is only for enhancement of understanding of the background of the present disclosure, and thus may include information that does not constitute prior art known to those of ordinary skill in the art.
Disclosure of Invention
An object of the embodiments of the present invention is to provide a color space conversion circuit, which enables a digital circuit to convert a color space of an image in image processing and to realize real-time conversion in a conversion process of the digital circuit.
To solve the above technical problem, an embodiment of the present invention provides a color space conversion circuit, including: the first space conversion module, the second space conversion module and the third space conversion module are connected in sequence;
the first space conversion module is used for acquiring LCH data of an input image, amplifying L data and C data in the input image, performing sine and cosine processing on the H data in the input image respectively, performing multiplication processing on the amplified C data and the sine-processed H data to obtain B data, performing multiplication processing on the amplified C data and the cosine-processed H data to obtain A data, and performing amplification processing on the L data to obtain L data of a first color space, so that the LCH data of the input image is converted into the data of the first color space, and the data in the first color space is transmitted to the second space conversion module; the first color space is an LAB color space, and pixel data in the LAB color space comprises L data, A data and B data;
the second space conversion module is used for multiplying the L data, the A data and the B data in the first color space with the data in the first preset array respectively, adding the result of the multiplication operation of the data in the first color space to obtain a function expression of a pixel in the second color space, multiplying the function expression with the data in the second preset array respectively, subtracting the result of the multiplication operation of the function expression from the data in the second preset array or performing cubic operation on the function expression to obtain data in the second color space, and transmitting the data in the second color space to the third space conversion module; the data in the first preset array and the data in the second preset array are integers, the second color space is an XYZ color space, pixel data in the XYZ color space comprise X-dimension data, Y-dimension data and Z-dimension data, the X-dimension data comprise X data, the Y-dimension data comprise Y data, and the Z-dimension data comprise Z data;
the third space conversion module is used for acquiring data of a second color space transmitted by the second space conversion module, performing matrix operation on a preset data matrix and the data of each dimension of the second color space, and generating data of a third color space according to a matrix operation result; the data in the data matrix are integers, the third color space is an RGB color space, and the data of each pixel in the RGB color space comprises R data, G data and B data.
Compared with the prior art, in the process of converting the image color space, in the second space conversion module, the first color space is converted into the second color space through the first preset array and the second preset array, wherein data in the first preset array and data in the second preset array are both integers, so that the color space conversion can be performed through a digital circuit, the operation process of color space conversion is simplified, in the process of converting the second color space into the third color space through the third space conversion module, data in each dimension in the second color space are converted respectively, data in matrix data are integers, the conversion process is realized through the digital circuit, and real-time conversion can be realized.
In addition, the first space conversion module comprises a fixed-point processing module, a sine and cosine processing module and a multiplication processing module which are connected in sequence, wherein a first output end of the fixed-point processing module is connected with an input end of the second space conversion module, and a second output end of the fixed-point processing module is connected with one input end of the multiplication processing module;
the fixed point processing module is used for acquiring LCH data of an input image, amplifying the L data and the C data, transmitting the amplified L data to the second space conversion module, transmitting the amplified C data to the multiplication processing module, delaying the H data and transmitting the H data to the sine and cosine processing module;
the sine and cosine processing module is used for respectively carrying out sine processing and cosine processing on the H data and transmitting the H data after the sine processing and the H data after the cosine processing to the multiplication processing module;
and the multiplication processing module is used for performing multiplication operation on the C data and the H data after sine processing and the H data after cosine processing respectively to obtain B data and A data.
In addition, the second space conversion module comprises a function operation module and a data generation module; the input end of the function operation module is connected with the output end of the first space conversion module, the output end of the function operation module is connected with the input end of the data generation module, and the output end of the data generation module is connected with the third space conversion module;
the function operation module is used for performing multiplication operation on the L data and first data in a first preset array, and performing addition operation on the multiplication operation result of the L data and second data in the first preset array to obtain a function expression of the Y data; multiplying the data A by third data in a first preset array, and adding the result of the multiplication of the function expression of the data Y and the data A to obtain a function expression of the data X; carrying out multiplication operation on the data B and fourth data in the first preset array, and carrying out subtraction operation on the result of the multiplication operation of the function expression of the data Y and the data B to obtain a function expression of the data Z; transmitting the function expression of the Y data, the function expression of the X data and the function expression of the Z data to a data generation module;
the data generation module is used for performing cubic operation on the function expression of the acquired Y data to generate first Y data, or performing multiplication operation on the function expression of the Y data and first data in a second preset array, performing subtraction operation on the multiplication result of the function expression of the Y data and second data in the second preset array to generate second Y data, and outputting the first Y data or the second Y data according to the comparison result of the value of the function expression of the Y data and a first preset parameter; performing cubic operation on the function expression of the obtained X data to generate first X data, or performing multiplication operation on the function expression of the X data and third data in a second preset group, performing subtraction operation on the multiplication result of the function expression of the X data and fourth data in the second preset group to generate second X data, and outputting the first X data or the second X data according to the comparison result of the value of the function expression of the X data and a second preset parameter; cubic operation is carried out on the function expression of the acquired Z data to generate first Z data, or multiplication operation is carried out on the function expression of the Z data and fifth data in a second preset group, subtraction operation is carried out on the multiplication result of the function expression of the Z data and sixth data in the second preset group to generate second Z data, and the first Z data or the second Z data are output according to the comparison result of the value of the function expression of the Z data and a third preset parameter.
In addition, the third space conversion module comprises a multiplication operation module and an addition operation module which are connected in series, and the input end of the multiplication operation module is connected with the output end of the second space conversion module;
the multiplication operation module is used for respectively carrying out multiplication operation on the obtained X data, Y data and Z data and the data in the data matrix and transmitting the result of the multiplication operation to the addition operation module;
and the addition operation module is used for acquiring the operation result transmitted by the multiplication operation module, performing addition operation on the multiplication result according to the rule of matrix operation, and generating data of a third color space according to the addition operation result.
In addition, the third color space conversion module also comprises a data conversion module, wherein the input end of the data conversion module is connected with the output end of the addition operation module;
the addition operation module is also used for transmitting the data of the third color space generated by the addition operation result to the data transformation module;
and the data transformation module is used for acquiring the data of the third color space transmitted by the addition operation module, reducing the data of the third color space by preset times and generating the data of the RGB color space.
In addition, the data generation module includes: the system comprises a first cubic operation module, a first multiplier, a first subtracter, a second cubic operation module, a second multiplier, a second subtracter, a third cubic operation module, a third multiplier, a third subtracter and a data synchronous output module;
the first cubic operation module, the second cubic operation module and the third cubic operation module are respectively connected in series between the function operation module and the data synchronous output module, the first multiplier and the first subtracter are sequentially connected in series between the function operation module and the data synchronous output module, the second multiplier and the second subtracter are sequentially connected in series between the function operation module and the data synchronous output module, and the third multiplier and the third subtracter are sequentially connected in series between the function operation module and the data synchronous output module;
the first cubic operation module is used for acquiring a function expression of the Y data transmitted by the function operation module, performing cubic operation on the function expression of the Y data to generate first Y data, and transmitting the first Y data to the data synchronous transmission module;
the first multiplier is used for acquiring a function expression of the Y data transmitted by the function operation module, performing multiplication operation on the function expression of the Y data and the first data in the second preset array, and transmitting a multiplication operation result to the first subtractor;
the first subtractor is used for acquiring a multiplication result transmitted by the first multiplier, performing subtraction operation on the multiplication result transmitted by the first multiplier and second data in a second preset array to generate second Y data, and transmitting the second Y data to the data synchronous transmission module;
the second cubic operation module is used for acquiring a function expression of the X data transmitted by the function operation module, performing cubic operation on the function expression of the X data to generate first X data, and transmitting the first X data to the data synchronous transmission module;
the second multiplier is used for acquiring a function expression of the X data transmitted by the function operation module, performing multiplication operation on the function expression of the X data and third data in a second preset array, and transmitting a multiplication operation result to the second subtractor;
the second subtractor is used for acquiring a multiplication result transmitted by the second multiplier, performing subtraction operation on the multiplication result transmitted by the second multiplier and fourth data in a second preset array to generate second X data, and transmitting the second X data to the data synchronous transmission module;
the third cubic operation module is used for acquiring a function expression of the Z data transmitted by the function operation module, performing cubic operation on the function expression of the Z data to generate first Z data, and transmitting the first Z data to the data synchronous transmission module;
the third multiplier is used for acquiring a function expression of the Z data transmitted by the function operation module, performing multiplication operation on the function expression of the Z data and fifth data in a second preset array, and transmitting a multiplication operation result to the third subtractor;
the third subtractor is used for acquiring a multiplication result transmitted by the third multiplier, performing subtraction operation on the multiplication result transmitted by the third multiplier and sixth data in a second preset array to generate second Z data, and transmitting the second Z data to the data synchronous transmission module;
the data synchronous transmission module is used for acquiring a function expression of Y data, a function expression of X data, a function expression of Z data, first Y data, second Y data, first X data, second X data, first Z data and first Z data, outputting the first Y data to represent the Y data if the value of the function expression of the Y data is determined to be greater than a first preset parameter, and otherwise outputting the second Y data to represent the Y data; if the value of the function expression of the X data is larger than a second preset parameter, outputting first X data to represent the X data, and otherwise, outputting second X data to represent the X data; and if the value of the function expression of the Z data is larger than a third preset parameter, outputting first Z data to represent the Z data, otherwise, outputting second Z data to represent the Z data.
In addition, the data matrix is processed by the computer in an integer way, and the result of the integer processing is transmitted to the third space conversion processing module.
In addition, the first preset array and the second preset array are subjected to integer processing by the computer, and the result of the integer processing is transmitted to the second space conversion module.
Drawings
One or more embodiments are illustrated by way of example in the accompanying drawings which correspond to and are not to be construed as limiting the embodiments, in which elements having the same reference numeral designations represent like elements throughout, and in which the drawings are not to be construed as limiting in scale unless otherwise specified.
FIG. 1 is a block diagram of a color conversion circuit according to a first embodiment of the present invention;
fig. 2 is a schematic structural diagram of a first spatial conversion module according to a first embodiment of the present invention;
fig. 3 is a schematic structural diagram of a second spatial conversion module according to the first embodiment of the present invention;
fig. 4 is a schematic structural diagram of a third spatial conversion module according to the first embodiment of the present invention;
fig. 5 is a schematic structural diagram of a data generation module in a second spatial conversion module according to a second embodiment of the present invention.
Detailed Description
To make the objects, technical solutions and advantages of the embodiments of the present invention more apparent, embodiments of the present invention will be described in detail below with reference to the accompanying drawings. However, it will be appreciated by those of ordinary skill in the art that numerous technical details are set forth in order to provide a better understanding of the present application in various embodiments of the present invention. However, the technical solution claimed in the present application can be implemented without these technical details and various changes and modifications based on the following embodiments.
It should be noted that the terms "first," "second," and the like in the description and claims of the present invention and in the drawings described above are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order.
A first embodiment of the present invention relates to a color space conversion circuit. The specific structure is shown in fig. 1, and comprises: a first space conversion module 10, a second space conversion module 20 and a third space conversion module 30 connected in sequence.
The first space conversion module 10 is configured to obtain LCH data of an input image, amplify L data and C data in the input image, perform sine and cosine processing on H data in the input image, perform multiplication processing on the amplified C data and the sine-processed H data to obtain B data, perform multiplication processing on the amplified C data and the cosine-processed H data to obtain a data, amplify L data to obtain L data of a first color space, convert the LCH data of the input image into data of the first color space, and transmit the data of the first color space to the second space conversion module 20; the first color space is an LAB color space, and pixel data in the LAB color space comprises L data, A data and B data.
The second spatial conversion module 20 is configured to perform multiplication operations on the L data, the a data, and the B data in the first color space respectively with the data in the first preset array, perform addition operations on the result of the multiplication operations on the data in the first color space to obtain a function expression of a pixel in the second color space, perform multiplication operations on the function expression respectively with the data in the second preset array, perform subtraction operations on the result of the multiplication operations on the function expression and the data in the second preset array, or perform cubic operations on the function expression to obtain data in the second color space, and transmit the data in the second color space to the third spatial conversion module 30; the data in the first preset array and the data in the second preset array are integers, the second color space is an XYZ color space, pixel data in the XYZ color space comprise X-dimension data, Y-dimension data and Z-dimension data, the X-dimension data comprise X data, the Y-dimension data comprise Y data, and the Z-dimension data comprise Z data.
The third spatial conversion module 30 is configured to obtain data of the second color space transmitted by the second spatial conversion module 20, perform matrix operation on a preset data matrix and data of each dimension of the second color space, and generate data of a third color space according to a result of the matrix operation; the data in the data matrix are integers, the third color space is an RGB color space, and the data of each pixel in the RGB color space comprises R data, G data and B data.
In a specific implementation, the first preset array and the second preset array in the second spatial conversion module 20 are both integers, and the first preset array and the second preset array are subjected to integer processing by a computer, and the result of the integer processing is transmitted to the second spatial conversion module 20. In one embodiment, the data matrix is processed by a computer through an integer process, and the result of the integer process is transmitted to a third spatial transform processing module. After the data in the first preset array and the second preset array and the data in the data matrix are converted into integers, the conversion processing of the digital circuit is facilitated.
In a specific implementation, the process of performing integer processing on the data in the coefficient matrix is to amplify the data in the coefficient matrix by 2^ n times, where n is a positive integer, and the specific value of n may be set according to the actual situation, and is not limited specifically, for example, amplifying the coefficient matrix by 2^15 times.
It should be noted that the color conversion Circuit in this embodiment is implemented by a digital Circuit, the color conversion process is implemented by a digital control device, such as an FPGA (Field-Programmable Gate Array), or may be implemented by an ASIC (Application Specific Integrated Circuit). For example, in the process of implementing color conversion in the digital circuit by using an FPGA, since the FPGA generally processes fixed points, it is necessary to perform fixed point processing on the above formula 1, and select an appropriate magnification factor for data in the coefficient matrix to be processed into an integer. This is by way of example only and is not intended to be limiting.
Specifically, the first space conversion module 10 implements color space conversion of an input image, for example, LCH data of the input image is converted into LAB color space data, wherein the first space conversion module 10 includes a fixed-point processing module 11, a sine and cosine processing module 12 and a multiplication processing module 13, which are connected in sequence, and the specific structure of the first space conversion module 10 is as shown in fig. 2, a first output end of the fixed-point processing module 11 is connected to an input end of the second space conversion module 20, and a second output end of the fixed-point processing module 11 is connected to an input end of the multiplication processing module 13.
The fixed-point processing module 11 is configured to obtain LCH data of an input image, amplify the L data and the C data, transmit the amplified L data to the second space conversion module 20, transmit the amplified C data to the multiplication processing module, delay the H data, and transmit the delayed H data to the sine and cosine processing module 12.
The sine and cosine processing module 12 is configured to perform sine processing and cosine processing on the H data, and transmit the sine processed H data and the cosine processed H data to the multiplication processing module 13.
The multiplication processing module 13 is configured to perform multiplication operations on the C data and the H data after the sine processing and the H data after the cosine processing, respectively, to obtain B data and a data.
In one specific implementation, the first spatial transformation process is represented by equation 1:
Figure BDA0001889696870000071
wherein, K represents the multiple of the amplification processing of the L data, the amplified L is the data of the LAB color space, the multiple of the amplification processing of the C data in the LCH data is also K, a represents the a data in the converted LAB color space, and B represents the B data in the converted LAB color space.
Specifically, the second color space is used for converting the LAB color space into the XYZ color space, and in one specific implementation, the second space conversion module 20 includes a function operation module 21 and a data generation module 22; as shown in fig. 3, the input end of the function operation module 21 is connected to the output end of the first space transformation module 10, the output end of the function operation module 21 is connected to the input end of the data generation module 22, and the output end of the data generation module 22 is connected to the third space transformation module 30.
The function operation module 21 is configured to perform multiplication operation on the L data and first data in the first preset array, and perform addition operation on a multiplication operation result of the L data and second data in the first preset array to obtain a function expression of the Y data; multiplying the data A by third data in a first preset array, and adding the result of the multiplication of the function expression of the data Y and the result of the multiplication of the data A to obtain a function expression of the data X; multiplying the data B by fourth data in a first preset array, and subtracting the multiplication result of the data B from the function expression of the data Y to obtain a function expression of the data Z; the function expression of the Y data, the function expression of the X data, and the function expression of the Z data are transmitted to the data generation module 22.
In one specific implementation, the specific conversion process of the function operation module 21 is expressed by formula 2 as follows:
Figure BDA0001889696870000081
wherein, fy represents in the color space conversion process, and LAB color space converts to XYZ color space, and the function expression that Y data corresponds, fx represents the function expression that X data corresponds, and fz represents the function expression that Z data corresponds, and QK1, QK2, QK3 and QK4 are first preset array, are the preset numerical value after the integer.
The data generating module 22 is configured to perform cubic operation on the function expression of the obtained Y data to generate first Y data, or perform multiplication operation on the function expression of the Y data and first data in a second preset array, perform subtraction operation on the multiplication result of the function expression of the Y data and second data in the second preset array to generate second Y data, and output the first Y data or the second Y data according to a comparison result between the value of the function expression of the Y data and a first preset parameter; performing cubic operation on the function expression of the obtained X data to generate first X data, or performing multiplication operation on the function expression of the X data and third data in a second preset group, performing subtraction operation on the multiplication result of the function expression of the X data and fourth data in the second preset group to generate second X data, and outputting the first X data or the second X data according to the comparison result of the value of the function expression of the X data and a second preset parameter; cubic operation is carried out on the function expression of the acquired Z data to generate first Z data, or multiplication operation is carried out on the function expression of the Z data and fifth data in a second preset group, subtraction operation is carried out on the multiplication result of the function expression of the Z data and sixth data in the second preset group to generate second Z data, and the first Z data or the second Z data are output according to the comparison result of the value of the function expression of the Z data and a third preset parameter.
Specifically, the third space conversion module 30 is used for converting the color space XYZ into the RGB color space, wherein the third space conversion module 30 includes a multiplication module 31 and an addition module 32 connected in series, and the structure thereof is as shown in fig. 4, wherein an input terminal of the multiplication module 31 is connected to an output terminal of the second space conversion module 20.
The multiplication module 31 is configured to perform multiplication on the acquired X data, Y data, and Z data and data in the data matrix, and transmit a result of the multiplication to the addition module.
The addition module 32 is configured to obtain an operation result transmitted by the multiplication module, perform addition on the multiplication result according to a rule of matrix operation, and generate data of a third color space according to the addition result.
In one specific implementation, the specific conversion process of the third color space is expressed by equation 3 as follows:
Figure BDA0001889696870000091
wherein, PK represents the data matrix after integer processing, PK11, PK12, 8230, 8230and PK33 respectively represent the data of corresponding positions in the data matrix, R represents the R data in the RGB color space after color space conversion, G represents the G data in the RGB color space, and B represents the B data in the RGB color space.
In a specific implementation, the third space conversion module is further provided with a data conversion module, configured to process the converted data into required data, for example, reduce the RGB data by K times, or reduce the RGB data by a preset multiple and then obtain higher-order data.
The above description is only for illustrative purposes and does not limit the technical aspects of the present invention.
Compared with the prior art, in the process of image color space conversion, in the second space conversion module, convert first color space into second color space through first preset array and second preset array, wherein the data in first preset array and the second preset array are the integer, make the accessible digital circuit carry out the conversion of color space, the operation process of color space conversion has been simplified, in the process of third space conversion module to second color space conversion into third color space, convert the data of every dimensionality in the second color space respectively, data in the matrix data are the integer, can realize real-time conversion.
A second embodiment of the present invention relates to a color space conversion circuit, and is substantially the same as the first embodiment, and mainly differs therefrom in that: in the second embodiment of the present invention, a specific structure of the data generating module 22 in the second space transformation module 20 is specifically described, and as shown in fig. 5, the data generating module 22 includes: a first cubic operation module 220, a first multiplier 221, a first subtracter 222, a second cubic operation module 223, a second multiplier 224, a second subtracter 225, a third cubic operation module 226, a third multiplier 227, a third subtracter 228, and a data synchronization output module 229.
The first cubic operation module 220, the second cubic operation module 223 and the third cubic operation module 226 are respectively connected in series between the function operation module 21 and the data synchronization output module 229, the first multiplier 221 and the first subtractor 222 are sequentially connected in series between the function operation module 21 and the data synchronization output module 229, the second multiplier 224 and the second subtractor 225 are sequentially connected in series between the function operation module 21 and the data synchronization output module 229, and the third multiplier 227 and the third subtractor 228 are sequentially connected in series between the function operation module 21 and the data synchronization output module 229.
The first cubic operation module 220 is configured to obtain a function expression of the Y data transmitted by the function operation module, perform cubic operation on the function expression of the Y data, generate first Y data, and transmit the first Y data to the data synchronization transmission module 229.
The first multiplier 221 is configured to obtain a function expression of the Y data transmitted by the function operation module, perform multiplication on the function expression of the Y data and the first data in the second preset array, and transmit a result of the multiplication to the first subtractor 222.
The first subtractor 222 is configured to obtain a multiplication result transmitted by the first multiplier, perform subtraction on the multiplication result transmitted by the first multiplier and the second data in the second preset array to generate second Y data, and transmit the second Y data to the data synchronous transmission module 229.
The second cubic operation module 223 is configured to obtain a function expression of the X data transmitted by the function operation module, perform cubic operation on the function expression of the X data, generate first X data, and transmit the first X data to the data synchronization transmission module 229.
The second multiplier 224 is configured to obtain a function expression of the X data transmitted by the function operation module, perform multiplication operation on the function expression of the X data and third data in a second preset array, and transmit a result of the multiplication operation to the second subtractor 225.
The second subtractor 225 is configured to obtain a multiplication result transmitted by the second multiplier, subtract the multiplication result transmitted by the second multiplier and the fourth data in the second preset array to generate second X data, and transmit the second X data to the data synchronous transmission module 229.
The third cubic operation module 226 is configured to obtain a function expression of the Z data transmitted by the function operation module, perform cubic operation on the function expression of the Z data, generate first Z data, and transmit the first Z data to the data synchronization transmission module 229.
The third multiplier 227 is configured to obtain a function expression of the Z data transmitted by the function operation module, perform multiplication on the function expression of the Z data and fifth data in the second preset array, and transmit a result of the multiplication to the third subtractor 228.
The third subtractor 228 is configured to obtain a multiplication result transmitted by the third multiplier, perform subtraction on the multiplication result transmitted by the third multiplier and sixth data in the second preset array to generate second Z data, and transmit the second Z data to the data synchronous transmission module 229.
The data synchronization transmission module 229 is configured to obtain a function expression of the Y data, a function expression of the X data, a function expression of the Z data, the first Y data, the second Y data, the first X data, the second X data, the first Z data, and the first Z data, output the first Y data to represent the Y data if it is determined that the value of the function expression of the Y data is greater than a first preset parameter, and output the second Y data to represent the Y data if it is not determined that the value of the function expression of the Y data is greater than the first preset parameter; if the value of the function expression of the X data is determined to be larger than a second preset parameter, outputting first X data to represent the X data, and otherwise, outputting second X data to represent the X data; and if the value of the function expression of the Z data is determined to be larger than the third preset parameter, outputting the first Z data to represent the Z data, otherwise, outputting the second Z data to represent the Z data.
In one specific implementation, the specific conversion process of the data generation module is represented by formula 4:
Figure BDA0001889696870000111
the QK5, QK6, 8230, 8230and QK13 are second preset arrays after integer processing.
The above description is only for illustrative purposes and does not limit the technical aspects of the present invention.
It should be noted that, in practical applications, each module related in the present invention is a digital circuit module, and the digital circuit module may be composed of a logic module, may also be composed of other digital circuit devices, and may also be a digital circuit module composed of a plurality of digital circuit units.
It will be understood by those of ordinary skill in the art that the foregoing embodiments are specific examples for carrying out the invention, and that various changes in form and details may be made therein without departing from the spirit and scope of the invention in practice.

Claims (8)

1. A color space conversion circuit, comprising: the first space conversion module, the second space conversion module and the third space conversion module are connected in sequence;
the first space conversion module is used for acquiring LCH data of an input image, amplifying L data and C data in the input image, performing sine and cosine processing on the H data in the input image respectively, multiplying the C data after the amplification processing and the H data after the sine processing to obtain B data, multiplying the C data after the amplification processing and the H data after the cosine processing to obtain A data, amplifying the L data to obtain L data of a first color space, converting the LCH data of the input image into data of the first color space, and transmitting the data in the first color space to the second space conversion module; wherein the first color space is an LAB color space, and pixel data in the LAB color space includes the L data, the a data, and the B data;
the second space conversion module is configured to perform multiplication operations on the L data, the a data, and the B data in the first color space respectively with data in a first preset array, perform addition operations on a result of the multiplication operations on the data in the first color space to obtain a function expression of a pixel in a second color space, perform multiplication operations on the function expression respectively with data in a second preset array, perform subtraction operations on a result of the multiplication operations on the function expression and the data in the second preset array, or perform cubic operations on the function expression to obtain data in the second color space, and transmit the data in the second color space to the third space conversion module; the data in the first preset array and the data in the second preset array are both integers, the second color space is an XYZ color space, the pixel data in the XYZ color space comprises data in an X dimension, data in a Y dimension and data in a Z dimension, the data in the X dimension comprises X data, the data in the Y dimension comprises Y data, and the data in the Z dimension comprises Z data;
the third space conversion module is used for acquiring the data of the second color space transmitted by the second space conversion module, performing matrix operation on a preset data matrix and the data of each dimension of the second color space, and generating the data of the third color space according to the result of the matrix operation; the data in the data matrix are integers, the third color space is an RGB color space, and the data of each pixel in the RGB color space comprises R data, G data and B data.
2. The color space conversion circuit according to claim 1,
the first space conversion module comprises a fixed-point processing module, a sine and cosine processing module and a multiplication processing module which are connected in sequence, wherein a first output end of the fixed-point processing module is connected with an input end of the second space conversion module, and a second output end of the fixed-point processing module is connected with one input end of the multiplication processing module;
the fixed-point processing module is configured to obtain LCH data of an input image, amplify the L data and the C data, transmit the amplified L data to the second spatial conversion module, transmit the amplified C data to the multiplication processing module, delay the H data, and transmit the delayed H data to the sine and cosine processing module;
the sine and cosine processing module is used for respectively carrying out sine processing and cosine processing on the H data and transmitting the H data after the sine processing and the H data after the cosine processing to the multiplication processing module;
and the multiplication processing module is used for performing multiplication operation on the data C and the H data after the sine processing and the H data after the cosine processing respectively to obtain the data B and the data A.
3. The color space conversion circuit according to any one of claims 1-2,
the second space conversion module comprises a function operation module and a data generation module; the input end of the function operation module is connected with the output end of the first space conversion module, the output end of the function operation module is connected with the input end of the data generation module, and the output end of the data generation module is connected with the third space conversion module;
the function operation module is used for performing multiplication operation on the L data and first data in the first preset array, and performing addition operation on a multiplication operation result of the L data and second data in the first preset array to obtain a function expression of the Y data; performing multiplication operation on the data A and third data in the first preset array, and performing addition operation on the result of the multiplication operation on the function expression of the data Y and the data A to obtain a function expression of the data X; performing multiplication operation on the B data and fourth data in the first preset array, and performing subtraction operation on the result of the multiplication operation on the Y data and the B data to obtain a function expression of the Z data; transmitting the function expression of the Y data, the function expression of the X data and the function expression of the Z data to the data generation module;
the data generation module is used for performing cubic operation on the function expression of the acquired Y data to generate first Y data, or performing multiplication operation on the function expression of the Y data and first data in the second preset array, performing subtraction operation on the multiplication result of the function expression of the Y data and second data in the second preset array to generate second Y data, and outputting the first Y data or the second Y data according to the comparison result of the value of the function expression of the Y data and a first preset parameter; performing cubic operation on the function expression of the obtained X data to generate first X data, or performing multiplication operation on the function expression of the X data and third data in the second preset group, performing subtraction operation on the multiplication result of the function expression of the X data and fourth data in the second preset group to generate second X data, and outputting the first X data or the second X data according to the comparison result of the value of the function expression of the X data and a second preset parameter; performing cubic operation on the function expression of the acquired Z data to generate first Z data, or performing multiplication operation on the function expression of the Z data and fifth data in the second preset group, performing subtraction operation on the multiplication result of the function expression of the Z data and sixth data in the second preset group to generate second Z data, and outputting the first Z data or the second Z data according to the comparison result of the value of the function expression of the Z data and a third preset parameter.
4. The color space conversion circuit according to any one of claims 1-2,
the third space conversion module comprises a multiplication operation module and an addition operation module which are connected in series, and the input end of the multiplication operation module is connected with the output end of the second space conversion module;
the multiplication operation module is used for respectively carrying out multiplication operation on the obtained X data, Y data and Z data and the data in the data matrix, and transmitting the result of the multiplication operation to the addition operation module;
the addition operation module is used for acquiring the operation result transmitted by the multiplication operation module, performing addition operation on the multiplication operation result according to the rule of matrix operation, and generating data of a third color space according to the addition operation result.
5. The color space conversion circuit of claim 4, wherein said third color space conversion module further comprises a data transform module, an input of said data transform module being connected to an output of said summing module;
the addition operation module is further configured to transmit the data of the third color space generated by the addition operation result to the data transformation module;
and the data conversion module is used for acquiring the data of the third color space transmitted by the addition operation module, reducing the data of the third color space by preset times and generating the data of the RGB color space.
6. The color space conversion circuit according to claim 3,
the data generation module comprises: the device comprises a first cubic operation module, a first multiplier, a first subtracter, a second cubic operation module, a second multiplier, a second subtracter, a third cubic operation module, a third multiplier, a third subtracter and a data synchronous output module;
the first cubic operation module, the second cubic operation module and the third cubic operation module are respectively connected in series between the function operation module and the data synchronous output module, the first multiplier and the first subtractor are sequentially connected in series between the function operation module and the data synchronous output module, the second multiplier and the second subtractor are sequentially connected in series between the function operation module and the data synchronous output module, and the third multiplier and the third subtractor are sequentially connected in series between the function operation module and the data synchronous output module;
the first cubic operation module is used for acquiring a function expression of the Y data transmitted by the function operation module, performing cubic operation on the function expression of the Y data to generate first Y data, and transmitting the first Y data to the data synchronous transmission module;
the first multiplier is used for acquiring a function expression of the Y data transmitted by the function operation module, performing multiplication operation on the function expression of the Y data and the first data in the second preset array, and transmitting a multiplication operation result to the first subtractor;
the first subtractor is configured to obtain a multiplication result transmitted by the first multiplier, perform subtraction on the multiplication result transmitted by the first multiplier and second data in the second preset array to generate second Y data, and transmit the second Y data to the data synchronous transmission module;
the second cubic operation module is used for acquiring a function expression of the X data transmitted by the function operation module, performing cubic operation on the function expression of the X data to generate first X data, and transmitting the first X data to the data synchronous transmission module;
the second multiplier is used for acquiring a function expression of the X data transmitted by the function operation module, performing multiplication operation on the function expression of the X data and third data in the second preset array, and transmitting a multiplication operation result to the second subtractor;
the second subtractor is configured to obtain a multiplication result transmitted by the second multiplier, perform subtraction on the multiplication result transmitted by the second multiplier and fourth data in the second preset array to generate second X data, and transmit the second X data to the data synchronous transmission module;
the third cubic operation module is used for acquiring a function expression of the Z data transmitted by the function operation module, performing cubic operation on the function expression of the Z data to generate first Z data, and transmitting the first Z data to the data synchronous transmission module;
the third multiplier is configured to obtain a function expression of the Z data transmitted by the function operation module, perform multiplication on the function expression of the Z data and fifth data in the second preset array, and transmit a result of the multiplication to the third subtractor;
the third subtractor is configured to obtain a multiplication result transmitted by the third multiplier, perform subtraction on the multiplication result transmitted by the third multiplier and sixth data in the second preset array to generate second Z data, and transmit the second Z data to the data synchronous transmission module;
the data synchronous transmission module is used for acquiring a function expression of the Y data, a function expression of the X data, a function expression of the Z data, the first Y data, the second Y data, the first X data, the second X data, the first Z data and the first Z data, if the function expression value of the Y data is determined to be larger than the first preset parameter, outputting the first Y data to represent the Y data, and otherwise, outputting the second Y data to represent the Y data; if the value of the function expression of the X data is determined to be larger than the second preset parameter, outputting the first X data to represent the X data, otherwise, outputting the second X data to represent the X data; and if the value of the function expression of the Z data is determined to be larger than the third preset parameter, outputting the first Z data to represent the Z data, otherwise, outputting the second Z data to represent the Z data.
7. The color space conversion circuit according to any of claims 1-2, wherein the data matrix is processed by an integer by a computer and the result of the integer processing is transmitted to the third space conversion processing module.
8. The color space conversion circuit of claim 7, wherein the first predetermined array and the second predetermined array are processed by the computer by an integer, and the result of the integer processing is transmitted to the second space conversion module.
CN201811465643.8A 2018-12-03 2018-12-03 Color space conversion circuit Active CN109636863B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201811465643.8A CN109636863B (en) 2018-12-03 2018-12-03 Color space conversion circuit

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201811465643.8A CN109636863B (en) 2018-12-03 2018-12-03 Color space conversion circuit

Publications (2)

Publication Number Publication Date
CN109636863A CN109636863A (en) 2019-04-16
CN109636863B true CN109636863B (en) 2022-10-21

Family

ID=66070845

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201811465643.8A Active CN109636863B (en) 2018-12-03 2018-12-03 Color space conversion circuit

Country Status (1)

Country Link
CN (1) CN109636863B (en)

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1906951A (en) * 2004-01-05 2007-01-31 皇家飞利浦电子股份有限公司 Ambient light derived by subsampling video content and mapped through unrendered color space
JP2010232774A (en) * 2009-03-26 2010-10-14 Seiko Epson Corp Color space conversion circuit, color signal conversion device, and image display device
CN102280096A (en) * 2011-07-15 2011-12-14 杭州米加科技有限公司 Method for combining image scaling and color space switching

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1906951A (en) * 2004-01-05 2007-01-31 皇家飞利浦电子股份有限公司 Ambient light derived by subsampling video content and mapped through unrendered color space
JP2010232774A (en) * 2009-03-26 2010-10-14 Seiko Epson Corp Color space conversion circuit, color signal conversion device, and image display device
CN102280096A (en) * 2011-07-15 2011-12-14 杭州米加科技有限公司 Method for combining image scaling and color space switching

Also Published As

Publication number Publication date
CN109636863A (en) 2019-04-16

Similar Documents

Publication Publication Date Title
US5678033A (en) Multi-stage interpolation processor
US9659354B2 (en) Color matching for imaging systems
CN100463494C (en) Video signal processing apparatus and video signal processing method
EP3451294B1 (en) Luminance-normalised colour spaces
US9444975B2 (en) Image sensor gamut mapping
JP6069593B2 (en) Two-dimensional color conversion for wide color gamut workflow in digital cameras
CN109636863B (en) Color space conversion circuit
McElvain et al. Camera color correction using two-dimensional transforms
CN109754374A (en) A kind of method and device removing brightness of image noise
US7251360B2 (en) Look-up table generation method, computer program, and imaging apparatus
TWI523500B (en) Dynamic range compression method for image and image processing device
CN102231787B (en) Image color correction method and device
Nnolim Design and implementation of novel, fast, pipelined HSI2RGB and log-hybrid RGB2HSI colour converter architectures for image enhancement
JP2938115B2 (en) Color signal conversion circuit
Celebi et al. Accelerating color space transformations using numerical approximations
US8280155B2 (en) Modeling spectral characteristics of an input imaging device
US20100195125A1 (en) Image conversion device, image conversion method, and conversion program
Kumar et al. Grey level to RGB using YCbCr color space Technique
JP3576612B2 (en) Color conversion processor
CN104144291A (en) Method for conversion between Bayer format data and equivalent same-structure brightness and chromatic aberration component data
CN101330626B (en) Method of modifying brightness of color pixels
KR100536703B1 (en) Color signal conversion apparatus and method for video
JPS6038976A (en) Picture input display device
CN109587467A (en) A kind of color space converting circuit
KR20020088645A (en) Illuminant-adaptive color matching apparatus and method there of

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant