Method for color gamut conversion and image display method based on field programmable gate array

CN121393391BActive Publication Date: 2026-08-07ANHUI YUTU TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
ANHUI YUTU TECH CO LTD
Filing Date
2025-12-24
Publication Date
2026-08-07

AI Technical Summary

Technical Problem

[0005]本发明的目的是提供一种基于现场可编程门阵列实现色域转换方法和图像显示方法,以解决相关技术中,FPGA在实现色域空间转换处理时消耗大量乘法器资源,导致系统整体性能降低的技术问题

Benefits of technology

[0048]The color gamut conversion method based on Field Programmable Gate Array (FPGA) provided in this invention is applied to FPGAs. In an FPGA, firstly, the sector number of the hue is determined based on the initial RGB component values ​​of the pixels. Secondly, the initial brightness and initial saturation are determined based on the RGB-to-HSV color space conversion model and the initial RGB component values ​​(in practical applications, the hue is not adjusted). Thus, the RGB-to-HSV conversion is achieved. After the RGB-to-HSV conversion, adjusting the brightness and/or saturation can improve the display effect. After adjusting the brightness and/or saturation, the target intermediate variable to be output is determined based on the sector number and the HSV-to-RGB color space conversion model. The value of the unified representation parameter corresponding to the sector number is also obtained. The value of the target intermediate variable is output through a first multiplier, a second multiplier, and a subtractor. Finally, based on the target brightness, target saturation, the value of the target intermediate variable, and the sector number, the HSV-to-RGB conversion is performed. The color space conversion model determines the target RGB component values. After adjusting brightness and/or saturation, the conversion from HSV to RGB is achieved. Due to the highly flexible programmability, high-speed data processing capability, and parallelism of field-programmable gate array (FPGA) processing, this invention improves the conversion rate and meets the real-time requirements of image processing. In addition, during the RGB to HSV conversion, the relative position of the hue in the sector is obtained, which reduces the use of one multiplier compared to directly obtaining the hue. During the HSV to RGB conversion, compared to the previous method that required at least two multipliers for each intermediate variable, the method provided by this invention can achieve the value of the intermediate variable by reusing the first and second multipliers, saving the use of multipliers and DSP resources.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121393391B_ABST
    Figure CN121393391B_ABST
Patent Text Reader

Abstract

The application discloses a color gamut conversion method and image display method based on a field programmable gate array, and relates to the field of cholesteric LCD display screens. The field programmable gate array is used to realize RGB to HSV conversion, brightness and / or saturation adjustment, and HSV to RGB conversion, so that the conversion rate is improved, and the real-time performance of image processing can be met. In addition, in the process of RGB to HSV conversion, the relative position of the hue in the sector is obtained, which can reduce the use of one multiplier compared with the method of directly obtaining the hue. In the process of HSV to RGB conversion, compared with the method that at least two multipliers are needed to obtain the value of each intermediate variable, the value of the intermediate variable can be realized by reusing the first multiplier and the second multiplier in the method provided by the application, so that the use of the multiplier is saved, and the DSP resource is saved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of cholesteric LCD displays, and in particular to a method for color gamut conversion and image display based on a field-programmable gate array (FPGA). Background Technology

[0002] In cholesteric liquid crystal display (LCD) screen driving, it is usually necessary to enhance the brightness and saturation of the image based on the display characteristics of the screen to improve the display effect. The cholesteric LCD display process involves the conversion between red, green, and blue (RGB) and hue, saturation, and value (HSV) color gamuts.

[0003] In related color gamut conversion processes, color gamut space conversion is typically performed by a Digital Signal Processor (DSP), Microcontroller Unit (MCU), or host computer. However, real-time conversion of image data color gamut space is difficult to achieve. Considering the highly flexible programmability, high-speed data processing capabilities, and parallelism of Field Programmable Gate Arrays (FPGAs), which can improve computational speed and meet the real-time requirements of image processing, related technologies further utilize FPGAs for color gamut conversion. However, FPGAs consume significant multiplier resources when implementing color gamut space conversion. Taking HSV to RGB conversion as an example, obtaining intermediate variables... and During the process, each operation requires at least two multipliers, which consumes the DSP hardware resources integrated with the multipliers in the FPGA, squeezes the resource quota of other operations, and thus reduces the overall system performance.

[0004] Therefore, reducing the consumption of multiplier resources when using FPGA for color gamut conversion is a technical problem that urgently needs to be solved by those in the field. Summary of the Invention

[0005] The purpose of this invention is to provide a method for color gamut conversion and image display based on field-programmable gate arrays (FPGAs), in order to solve the technical problem in related technologies where FPGAs consume a large amount of multiplier resources when implementing color gamut space conversion processing, resulting in a reduction in the overall system performance.

[0006] To address the aforementioned technical problems, this invention provides a method for color gamut conversion based on a field-programmable gate array (FPGA), applicable to FPGAs, comprising:

[0007] The sector number of the hue is determined based on the initial RGB component values ​​of the pixel, and the initial brightness, initial saturation and hue relative position in the sector are determined based on the RGB to HSV color space conversion model and the initial RGB component values.

[0008] Adjust the initial brightness to the target brightness, and / or adjust the initial saturation to the target saturation;

[0009] The target intermediate variable to be output is determined based on the sector number and the HSV to RGB color space conversion model, and the value of the unified characterization parameter corresponding to the sector number is obtained; wherein, the unified characterization parameter is determined by the relative position of the hue in the sector;

[0010] The first multiplier outputs the first product of the target saturation and the first difference, the subtractor outputs the second difference between the first preset value and the first product, and the second multiplier outputs the second product of the second difference and the target brightness to determine the value of the target intermediate variable; wherein, the first difference is the difference between the second preset value and the value of the unified characterization parameter;

