원시데이터 수집 시스템
선정목록으로

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

관련 필름·전자재료 · (15) 디스플레이 패널재료

기본 정보

저자
  1. Shuaiqing Zhi — College of Information and Communication Engineering, Hainan University, Haikou, China
  2. Yani Cui — College of Information and Communication Engineering, Hainan University, Haikou, China
  3. Jiaxian Deng — College of Information and Communication Engineering, Hainan University, Haikou, China
  4. Wencai Du — Institute of Data Science, City University of Macau, Taipa, China
DOI
10.1109/access.2020.3026189
저널
IEEE Access
발행년도
2020
발행기관
Institute of Electrical and Electronics Engineers
피인용수
12
라이선스
cc-by
논문 유형
–
언어
–
원문 페이지
https://doi.org/10.1109/access.2020.3026189
토픽
Color Science and Applications
OpenAlex ID
W3089049085

평가 내용

관련도
관련
사업분야
필름·전자재료 · (15) 디스플레이 패널재료
부 분야
–
R&D 측면
–
확신도
–
근거 용어
–
판단 근거
임베딩 유사도 기반 평가로 '필름·전자재료 > 디스플레이 패널재료' 분야에 선정된 논문입니다.
R&D 활용 포인트
–
평가 입력
–

초록

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.

본문 73,647자

