An FPGA-Based Simple RGB-HSI Space Conversion Algorithm for Hardware Image Processing

In this paper, a new, low-complexity, easy-to-implement hardware method for color space conversion between the red-green-blue (RGB) and the hue-saturation-intensity (HSI) color spaces called the simple RGB-HSI space conversion (S-SC) algorithm is proposed, which aims to provide more rapid computing due to the need for fewer operations. In the S-SC algorithm, we reconstruct the model of space conversion between the RGB color space and the HSI color space (RGB-HSI) by inverting the conversion from the HSI color space to the RGB color space of the traditional geometric derivation algorithm. As a result, the nonlinear model-realized RGB-HSI color space conversion by the geometric derivation algorithm is transformed into a linear conversion model, which can avoid complicated calculations such as trigonometric and inverse trigonometric functions in the color space conversion process. The model can effectively reduce the computational complexity of the algorithm and facilitate hardware implementation at the same time. To evaluate the performance of the S-SC algorithm, we first compare the S-SC algorithm with the geometric derivation algorithm from the computational complexity perspective. On this basis, we compare the S-SC algorithm with five other RGB-HSI color space conversion algorithms from the perspectives of error and conversion effect. Finally, we use the field programmable gate array (FPGA) hardware platform to analyze and verify the timing sequence and logical resource consumption and verify the effectiveness of the proposed algorithm with experimental results. We show that the S-SC algorithm achieves good performance in terms of conversion accuracy, logical unit resource occupancy, and output timing.