[0011] The target RGB component values ​​are determined based on the target brightness, the target saturation, the value of the target intermediate variable, and the sector number, using an HSV-to-RGB color space conversion model.

[0012] For example, determining the relative positions of the initial saturation and hue in the sector based on the RGB to HSV color space conversion model and the initial RGB component values ​​includes:

[0013] Based on the RGB to HSV color space conversion model and the initial RGB component values, determine the numerator component of the initial saturation, the denominator component of the initial saturation, the numerator component of the relative position of the hue in the sector, and the denominator component of the relative position of the hue in the sector.

[0014] Shift the molecular components of initial saturation and hue relative to each other in the sector to the left to the target position;

[0015] The final initial saturation is determined by the denominator component of the initial saturation and the numerator component of the initial saturation shifted to the left.

[0016] The final relative position of the hue in the sector is determined by the denominator component of the relative position of the hue in the sector and the numerator component of the relative position of the hue in the sector after shifting to the left.

[0017] For example, the sector number of the hue is determined based on the initial RGB component values ​​of the pixel. Satisfy the following expression:

[0018] ;

[0019] The relative position of the hue in the sector is determined based on the RGB to HSV color space conversion model and the initial RGB component values. Satisfy the following expression:

[0020] .

[0021] For example, the target intermediate variable to be output is determined based on the sector number and the HSV to RGB color space conversion model. Satisfy the following expression:

[0022] ;

[0023] in, and These are all specific intermediate variables.

[0024] For example, the target intermediate variable The value of satisfies the following first expression:

[0025] ;

[0026] in, Indicates brightness, Represents a unified characterization parameter. Indicates saturation;

[0027] Both the first preset value and the second preset value are 1.

[0028] For example, the target bit is 8 bits, and the target intermediate variable The value of satisfies the following second expression:

[0029] ;

[0030] in, Indicates brightness, Represents a unified characterization parameter. Indicates saturation;

[0031] The first preset value is 65536, and the second preset value is 256.

[0032] For example, the sector number The values ​​of the corresponding unified representation parameters satisfy the following expression:

[0033] .

[0034] To address the aforementioned technical problems, the present invention also provides an image display method applied to a field-programmable gate array (FPGA), comprising:

[0035] The sector number of the hue is determined based on the initial RGB component values ​​of the pixel, and the initial brightness, initial saturation and hue relative position in the sector are determined based on the RGB to HSV color space conversion model and the initial RGB component values.

[0036] Adjust the initial brightness to the target brightness, and / or adjust the initial saturation to the target saturation;

[0037] The target intermediate variable to be output is determined based on the sector number and the HSV to RGB color space conversion model, and the value of the unified characterization parameter corresponding to the sector number is obtained; wherein, the unified characterization parameter is determined by the relative position of the hue in the sector;

[0038] The first multiplier outputs the first product of the target saturation and the first difference, the subtractor outputs the second difference between the first preset value and the first product, and the second multiplier outputs the second product of the second difference and the target brightness to determine the value of the target intermediate variable; wherein, the first difference is the difference between the second preset value and the value of the unified characterization parameter;

[0039] The target RGB component values ​​are determined based on the target brightness, the target saturation, the value of the target intermediate variable, and the sector number, using an HSV to RGB color space conversion model.

[0040] The target RGB component values ​​are sent to the cholesteric phase LCD screen so that the cholesteric phase LCD screen can display an image based on the received target RGB component values.

[0041] For example, before determining the sector number of the hue based on the initial RGB component values ​​of the pixel, the method further includes:

[0042] The system receives the initial RGB component values ​​of the pixels sent by the host computer through a serial peripheral interface; wherein the host computer sends the initial RGB component values ​​of each pixel in the image sequentially at a preset frequency.

[0043] To address the aforementioned technical problems, this invention also provides a device for color gamut conversion based on a field-programmable gate array (FPGA), comprising a color conversion module for RGB to HSV conversion, a module for brightness and saturation adjustment, a color conversion module for HSV to RGB conversion, and an output module connected in sequence; wherein the color conversion module for HSV to RGB conversion is configured with logic circuitry for determining intermediate variables generated during the HSV to RGB conversion process, the logic circuitry comprising a first multiplier, a subtractor, and a second multiplier connected in sequence;

[0044] The color conversion module for implementing RGB to HSV is used to determine the sector number where the hue is located based on the initial RGB component values ​​of the pixel, and to determine the initial brightness, initial saturation and the relative position of the hue in the sector based on the RGB to HSV color space conversion model and the initial RGB component values.

[0045] The module for adjusting brightness and saturation is used to adjust the initial brightness to the target brightness and / or adjust the initial saturation to the target saturation.

[0046] The color conversion module for HSV to RGB is used to determine the target intermediate variable to be output based on the sector number and the HSV to RGB color space conversion model, and to obtain the value of the unified representation parameter corresponding to the sector number; it outputs the first product result of the target saturation and the first difference through the first multiplier, outputs the second difference between the first preset value and the first product result through the subtractor, and outputs the second product result of the second difference and the target brightness through the second multiplier to determine the value of the target intermediate variable; it determines the target RGB component value based on the target brightness, the target saturation, the value of the target intermediate variable, and the HSV to RGB color space conversion model under the sector number; wherein, the unified representation parameter is determined by the relative position of the hue in the sector; the first difference is the difference between the second preset value and the value of the unified representation parameter;

[0047] The output module is used to output the pixel data stream of the image to be displayed after brightness and saturation adjustment to the cholesteric LCD display screen.