본문 펼치기
Received September 9, 2020, accepted September 19, 2020, date of publication September 23, 2020, date of current version October 2, 2020. _Digital Object Identifier 10.1109/ACCESS.2020.3026189_ # An FPGA-Based Simple RGB-HSI Space Conversion Algorithm for Hardware Image Processing SHUAIQING ZHI 1, YANI CUI1, JIAXIAN DENG1, AND WENCAI DU2 1College of Information and Communication Engineering, Hainan University, Haikou 570228, China 2Institute of Data Science, City University of Macau, Taipa 999078, China Corresponding author: Yani Cui (cyn0213@163.com) This work was supported in part by the Hainan Provincial Key Research and Development Plan under Grant ZDYF2019014, in part by the National Natural Science Foundation of China and Macau Science and Technology Development Joint Fund under Grant 61961160706 and Grant 0066/2019/AFJ, in part by the Hainan Association for Science and Technology Plans to Youth Research and Development Innovation under Grant QCXM201912, and in part by the Program of and the Scientific Research Foundation of Hainan University under Grant KYQD(ZR)1859. ABSTRACT 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. INDEX TERMS RGB-HSI space conversion, FPGA implementation, low computational complexity, low logic resource consumption. 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]. 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. II. THE DERIVATION OF THE S-SC ALGORITHM _A._ _THE RGB-HSI CONVERSION OF THE GEOMETRIC_ _DERIVATION ALGORITHM_ 1) THE CONVERSION FROM THE RGB COLOR SPACE TO THE HSI COLOR SPACE 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: - 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: _I_ = <sup>_<u>R</u>_</sup> <sup>+</sup> <sup>_<u>G</u>_</sup> <sup>+</sup> <sup>_<u>B</u>_</sup>   3 _S_ = 1 − <sup><u>3 min</u></sup> <sup>_<u>(R, G, B)</u>_</sup> (1) _H_ =  - _θ_ ( _G_ ≥ _B_ ) 2 _π_ - _θ_ ( _G < B_ ) _R_ + _G_ + _B_ where _H_ ∈ [0 _,_ 2 _π_ ), _S_ and _I_ ∈ [0 _,_ 1), and _θ_ is expressed as: _θ_ = arccos - _<u>(R</u>_ - _<u>G) (R</u>_ - _<u>B)</u>_ 2 ~~<u>�</u>~~ _(R_ - _G)_ <sup>2</sup> + _(R_ - _B) (G_ - _B)_ (2) FIGURE 1. The models of the RGB color space and the HSI color space. and square root calculations are required while calculating the parameter _θ_ . The terms in the denominator of (2) can be rewritten as: _J_ = _(R_ - _G)_ <sup>2</sup> + _(R_ - _B) (G_ - _B)_ (3) 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. Algorithm 1 The RGB2HSI Conversion of the Geometric <u>Derivation Algorithm</u> I: Calculate number of pixels _N_ of the input RAW RGB Image Format. II: for _i_ = 0 to _i < N_ do III: Separate the _R_ ( _i_ ), _G_ ( _i_ ), and _B_ ( _i_ ) components from an input RGB image. IV: Search for the minimum value in the _R_ ( _i_ ), _G_ ( _i_ ), and _B_ ( _i_ ) components. V: Calculate the _H_ ( _i_ ), _S_ ( _i_ ), and _I_ ( _i_ ) components according to (1)-(2). VI: end for <u>Output: The</u> _<u>H</u>_ <u>,</u> _<u>R</u>_ <sup>′</sup> _<u>S</u>_ <u>,</u> _<u>G</u>_ <sup>′</sup> <u>and</u> _<u>I</u>_ <u>components.</u> 2) THE CONVERSION FROM THE HSI COLOR SPACE TO THE RGB COLOR SPACE 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 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 for the HSI2RGB conversion can be written as:   _B_ = _I (_ 1 − _S)_ _R_ = _I_ - _<u>S</u>_ <u>cos</u> _<u>H</u>_ 1 + cos _(π/_ 3 − _H_ _)_ (4)  _G_ = 3 _I_ - _(B_ + _R)_ - In the case where _H_ ∈ [2 _π_ /3 _,_ 4 _π_ /3), the _R_ component is the minimum of the original image pixel, and the formulas for the HSI2RGB conversion can be written as:    _R_ = _I (_ 1 − _S)_ (5) (6) Algorithm 2 The HSI2RGB Conversion of the Geometric <u>Derivation Algorithm</u> I: Input number of pixels _N_ and the _H_, _R_ <sup>′</sup> _S_, _G_ <sup>′</sup> and _I_ components. II: for _i_ = 0 to _i < N_ do III: Calculate the _R_ ( _i_ ), _G_ ( _i_ ), and _B_ ( _i_ ) components according to (4)-(8). IV: Integrate the _R_ ( _i_ ), _G_ ( _i_ ), and _B_ ( _i_ ) components into pixels value RGB( _i_ ). V: end for <u>Output: The recovered RGB image.</u> two expressions must be calculated regardless of the position of the _H_ component: _I (_ 1 − _S)_ (9) and _I_ _G_ = _I_ �1 + <sup>_<u>S</u>_</sup> <sup><u>cos</u></sup> <sup>_<u>(H</u>_</sup> <sup>−</sup> <sup><u>2</u></sup> <sup>_π/_</sup> <sup><u>3</u></sup> <sup>_<u>)</u>_</sup> cos _(π_ - _H_ _)_ _B_ = 3 _I_ - _(R_ + _G)_ Let _H_ = _H_ −2 _π/_ 3(5) can be rewritten as:    _R_ = _I (_ 1 − _S)_ _G_ = _I_ - _<u>S</u>_ <u>cos</u> _<u>(H</u>_ _<u>)</u>_ 1 + cos _(π/_ 3 − _H_ _)_ - _<u>S</u>_ <u>cos</u> _<u>H</u>_ 1 + cos _(π/_ 3 − _H_ _)_ (10) _B_ = 3 _I_ - _(R_ + _G)_ - In the case where _H_ ∈ [4 _π_ /3 _,_ 2 _π_ ), the _G_ component is the minimum of the original image pixel, and the formulas for the HSI2RGB conversion can be written as:    _G_ = _I (_ 1 − _S)_ (7) (8) where (10) is the only one that is affected by the _H_ component. In this case, the inverse transformation can be achieved if the term cos( _H_ ) _/_ cos( _π/_ 3− _H_ ) and the position of the _H_ component are known. To facilitate the FPGA hardware implementation, reduce the computational complexity and improve the efficiency of the algorithm, the expression cos( _H_ ) _/_ cos( _π/_ 3− _H_ ) is regarded as the whole integral component used to replace the hue information of the image rather than directly utilizing (1) to calculate the _H_ component through the RGB2HSI conversion. Briefly, the _H_ component in the geometric derivation algorithm is replaced by: _H_ <sup>′</sup> = <u>cos</u> _<u>H</u>_ (11) cos _(π/_ 3 − _H_ _)_ 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_ <sup>′</sup> ) based on (4), and then (12) can be elicited. _H_ <sup>′</sup> = <sup>_<u>R</u>_</sup> <sup>−</sup> <sup>_<u>I</u>_</sup> (12) _IS_ The expressions of the _S_ and _I_ components in (1) can be rewritten as (13)-(14). <u>3</u> _S_ = 1 − _R_ + _G_ + _B_ <sup>min</sup> <sup>_(R, G, B)_</sup> <sup>=</sup> <sup>_<u>R</u>_</sup> _R_ <sup>+</sup> + <sup>_<u>G</u>_</sup> _G_ <sup>−</sup> + <sup><u>2</u></sup> _B_ <sup>_<u>B</u>_</sup> (13) 3 _I_ = _R_ + _G_ + _B_ (14) We can obtain (15) by substituting (14) into (13). _S_ = <sup>_<u>R</u>_</sup> <sup>+</sup> <sup>_<u>G</u>_</sup> <sup>−</sup> <sup><u>2</u></sup> <sup>_<u>B</u>_</sup> (15) 3 _I_ _B_ = _I_ �1 + <sup>_<u>S</u>_</sup> <sup><u>cos</u></sup> <sup>_<u>(H</u>_</sup> <sup>−</sup> <sup><u>4</u></sup> <sup>_π/_</sup> <sup><u>3</u></sup> <sup>_<u>)</u>_</sup> cos _(_ 5 _π/_ 3 − _H_ _)_ _R_ = 3 _I_ - _(G_ + _B)_ Let _H_ = _H_ −4 _π/_ 3(7) can be rewritten as:   _G_ = _I (_ 1 − _S)_ _B_ = _I_ - _<u>S</u>_ <u>cos</u> _<u>(H</u>_ _<u>)</u>_ 1 + cos _(π/_ 3 − _H_ _)_  _R_ = 3 _I_ - _(G_ + _B)_ 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. _B._ _THE OPTIMIZATION OF THE RGB-HSI COLOR SPACE_ _CONVERSION IN THE S-SC ALGORITHM_ 1) THE OPTIMIZATION OF THE H COMPONENT IN RGB2HSI CONVERSION According to part A, the position of the _H_ component determines the HSI2RGB conversion formulas. The _H_ component is located in the sectors [0 _,_ 2 _π_ /3), [2 _π/_ 3 _,_ 4 _π/_ 3) and [4 _π_ /3 _,_ 2 _π_ ). Further, all the formulas listed in (4)-(8) are similar except for changes in form. In brief, the following Then, (15) can be rewritten as: 3 _IS_ = _R_ + _G_ - 2 _B_ (16) and (17) can be derived based on (14). 3 _(R_ - _I_ _)_ = 2 _R_ - _G_ - _B_ (17) Then, (18) can be derived by substituting (16)-(17) into (12). By substituting (23) into (21), the formulas of the hue of the RGB2HSI conversion in the S-SC algorithm can be written as: <u>2</u> _<u>G</u>_ - _<u>B</u>_ - _<u>R</u>_ _Hflag_ = 00 _G_ + _B_ - 2 _R_ <u>2</u> _<u>B</u>_ - _<u>R</u>_ - _<u>G</u>_ _Hflag_ = 01 _B_ + _R_ - 2 _G_ <u>2</u> _<u>R</u>_ - _<u>G</u>_ - _<u>B</u>_ _Hflag_ = 10 _R_ + _G_ - 2 _B_ _H_ <sup>′</sup> =    (24) <sup>−</sup> <sup>_<u>I</u>_</sup> = <sup><u>2</u></sup> <sup>_<u>R</u>_</sup> <sup>−</sup> <sup>_<u>G</u>_</sup> <sup>−</sup> <sup>_<u>B</u>_</sup> _IS_ _R_ + _G_ - 2 _B_ _H_ <sup>′</sup> = <sup>_<u>R</u>_</sup> <sup>−</sup> <sup>_<u>I</u>_</sup> <sup><u>2</u></sup> <sup>_<u>R</u>_</sup> <sup>−</sup> <sup>_<u>G</u>_</sup> <sup>−</sup> <sup>_<u>B</u>_</sup> (18) _R_ + _G_ - 2 _B_ Similarly, the following two conditions can be derived as well. b) When _H_ ∈ [2 _π_ /3 _,_ 4 _π_ /3), the _R_ component is the mini mum of the original image pixel. _H_ <sup>′</sup> = <sup><u>2</u></sup> <sup>_<u>G</u>_</sup> <sup>−</sup> <sup>_<u>B</u>_</sup> <sup>−</sup> <sup>_<u>R</u>_</sup> (19) _G_ + _B_ - 2 _R_ c) When _H_ ∈ [ 4 _π_ /3 _,_ 2 _π_ ), the _G_ component is the minimum of the original image pixel. _H_ <sup>′</sup> = <sup><u>2</u></sup> <sup>_<u>B</u>_</sup> <sup>−</sup> <sup>_<u>R</u>_</sup> <sup>−</sup> <sup>_<u>G</u>_</sup> (20) _R_ + _B_ - 2 _G_ 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_ <sup>′</sup> _H_ <sup>′</sup> as the hue component of the image. <u>2</u> _<u>G</u>_ - _<u>B</u>_ - _<u>R</u>_ _w_ = _R_ _G_ + _B_ - 2 _R_ <u>2</u> _<u>B</u>_ - _<u>R</u>_ - _<u>G</u>_ _w_ = _G_ _B_ + _R_ - 2 _G_ <u>2</u> _<u>R</u>_ - _<u>G</u>_ - _<u>B</u>_ _w_ = _B_ _R_ + _G_ - 2 _B_ _H_ <sup>′</sup> =    (21) 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 <sup>12</sup>, 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: _I_ <sup>′</sup> = <sup><u>1365</u></sup> 4096 <sup>_(R_</sup> <sup>+</sup> <sup>_G_</sup> <sup>+</sup> <sup>_B)_</sup> (25) According to (24)-(25), the rest of the optimized formulas of the RGB2HSI conversion can be rewritten as: <u>2</u> _<u>G</u>_ - _<u>B</u>_ - _<u>R</u>_ _Hflag_ = 00 _G_ + _B_ - 2 _R_ <u>2</u> _<u>B</u>_ - _<u>R</u>_ - _<u>G</u>_ _Hflag_ = 01 _B_ + _R_ - 2 _G_ <u>2</u> _<u>R</u>_ - _<u>G</u>_ - _<u>B</u>_ _Hflag_ = 10 _R_ + _G_ - 2 _B_ _<u>G</u>_ + _<u>B</u>_ - <u>2</u> _<u>R</u>_ _Hflag_ = 00 _R_ + _G_ + _B_ _<u>R</u>_ + _<u>B</u>_ - <u>2</u> _<u>G</u>_ _Hflag_ = 01 _R_ + _G_ + _B_ _<u>R</u>_ + _<u>G</u>_ - <u>2</u> _<u>B</u>_ _Hflag_ = 10 _R_ + _G_ + _B_ where _w_ represents the minimum value among the _R_, _G_, and _B_ components. _w_ = min _(R, G, B)_ (22) 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_ <sup>′</sup> _H_ <sup>′</sup> 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_ <sup>′</sup> component _H_ <sup>′</sup> 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: _H_ <sup>′</sup> = _S_ <sup>′</sup> =       (26) (27) 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 _Hflag_ On this basis, the optimized formulas of the HSI2RGB conversion in the S-SC algorithm are as follows. - In the case where _Hflag_ equals 00, the input _R_ component is the minimum, and the optimized formulas of the _Hflag_ =  00 _w_ = _R_  01 _w_ = _G_ 10 _w_ = _B_ (23) Algorithm 3 The RGB2HSI Conversion of the S-SC <u>Algorithm</u> I: Calculate number of pixels _N_ of the input RAW RGB Image Format. II: for _i_ = 0 to _i < N_ do III: Separate the _R_ ( _i_ ), _G_ ( _i_ ), and _B_ ( _i_ ) components from an input RGB image. IV: Search for the minimum value _w_ ( _i_ ) in the _R_ ( _i_ ), _G_ ( _i_ ), and _B_ ( _i_ ) components. V: Decide the value of _Hflag_ ( _i_ ) by _w_ ( _i_ ). VI: Calculate the _H_ <sup>′</sup> ( _i_ ), _S_ <sup>′</sup> ( _i_ ), and _I_ <sup>′</sup> ( _i_ ) components according to (25)-(27). VII: end for Output: _H_ _flag_ and the _H_ <sup>_′_</sup> _, R_ <sup>′</sup> _S_ <sup>_′_</sup>, _G_ <sup>′</sup> and _I_ <sup>_′_</sup> components. HSI2RGB conversion can be written as: _R_ <sup>′</sup> = _I_ <sup>′ �</sup> _G_ <sup>′</sup> = _I_ <sup>′ �</sup>   1 + _S_ <sup>′</sup> _H_ <sup>′�</sup> 1 − _S_ <sup>′�</sup>  _B_ <sup>′</sup> = 3 _I_ <sup>′</sup> _S_ <sup>′</sup> _H_ <sup>′�</sup> (28) - _R_ <sup>′</sup> + _G_ <sup>′�</sup> - In the case where _Hflag_ equals 01, the input _G_ component is the minimum, and the optimized formulas of the HSI2RGB conversion can be written as: _G_ <sup>′</sup> = _I_ <sup>′ �</sup> _B_ <sup>′</sup> = _I_ <sup>′ �</sup>   1 + _S_ <sup>′</sup> _H_ <sup>′�</sup> 1 − _S_ <sup>′�</sup>  _R_ <sup>′</sup> = 3 _I_ <sup>′</sup> _S_ <sup>′</sup> _H_ <sup>′�</sup> (29) - _G_ <sup>′</sup> + _B_ <sup>′�</sup> - In the case where _Hflag_ equals 10, the input _B_ component is the minimum, and the optimized formulas of the HSI2RGB conversion can be written as: _B_ <sup>′</sup> = _I_ <sup>′ �</sup> _R_ <sup>′</sup> = _I_ <sup>′ �</sup>   1 + _S_ <sup>′</sup> _H_ <sup>′�</sup> 1 − _S_ <sup>′�</sup> Algorithm 4 The HSI2RGB Conversion of the S-SC Algo<u>rithm</u> I: Input number of pixels _N_, _H_ _flag_, and the _H_ <sup>_′_</sup> _, R_ <sup>′</sup> _S_ <sup>_′_</sup>, _G_ <sup>′</sup> and _I_ <sup>_′_</sup> components. II: for _i_ = 0 to _i < N_ do III: Calculate the _R_ <sup>′</sup> ( _i_ ), _G_ <sup>′</sup> ( _i_ ), and _B_ <sup>′</sup> ( _i_ ) components according the value of _Hflag_ ( _i_ ) as given by (31). IV: Integrate the _R_ <sup>′</sup> ( _i_ ), _G_ <sup>′</sup> ( _i_ ), and _B_ <sup>′</sup> ( _i_ ) components into pixels value RGB( _i_ ). V: end for <u>Output: The recovered RGB image.</u> 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 _Hflag_ . _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). _�H_ = _H_ <sup>′</sup> - _H_ = <sup><u>2</u></sup> <sup>_<u>R</u>_</sup> <sup>−</sup> <sup>_<u>G</u>_</sup> <sup>−</sup> <sup>_<u>B</u>_</sup> _R_ + _G_ - 2 _B_  _G_ <sup>′</sup> = 3 _I_ <sup>′</sup> _S_ <sup>′</sup> _H_ <sup>′�</sup> (30) - _B_ <sup>′</sup> + _R_ <sup>′�</sup> 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 _Hflag_ . To be brief, (31) needs to be calculated regardless of the value of _Hflag_ . - arccos - _<u>(R</u>_ - _<u>G)</u>_ + _<u>(R</u>_ - _<u>B)</u>_ 2 ~~<u>�</u>~~ _(R_ - _G)_ <sup>2</sup> + _(R_ - _B) (G_ - _B)_    _f_ 3 = 3 _I_ <sup>′</sup> - _(f_ 1 + _f_ 2 _)_ = _I_ <sup>′ �</sup> _f_ 1 = _I_ <sup>′ �</sup> 1 − _S_ <sup>′�</sup> _f_ 2 = _I_ <sup>′ �</sup> 1 + _S_ <sup>′</sup> _H_ <sup>′�</sup> (31) 1 + _S_ <sup>′</sup> - _S_ <sup>′</sup> _H_ <sup>′�</sup> (32) According to (32), the error of the _H_ component in the RGB2HSI conversion can be calculated. Similarly, the error of the _H_ component can be derived in the other two conditions as well. - In the case where _H_ ∈ [2 _π_ /3 _,_ 4 _π_ /3). _�H_ = <sup><u>2</u></sup> <sup>_<u>G</u>_</sup> <sup>−</sup> <sup>_<u>B</u>_</sup> <sup>−</sup> <sup>_<u>R</u>_</sup> _G_ + _B_ - 2 _R_ Therefore, during the HSI2RGB conversion, _f_ 1, _f_ 2, and _f_ 3 can be calculated during the first step based on (25)-(27). The values of the reconstructed _R_ <sup>′</sup> _R_ <sup>′</sup> _, G_ <sup>′</sup>, _G_ <sup>′</sup> and _B_ <sup>′</sup> components of the recovered RGB image can be obtained based on the value of _Hflag_ In this way, the nonlinear calculation step of the trigonometric function during the HSI2RGB conversion in the geometric derivation algorithm is no longer needed. The pseudocode of the HSI2RGB conversion of the S-SC algorithm is shown in Algorithm 4. - arccos - _<u>(R</u>_ - _<u>G)</u>_ + _<u>(R</u>_ - _<u>B)</u>_ 2 ~~<u>�</u>~~ _(R_ - _G)_ <sup>2</sup> + _(R_ - _B) (G_ - _B)_ (33) - In the case where _H_ ∈ [4 _π_ /3 _,_ 2 _π_ ). _�H_ = <sup><u>2</u></sup> <sup>_<u>B</u>_</sup> <sup>−</sup> <sup>_<u>R</u>_</sup> <sup>−</sup> <sup>_<u>G</u>_</sup> _R_ + _B_ - 2 _G_ - arccos - _<u>(R</u>_ - _<u>G)</u>_ + _<u>(R</u>_ - _<u>B)</u>_ 2 ~~<u>�</u>~~ _(R_ - _G)_ <sup>2</sup> + _(R_ - _B) (G_ - _B)_ (34) 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), (b), and (c) represent the error _�H_ _a_ when _H_ ∈ [0 _,_ 2 _π_ /3), the error _�Hb_ when _H_ ∈ [2 _π_ /3 _,_ 4 _π_ /3), and the error _�Hc_ when _H_ ∈ [4 _π_ /3 _,_ 2 _π_ ), respectively. FIGURE 2. The error _�_ _H_ of the _H_ component. According to part (a) in Fig. 2 and the experimental results, in the case where _H_ ∈ [0 _,_ 2 _π_ /3), the values of _�Ha_ are in the range [−3 _._ 0793 _,_ 1 _._ 9849] When the input data of the _R_, _G_, and _B_ components are equal to 1, 255, and 0, respectively, _�Ha_ possesses the minimum value, which equals -3.0793. When the input data of the _R_, _G_, and _B_ components are equal to 255, 1, and 0, respectively, _�Ha_ possesses the maximum value, which equals 1.9849. According to part (b) in Fig. 2, in the case where _H_ ∈ [2 _π_ /3 _,_ 4 _π_ /3), the values of _�Hb_ are in the range [−3 _._ 0861 _,_ −0 _._ 1095] When the input data of the _R_, _G_, and _B_ components are equal to 0, 1, and 255, respectively, _�Hb_ possesses the minimum value, which equals -3.0861. When the input data of the _R_, _G_, and _B_ components are equal to 0, 255, and 1, respectively, _�Hb_ possesses the maximum value, which equals -0.1095. According to part (c) in Fig. 2, in the case where _H_ ∈ [4 _π_ /3 _,_ 2 _π_ ), the values of _�Hc_ are in the range [−0 _._ 9917 _,_ −0 _._ 1027] When the input data of the _R_, _G_, and _B_ components are equal to 255, 0, and 1, respectively, _�Hc_ possesses the minimum value, which equals -0.9917. When the input data of the _R_, _G_, and _B_ components are equal to 1, 0, and 255, respectively, _�Hc_ possesses the maximum value, which equals −1.027. 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: _�I_ = _I_ <sup>′</sup> - _I_ = − <sup>_<u>R</u>_</sup> <sup>+</sup> <sup>_<u>G</u>_</sup> <sup>+</sup> <sup>_<u>B</u>_</sup> (35) 12288 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. FIGURE 3. The error _�_ _I_ of the _I_ component. 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). Fig. 4 shows the calculation results of the errors _�R_, _�G_ and _�B_, and parts (a), (b), and (c) represent the error calculation results of the reconstructed _R_, _G_, and _B_ components, respectively. FIGURE 4. The error of the _R_, _G_, and _B_ components of the reconstructed RGB image when _H_ ∈ [0, 2 _π_ /3). According to Fig. 4 and the experimental results, in the case where _H_ ∈ [0 _,_ 2 _π_ /3), the _�R_, _�G_ and _�B_ _�B_ = _B_ <sup>′</sup> - _B_ = _�I_ �1 − _S_ <sup>′�</sup>   _�R_ = _R_ <sup>′</sup> - _R_ = _�I_ �1 + _S_ <sup>′</sup> _H_ <sup>′�</sup> _�R_ = _R_ <sup>′</sup> - _R_ = _�I_ �1 + _S_ <sup>′</sup> _H_ <sup>′�</sup> (36) _�G_ = _G_ <sup>′</sup> - _G_ = _�I_ �1 + _S_ <sup>′</sup> - _S_ <sup>′</sup> _H_ <sup>′�</sup>  values are in the ranges [−0 _._ 0623 _,_ −2 _._ 4414 × 10 <sup>−4</sup> ] _,_ [−0 _._ 0623 _,_ −2 _._ 4414 × 10 <sup>−4</sup> ] and [−0 _._ 0620 _,_ 0], respectively. - When the input data of the _R_, _G_, and _B_ components are equal to 255, 2, and 1, respectively, _�R_ possesses the minimum value, which equals −0.0623. Further, when the input data of the _R_, _G_, and _B_ components are equal to 1, 255, and 0, respectively, _�R_ possesses the maximum value, which equals −2 _._ 4414 × 10 <sup>−4</sup> - When the input data of the _R_, _G_, and _B_ components are equal to 4, 255, and 3, respectively, _�G_ possesses the minimum value, which equals −0.0623. Furthermore, when the input data of the _R_, _G_, and _B_ components are equal to 1, 252, and 0, respectively, _�G_ possesses the maximum value, which equals −2 _._ 4414 × 10 <sup>−4</sup> . - When the input data of the _R_, _G_, and _B_ components are equal to 255, 255, and 4, respectively, _�B_ possesses the minimum value, which equals −0.0620. Furthermore, when the input data of the _B_ component is equal to 0, _�B_ possesses the maximum value, which equals 0. Similarly, the error of the _R_, _G_, and _B_ components of the reconstructed RGB image can be calculated in the same way in the cases where _H_ ∈ [2 _π_ /3 _,_ 4 _π_ /3) and _H_ ∈ [4 _π_ /3 _,_ 2 _π_ ). The calculation results are shown in Fig. 5 and Fig. 6. FIGURE 5. The error of the _R_, _G_, and _B_ components of the reconstructed RGB image when _H_ ∈ [2 _π_ /3, 4 _π_ /3). FIGURE 6. The error of the _R_, _G_, and _B_ components of the reconstructed RGB image when _H_ ∈ [4 _π_ /3, 2 _π_ ). According to Fig. 5, Fig. 6, and the experimental results, in the case where _H_ ∈ [2 _π_ /3 _,_ 4 _π_ /3), the values of _�R_ and _�G_ are all in the range [−0 _._ 0623 _,_ −2 _._ 4414 × 10 <sup>−4</sup> ], and _�B_ is in the range [-0.0620, 0]. In the case where _H_ ∈ [4 _π_ /3 _,_ 2 _π_ ), the values of _�R_ and _�G_ are all in the range [−0 _._ 0623 _,_ −2 _._ 4414 × 10 <sup>−4</sup> ] _,_ and _�B_ is in the range [−0 _._ 0620 _,_ 0]. 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, Therefore, the time complexity of the RGB2HSI conversion in the S-SC algorithm is O(3 _N_ + 4 _N_ + _N_ + 6 _N_ ) = O(14 _N_ ). 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 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). - Calculate the values of the _H_ <sup>′</sup>, _S_ <sup>′</sup>, and _I_ <sup>′</sup> components (Algorithm 3 Step VI). For the above four steps, the time complexities of steps III, IV, and V are O(3 _N_ ), O(4 _N_ ), and O( _N_ ), respectively. Step VI possesses a time complexity of O(6 _N_ ), including O(3 _N_ ) for calculating the _H_ <sup>′</sup> component, O(2 _N_ ) for calculating the _S_ <sup>′</sup> component, and O( _N_ ) for calculating the _I_ <sup>′</sup> component. 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). - Calculate the values of the _H_, _S_, and _I_ components (Algorithm 1 Step V). Among the steps, the time complexities of step III, step IV, and the _I_ component calculation in step V are the same as those of the S-SC algorithm, which are O(3 _N_ ), O(4 _N_ ), and O( _N_ ), respectively. 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: _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_ <sup>′</sup> _R_ <sup>′</sup> _, G_ <sup>′</sup>, _G_ <sup>′</sup> and _B_ <sup>′</sup> components of each reconstructed pixel (Algorithm 4 Step III). - Integrate the reconstructed _R_ <sup>′</sup> _R_ <sup>′</sup> _, G_ <sup>′</sup>, _G_ <sup>′</sup> and _B_ <sup>′</sup> components into a reconstructed RGB image (Algorithm 4 Step IV). For the above two steps, the time complexities of steps III and IV are O(5 _N_ ) and O(3 _N_ ), respectively. In step III, the time complexity O(5 _N_ ) includes O(3 _N_ ) for calculating the reconstructed _R_ <sup>′</sup> component, O( _N_ ) for calculating the _G_ <sup>′</sup> component, and O( _N_ ) for calculating the _B_ <sup>′</sup> component. <sup>_π_</sup> 2 <sup>−</sup> <sup>_x_</sup> <sup>−</sup> <sup>_<u>x</u>_</sup> 6 <sup>3</sup> arccos( _x_ ) = <sup>_π_</sup> 2 - _x_ <sup>3�</sup> 6 <sup>3</sup> <sup>+ O</sup> Therefore, the time complexity of the HSI2RGB conversion in the S-SC algorithm is O(5 _N_ + 3 _N_ ) = O(8 _N_ ). 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(3 _N_ ) 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: We can obtain (38) by incorporating (37) into (1). (37) (38) (39) <sup>_π_</sup> 2 <sup>−</sup> <sup>_X_</sup> <sup>−</sup> <sup>_<u>X</u>_</sup> 6 <sup>3</sup> _H_ = <sup>_π_</sup> 2 - _X_ <sup>3�</sup> 6 <sup>3</sup> <sup>+ O</sup> where _<u>(R</u>_ - _<u>G) (R</u>_ - _<u>B)</u>_ _X_ = 2 ~~<u>�</u>~~ _(R_ - _G)_ <sup>2</sup> + _(R_ - _B) (G_ - _B)_ Then, the time complexity of the geometric derivation algorithm for calculating the _H_ component is O(7 _N_ ). 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(7 _N_ + 3 _N_ + _N_ ) = O(11 _N_ ). Therefore, the time complexity of the RGB2HSI conversion in the geometric derivation algorithm is O(3 _N_ + 4 _N_ + 11 _N_ ) = O(18 _N_ ). Compared with the geometric derivation algorithm, the time complexity of the RGB2HSI conversion in the S-SC algorithm is reduced by O(4 _N_ ), 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. Then, the time complexity of the geometric derivation algorithm for calculating the reconstructed _R_ component is O(6 _N_ ). 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(6 _N_ + _N_ + 2 _N_ ) = O(9 _N_ ). _S_ 1 − <sup>_<u>Y</u>_</sup> 21 <sup>2</sup> ! <sup>−</sup> <sup>_<u>Y</u>_</sup> 41 <sup>4</sup> ! <sup>+</sup> <sup>_O_</sup> - _Y_ 1 <sup>4</sup> - <sup>�</sup> 1 − <sup>_<u>Y</u>_</sup> 22 <sup>2</sup> ! <sup>−</sup> <sup>_<u>Y</u>_</sup> 42 <sup>4</sup> ! <sup>+</sup> <sup>_O_</sup> <u>�</u> _Y_ 2 <sup>4</sup> <u>�</u>   (40) _Z_ = _I_  1 + where _Y_ 1 and _Y_ 2 can be expressed as: - _Y_ 1 = _H_ _Y_ 2 = <sup>_π_</sup> 3 <sup>_π_</sup> (41) 3 <sup>−</sup> <sup>_H_</sup> FIGURE 7. The HSI images and the images of their corresponding components through the RGB2HSI conversion. Therefore, the time complexity of the HSI2RGB conversion in the geometric derivation algorithm is O(3 _N_ + 9 _N_ ) = O(12 _N_ ). Compared with the geometric derivation algorithm, the time complexity of the HSI2RGB conversion in the S-SC algorithm is reduced by O(4 _N_ ), 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 FIGURE 8. The reconstructed RGB images and the images of their corresponding components after the HSI2RGB conversion. 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 FIGURE 9. The PSNR results for the reconstructed RGB Lena images. 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. FIGURE 10. The SSIM results for the reconstructed RGB Lena images. 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. TABLE 1. The time consumption of The RGB2HSI conversion. TABLE 2. The time consumption of The HSI2RGB conversion. 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 TABLE 3. The total time consumption of The RGB2HSI and The HSI2RGB conversions. 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. FIGURE 11. The FPGA structure flowchart for the RGB2HSI conversion in the S-SC algorithm. 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. TABLE 4. The Logic resource consumption of The RGB2HSI conversion in The S-SC algorithm (Artix7-100T). 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. FIGURE 13. The FPGA structure flowchart for the HSI2RGB conversion in the S-SC algorithm. 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. TABLE 5. The Logic resource consumption of The HSI2RGB consumption in The S-SC algorithm (Artix7-100T). 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. FIGURE 12. The timing sequence simulation result for the input data Rin, Gin, and Bin and the output data Hcomp, Scomp, and Icomp. FIGURE 14. The timing sequence simulation result for the input data Hcomp, Scomp, and Icomp and the output data Rout, Gout, and Bout. TABLE 6. The comparation of logic resource consumption between The S-SC algorithm (Artix-7) and the algorithm proposed in [7] (Virtex5). TABLE 7. The comparation of logic resource consumption between The S-SC algorithm (Artix-7) and the algorithm proposed in [17] (Spartan6). 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. TABLE 8. Slice LUTs occupancy of the three algorithms in the RGB2HSI conversion and the HSI2RGB conversion. 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. FIGURE 15. The effects of reconstructed RGB Lena images through the S-SC algorithm (software) and S-SC algorithm (FPGA). 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. TABLE 9. Evaluation of reconstructed RGB images of the S-SC algorithm (software) and S-SC algorithm (FPGA). 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. REFERENCES [1] H. Endo and A. Taguchi, ‘‘Color image enhancement by using hue saturation gradient,’’ in _Proc. Int. Symp. Intell. Signal Process. Commun._ _Syst. (ISPACS)_, Taipei, China, Dec. 2019, pp. 1–2. [2] S.-L. Lee and C.-C. Tseng, ‘‘Color image enhancement using histogram equalization method without changing hue and saturation,’’ in _Proc. IEEE_ _Int. Conf. Consum. Electron. Taiwan (ICCE-TW)_, Taipei, China, Jun. 2017, pp. 305–306. [3] G. Hou, Z. Pan, B. Huang, G. Wang, and X. Luan, ‘‘Hue preserving-based approach for underwater colour image enhancement,’’ _IET Image Process._, vol. 12, no. 2, pp. 292–298, Feb. 2018. [4] S. Chen, R. Feng, Y. Zhang, and C. Zhang, ‘‘Aerial image matching method based on HSI hash learning,’’ _Pattern_ _Recognit._ _Lett._, vol. 117, pp. 131–139, Jan. 2019. [5] Y. Guo, Z. Zhang, H. Yuan, and S. Shao, ‘‘Single remote-sensing image dehazing in HSI color space,’’ _J._ _Korean_ _Phys._ _Soc._, vol. 74, no. 8, pp. 779–784, Apr. 2019. [6] N. Nakajima and A. Taguchi, ‘‘A novel color image processing scheme in HSI color space with negative image processing,’’ in _Proc. Int. Symp. Intell._ _Signal_ _Process._ _Commun._ _Syst._ _(ISPACS)_, Kuching, India, Dec. 2014, pp. 029–033. [7] U. A. Nnolim, ‘‘Design and implementation of novel, fast, pipelined HSI2RGB and log-hybrid RGB2HSI colour converter architectures for image enhancement,’’ _Microprocessors_ _Microsyst._, vol. 39, nos. 4–5, pp. 223–236, Jun. 2015. [8] W. Zhang, J. Liang, L. Ren, H. Ju, Z. Bai, and Z. Wu, ‘‘Fast polarimetric dehazing method for visibility enhancement in HSI colour space,’’ _J. Opt._, [vol. 19, no. 9, Sep. 2017, Art. no. 095606, doi: 10.1088/2040-8986/aa7f39.](http://dx.doi.org/10.1088/2040-8986/aa7f39) [9] F. Qin, Y. Weiping, Y. Jia, L. Hongning, L. Yanlin, L. Xiankui, L. Yichao, and Z. Jiping, ‘‘Research on image reconstruction of traditional Chinese painting art based on radiance information matching,’’ _Acta Optica Sinica_, [vol. 34, no. 10, pp. 337–345, 2014, doi: 10.3788/AOS201434.1033001.](http://dx.doi.org/10.3788/AOS201434.1033001) [10] S. Ma, H. Ma, Y. Xu, S. Li, C. Lv, and M. Zhu, ‘‘A low-light sensor image enhancement algorithm based on HSI color model,’’ _Sensors_, vol. 18, no. 10, p. 3583, Oct. 2018. [11] S. E. Kim, J. J. Jeon, and I. K. Eom, ‘‘Image contrast enhancement using entropy scaling in wavelet domain,’’ _Signal_ _Process._, vol. 127, pp. 1–11, [Oct. 2016, doi: 10.1016/j.sigpro.2016.02.016.](http://dx.doi.org/10.1016/j.sigpro.2016.02.016) [12] R. C. Gonzalez, S. L. Woods, and S. L. Eddins, _Digital Image Processing_, 2nd ed. New York, NY, USA: Prentice-Hall, 2002. [13] J. Bajon, M. Cattoen, and L. Liang, ‘‘Identification of multicoloured objects using a vision module,’’ in _Proc. 6th Int. Conf., Robot Vis. Sensory_ _Control (RoViSeC)_, Paris, France, 1986, pp. 21–30. [14] H. Liu, _Comparative Studies on the Conversion Methods Between RGB and_ _HSI_ _Color_ _Models_ . China Sciencepaper, Apr. 2008. [Online]. Available: http://www.paper.edu.cn/releasepaper/content/200804-1063 [15] S. Khan, P. Manwaring, A. Borsic, and R. Halter, ‘‘FPGA-based voltage and current dual drive system for high frame rate electrical impedance tomography,’’ _IEEE_ _Trans._ _Med._ _Imag._, vol. 34, no. 4, pp. 888–901, Apr. 2015. [16] M. Ravi, A. Sewa, T. G. Shashidhar, and S. S. S. Sanagapati, ‘‘FPGA as a hardware accelerator for computation intensive maximum likelihood expectation maximization medical image reconstruction algorithm,’’ _IEEE_ _Access_, vol. 7, pp. 111727–111735, 2019. [17] G. Saravanan, G. Yamuna, and S. Nandhini, ‘‘Real time implementa tion of RGB to HSV/HSI/HSL and its reverse color space models,’’ in _Proc. Int. Conf. Commun. Signal Process. (ICCSP)_, Melmaruvathur, India, Apr. 2016, pp. 0462–0466. [18] R. Swenson, ‘‘A real-time high performance universal colour transforma tion hardware system,’’ Ph.D. dissertation, Dept. Electron. Eng., Univ. Kent, Canterbury, U.K., 2000. [19] M. Shakeri, M. H. Dezfoulian, H. Khotanlou, A. H. Barati, and Y. Masoumi, ‘‘Image contrast enhancement using fuzzy clustering with adaptive cluster parameter and sub-histogram equalization,’’ _Digit. Signal_ _Process._, vol. 62, pp. 224–237, Mar. 2017. [20] N. K. Quang, N. T. Hieu, and Q. P. Ha, ‘‘FPGA-based sensorless PMSM speed control using reduced-order extended Kalman filters,’’ _IEEE Trans._ _Ind. Electron._, vol. 61, no. 12, pp. 6574–6582, Dec. 2014. [21] G. Licciardo, C. Cappetta, and L. Di Benedetto, ‘‘Design of a convolu tional two-dimensional filter in FPGA for image processing applications,’’ _Computers_, vol. 6, no. 2, p. 19, May 2017. [22] U. A. Nnolim, ‘‘FPGA-based hardware architecture for fuzzy homomorphic enhancement based on partial differential equations,’’ _Int._ _J._ _Image_ _Graph._, vol. 17, no. 4, p. 170022, 2017, doi: [10.1142/S021946781750022X.](http://dx.doi.org/10.1142/S021946781750022X) [23] X. Shang, J. Liang, G. Wang, H. Zhao, C. Wu, and C. Lin, ‘‘Color Sensitivity-Based combined PSNR for objective video quality assessment,’’ _IEEE_ _Trans._ _Circuits_ _Syst._ _Video_ _Technol._, vol. 29, no. 5, pp. 1239–1250, May 2019. [24] A. Hore and D. Ziou, ‘‘Image quality metrics: PSNR vs. SSIM,’’ in _Proc._ _20th_ _Int._ _Conf._ _Pattern_ _Recognit._, Istanbul, Turkey, Aug. 2010, pp. 2366–2369. SHUAIQING ZHI received the B.E. degree in electrical engineering and automation from Southwest Jiaotong University (SWJTU), Chengdu, China, in 2018. He is currently pursuing the M.S. degree with the College of Information and Communication Engineering, Hainan University, Haikou, China. His research interests include hardware image processing and control engineering. YANI CUI received the B.S. and Ph.D. degrees in communication and information systems and information and communication engineering from Hainan University, Haikou, China, in 2011 and 2017, respectively. She is currently a Lecturer with the College of Information and Communication Engineering, Hainan University. Her research interests include intelligent systems, collaborative control, and image processing. JIAXIAN DENG received the Ph.D. degree in information and communication engineering from Xidian University, Xi’an, China, in 2004. Since 2005, he has been a Professor with the College of Information and Communication Engineering, Hainan University. His research interests include data compression and decompression, data encryption and decryption, parallel data procession, and hardware image processing. WENCAI DU received the B.S. degree from Peking University, Beijing, China, in 1978, the M.S. degree from Hehai University, Nanjing, China, in 1986, the M.S. degree from the Faculty of Geo-Information Science and Earth Observation, University of Twente, Enschede, The Netherlands, in 1996, and the Ph.D. degree from the University of South Australian, in 2000. From March 2001 to March 2002, he conducted Postdoctoral Research with the Technion-Israel Institute of Technology (IIT), Israel. He is currently the Dean of the Institute of Data Science, City University of Macau, Taipa, Macau, China. He has authored or coauthored 18 books and over 80 science publications. His research interests include several aspects of information technology and communication, including computer network and maritime communications. Dr. Du is also a member of the Editorial Board of the _Invertis Journal of_ _Science and Technology_, India. He has taken services on many professional conferences, including Conference Chair of the IEEE/ACIS ICIS 2011, the Conference Co-Chair of the IEEE/ACIS SNPD 2010, U.K., the Conference Chair of the IEEE/ACIS SERA 2009, and the Program Chair of the IEEE/ACIS SNPD 2009, Daegu, South Korea.