I. INTRODUCTION
Color spaces are essential in research fields such as image processing and computer vision. Frequently used color space types include the red-green-blue (RGB) color space, huesaturation-intensity (HSI) color space, hue-saturation-value (HSV) color space, and Luma-blue-difference-Chroma-reddifference-Chroma (YCbCr) color space. Attributed to a color description based on the additive color principle and The associate editor coordinating the review of this manuscript and approving it for publication was Liang-Bi Chen . facilitating color data collection and display, the RGB color space is the most basic, commonly used, and hardwareoriented space. However, since the red, green, and blue components of the RGB color space are not independent of each other, interference between them occurs during image processing. This circumstance is disadvantageous to image processing [1]- [3]. The HSI color space, based on the human visual system, is used for color description, which is convenient for researchers to process color information from subjective consciousness. Moreover, since the HSI color space components are independent of each other and can be processed separately, the HSI space has been widely utilized in image processing [4]- [6]. In addition, relevant studies have also proven that compared with other color spaces such as HSV and YCbCr, the HSI color space is the most suitable for visible light image processing with the best processing effect [7].
Due to the reasons mentioned above, researchers have done much work on visible light image processing based on the HSI color space. A fast haze removal method based on the polarimetric imaging technique by combining the HSI color space and retinex theory was proposed in [8]. The method in this reference could recover the information data in an image with a fast process. In addition, the Gaussian function was utilized in [9] to fit the intensities of image color blocks based on the HSI color space and reconstruct the image by combining the chrominance information in the HSI color space and the intensity information in the fitting space. The algorithm in [9] possesses practical application value in the digital reconstruction of artworks. A deep convolutional neural network (CNN) model to enhance low-light sensor images based on the HSI color space model was proposed in [10], and the experimental results show that the proposed algorithm significantly enhanced the brightness and contrast of the image and avoided color distortion and over enhancement.
Furthermore, an entropy-based contrast enhancement method based on the HSI color space was proposed in [11]. The author processed the color saturation component while enhancing the image contrast, which made the processed image much smoother. However, since the images captured through a visible light camera are generally under the RGB color space model, the methods mentioned above first utilized the RGB-HSI color space conversion algorithm to realize color space conversion.
There are many algorithms for RGB-HSI color space conversion, among which the geometric derivation algorithm is the most classical and the most widely used RGB-HSI algorithm [12]. However, in the process of RGB-HSI conversion, the geometric derivation algorithm requires nonlinear calculations such as trigonometric and inverse trigonometric functions. These nonlinear calculations result in high algorithmic complexity and low conversion efficiency. For this reason, based on the geometric derivation algorithm, researchers have proposed a variety of improved RGB-HSI conversion algorithms. These include the coordinate transformation method, segmentation definition method, Bajon approximation algorithm, and standard module arithmetic method [13]. Among those algorithms, the geometric derivation algorithm achieves the highest resolution and the highest accuracy of reverse reduction [14]. In addition, researchers have realized relevant color space conversion algorithms based on the field programmable gate array (FPGA) hardware and carried out performance tests in practical application scenarios simultaneously [15], [16]. The RGB-HSI color space conversion based on FPGA hardware was realized in [17]. The experimental results showed that the reconstructed RGB image, obtained by color space conversion of RGB-HSI by utilizing FPGA hardware, was almost the same as the original image. It not only had the advantage of fast parallel data processing but also maintained a high conversion accuracy. However, the method proposed in [17] was not further optimized for the conversion between the RGB color space and the HSI color space. This resulted in a waste of logic resources such as slice registers and Look-Up Tables (LUTs), and LUTs can be regarded as one of the most important resources in FPGA hardware. In [7], based on the Swenson algorithm proposed in [18], the log-hybrid method was used to optimize the trigonometric function in the color space conversion from the HSI color space to the RGB color space, and the algorithm was realized on FPGA hardware. However, the algorithm proposed in [7] utilized digital signal processor (DSP) modules and did not optimize the color space conversion from the RGB color space to the HSI color space, leading to the large consumption of logic resources such as slice LUTs, which was proven by experiments.
According to the above, in the process of RGB-HSI color space conversion, nonlinear calculations frequently exist, such as trigonometric functions and inverse trigonometric functions. These complicated nonlinear calculations, if not optimized, will consume a large number of logic resources that are not abundant in FPGA hardware. To solve this problem, a new, easy-to-implement hardware method for RGB-HSI color space conversion named the simple RGB-HSI space conversion (S-SC) algorithm is proposed in this paper. By reconstructing the mapping relationship between the R, G, and B components in the RGB color space and the H , S, and I components in the HSI color space, the nonlinear calculation in the traditional color space conversion algorithm is avoided, which reduces the computational complexity and improves the conversion efficiency. On this basis, the effectiveness of the proposed algorithm is verified with simulation results.
The main contributions of this paper can be summarized as follows: • We propose an optimized RGB-HSI color conversion algorithm, called the S-SC algorithm, based on the geometric derivation algorithm. In the S-SC algorithm, complex nonlinear calculations, such as square, square root, cosine, and arc-cosine calculations, can be eliminated, which can reduce calculational complexity and improve the conversion efficiency.
• We study the conversion accuracy and computational complexity of the S-SC algorithm together with the geometric derivation algorithm for comparison.
• We also investigate the performance of the S-SC algorithm on the Lena image process together with five other RGB-HSI color space conversion algorithms for comparison.
• We present the implementation of the S-SC algorithm on the FPGA platform. Moreover, we compare the logic resource consumption of the S-SC algorithm with the algorithms proposed in [17] and [7]. VOLUME 8, 2020 The results indicate that the S-SC algorithm achieves good performance in terms of conversion accuracy, logical unit resource occupancy, and output timing.
The remainder of this paper is organized as follows: the RGB2HSI model and HSI2RGB model of the geometric derivation algorithm and the S-SC algorithm are studied in Section II. The conversion error analysis and computational complexity analysis are performed in Section III and Section IV, respectively. To evaluate the performance of the S-SC algorithm, the processing results of the S-SC algorithm and five other RGB-HSI color space conversion algorithms are presented in Section V. The hardware implementation performance of the S-SC algorithm is presented in Section VI. Finally, the paper is concluded in Section VII. The essential conversion from the RGB color space to the HSI color space (hereafter written as RGB2HSI) is the conversion from the unit cube of the Cartesian coordinate system in the RGB color space to a cylindrical polar coordinate-based bipyramid model [19]. The process of the RGB2HSI conversion can be decomposed into the following steps:

II. THE DERIVATION OF THE S-SC ALGORITHM
• Peel off the I component (Intensity) from the RGB color space.
• Reduce the three-dimensional RGB color space to a two-dimensional space.
• Based on the above two points, decompose the chroma into the H component (Hue) and S component (Saturation).
• Calculate the H component through the dot product formula of the vector. The models of the RGB color space and HSI color space are shown in Fig. 1. According to [7], the RGB2HSI conversion in the geometric derivation algorithm is written as: where H ∈ [0, 2π), S and I ∈ [0, 1), and θ is expressed as: According to (1)-(2), R, G, and B represent the red, green, and blue components in the normalized RGB color space, respectively. H , S, and I represent the hue, saturation, and intensity components in the HSI color space, respectively. It can be directly shown from (2) that inverse-trigonometric and square root calculations are required while calculating the parameter θ. The terms in the denominator of (2) can be rewritten as: Since the R, G, and B components are all 8-bit vectors, the range of J is in [0, 65025], and values of J are all integer type. In this case, since the enormous scope of the data would cause the consumption of many logic resources of the FPGA hardware, the lookup table method is truly hard to realize. In addition, when realizing square root calculations on FPGA hardware, it is difficult to use iterative methods to approximate the actual value [20], which leads to high time complexity for the whole system. The pseudocode of the RGB2HSI conversion of the geometric derivation algorithm is shown in Algorithm 1.  The sector where the H component is located determines the conversion from the HSI color space to the RGB color space (hereafter written as HSI2RGB). The process of the HSI2RGB conversion in the geometrically derived method can be separated into the following three conditions.
• In the case where H ∈ [0, 2π/3), the B component is the minimum of the original image pixel, and the formulas for the HSI2RGB conversion can be written as: is the minimum of the original image pixel, and the formulas for the HSI2RGB conversion can be written as: Let H = H −2π/3(5) can be rewritten as: is the minimum of the original image pixel, and the formulas for the HSI2RGB conversion can be written as: Let H = H −4π/3(7) can be rewritten as: Although the formulas for the HSI2RGB conversion, as shown in (4)- (8), are determined by the position of the H component, regardless of the sector in which the H component is located, the cosine term must be calculated. If the cosine term cannot be optimized, this part would cost a large amount of logic resources and cause many difficulties in the process of timing sequence optimization during FPGA implementation. The pseudocode of the HSI2RGB conversion of the geometric derivation algorithm is shown in Algorithm 2. and where (10) On this basis, the HSI2RGB inverse transformation formula in the geometric derivation algorithm is used to obtain the RGB2HSI transformation formula. The details are as follows. a) When H ∈ [0, 2π/3), the B component is the minimum of the original pixel. We know that R = I (1 + SH ) based on (4), and then (12) can be elicited.
The expressions of the S and I components in (1) can be rewritten as (13)- (14).
Similarly, the following two conditions can be derived as According to (18)- (20), the formulas of the S-SC algorithm in the RGB2HSI conversion can be rewritten as (21), and H is replaced by H H as the hue component of the image.
where w represents the minimum value among the R, G, and B components.
According to 2) in part A, the formulas for the HSI2RGB conversion are determined by the position of the H component. However, according to (6)- (8), utilizing H H to replace H as the hue component would cause the loss of sector information. In other words, with the H component changing in the range [0, 2π), the H component H would lose the sector information. In this case, the HSI2RGB conversion cannot be achieved directly, and a necessary consideration for this issue is to construct a model to preserve the sector information. If the number of sectors is equal to three, the sector in which the H component is located is decided by the minimum value among the R, G, and B components. The sector information can be preserved through two-bit binary number encoding as: By substituting (23) into (21), the formulas of the hue of the RGB2HSI conversion in the S-SC algorithm can be written as: As seen in (24), in this way, the nonlinear calculation steps during the RGB2HSI conversion of the geometric derivation algorithm, such as the inverse trigonometric function and squared root function, can be eliminated.

2) THE OPTIMIZATION OF THE I COMPONENT IN THE RGB2HSI CONVERSION
To avoid extra logic resource consumption under the condition of utilizing the divider IP core to calculate the constant fraction 1/3, in the S-SC algorithm, we utilize the approximation method to approach 1/3. Because the constant 4096 can be rewritten as 2 12 , the constant fraction 1/3 can be approximated by binary shift processing of the integer 1365. In this way, the approach can not only reduce the consumption of logical resources but also reduce the complexity of the timing sequence. The optimized calculation formula of the I component in the RGB2HSI conversion is shown as: According to (24)-(25), the rest of the optimized formulas of the RGB2HSI conversion can be rewritten as: The pseudocode of the RGB2HSI conversion in the S-SC algorithm is shown in Algorithm 3.

3) THE OPTIMIZATION OF THE HSI2RGB CONVERSION
According to part 2), the sector information of the H component can be preserved by introducing the encoding variable H flag On this basis, the optimized formulas of the HSI2RGB conversion in the S-SC algorithm are as follows.
• In the case where H flag equals 00, the input R component is the minimum, and the optimized formulas of the HSI2RGB conversion can be written as: • In the case where H flag equals 01, the input G component is the minimum, and the optimized formulas of the HSI2RGB conversion can be written as: • In the case where H flag equals 10, the input B component is the minimum, and the optimized formulas of the HSI2RGB conversion can be written as: It is known from (29)-(31) that the equations for the above three conditions are similar except for the equation of each component needing to be rescheduled according to the value of H flag . To be brief, (31) needs to be calculated regardless of the value of H flag .