[0048] The color gamut conversion method based on Field Programmable Gate Array (FPGA) provided in this invention is applied to FPGAs. In an FPGA, firstly, the sector number of the hue is determined based on the initial RGB component values ​​of the pixels. Secondly, the initial brightness and initial saturation are determined based on the RGB-to-HSV color space conversion model and the initial RGB component values ​​(in practical applications, the hue is not adjusted). Thus, the RGB-to-HSV conversion is achieved. After the RGB-to-HSV conversion, adjusting the brightness and / or saturation can improve the display effect. After adjusting the brightness and / or saturation, the target intermediate variable to be output is determined based on the sector number and the HSV-to-RGB color space conversion model. The value of the unified representation parameter corresponding to the sector number is also obtained. The value of the target intermediate variable is output through a first multiplier, a second multiplier, and a subtractor. Finally, based on the target brightness, target saturation, the value of the target intermediate variable, and the sector number, the HSV-to-RGB conversion is performed. The color space conversion model determines the target RGB component values. After adjusting brightness and / or saturation, the conversion from HSV to RGB is achieved. Due to the highly flexible programmability, high-speed data processing capability, and parallelism of field-programmable gate array (FPGA) processing, this invention improves the conversion rate and meets the real-time requirements of image processing. In addition, during the RGB to HSV conversion, the relative position of the hue in the sector is obtained, which reduces the use of one multiplier compared to directly obtaining the hue. During the HSV to RGB conversion, compared to the previous method that required at least two multipliers for each intermediate variable, the method provided by this invention can achieve the value of the intermediate variable by reusing the first and second multipliers, saving the use of multipliers and DSP resources.

[0049] In addition, the present invention also provides an image display method and an apparatus for color gamut conversion based on field-programmable gate arrays, which have the same or corresponding technical features as the color gamut conversion method based on field-programmable gate arrays described above, and have the same effect. Attached Figure Description

[0050] To more clearly illustrate the embodiments of the present invention, the accompanying drawings used in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0051] Figure 1 A flowchart illustrating a method for color gamut conversion based on a field-programmable gate array (FPGA) is provided as an embodiment of the present invention.

[0052] Figure 2 A schematic diagram illustrating an RGB to HSV conversion process provided in an embodiment of the present invention;

[0053] Figure 3 A schematic diagram of a logic circuit for determining intermediate variables generated during the HSV to RGB conversion process, provided as an embodiment of the present invention;

[0054] Figure 4 A schematic diagram of another logic circuit for determining intermediate variables generated during the HSV to RGB conversion process, provided as an embodiment of the present invention;

[0055] Figure 5 A data flow diagram provided in an embodiment of the present invention;

[0056] Figure 6 A flowchart of an HSV to RGB conversion method provided in an embodiment of the present invention;

[0057] Figure 7 A schematic diagram illustrating an image display method provided in an embodiment of the present invention;

[0058] Figure 8 This is a structural diagram of an electronic device provided in an embodiment of the present invention. Detailed Implementation

[0059] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative effort are within the protection scope of the present invention.

[0060] The core of this invention is to provide a method for color gamut conversion and image display based on field-programmable gate arrays (FPGAs), in order to solve the technical problem in related technologies where FPGAs consume a large amount of multiplier resources when implementing color gamut space conversion processing, resulting in a reduction in the overall system performance.

[0061] To enable those skilled in the art to better understand the present invention, the present invention will be further described in detail below with reference to the accompanying drawings and specific embodiments.

[0062] The RGB color model is an industry standard that derives colors by varying the red, green, and blue channels and superimposing them. The HSV color model, on the other hand, divides colors into hue, saturation, and lightness channels based on their intuitive characteristics. Compared to the RGB model, the HSV model is more suitable for image segmentation applications. In cholesteric LCD display drivers, it's often necessary to enhance the brightness and saturation of the image based on the screen's display characteristics to improve the display effect; therefore, RGB to HSV color gamut conversion is essential. With the development of multimedia and communication technologies, real-time image processing has become a major focus. Traditionally, color gamut conversion algorithms are implemented using DSPs, MCUs, or host computers, which makes real-time conversion of image data color gamut difficult. However, Field-Programmable Gate Arrays (FPGAs) offer high programmability, high-speed data processing capabilities, and parallelism, improving processing speed and meeting the real-time requirements of image processing.