섹션 본문 102문단 · 42,240자

(제목 없음)

1In 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.INDEX TERMS RGB-HSI space conversion, FPGA implementation, low computational complexity, low logic resource consumption.

I. INTRODUCTION

2Color 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].

3Due 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.

4Furthermore, 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.

5There 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.

6According 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.

7The main contributions of this paper can be summarized as follows:

8• 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.

9• We study the conversion accuracy and computational complexity of the S-SC algorithm together with the geometric derivation algorithm for comparison.

10• 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.

11• 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.

12The 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

13• Peel off the I component (Intensity) from the RGB color space.

14• Reduce the three-dimensional RGB color space to a two-dimensional space.

15• Based on the above two points, decompose the chroma into the H component (Hue) and S component (Saturation).

16• 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:

17where H ∈ [0, 2π), S and I ∈ [0, 1), and θ is expressed as:

18According 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:

19Since 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.

20• 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:

21is the minimum of the original image pixel, and the formulas for the HSI2RGB conversion can be written as:

22Let H = H −2π/3(5) can be rewritten as:

23is the minimum of the original image pixel, and the formulas for the HSI2RGB conversion can be written as:

24Let H = H −4π/3(7) can be rewritten as:

25Although 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.

26and

27where (10)

28On 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.

29The expressions of the S and I components in (1) can be rewritten as (13)- (14).