III. THE ERROR ANALYSIS OF THE S-SC ALGORITHM
Based on Section II, MATLAB 2019a software is used to analyze the error of the S-SC algorithm and the geometric derivation algorithm for the RGB2HSI and HSI2RGB conversions, respectively, and the conversion accuracy is verified according to the experimental results.
The input data of the R, G, and B components are affected by the AD module inside the visible light camera. During the FPGA implementation of the S-SC algorithm, the real output data of the R, G, and B components are all integer data in the range [0x00, 0xFF]. In this case, the input original R, G, and B data of the S-SC algorithm are all 8-bit vectors. In other words, the input original R, G, and B data are all integers in the range [0, 255]. In this case, an experimental method is designed and utilized that makes the R, G, and B components traverse all possible input data cases in the range [0, 255] under the condition that satisfies the value of H flag .

A. THE ERROR ANALYSIS OF THE H COMPONENT 1) THE ANALYSIS OF THE H COMPONENT
• In the case where H ∈ [0, 2π/3), (32) can be derived by combining (1) and (18).
Sequentially, the error calculations in (32)-(34) can be calculated through MATLAB 2019a, and the results are shown in Fig. 2. For the supplementary explanation to Fig. 2, parts (a)

2) THE ANALYSIS OF THE I COMPONENT
According to (1) and (25), the error calculation formula of the I component in the RGB2HSI conversion can be written as: According to (35), the error value of the I component in the RGB2HSI conversion is inversely proportional to the sum of the values of the R, G, and B components. When the input data of the R, G, and B components are all equal to 255, the error of the component I is the minimum, which equals −0.0622. In this case, compared with the geometric derivation algorithm, the error of the I component of the S-SC algorithm in the RGB2HSI conversion is the maximum. When the input data of the R, G, and B components are all equal to 0, the error of the I component is the maximum, which equals 0. In this case, compared with the geometric derivation algorithm, the error of the I component of the S-SC algorithm in the RGB2HSI conversion is the minimum. The calculation result is shown in Fig. 3. In addition, since the calculation formulas of the S component do not differ between the S-SC algorithm and the geometric derivation algorithm and the S component is directly determined by the input data of the R, G, and B components, the error of the S component can be regarded as 0 during the color space conversion.

B. THE ERROR ANALYSIS OF EACH COMPONENT OF THE RECONSTRUCTED RGB IMAGE IN THE S-SC ALGORITHM
In the previous section, we analyze the error of the S-SC algorithm in the HSI2RGB conversion. In this section, we take the case of H ∈ [0, 2π/3) as an example, so that (36) can be derived from (4) and (30).   According to the above assertions, compared with the geometric derivation algorithm, the R, G, and B component error of the RGB image reconstructed by the S-SC algorithm are smaller. Combining the analyses in Section II part C) and this section, it can be proven that the S-SC algorithm achieves a high conversion accuracy and low complexity. In addition, due to high computational complexity and high resource consumption, brought the floating data operation in the FPGA hardware, it is necessary to convert the floating data into integer data when realizing the S-SC algorithm (software) in FPGA hardware [21], [22]. Therefore, from the perspective of FPGA implementation, the error of the R, G, and B components of the reconstructed RGB image can be regarded as integer values of 0. Briefly, the error of the three components of the reconstructed RGB image can be ignored as opposed to those of the geometric derivation algorithm.

IV. THE COMPUTATIONAL COMPLEXITY OF THE S-SC ALGORITHM
According to parts A and B of Section II, we obtain the RGB2HSI conversion equations of the geometric derivation algorithm and S-SC algorithm. As shown by pseudocodes 1-4, since the geometric derivation algorithm and the S-SC algorithm have the same number of iterations, we cannot judge their time complexity by the difference in iterations. In addition, because the S-SC algorithm is designed to be implemented on FPGA hardware, in this section, we analyze the time complexities of the two algorithms from the perspective of FPGA-based calculations by combining the traditional time complexity methods. In addition, considering the calculation characteristics of the RGB2HSI and HSI2RGB conversions, we decided to choose Taylor series expansions to expand the trigonometric function and inverse trigonometric function of the geometric derivation algorithm.