[0063] However, FPGAs consume a large amount of multiplier resources when implementing color space conversion. Taking the HSV to RGB conversion as an example, in obtaining intermediate variables... ( )and ( During the process, each operation requires at least two multipliers, which consumes the DSP hardware resources integrated with the multipliers in the FPGA, squeezes the resource quota of other operations, and thus reduces the overall system performance.

[0064] Therefore, this invention provides a method for color gamut conversion based on field-programmable gate arrays (FPGAs) to reduce the consumption of multiplier resources when using FPGAs for color gamut conversion. Figure 1 A flowchart of a color gamut conversion method based on a field-programmable gate array (FPGA) is provided for an embodiment of the present invention, as follows: Figure 1 As shown, the method includes:

[0065] S10: Determine the sector number of the hue based on the initial RGB component values ​​of the pixel, and determine the initial brightness, initial saturation and the relative position of the hue in the sector based on the RGB to HSV color space conversion model and the initial RGB component values.

[0066] S11: Adjust the initial brightness to the target brightness, and / or adjust the initial saturation to the target saturation;

[0067] S12: Determine the target intermediate variable to be output based on the sector number and the HSV to RGB color space conversion model, and obtain the value of the unified characterization parameter corresponding to the sector number; wherein, the unified characterization parameter is determined by the relative position of the hue in the sector;

[0068] S13: The first multiplier outputs the first product result of the target saturation and the first difference, the subtractor outputs the second difference between the first preset value and the first product result, and the second multiplier outputs the second product result of the second difference and the target brightness to determine the value of the target intermediate variable; wherein, the first difference is the difference between the second preset value and the value of the unified characterization parameter;

[0069] S14: Based on the target brightness, target saturation, target intermediate variable values, and sector number, the HSV to RGB color space conversion model determines the target RGB component values.

[0070] Before explaining color gamut conversion, we will first explain the color space conversion models from RGB to HSV and from HSV to RGB.

[0071] The color space conversion model from RGB to HSV (i.e., the formula for converting the RGB color gamut to the HSV color gamut) is as follows:

[0072] ;

[0073] in, Indicates brightness, Indicates saturation, Indicates hue. If the calculated value is... If the value is less than 0, add 360 to the value to get the final result. Value. That is... .

[0074] The HSV to RGB color space conversion model (i.e., the formula for converting the HSV color gamut to the RGB color gamut) is as follows:

[0075] ;

[0076] in, Indicates the sector number where the hue is located; Indicates the relative position of the hue within the sector; , and These all represent intermediate variables generated during the HSV to RGB conversion process. In the HSV color gamut, hues are artificially divided into 6 sectors, each 60°, corresponding to the 6 basic hues: red, yellow, green, cyan, blue, and magenta. The sector numbers can be... =0 to 5.

[0077] In practical applications, the color tone is not adjusted; therefore, during RGB to HSV conversion, only the desired color is obtained. and The component is sufficient. Furthermore, to facilitate direct use during subsequent HSV color gamut conversion to RGB color gamut, simplify the calculation process, reduce computational complexity, and thus save DSP resources, this invention also obtains the sector number of the hue during RGB to HSV conversion. And the relative position of hue in the sector .

[0078] It is worth noting that if the calculation is The components, according to the RGB to HSV color space conversion model, are calculated... The component requires two multipliers; however, in this invention, the relative position of the hue within the sector is calculated. According to the HSV to RGB color space conversion model, the calculation... Compared to calculation If the components are used, the use of one multiplier can be saved.

[0079] In FPGA implementations, only logic 1s and 0s exist. Implementing floating-point calculations on an FPGA is complex and consumes significant logic resources. Therefore, to conserve resources, in some embodiments, the relative positions of initial saturation and hue within a sector are determined based on the RGB-to-HSV color space conversion model and the initial RGB component values, including:

[0080] Based on the RGB to HSV color space conversion model and the initial RGB component values, determine the numerator component (Snum) of the initial saturation, the denominator component of the initial saturation, the numerator component (fnum) of the relative position of the hue in the sector, and the denominator component (fden) of the relative position of the hue in the sector.

[0081] Shift the molecular components of initial saturation and hue relative to each other in the sector to the left to the target position;

[0082] The final initial saturation is determined by the denominator component of the initial saturation and the numerator component of the initial saturation shifted to the left.

[0083] The final relative position of the hue in the sector is determined by the denominator component of the relative position of the hue in the sector and the numerator component of the relative position of the hue in the sector after shifting to the left.

[0084] The target bit is not limited and can be 8 bits, 12 bits, etc. In the FPGA implementation, only logic 1s and logic 0s exist. Therefore, during the calculation, the molecular components of the initial saturation and the molecular components of the hue relative to each other in the sector are shifted to the left to the target position. and The range of the representation has been expanded from 0 to 1 to 0 to 256. Through this process, the originally complex floating-point operations in the range of 0 to 1 are converted into integer operations in the range of 0 to 256, which speeds up the system's response speed and reduces the consumption of system logic units.

[0085] Determine the sector number of the hue based on the initial RGB component values ​​of the pixel. Satisfy the following expression:

[0086] ;

[0087] The relative position of the hue in the sector is determined based on the RGB to HSV color space conversion model and the initial RGB component values. Satisfy the following expression:

[0088] .

[0089] The RGB to HSV conversion process has been described above. To enable those skilled in the art to better understand the above RGB to HSV conversion process, the process will be explained again below with reference to specific embodiments and accompanying drawings. Figure 2 This is a schematic diagram of an RGB to HSV conversion process provided by an embodiment of the present invention, as shown below. Figure 2 As shown, the method includes:

[0090] S15: Acquire pixels \ \ Quantity;

[0091] S16: Pixel-based \ \ The components are converted from RGB to HSV.

[0092] Step S16 specifically includes the following steps:

[0093] Determine if it satisfies = = ;

[0094] If so, then , , , ;

[0095] If not, then check Max( , , Does it meet the preset requirements?

[0096] In Max( , , )= In the case of, judge Does it meet the requirements? ;

[0097] like satisfy Then calculate Molecular component fnum= ,calculate Denominator component fden= ,calculate Molecular component Snum= Shift fnum and Snum left by 8 bits; , = fnum / fden, = Snum / , Output pixels , , , Quantity;

[0098] like Not satisfied Then calculate Molecular component fnum= ,calculate Denominator component fden= ,calculate Molecular component Snum= Shift fnum and Snum left by 8 bits; , = fnum / fden, = Snum / , Output pixels , , , Quantity;

[0099] In Max( , , )= In the case of, judge Does it meet the requirements? ;

[0100] like satisfy Then calculate Molecular component fnum= ,calculate Denominator component fden= ,calculate Molecular component Snum= Shift fnum and Snum left by 8 bits; , = fnum / fden, = Snum / , Output pixels , , , Quantity;

[0101] like Not satisfied Then calculate Molecular component fnum= ,calculate Denominator component fden= ,calculate Molecular component Snum= Shift fnum and Snum left by 8 bits; , = fnum / fden, = Snum / , Output pixels , , , Quantity;

[0102] In Max( , , )= In the case of, judge Does it meet the requirements? ;

[0103] like satisfy Then calculate Molecular component fnum= ,calculate Denominator component fden= ,calculate Molecular component Snum= Shift fnum and Snum left by 8 bits; , = fnum / fden, =Snum / , Output pixels , , , Quantity;

[0104] like Not satisfied Then calculate Molecular component fnum= ,calculate Denominator component fden= ,calculate Molecular component Snum= Shift fnum and Snum left by 8 bits; , = fnum / fden, = Snum / , Output pixels , , , Quantity.

[0105] After converting RGB to HSV, the initial brightness can be adjusted to the target brightness, and / or the initial saturation can be adjusted to the target saturation. There are no strict limitations on the target brightness and saturation; typically, the brightness and saturation of the image need to be enhanced in conjunction with the screen's display characteristics to improve the display effect.

[0106] After increasing brightness and / or adjusting saturation, the HSV color space is converted to RGB. During the HSV to RGB conversion process, by combining the HSV to RGB color space conversion model, it can be found that... and They will not be output simultaneously. Analysis reveals the following pattern:

[0107] When converting from RGB color gamut to HSV color gamut The calculation formula yields, In the case of, when hour, , ;when hour, , .

[0108] The formula for converting from the HSV color gamut to the RGB color gamut is as follows: At that time, the intermediate variable corresponding to the green component The calculation formula is:

[0109] ;

[0110] At that time, the intermediate variable corresponding to the blue component The calculation formula is:

[0111] ;

[0112] From the above two equations, we can obtain that when converting from the RGB color gamut to the HSV color gamut, when In this case, At that time, the intermediate variable corresponding to the green component The calculation formula, and At that time, the intermediate variable corresponding to the blue component The calculation formula follows the following pattern (i.e., target intermediate variable) The value satisfies the following first expression): ;in, Indicates brightness, Represents a unified characterization parameter. Indicates saturation. Target intermediate variable. Specifically refers to or .

[0113] Similarly, , Sometimes, it also conforms to the first expression.

[0114] At this point, both the first and second preset values ​​are 1.

[0115] After the above conversion, in the HSV to RGB conversion process, the present invention configures a logic circuit in the FPGA to determine the intermediate variables generated during the HSV to RGB conversion process. The logic circuit includes a first multiplier, a subtractor, and a second multiplier connected in sequence, as follows: Figure 3 As shown, Figure 3 This is a schematic diagram of a logic circuit for determining intermediate variables generated during the HSV to RGB conversion process, provided as an embodiment of the present invention.

[0116] The first multiplier outputs the first product of the target saturation and the first difference (the difference between the second preset value (which is 1) and the value of the unified characterization parameter). The subtractor outputs the second difference between the first preset value (which is 1) and the first product. The second multiplier then outputs the second product of the second difference and the target brightness to determine the value of the target intermediate variable. value or (value).

[0117] In implementation, the target intermediate variable to be output by the logic circuit is determined based on the sector number and the HSV to RGB color space conversion model. Satisfy the following expression:

[0118] ;

[0119] in, and These are all specific intermediate variables.

[0120] sector number The values ​​of the corresponding unified representation parameters satisfy the following expression:

[0121] .

[0122] In the HSV to RGB conversion process, compared to the previous method of obtaining various intermediate variables ( and When the value of ) is obtained, each requires at least two multipliers. In the method provided by this invention, the value of the intermediate variable can be obtained by reusing the first multiplier and the second multiplier, which saves the use of multipliers and saves DSP resources.

[0123] Implementing floating-point calculations using FPGAs is complex and consumes significant logic resources. The above text will... and A left shift was performed to convert floating-point arithmetic to integer arithmetic. Because... and The range of representation changes, therefore the target intermediate variable The expression for the value can be updated.

[0124] In some embodiments, the target bit is 8 bits, and the target intermediate variable The value of satisfies the following second expression:

[0125] ;

[0126] in, Indicates brightness, Represents a unified characterization parameter. Indicates saturation;

[0127] At this point, the first preset value is 65536, and the second preset value is 256.

[0128] Figure 4 This is a schematic diagram of another logic circuit for determining intermediate variables generated during the HSV to RGB conversion process, provided as an embodiment of the present invention. Figure 3 The circuit structures are the same, the only difference being the input and the corresponding circuit output. value or The value and Figure 3 different.

[0129] The first multiplier outputs the first product of the target saturation and the first difference (the difference between the second preset value (256) and the value of the unified characterization parameter). The subtractor outputs the second difference between the first preset value (65536) and the first product. The second multiplier outputs the second product of the second difference and the target brightness to determine the value of the target intermediate variable. value or (value).

[0130] Figure 5 This is a schematic diagram of a data flow provided in an embodiment of the present invention. For example... Figure 5 As shown, from left to right, the first cycle, ; =S1; =f1、 =V1、 or The output is The second cycle, ; =S2; =f2、 =V2、 or The output is The third cycle, ; =S3; =f3、 =V3、 or The output is The fourth cycle, ; =S4; =f4、 =V4、 or The output is The fifth cycle, ; =S5; =f5、 =V5、 or The output is The sixth cycle, ; =S6; =f6、 =V6、 or The output is .

[0131] The HSV to RGB conversion process has been described above. To enable those skilled in the art to better understand this process, the following description, in conjunction with the accompanying drawings and specific embodiments, will be provided. Figure 6 A flowchart of an HSV to RGB conversion method provided in an embodiment of the present invention is shown below. Figure 6 As shown, the method includes:

[0132] S17: Obtain pixels , , , Quantity;

[0133] S18: Calculation ;

[0134] S19: Calculation (or )= *(65536-(256- )* );

[0135] S20: According to Color gamut conversion is performed in this case;

[0136] S21: Output pixels , , Quantity.

[0137] Specifically, step S20 includes:

[0138] when ; ; ; ;

[0139] when ; ; ; ;

[0140] when ; ; ; ;

[0141] when ; ; ; ;

[0142] when ; ; ; ;

[0143] when ; ; ; .

[0144] This embodiment demonstrates the conversion from HSV to RGB.

[0145] The color gamut conversion method based on Field Programmable Gate Array (FPGA) provided in this invention is applied to FPGAs. In an FPGA, firstly, the sector number of the hue is determined based on the initial RGB component values ​​of the pixels. Secondly, the initial brightness and initial saturation are determined based on the RGB-to-HSV color space conversion model and the initial RGB component values ​​(in practical applications, the hue is not adjusted). Thus, the RGB-to-HSV conversion is achieved. After the RGB-to-HSV conversion, adjusting the brightness and / or saturation can improve the display effect. After adjusting the brightness and / or saturation, the target intermediate variable to be output is determined based on the sector number and the HSV-to-RGB color space conversion model. The value of the unified representation parameter corresponding to the sector number is also obtained. The value of the target intermediate variable is output through a first multiplier, a second multiplier, and a subtractor. Finally, based on the target brightness, target saturation, the value of the target intermediate variable, and the sector number, the HSV-to-RGB conversion is performed. The color space conversion model determines the target RGB component values. After adjusting brightness and / or saturation, the conversion from HSV to RGB is achieved. Due to the highly flexible programmability, high-speed data processing capabilities, and parallelism of field-programmable gate arrays (FPGAs), this invention improves the conversion rate and meets the real-time requirements of image processing. Furthermore, in the RGB to HSV conversion process, the relative position of the hue within the sector is obtained, reducing the need for a multiplier compared to directly obtaining the hue. In the HSV to RGB conversion process, compared to the previous method where at least two multipliers were required for each intermediate variable, the method provided in this invention allows the intermediate variable values ​​to be obtained by reusing the first and second multipliers, saving multiplier usage and DSP resources. Specifically, by optimizing the process and simplifying the calculation, computational complexity is reduced, saving DSP resources. In addition, since only logic 1s and logic 0s exist in the FPGA implementation, f_num and S_num are left-shifted by 8 bits during the calculation process, thus... and The range of the representation has been expanded from 0 to 1 to 0 to 255. Through this process, the originally complex floating-point operations within the range of 0 to 1 are converted into integer operations within the range of 0 to 255, which speeds up the system's response speed and reduces the consumption of system logic units.

[0146] The above describes a method for color gamut conversion based on a field-programmable gate array (FPGA). This embodiment also provides an image display method applied to a FPGA, including:

[0147] The sector number of the hue is determined based on the initial RGB component values ​​of the pixel, and the initial brightness, initial saturation and hue relative position in the sector are determined based on the RGB to HSV color space conversion model and the initial RGB component values.

[0148] Adjust the initial brightness to the target brightness, and / or adjust the initial saturation to the target saturation;

[0149] The target intermediate variable to be output is determined based on the sector number and the HSV to RGB color space conversion model, and the value of the unified characterization parameter corresponding to the sector number is obtained; wherein, the unified characterization parameter is determined by the relative position of the hue in the sector;

[0150] The first multiplier outputs the first product of the target saturation and the first difference, the subtractor outputs the second difference between the first preset value and the first product, and the second multiplier outputs the second product of the second difference and the target brightness to determine the value of the target intermediate variable; wherein, the first difference is the difference between the second preset value and the value of the unified characterization parameter;

[0151] The target RGB component values ​​are determined by the HSV to RGB color space conversion model based on the target brightness, target saturation, target intermediate variable values, and sector number.

[0152] The target RGB component values ​​are sent to the cholesteric phase LCD screen so that the cholesteric phase LCD screen can display the image based on the received target RGB component values.

[0153] Before determining the sector number of the hue based on the initial RGB component values ​​of the pixel, the process also includes:

[0154] The system receives the initial RGB component values ​​of the pixels sent by the host computer via the Serial Peripheral Interface (SPI); the host computer sends the initial RGB component values ​​of each pixel in the image sequentially at a preset frequency.

[0155] There is no limit to the preset frequency. In order to ensure the real-time display, the host computer sends out the initial RGB component value of one pixel in the image and then continues to send the initial RGB component value of the next pixel.

[0156] Figure 7 This is a schematic diagram of an image display method provided in an embodiment of the present invention, as shown below. Figure 7 As shown, the FPGA obtains the pixel RGB components via SPI, performs RGB to HSV conversion, and after brightness / saturation adjustment, converts HSV to RGB and displays it on the cholesteric LCD screen.

[0157] The FPGA receives the pixel RGB components sent by the host computer via the SPI port. The RGB to HSV conversion module converts and calculates the input pixel RGB component values ​​to output the pixel. , , , The brightness / saturation adjustment module adjusts pixel brightness according to the screen characteristics of the cholesteric LCD screen. ) and saturation value ( HSV to RGB conversion based on brightness / saturation adjustment module output , , , The conversion calculation is performed to output the adjusted RGB values ​​and send them to the cholesteric phase LCD screen for display.

[0158] The image display method provided in this embodiment has the same or corresponding technical features as the color gamut conversion method based on field-programmable gate arrays described above. The embodiments of the color gamut conversion method based on field-programmable gate arrays have been described in detail above, and the embodiments of the image display method will not be repeated here, and the effects are the same as above.

[0159] This invention also provides a device for color gamut conversion based on a field-programmable gate array (FPGA), comprising a color conversion module for RGB to HSV conversion, a module for brightness and saturation adjustment, a color conversion module for HSV to RGB conversion, and an output module connected in sequence; wherein the color conversion module for HSV to RGB conversion is configured with a method for determining intermediate variables generated during the HSV to RGB conversion process. , The logic circuit includes a first multiplier, a subtractor, and a second multiplier connected in sequence.

[0160] The color conversion module is used to implement RGB to HSV, which determines the sector number of the hue based on the initial RGB component values ​​of the pixel, and determines the initial brightness, initial saturation and the relative position of the hue in the sector based on the RGB to HSV color space conversion model and the initial RGB component values.

[0161] A module for adjusting brightness and saturation, used to adjust the initial brightness to the target brightness, and / or adjust the initial saturation to the target saturation;

[0162] This module implements HSV to RGB color conversion. It determines the target intermediate variable to be output based on the sector number and the HSV to RGB color space conversion model, and obtains the value of the unified representation parameter corresponding to the sector number. It outputs the first product of the target saturation and the first difference through a first multiplier, the second difference between the first preset value and the first product through a subtractor, and the second product of the second difference and the target brightness through a second multiplier to determine the value of the target intermediate variable. Based on the target brightness, target saturation, the target intermediate variable, and the sector number, the HSV to RGB color space conversion model determines the target RGB component values. The unified representation parameter is determined by the relative position of the hue within the sector. The first difference is the difference between the second preset value and the value of the unified representation parameter.

[0163] The output module is used to output the pixel data stream of the image to be displayed after brightness and saturation adjustment to the cholesteric LCD display screen.

[0164] The field-programmable gate array (FPGA) provided in this embodiment has the same or corresponding technical features as the color gamut conversion method based on FPGA described above. The embodiments of the color gamut conversion method based on FPGA have been described in detail above, and the embodiments of FPGA will not be repeated here, and the effects are the same as above.

[0165] In the above embodiments, a method for color gamut conversion based on field-programmable gate arrays has been described in detail. The present invention also provides embodiments for electronic devices.

[0166] Figure 8 This is a structural diagram of an electronic device provided in an embodiment of the present invention. This embodiment is based on a hardware perspective, such as... Figure 8 As shown, the electronic device includes:

[0167] Memory 20 is used to store computer programs;

[0168] The processor 21 is used to implement the steps of the color gamut conversion method based on field-programmable gate array as mentioned in the above embodiments when executing a computer program.

[0169] The processor 21 may include one or more processing cores, such as a quad-core processor or an octa-core processor. The processor 21 may be implemented using at least one of the following hardware forms: Digital Signal Processor (DSP), Field-Programmable Gate Array (FPGA), or Programmable Logic Array (PLA). The processor 21 may also include a main processor and a coprocessor. The main processor, also known as the Central Processing Unit (CPU), is used to process data in the wake-up state; the coprocessor is a low-power processor used to process data in the standby state. In some embodiments, the processor 21 may integrate a Graphics Processing Unit (GPU), which is responsible for rendering and drawing the content to be displayed on the screen. In some embodiments, the processor 21 may also include an Artificial Intelligence (AI) processor, which handles computational operations related to machine learning.

[0170] The memory 20 may include one or more computer-readable storage media, which may be non-transitory. The memory 20 may also include high-speed random access memory and non-volatile memory, such as one or more disk storage devices or flash memory devices. In this embodiment, the memory 20 is used to store at least the following computer program 201, which, after being loaded and executed by the processor 21, is capable of implementing the relevant steps of the color gamut conversion method based on a field-programmable gate array disclosed in any of the foregoing embodiments. In addition, the resources stored in the memory 20 may also include an operating system 202 and data 203, and the storage method may be temporary or permanent storage. The operating system 202 may include Windows, Unix, Linux, etc. The data 203 may include, but is not limited to, the data involved in the aforementioned color gamut conversion method based on a field-programmable gate array.

[0171] In some embodiments, the electronic device may further include a display screen 22, an input / output interface 23, a communication interface 24, a power supply 25, and a communication bus 26.

[0172] Those skilled in the art will understand that Figure 8 The structures shown do not constitute a limitation on electronic devices and may include more or fewer components than those shown.

[0173] The electronic device provided in this embodiment of the invention includes a memory and a processor. When the processor executes the program stored in the memory, it can implement the following method: a color gamut conversion method based on a field-programmable gate array, with the same effect as above.

[0174] Finally, the present invention also provides an embodiment corresponding to a computer-readable storage medium. The computer-readable storage medium stores a computer program, which, when executed by a processor, performs the steps described in the above method embodiments.

[0175] It is understood that if the methods in the above embodiments are implemented as software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and executes all or part of the steps of the methods described in the various embodiments of the present invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0176] The computer-readable storage medium provided by this invention includes the aforementioned method for color gamut conversion based on field-programmable gate arrays, with the same effect.