30We can obtain (15) by substituting (14) into (13).

31Then, (15) can be rewritten as:

32and (17) can be derived based on (14).

33Then, (18) can be derived by substituting (16)- (17) into (12).

34Similarly, the following two conditions can be derived as

35According 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.

36where w represents the minimum value among the R, G, and B components.

37According 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:

38By substituting (23) into (21), the formulas of the hue of the RGB2HSI conversion in the S-SC algorithm can be written as:

39As 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

40To 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:

41According to (24)-(25), the rest of the optimized formulas of the RGB2HSI conversion can be rewritten as:

42The pseudocode of the RGB2HSI conversion in the S-SC algorithm is shown in Algorithm 3.

3) THE OPTIMIZATION OF THE HSI2RGB CONVERSION

43According 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.

44• 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:

45• 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:

46• 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:

47It 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

48Based 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.

49The 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

50• In the case where H ∈ [0, 2π/3), (32) can be derived by combining (1) and (18).

51Sequentially, 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

52According to (1) and (25), the error calculation formula of the I component in the RGB2HSI conversion can be written as:

53According 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

54In 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

55According 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

56Assuming 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.

57• Separate the values of the R, G, and B components from each pixel (Algorithm 3

58Step III).

59• Calculate the minimum values of the separated R, G, and B components for each pixel (Algorithm 3

60Step IV).