A. THE TIME COMPLEXITY ANALYSIS OF THE RGB2HSI CONVERSION
Assuming that the number of pixels in the input image is N , according to the pseudocode of the RGB2HSI conversion process of the S-SC algorithm shown in Algorithm 3, it can be seen that the conversion process of the S-SC algorithm mainly includes the following 4 parts.
• Separate the values of the R, G, and B components from each pixel (Algorithm 3 Step III).
• Calculate the minimum values of the separated R, G, and B components for each pixel (Algorithm 3 Step IV).
• Preserve the H component sector information (Algorithm 3 Step V). For the time complexity of the RGB2HSI conversion in the geometric derivation algorithm, according to the descriptions in parts A and B in Section II, the RGB2HSI conversion formulas are not different between the geometric derivation algorithm and S-SC algorithm except for the calculation of the H component. Therefore, as Algorithm 1 shows, the RGB2HSI conversion in the geometric derivation algorithm is similar to that of the S-SC algorithm, and it mainly includes the following three steps.
• Separate the values of the R, G, and B components from each pixel (Algorithm 1 Step III).
• Calculate the minimum values of the separated R, G, and B components for each pixel (Algorithm 1 Step IV). It can be seen from (1)-(2) that the conversion formula for calculating the H component in the geometric derivation algorithm includes the arccosine function. To calculate its time complexity, we use a Taylor series expansion to expand the inverse trigonometric function. In this part, we take case H ∈ [0, 2π/3) as an example to analyze the case at point 0. At this time, the three-term Taylor series expansion of the arccosine function can be expressed as: We can obtain (38) by incorporating (37) into (1).
Then, the time complexity of the geometric derivation algorithm for calculating the H component is O (7N ). For the calculation of the S component, its time complexity in the geometric derivation algorithm is O(3N), which differs from that of the S-SC algorithm. Therefore, the time complexity of step V of Algorithm 1 is O (7N + 3N + N ) = O(11N ). Therefore, the time complexity of the RGB2HSI conversion in the geometric derivation algorithm is O (3N + 4 N Compared with the geometric derivation algorithm, the time complexity of the RGB2HSI conversion in the S-SC algorithm is reduced by O(4N ), which is not a significant gap. This is because we use a three-term Taylor series expansion to expand the H component when calculating its time complexity in the RGB2HSI conversion of the geometric derivation algorithm. In summary, the more Taylor series expansion items of the H component that are in the geometric derivation algorithm, the higher the time complexity, and the more prominent the advantage of the S-SC algorithm.

B. THE TIME COMPLEXITY ANALYSIS OF THE HSI2RGB CONVERSION
Similarly, we assume that the number of pixels in the input image is N . According to the pseudocode of the HSI2RGB conversion in the S-SC algorithm shown in Algorithm 4, it can be seen that the HSI2RGB conversion of the S-SC algorithm mainly includes the following two steps: • Calculate the values of the R R , G , G and B components of each reconstructed pixel (Algorithm 4 Step III).
• Integrate the reconstructed R R , G , G and B components into a reconstructed RGB image (Algorithm 4 Step IV). For the time complexity of the HSI2RGB conversion in the geometric derivation algorithm, we also take H ∈ [0, 2π /3) as an example. According to Algorithm 2, the HSI2RGB conversion of the geometric derivation algorithm mainly contains the following two steps.
• Calculate the values of the reconstructed R, G, and B components of each pixel (Algorithm 2 step III).
• Integrate the reconstructed R, G, and B components into a reconstructed RGB image (Algorithm 2 Step IV). For the above two steps, the time complexities of step IV and the calculation of the reconstructed G component in step III are the same as those in the S-SC algorithm, which equal O(3N ) and O(N ), respectively.
It can be seen from (4) that the HSI2RGB conversion of the geometric derivation algorithm contains the trigonometric function in case H ∈ [0, 2π/3). To calculate the time complexity, we also use a Taylor series expansion to expand (4), and (4) can be rewritten in a three-term Taylor series expansion form as: where Y 1 and Y 2 can be expressed as: Then, the time complexity of the geometric derivation algorithm for calculating the reconstructed R component is O (6N ). For the calculation of the reconstructed B component, its time complexity in the geometric derivation algorithm is O(2N), which differs from that of the S-SC algorithm. In the HSI2RGB conversion of the geometric derivation algorithm, the time complexity of step III is O (6N + N + 2N ) = O(9N ). Compared with the geometric derivation algorithm, the time complexity of the HSI2RGB conversion in the S-SC algorithm is reduced by O (4N ), which is not a significant gap. This is also because we use a three-term Taylor series expansion to expand the trigonometric function when calculating its time complexity in the HSI2RGB conversion of the geometric derivation algorithm. In conclusion, the more Taylor series expansion terms of the trigonometric function that are in the algorithm, the higher the time complexity, and the more prominent the advantage of the S-SC algorithm.

V. SIMULATION EFFECTS OF THE S-SC ALGORITHM
In this section, we use MATLAB 2019a with an AMD RYZEN 3970X and 64G memory to verify the effectiveness of the S-SC algorithm by comparing it with five classical RGB-HSI color space conversion algorithms, namely, the geometric derivation algorithm, the coordinate transformation method, the segment definition method, the Bajon approximation algorithm, and the standard module arithmetic method.

A. THE COMPARISON OF CONVERSION PERFORMANCES
The Lena image is one of the most commonly used images in digital image processing because it possesses high recognition and pronounced features. Therefore, in this section, we utilize the Lena image with 512 × 512 resolution as the original RGB image for the performance verification of the S-SC algorithm. First, the above six RGB-HSI conversion algorithms are utilized to convert the RGB Lena image into the HSI image through RGB2HSI conversion. Fig. 7 shows the HSI image and the images of the corresponding H , S, and I components.
According to Fig. 7, in the images of the H components, the conversion result from the S-SC algorithm differs from those of the other RGB-HSI conversion algorithms, and the conversion results obtained by the other five algorithms are relatively close. The reason for the above issue is that (11) is utilized as the H component for the hue information in the S-SC algorithm.
In the images of the S components, the result obtained by the S-SC algorithm is close to those obtained by the geometric derivation algorithm and the Bajon approximation algorithm but far from those obtained by the coordinate transformation method, the segment definition method, and the standard module arithmetic method. In terms of the I components, except for the coordinate transformation method, the conversion results of the S-SC algorithm are close to those of the other four algorithms.
Although these differences can be seen directly by the human eye, they do not clearly describe the specific differences between the aforementioned six algorithms. In this case, the reconstructed RGB Lena image and the images of its corresponding R, G, and B components are obtained by the HSI2RGB conversion based on the HSI images obtained by the six RGB-HSI conversion algorithms in Fig. 7. Further, the VOLUME 8, 2020 images of the reconstructed RGB and its corresponding components are compared with the images of the original Lena image and its corresponding components, and the results are shown in Fig. 8.
According to Fig. 8, the reconstructed Lena images generated by the S-SC algorithm and the other five RGB-HSI conversion algorithms, and the original Lena image are evaluated subjectively. The reconstructed Lena images generated by the S-SC algorithm and the geometric derivation algorithm are most similar to the original image. In contrast, there are obvious differences between the original image and those generated by the other four algorithms.
To further verify the performance of the S-SC algorithm, based on a subjective evaluation, two commonly used objective evaluation indexes, the peak signal-to-noise ratio (PSNR) and structural similarity (SSIM) [23], [24], are utilized. Fig. 9 shows the PSNR values of the six RGB-HSI algorithms. The higher the PSNR value is, the less noise the image contains. According to Fig. 9, we can see that among the six RGB-HSI conversion algorithms, the PSNR value of the S-SC algorithm is the largest, equaling 369.4775, and it is slightly larger than that of the geometric derivation algorithm and much larger than that of the other four RGB-HSI conversion algorithms. Briefly, the experimental results show that the reconstructed RGB image of the S-SC algorithm possesses the lowest noise and is the most similar to the original image. Fig. 10 shows the SSIM values of the six RGB-HSI conversion algorithms. The SSIM is an index to measure the similarity of two images and an all-reference image quality evaluation index. It measures the similarity of images in terms of brightness, contrast, and structure. The value range of SSIM is between 0 and 1, and if the value is 1, it means the two images are the same. The higher the value of SSIM is, the higher the similarity and the lower the distortion of the image, which means that the evaluated image is closer to the original image. It can be seen from Fig. 10 that the SSIM value of the S-SC algorithm equals 1, which is the same as that of the geometric derivation algorithm, and slightly larger than those of the other four algorithms. The experimental results indicate that the structure of the reconstructed RGB Lena image of the S-SC algorithm is almost the same as the structure of the original image, and the degree of distortion is almost equal to 0. In conclusion, according to Fig. 7 to Fig. 10, the results show that the S-SC algorithm possesses a high performance in HSI-RGB conversion. The RGB image reconstructed by the S-SC algorithm is the most similar to the original RGB image. Since the trigonometric function and inverse trigonometric function parts are designed to be optimized, the image of the H component generated by the S-SC algorithm is different from those of all other algorithms.

B. THE COMPARISON OF COMPUTATIONAL COMPLEXITIES
Based on the comparisons with and verification of the conversion performance of the S-SC algorithm in the previous section, in this section, we simulate and verify the computational complexity of the S-SC algorithm. For the above six algorithms for processing the Lena graph, the running times are shown in Tables 1-3.  It can be seen in Table 1 that in the RGB2HSI conversion, except for the coordinate conversion method, the time consumption of the S-SC algorithm is the lowest. As Table 3 shows, the total time consumption of the coordinate transformation method is lower than that of the S-SC algorithm in the RGB2HSI and HSI2RGB conversions. However, it can be seen from Fig. 9 and Fig. 10 that although the coordinate transformation method requires less time, the PSNR and SSIM values of the coordinate transformation method are the lowest among the six RGB-HSI conversion algorithms, which means that the coordinate transformation method achieves the worst restoration effect compared to those of other RGB-HSI algorithms.
Furthermore, it can be seen in Table 2 that in the HSI2RGB conversion, the time consumption of the S-SC algorithm is the lowest. This is because the S-SC algorithm uses (11) as the hue information of the image. This makes it unnecessary to perform nonlinear calculations such as the cosine function in the HSI2RGB conversion, and only linear calculations are required, thereby reducing the running time of the S-SC algorithm.
Through combining the analysis mentioned in Section IV and in this section, it can be proven that compared with the geometric derivation algorithm, the S-SC algorithm has lower time complexity in both the RGB2HSI and HSI2RGB conversions. Compared with other traditional RGB-HSI conversion algorithms, the S-SC algorithm possesses the advantages of a high restoration degree and low operation time consumption.

VI. THE FPGA IMPLEMENTATION AND PERFORMANCE ANALYSIS OF THE S-SC ALGORITHM
After verifying the performance of the S-SC on the software platform, in this section, the XC7A100T-2fgg484 development board of the Artix-7 series produced by the Xilinx company is utilized as the hardware platform for the verification of the S-SC algorithm. First, the hardware logic timing sequence and hardware conversion effect of the S-SC algorithm are simulated and verified based on the Integrated Software Environment 14.7 (ISE 14.7) software. The logic resource consumption of the S-SC algorithm in the FPGA implementation is analyzed by comparing it with the algorithms proposed by [7] and [17]. Second, the reconstructed RGB images generated by the S-SC algorithm (FPGA) and S-SC algorithm (software) are compared and analyzed.

A. THE FPGA IMPLEMENTATION AND RESOURCE CONSUMPTION OF THE S-SC ALGORITHM IN THE RGB2HSI CONVERSION
To ensure the strict consistency of the timing sequence, it is necessary to delay the earlier output signals during the FPGA implementation. The RGB2HSI conversion structure of the S-SC algorithm is shown in Fig. 11. As Fig. 11 shows, it is necessary to delay the signals of the H and S components to ensure that Hcomp, Scomp, and Icomp can be output in a strict timing sequence. According to the logic timing sequence simulation of signals in Fig. 12, there indeed exist 39 clock delays between the input data Rin, Gin, and Bin and the output data Hcomp, Scomp, and Icomp, which proves the correctness of the structure in Fig. 11.
For the FPGA implementation of the RGB2HSI conversion in the S-SC algorithm, the amounts of logic resources consumed based on the Artix7-100t board are shown in Table 4. As Table 4 shows, the S-SC algorithm consumes few logic resources in the RGB2HSI conversion. The number of consumed LUTs is 1.74% of all available LUTs, and the number of consumed registers is 1.65% of all available registers.

B. THE FPGA IMPLEMENTATION AND RESOURCE CONSUMPTION OF THE S-SC ALGORITHM IN THE HSI2RGB CONVERSION
For the FPGA implementation of the HSI2RGB conversion in the S-SC algorithm, the designed structure of the HSI2RGB conversion is shown in Fig. 13, and the timing sequence simulation of the HSI2RGB conversion is shown in Fig. 14.
As Fig. 14 shows, there exist seven clock delays between the input data Hcomp, Scomp, and Icomp and the output data Rout, Gout, and Bout. According to the simulation result in Fig. 14, the delay between the input data and the output data is 140 ns, and the S-SC algorithm for the HSI2RGB conversion is proven in real-time.
For the FPGA implementation of the HSI2RGB conversion in the S-SC algorithm, the amounts of logic resources consumed are shown in Table 5. As Table 5 shows, the HSI2RGB conversion of the S-SC algorithm consumes few logic resources. Through combining Table 5 with Table 4, it is shown that we have approximately 62000 LUTs and 124400 registers to achieve the subsequent RGB image procession based on the HSI color space, which may contain complex processing modules such as multiple DSP modules and IP cores. Therefore, we can perform the whole image processing algorithm with one board instead of two, and we can also reduce the cost and raise the stability of signals.

C. THE ANALYSIS OF LOGIC RESOURCE COMSUMPTION IN THE RGB2HSI CONVERSION AND THE HSI2RGB CONVERSION
Based on the above sections, in this part, through the comparison of the experimental results of the algorithms proposed in [17] and [7], we analyze the amounts of logic resources consumed by the S-SC algorithm.   Further, we analyze the S-SC algorithm's realizability and efficiency, and Tables 6 and 7 show the comparisons.
According to Tables 6 and 7, the consumed slice LUTs in the algorithms proposed in [7] and [17] are significantly more than those in the S-SC algorithm regardless of the RGB2HSI conversion or the HSI2RGB conversion. In addition, the algorithm proposed in [7] utilizes the DSP modules, which leads to the high consumption of Slice LUTs. The details are shown in Table 8. According to Tables 6 to 8, although the S-SC algorithm has slightly higher consumption of register and flip-flop resources, the consumption of Slice LUTs is significantly lower than that in algorithms proposed in [7] and [17]. The reason for the S-SC algorithm has a slightly higher consumption of register, and flip-flop resources can be split into the following two points.
On the one hand, a slightly higher cost of register resources is needed to ensure the strict timing sequence of the whole system. On the other hand, from the perspective of the parallel data stream and the sufficient register resources of the FPGA hardware itself, a certain cost of flip-flop resources can help the entire line of three-channel RGB image data be output in a strict timing sequence after being cached in the First Input First Output (FIFO). In this case, not only can the timing sequence of the R, G, and B component data be ensured, but the complexity of the whole system can also be decreased.
In conclusion, compared with the algorithms proposed in [7] and [17], the S-SC algorithm consumes many fewer LUTs with the cost of slightly more register and flip-flop resources. In this way, the S-SC algorithm can leave many more logic resources for the subsequent image processing algorithm than the other two algorithms proposed in [7] and [17] can if the types of FPGA boards are all the same. Furthermore, the whole image processing approach based on the S-SC algorithm can be achieved with one FPGA board instead of two, and it can help improve the stability of signals while the whole system runs.

D. THE COMPARISON AND ANALYSIS OF THE RECONSTRUCTED RGB IIMAGE EFFECT OF THE S-SC ALGORITHM BASED ON SOFTWARE AND FPGA HARDWARE
Based on the above analyses, the effects of the reconstructed RGB Lena image generated by the S-SC algorithm (software) and S-SC algorithm (FPGA) are compared and analyzed in this section. The reconstructed RGB Lena images are shown in Fig. 15. The reconstructed RGB images generated by the S-SC algorithm (software) and the S-SC algorithm (FPGA) are evaluated and analyzed objectively, and the evaluation results are shown in Table 9. Combining Table 9 with Fig. 9 and Fig. 10, the SSIM index of the reconstructed RGB image generated by the S-SC algorithm (FPGA) possesses the same value as that generated by the S-SC algorithm (software). In addition, compared with Fig. 9 and Fig. 10 in Section IV, it can be found that the reconstructed RGB image generated by the S-SC algorithm (FPGA) not only obtains a higher value of the PSNR index than those generated by four RGB-HSI conversion algorithms, including the coordinate transformation method, the segmentation definition method, the Bajon approximation algorithm, and the standard module arithmetic method, but it also achieves a higher value of the SSIM index.
In summary, at the cost of a certain degree of register and flip-flop resource usage, the S-SC algorithm (FPGA) consumes significantly fewer slice LUTs resources than the algorithms proposed in [7] and [17]. In this case, it can be said that the S-SC algorithm (FPGA) provides sufficient logic resources for the follow-up works of FPGA-based hardware image processing. On the other hand, the reconstructed RGB image generated by the S-SC algorithm (FPGA) achieves a better effect than the above four RGB-HSI conversion algorithms, including the coordinate transformation method, the segmentation definition method, the Bajon approximation algorithm, and the standard module arithmetic method, which are achieved based on the software platform.

VII. CONCLUSION
In this paper, an FPGA-based simple RGB-HSI space conversion algorithm, named the S-SC algorithm, is proposed. The S-SC algorithm aims to solve the problems of high computational complexity and great difficulty in FPGA hardware implementation caused by nonlinear calculations in the geometric derivation algorithm, such as trigonometric and inverse trigonometric functions. The S-SC algorithm utilizes the inverse transformation process of the geometric derivation algorithm to reconstruct the mapping relationship between the R, G, and B components in the RGB color space and the H , S, and I components in the HSI color space. Based on ensuring the conversion accuracy, the complexity of the algorithm is effectively reduced, and the hardware realizability of the S-SC algorithm is improved. First, on this basis, the S-SC algorithm's conversion accuracy is verified by comparing the error with that of the geometric derivation algorithm. Second, the S-SC algorithm's performance is verified by comparing it with those of five commonly used RGB-HSI space conversion algorithms, such as the geometric derivation algorithm and the coordinate transformation method. Third, the hardware realizability of the S-SC algorithm is verified by comparing it with those of the algorithms proposed in [7] and [17].
The experimental results show that the S-SC algorithm not only possesses high conversion accuracy but it can also significantly decrease the consumption of slice LUTs at the cost of a few more register and flip-flop resources, and it can provide sufficient logic resources for subsequent research based on FPGA hardware.