[0177] The foregoing has provided a detailed description of a color gamut conversion method and an image display method based on a field-programmable gate array (FPGA) provided by the present invention. The various embodiments in the specification are described in a progressive manner, with each embodiment focusing on its differences from other embodiments. Similar or identical parts between embodiments can be referred to interchangeably. For the apparatus disclosed in the embodiments, since it corresponds to the method disclosed in the embodiments, the description is relatively simple; relevant parts can be referred to in the method section. It should be noted that those skilled in the art can make several improvements and modifications to the present invention without departing from the principles of the invention, and these improvements and modifications also fall within the protection scope of the present invention.

[0178] It should also be noted that, in this specification, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.

Claims

1. A method for color gamut conversion based on field-programmable gate arrays, characterized in that, Applications include: Field-Programmable Gate Arrays (FPGAs) The sector number of the hue is determined based on the initial RGB component values ​​of the pixel, and the initial brightness, initial saturation and hue relative position in the sector are determined based on the RGB to HSV color space conversion model and the initial RGB component values. Adjust the initial brightness to the target brightness, and / or adjust the initial saturation to the target saturation; The target intermediate variable to be output is determined based on the sector number and the HSV to RGB color space conversion model, and the value of the unified characterization parameter corresponding to the sector number is obtained; wherein, the unified characterization parameter is determined by the relative position of the hue in the sector; The first multiplier outputs the first product of the target saturation and the first difference, the subtractor outputs the second difference between the first preset value and the first product, and the second multiplier outputs the second product of the second difference and the target brightness to determine the value of the target intermediate variable; wherein, the first difference is the difference between the second preset value and the value of the unified characterization parameter; The target RGB component values ​​are determined based on the target brightness, the target saturation, the value of the target intermediate variable, and the sector number, using an HSV-to-RGB color space conversion model.