61• Preserve the H component sector information (Algorithm 3

62Step 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.

63• Separate the values of the R, G, and B components from each pixel (Algorithm 1 Step III).

64• 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:

65We can obtain (38) by incorporating (37) into (1).

66Then, 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

67Compared 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

68Similarly, 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:

69• Calculate the values of the R R , G , G and B components of each reconstructed pixel (Algorithm 4

70Step III).

71• Integrate the reconstructed R R , G , G and B components into a reconstructed RGB image (Algorithm 4

72Step 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.

73• Calculate the values of the reconstructed R, G, and B components of each pixel (Algorithm 2 step III).

74• Integrate the reconstructed R, G, and B components into a reconstructed RGB image (Algorithm 2

75Step 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.

76It 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:

77where Y 1 and Y 2 can be expressed as:

78Then, 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

79In 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

80The 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.

81According 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.

82In 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.

83Although 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.

84According 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.

85To 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

86Based 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.

87Furthermore, 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.

88Through 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

89After 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

90To 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.

91For 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

92For 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.

93As 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.

94For 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

95Based 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.

96According 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.

97On 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.

98In 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

99Based 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.

100In 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

101In 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].

102The 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.

참고문헌 22건

  1. FPGA-Based Sensorless PMSM Speed Control Using Reduced-Order Extended Kalman Filters IEEE Transactions on Industrial Electronics · Institute of Electrical and Electronics Engineers · 2014 10.1109/tie.2014.2320215
  2. A novel color image processing scheme in HSI color space with negative image processing 2021 International Symposium on Intelligent Signal Processing and Communication Systems (ISPACS) · 2014 10.1109/ispacs.2014.7024419
  3. Image Quality Metrics: PSNR vs. SSIM 2010 10.1109/icpr.2010.579
  4. FPGA-Based Voltage and Current Dual Drive System for High Frame Rate Electrical Impedance Tomography IEEE Transactions on Medical Imaging · Institute of Electrical and Electronics Engineers · 2014 10.1109/tmi.2014.2367315
  5. Image contrast enhancement using entropy scaling in wavelet domain Signal Processing · Elsevier BV · 2016 10.1016/j.sigpro.2016.02.016
  6. Research on Image Reconstruction of Traditional Chinese Painting Art Based on Radiance Information Matching Acta Optica Sinica · Shanghai Institute of Optics and Fine Mechanics · 2014 10.3788/aos201434.1033001
  7. Image contrast enhancement using fuzzy clustering with adaptive cluster parameter and sub-histogram equalization Digital Signal Processing · Elsevier BV · 2016 10.1016/j.dsp.2016.10.013
  8. Real time implementation of RGB to HSV/HSI/HSL and its reverse color space models 2016 10.1109/iccsp.2016.7754179
  9. Design of a Convolutional Two-Dimensional Filter in FPGA for Image Processing Applications Computers · Multidisciplinary Digital Publishing Institute · 2017 10.3390/computers6020019
  10. Fast polarimetric dehazing method for visibility enhancement in HSI colour space Journal of Optics · IOP Publishing · 2017 10.1088/2040-8986/aa7f39
  11. Color image enhancement using histogram equalization method without changing hue and saturation 2017 10.1109/icce-china.2017.7991117
  12. FPGA-Based Hardware Architecture for Fuzzy Homomorphic Enhancement Based on Partial Differential Equations International Journal of Image and Graphics · World Scientific · 2017 10.1142/s021946781750022x
  13. Hue preserving‐based approach for underwater colour image enhancement IET Image Processing · Institution of Engineering and Technology · 2017 10.1049/iet-ipr.2017.0359
  14. Color-Sensitivity-Based Combined PSNR for Objective Video Quality Assessment IEEE Transactions on Circuits and Systems for Video Technology · Institute of Electrical and Electronics Engineers · 2018 10.1109/tcsvt.2018.2836974
  15. Aerial image matching method based on HSI hash learning Pattern Recognition Letters · Elsevier BV · 2018 10.1016/j.patrec.2018.06.008
  16. A Low-Light Sensor Image Enhancement Algorithm Based on HSI Color Model Sensors · Multidisciplinary Digital Publishing Institute · 2018 10.3390/s18103583
  17. Single Remote-Sensing Image Dehazing in HSI Color Space Journal of the Korean Physical Society · Springer Science+Business Media · 2019 10.3938/jkps.74.779
  18. FPGA as a Hardware Accelerator for Computation Intensive Maximum Likelihood Expectation Maximization Medical Image Reconstruction Algorithm IEEE Access · Institute of Electrical and Electronics Engineers · 2019 10.1109/access.2019.2932647
  19. Color Image Enhancement by Using Hue-Saturation Gradient 2021 International Symposium on Intelligent Signal Processing and Communication Systems (ISPACS) · 2019 10.1109/ispacs48206.2019.8986271
  20. Design and implementation of novel, fast, pipelined HSI2RGB and log-hybrid RGB2HSI colour converter architectures for image enhancement Microprocessors and Microsystems · Elsevier BV · 2015 10.1016/j.micpro.2015.04.005
  21. Identification of multicoloured objects using a vision module. 1986
  22. Digital Image Processing Springer eBooks · Springer Nature · 2002 10.1007/978-3-662-04781-1