2. The method for color gamut conversion based on field-programmable gate arrays according to claim 1, characterized in that, Determining the relative positions of initial saturation and hue within the sector based on the RGB to HSV color space conversion model and the initial RGB component values ​​includes: Based on the RGB to HSV color space conversion model and the initial RGB component values, determine the numerator component of the initial saturation, the denominator component of the initial saturation, the numerator component of the relative position of the hue in the sector, and the denominator component of the relative position of the hue in the sector. Shift the molecular components of initial saturation and hue relative to each other in the sector to the left to the target position; The final initial saturation is determined by the denominator component of the initial saturation and the numerator component of the initial saturation shifted to the left. The final relative position of the hue in the sector is determined by the denominator component of the relative position of the hue in the sector and the numerator component of the relative position of the hue in the sector after shifting to the left.

3. The method for color gamut conversion based on field-programmable gate arrays according to claim 2, characterized in that, Determine the sector number of the hue based on the initial RGB component values ​​of the pixel. Satisfy the following expression: ; The relative position of the hue in the sector is determined based on the RGB to HSV color space conversion model and the initial RGB component values. Satisfy the following expression: 。 4. The method for color gamut conversion based on field-programmable gate arrays according to claim 1, characterized in that, The target intermediate variable to be output is determined based on the sector number and the HSV to RGB color space conversion model. Satisfy the following expression: ; in, and These are all specific intermediate variables.

5. The method for color gamut conversion based on field-programmable gate arrays according to claim 4, characterized in that, Target intermediate variables The value of satisfies the following first expression: ; in, Indicates brightness, Represents a unified characterization parameter. Indicates saturation; Both the first preset value and the second preset value are 1.

6. The method for color gamut conversion based on field-programmable gate arrays according to claim 2, characterized in that, The target bit is 8 bits, and the target intermediate variable The value of satisfies the following second expression: ; in, Indicates brightness, Represents a unified characterization parameter. Indicates saturation; The first preset value is 65536, and the second preset value is 256.

7. The method for color gamut conversion based on field-programmable gate arrays according to claim 5 or 6, characterized in that, The sector number The values ​​of the corresponding unified representation parameters satisfy the following expression: 。 8. An image display method, characterized in that, Applications include: Field-Programmable Gate Arrays (FPGAs) The sector number of the hue is determined based on the initial RGB component values ​​of the pixel, and the initial brightness, initial saturation and hue relative position in the sector are determined based on the RGB to HSV color space conversion model and the initial RGB component values. Adjust the initial brightness to the target brightness, and / or adjust the initial saturation to the target saturation; The target intermediate variable to be output is determined based on the sector number and the HSV to RGB color space conversion model, and the value of the unified characterization parameter corresponding to the sector number is obtained; wherein, the unified characterization parameter is determined by the relative position of the hue in the sector; The first multiplier outputs the first product of the target saturation and the first difference, the subtractor outputs the second difference between the first preset value and the first product, and the second multiplier outputs the second product of the second difference and the target brightness to determine the value of the target intermediate variable; wherein, the first difference is the difference between the second preset value and the value of the unified characterization parameter; The target RGB component values ​​are determined based on the target brightness, the target saturation, the value of the target intermediate variable, and the sector number, using an HSV to RGB color space conversion model. The target RGB component values ​​are sent to the cholesteric phase LCD screen so that the cholesteric phase LCD screen can display an image based on the received target RGB component values.

9. The image display method according to claim 8, characterized in that, Before determining the sector number of the hue based on the initial RGB component values ​​of the pixel, the process also includes: The system receives the initial RGB component values ​​of the pixels sent by the host computer through a serial peripheral interface; wherein the host computer sends the initial RGB component values ​​of each pixel in the image sequentially at a preset frequency.

10. A device for color gamut conversion based on a field-programmable gate array (FPGA), characterized in that, The system includes a color conversion module for RGB to HSV, a module for brightness and saturation adjustment, a color conversion module for HSV to RGB, and an output module connected in sequence. The color conversion module for HSV to RGB is configured with a logic circuit for determining the intermediate variables generated during the HSV to RGB conversion process. The logic circuit includes a first multiplier, a subtractor, and a second multiplier connected in sequence. The color conversion module for implementing RGB to HSV is used to determine the sector number where the hue is located based on the initial RGB component values ​​of the pixel, and to determine the initial brightness, initial saturation and the relative position of the hue in the sector based on the RGB to HSV color space conversion model and the initial RGB component values. The module for adjusting brightness and saturation is used to adjust the initial brightness to the target brightness and / or adjust the initial saturation to the target saturation. The color conversion module for HSV to RGB is used to determine the target intermediate variable to be output based on the sector number and the HSV to RGB color space conversion model, and to obtain the value of the unified representation parameter corresponding to the sector number; it outputs the first product result of the target saturation and the first difference through the first multiplier, outputs the second difference between the first preset value and the first product result through the subtractor, and outputs the second product result of the second difference and the target brightness through the second multiplier to determine the value of the target intermediate variable; it determines the target RGB component value based on the target brightness, the target saturation, the value of the target intermediate variable, and the HSV to RGB color space conversion model under the sector number; wherein, the unified representation parameter is determined by the relative position of the hue in the sector; the first difference is the difference between the second preset value and the value of the unified representation parameter; The output module is used to output the pixel data stream of the image to be displayed after brightness and saturation adjustment to the cholesteric LCD display screen.

Citation Information

Patent Citations

  • RGB and HSI color space conversion method and circuit based on FPGA

    CN114666559A

  • Tone adaptive saturation increase for OLED display power reduction

    CN118215956A