**2. GICam image compressor**

2 Will-be-set-by-IN-TECH

image resolution (512-by-512) that is four times the one (256-by-256) of the PillCam can be an assistant to promote the diagnosis of diseases for doctors. The other one is that we do not significantly increase the power consumption for the RF circuit after increasing the image resolution from the sensor. Instead of applying state-of-the-art video compression techniques, we proposed a simplified image compression algorithm, called GICam, in which the memory size and computational load can be significantly reduced. The experimental results shows that the GICam image compressor only costs 31K gates at 2 frames per second, consumes

In applications of capsule endoscopy, it is imperative to consider the tradeoffs between battery life and performance. To further extend the battery life of a capsule endoscope, we herein present a subsample-based GICam image compressor, called GICam-II. The proposed compression technique is motivated by the reddish feature of GI image. We have previously proposed the GICam-II image compressor in paper (20). However, the color importance of primary colors in GI images has no quantitative analysis in detail because of limited pages. Therefore, in this paper, we completely propose a series of mathematical statistics to systematically analyze the color sensitivity in GI images from the RGB color space domain to the 2-D DCT spatial frequency domain in order to make up for a deficiency in our previous work (20). This paper also refines the experimental results to analyze the performance about the compression rate, the quality degradation and the ability of power saving individually. As per the analysis of color sensitivity, the sensitivity of GI image sharpness to red component is at the same level as the sensitivity to green component. This result shows that the GI image is cardinal and different from the general image, whose sharpness sensitivity to the green component is much higher than the sharpness sensitivity to the red component. Because the GICam-II starts compressing the GI image from the Bayer-patterned image, the GICam-II technique subsamples the green component to make the weighting of red and green components the same. Besides, since the sharpness sensitivity to the blue component is as low as 7%, the blue component is down-sampled by four. As shown in experimental results, with the compression ratio as high as 4:1, the GICam-II can significantly save the power dissipation by 38.5% when compared with previous GICam work (11) and 98.95% when compared with JPEG compression, while the average PSNRY is 40.73 dB. The rest of the paper is organized as follows. Section II introduces fundamentals of GICam compression and briefs the previous GICam work. Section III presents the sensitivity analysis of GICam image and shows the importance of red component in GI image. In Section IV, the GICam-II compression will be described in details. Then, Section V illustrates the experimental results in terms of compression ratio, image quality and power consumption. Finally, Section VI

Except using novel ultra-low-power compression techniques to save the power dissipation of RF transmitter in high-resolution wireless gastrointestinal endoscope systems. How to efficiently eliminate annoying impulsive noise caused by a fault sensor and enhance the sharpness is necessary for gastrointestinal (GI) images in wired/wireless gastrointestinal endoscope systems. To overcome these problems, the LUM filter is the most suitable candidate because it simultaneously has the characteristics of smoothing and sharpening. In the operational procedure of LUM filter, the mainly operational core is the rank-order filtering (ROF) and the LUM filter itself needs to use different kind of rank values to accomplish

14.92 mW, and reduces the image size by at least 75% .

concludes our contribution and merits of this work.

#### **2.1 The review of GICam image compression algorithm**

Instead of applying state-of-the-art video compression techniques, we proposed a simplified image compression algorithm, called GICam. Traditional compression algorithms employ the YCbCr quantization to earn a good compression ratio while the visual distortion is minimized, based on the factors related to the sensitivity of the human visual system (HVS). However, for the sake of power saving, our compression rather uses the RGB quantization (15) to save the computation of demosaicking and color space transformation. As mentioned above, the advantage of applying RGB quantization is two-fold: saving the power dissipation on preprocessing steps and reducing the computing load of 2-D DCT and quantization. Moreover, to reduce the hardware cost and quantization power dissipation, we have modified the RGB quantization tables and the quantization multipliers are power of two's. In GICam, the Lempel-Ziv (LZ) coding (18) is employed for the entropy coding. The reason we adopted LZ coding as the entropy coding, is because the LZ encoding does not need look-up tables and complex computation. Thus, the LZ encoding consumes less power and uses smaller silicon size than the other candidates, such as the Huffman encoding and the arithmetic coding. The target compression performance of the GICam image compression is to reduce image size by at least 75%. To meet the specification, given the quantization tables, we exploited the cost-optimal LZ coding parameters to meet the compression ratio requirement by simulating with twelve tested endoscopic pictures shown in Fig.3.

When comparing the proposed image compression with the traditional one in (11), the power consumption of GICam image compressor can save 98.2% because of the reduction of memory requirement. However, extending the utilization of battery life for a capsule endoscope remains an important issue. The memory access dissipates the most power in GICam image compression. Therefore, in order to achieve the target of extending the battery life, it is necessary to consider how to efficiently reduce the memory access.

#### **2.2 Analysis of sharpness sensitivity in gastrointestinal images**

#### **2.2.1 The distributions of primary colors in the RGB color space**

In the modern color theory (16; 17), most color spaces in used today are oriented either toward hardware design or toward product applications. Among these color spaces, the

for all tested GI images. From Table 1, the results clearly show that *R* has the shortest average distance. Therefore, human eyes can be very sensitive to the obvious cardinal ingredient on all surfaces of tested GI images. Moreover, comparing *G* with *B*, *G* is shorter than *B* because

Study on Low-Power Image Processing for Gastrointestinal Endoscopy 247

*Rmax* )]

*Gmax* )]

*Bmax* )]

> *M*−1 ∑ *i*=0

The first index has particularly quantified the chrominance distributions through the concept of average distance, and the statistical results have also shown the reason the human eyes can sense the obvious cardinal ingredient for all tested GI images. Next, the second index is to calculate the variance between total pixels and average distance, in order to further observe

*M*−1 ∑ *i*=0

*M*−1 ∑ *i*=0

*N*−1 ∑ *j*=0

*N*−1 ∑ *j*=0

*N*−1 ∑ *j*=0

(<sup>1</sup> <sup>−</sup> *<sup>R</sup>*(*i*, *<sup>j</sup>*) *Rmax*

(<sup>1</sup> <sup>−</sup> *<sup>G</sup>*(*i*, *<sup>j</sup>*) *Gmax*

(<sup>1</sup> <sup>−</sup> *<sup>B</sup>*(*i*, *<sup>j</sup>*) *Bmax*

"transmission gate"

"row-select"

(a) (b)

Fig. 1. (a) The structure of locally-raster-scanning raw image sensor (b)The pixel sensor

"reset"

"enable"

"output line"

) (1)

) (2)

) (3)

*<sup>R</sup>* <sup>=</sup> *<sup>E</sup>*[(<sup>1</sup> <sup>−</sup> *<sup>R</sup>*(*i*, *<sup>j</sup>*)

*<sup>G</sup>* <sup>=</sup> *<sup>E</sup>*[(<sup>1</sup> <sup>−</sup> *<sup>G</sup>*(*i*, *<sup>j</sup>*)

*<sup>B</sup>* <sup>=</sup> *<sup>E</sup>*[(<sup>1</sup> <sup>−</sup> *<sup>B</sup>*(*i*, *<sup>j</sup>*)

= ( <sup>1</sup> *<sup>M</sup>* <sup>×</sup> *<sup>N</sup>* )

= ( <sup>1</sup> *<sup>M</sup>* <sup>×</sup> *<sup>N</sup>* )

= ( <sup>1</sup> *<sup>M</sup>* <sup>×</sup> *<sup>N</sup>* )

Pixel array

Column decoder

Transmission gate array Active load array

CDS & Subtraction 1st

CDS & Subtraction 2nd

Readout decoder

architecture for the locally-raster-scanning raw image sensor.

*G* contributes larger proportion in luminance.

2-Dimension Row decoder & Timing generater

RGB(red, green, blue) space is the most commonly used in the category of digital image processing; especially, broad class of color video cameras and we consequently adopt the RGB color space to analyze the importance of primary colors in the GI images. In the RGB color space, each color appears in its primary spectral components of red, green and blue. The RGB color space is based on a Cartesian coordinate system, in which, the differ colors of pixels are points on or inside the cube based on the triplet of values (*R*, *G*, *B*). Due to this project was supported in part by Chung-Shan Institute of Science and Technology, Taiwan, under the project BV94G10P. The responsibility of Chung-Shan Institute of Science and Technology mainly designs a 512-by-512 raw image sensor. The block-based image data can be sequentially outputted via the proposed locally-raster-scanning mechanism for this raw image sensor. The reason for adopting a novel image sensor without using generally conventional ones is to efficiently save the size of buffer memory. Conventional raw image sensors adopt the raster-scanning mechanism to output the image pixels sequentially, but they need large buffer memory to form each block-based image data before executing the block-based compression. However, we only need a small ping-pong type memory structure to directly save the block-based image data from the proposed locally-raster-scanning raw image sensor. The structure of this raw image sensor is shown in Fig.1 (a) and the pixel sensor architecture for the proposed image sensor is shown in Fig.1 (b). In order to prove the validity for this novel image sensor before the fabrication via the Chung-Shan Institute of Science and Technology, the chip of the 32-by-32 locally-raster-scanning raw image sensor was designed by full-custom CMOS technology and this chip is submitted to Chip Implementation Center (CIC), Taiwan, for the fabrication. Fig.2 (a) and Fig.2 (b) respectively shows the chip layout and the package layout with the chip specification. The advantage of this novel CMOS image sensor can save the large area of buffer memory. The size of buffer memory can be as a simple ping-pong memory structure shown in Fig.9 while executing the proposed image algorithm, a novel block coding. Our research only focuses on developing the proposed image compressor and other components are implemented by other research department for the GICam-II capsule endocopy. Therefore, the format of the GI image used in the simulation belongs to a raw image from the 512-by-512 sensor designed by Chung-Shan Institute of Science and Technology. In this work, we applied twelve GI images captured shown in Fig.3 for testcases to evaluate the compression technique. The distribution of GI image pixels in the RGB color space is non-uniform. Obviously, the GI image is reddish and the pixels are amassed to the red region. Based on the observation in the RGB color space, the majority of red values are distributed between 0.5 and 1 while most of the green and blue values are distributed between 0 and 0.5 for all tested GI images. To further analyze the chrominance distributions and variations in the RGB color space for each tested GI images, two quantitative indexes are used to quantify these effects. The first index is to calculate the average distances between total pixels and the maximum primary colors in each GI image, and the calculations are formulated as Eq.1, Eq.2 and Eq.3. First, Eq.1 defines the the average distance between total pixels and the most red color (*R*), in which, *R*(*i*, *j*) means the value of red component of one GI image at (*i*, *j*) position and the value of most red color (*Rmax*) is 255. In addition, *M* and *N* represent the width and length for one GI image, respectively. The *M* is 512 and the *N* is 512 for twelve tesed GI images in this work. Next, Eq.2 also defines the average distance between total pixels and the most green color (*G*) and the value of most green one (*Gmax*) is 255. Finally, Eq.3 defines the average distance between total pixels and the most blue color (*B*) and the value of most blue color (*Bmax*) is 255. Table 1 shows the statistical results of *R*, *G* and *B* 4 Will-be-set-by-IN-TECH

RGB(red, green, blue) space is the most commonly used in the category of digital image processing; especially, broad class of color video cameras and we consequently adopt the RGB color space to analyze the importance of primary colors in the GI images. In the RGB color space, each color appears in its primary spectral components of red, green and blue. The RGB color space is based on a Cartesian coordinate system, in which, the differ colors of pixels are points on or inside the cube based on the triplet of values (*R*, *G*, *B*). Due to this project was supported in part by Chung-Shan Institute of Science and Technology, Taiwan, under the project BV94G10P. The responsibility of Chung-Shan Institute of Science and Technology mainly designs a 512-by-512 raw image sensor. The block-based image data can be sequentially outputted via the proposed locally-raster-scanning mechanism for this raw image sensor. The reason for adopting a novel image sensor without using generally conventional ones is to efficiently save the size of buffer memory. Conventional raw image sensors adopt the raster-scanning mechanism to output the image pixels sequentially, but they need large buffer memory to form each block-based image data before executing the block-based compression. However, we only need a small ping-pong type memory structure to directly save the block-based image data from the proposed locally-raster-scanning raw image sensor. The structure of this raw image sensor is shown in Fig.1 (a) and the pixel sensor architecture for the proposed image sensor is shown in Fig.1 (b). In order to prove the validity for this novel image sensor before the fabrication via the Chung-Shan Institute of Science and Technology, the chip of the 32-by-32 locally-raster-scanning raw image sensor was designed by full-custom CMOS technology and this chip is submitted to Chip Implementation Center (CIC), Taiwan, for the fabrication. Fig.2 (a) and Fig.2 (b) respectively shows the chip layout and the package layout with the chip specification. The advantage of this novel CMOS image sensor can save the large area of buffer memory. The size of buffer memory can be as a simple ping-pong memory structure shown in Fig.9 while executing the proposed image algorithm, a novel block coding. Our research only focuses on developing the proposed image compressor and other components are implemented by other research department for the GICam-II capsule endocopy. Therefore, the format of the GI image used in the simulation belongs to a raw image from the 512-by-512 sensor designed by Chung-Shan Institute of Science and Technology. In this work, we applied twelve GI images captured shown in Fig.3 for testcases to evaluate the compression technique. The distribution of GI image pixels in the RGB color space is non-uniform. Obviously, the GI image is reddish and the pixels are amassed to the red region. Based on the observation in the RGB color space, the majority of red values are distributed between 0.5 and 1 while most of the green and blue values are distributed between 0 and 0.5 for all tested GI images. To further analyze the chrominance distributions and variations in the RGB color space for each tested GI images, two quantitative indexes are used to quantify these effects. The first index is to calculate the average distances between total pixels and the maximum primary colors in each GI image, and the calculations are formulated as Eq.1, Eq.2 and Eq.3. First, Eq.1 defines the the average distance between total pixels and the most red color (*R*), in which, *R*(*i*, *j*) means the value of red component of one GI image at (*i*, *j*) position and the value of most red color (*Rmax*) is 255. In addition, *M* and *N* represent the width and length for one GI image, respectively. The *M* is 512 and the *N* is 512 for twelve tesed GI images in this work. Next, Eq.2 also defines the average distance between total pixels and the most green color (*G*) and the value of most green one (*Gmax*) is 255. Finally, Eq.3 defines the average distance between total pixels and the most blue color (*B*) and the value of most blue color (*Bmax*) is 255. Table 1 shows the statistical results of *R*, *G* and *B*

for all tested GI images. From Table 1, the results clearly show that *R* has the shortest average distance. Therefore, human eyes can be very sensitive to the obvious cardinal ingredient on all surfaces of tested GI images. Moreover, comparing *G* with *B*, *G* is shorter than *B* because *G* contributes larger proportion in luminance.

$$\begin{split} \overline{R} &= E[(1 - \frac{R(i, j)}{R\_{\max}})] \\ &= (\frac{1}{M \times N}) \sum\_{i=0}^{M-1} \sum\_{j=0}^{N-1} (1 - \frac{R(i, j)}{R\_{\max}}) \end{split} \tag{1}$$

$$\begin{split} \overline{\mathbf{G}} &= E[(1 - \frac{G(i, j)}{G\_{\max}})] \\ &= (\frac{1}{M \times N}) \sum\_{i=0}^{M-1} \sum\_{j=0}^{N-1} (1 - \frac{G(i, j)}{G\_{\max}}) \end{split} \tag{2}$$

$$\begin{split} \overline{B} &= E[(1 - \frac{B(i, j)}{B\_{\max}})] \\ &= (\frac{1}{M \times N}) \sum\_{i=0}^{M-1} \sum\_{j=0}^{N-1} (1 - \frac{B(i, j)}{B\_{\max}}) \end{split} \tag{3}$$

The first index has particularly quantified the chrominance distributions through the concept of average distance, and the statistical results have also shown the reason the human eyes can sense the obvious cardinal ingredient for all tested GI images. Next, the second index is to calculate the variance between total pixels and average distance, in order to further observe

Fig. 1. (a) The structure of locally-raster-scanning raw image sensor (b)The pixel sensor architecture for the locally-raster-scanning raw image sensor.

Average Distance Test Picture ID *R G B*

Study on Low-Power Image Processing for Gastrointestinal Endoscopy 249

for GI images because the dynamic range of red signal is broader than green and blue ones.

<sup>2</sup>] − {*E*[(<sup>1</sup> <sup>−</sup> *<sup>R</sup>*(*i*, *<sup>j</sup>*)

[<sup>1</sup> <sup>−</sup> *<sup>R</sup>*(*i*, *<sup>j</sup>*) *Rmax* ]

(<sup>1</sup> <sup>−</sup> *<sup>R</sup>*(*i*, *<sup>j</sup>*) *Rmax*

)2] − {*E*[(<sup>1</sup> <sup>−</sup> *<sup>G</sup>*(*i*, *<sup>j</sup>*)

[<sup>1</sup> <sup>−</sup> *<sup>G</sup>*(*i*, *<sup>j</sup>*) *Gmax* ]

(<sup>1</sup> <sup>−</sup> *<sup>G</sup>*(*i*, *<sup>j</sup>*) *Gmax*

)2] − {*E*[(<sup>1</sup> <sup>−</sup> *<sup>B</sup>*(*i*, *<sup>j</sup>*)

[<sup>1</sup> <sup>−</sup> *<sup>B</sup>*(*i*, *<sup>j</sup>*) *Bmax* ]

(<sup>1</sup> <sup>−</sup> *<sup>B</sup>*(*i*, *<sup>j</sup>*) *Bmax*

*Rmax*

*Gmax*

*Bmax*

)]}<sup>2</sup> (4)

<sup>2</sup> <sup>−</sup> (5)

)]<sup>2</sup> (6)

)]}<sup>2</sup> (7)

<sup>2</sup> <sup>−</sup> (8)

)]<sup>2</sup> (9)

)]}<sup>2</sup> (10)

<sup>2</sup> <sup>−</sup> (11)

)]<sup>2</sup> (12)

*Rmax* )

*Gmax*

*Bmax*

*M*−1 ∑ *i*=0

> *M*−1 ∑ *i*=0

*M*−1 ∑ *i*=0

> *M*−1 ∑ *i*=0

*M*−1 ∑ *i*=0

> *M*−1 ∑ *i*=0

*N*−1 ∑ *j*=0

> *N*−1 ∑ *j*=0

*N*−1 ∑ *j*=0

> *N*−1 ∑ *j*=0

*N*−1 ∑ *j*=0

> *N*−1 ∑ *j*=0

In addition, the secondary is green signal and the last is blue signal.

*VARR* <sup>=</sup> *<sup>E</sup>*[(<sup>1</sup> <sup>−</sup> *<sup>R</sup>*(*i*, *<sup>j</sup>*)

= ( <sup>1</sup> *<sup>M</sup>* <sup>×</sup> *<sup>N</sup>* )

> [( <sup>1</sup> *<sup>M</sup>* <sup>×</sup> *<sup>N</sup>* )

*VARG* <sup>=</sup> *<sup>E</sup>*[(<sup>1</sup> <sup>−</sup> *<sup>G</sup>*(*i*, *<sup>j</sup>*)

= ( <sup>1</sup> *<sup>M</sup>* <sup>×</sup> *<sup>N</sup>* )

> [( <sup>1</sup> *<sup>M</sup>* <sup>×</sup> *<sup>N</sup>* )

*VARB* <sup>=</sup> *<sup>E</sup>*[(<sup>1</sup> <sup>−</sup> *<sup>B</sup>*(*i*, *<sup>j</sup>*)

= ( <sup>1</sup> *<sup>M</sup>* <sup>×</sup> *<sup>N</sup>* )

> [( <sup>1</sup> *<sup>M</sup>* <sup>×</sup> *<sup>N</sup>* )

Table 1. The Analysis of Average Distance.

 0.58 0.80 0.82 0.55 0.74 0.79 0.54 0.81 0.86 0.55 0.76 0.81 0.66 0.82 0.85 0.66 0.84 0.87 0.59 0.82 0.88 0.68 0.81 0.83 0.55 0.80 0.85 0.53 0.81 0.84 0.53 0.81 0.86 0.62 0.80 0.85 Average 0.59 0.80 0.84

Fig. 2. (a)The chip layout of the locally-raster-scanning raw image sensor (b)The package layout and the chip specification of the locally-raster-scanning raw image sensor.

the color variations in GI images, and the calculations are formulated as Eq.4, Eq.7 and Eq.10. The Table 2 shows that the average variation of red signal is 0.09, the average variance of green one is 0.03, and the average variance of blue one is 0.02. It signifies that the color information of red signal must be preserved carefully more than other two primary colors; green and blue,


Table 1. The Analysis of Average Distance.

6 Will-be-set-by-IN-TECH

(a) (b)

#1 #2 #3 #4

#5 #6 #7 #8

#9 #10 #11 #12

the color variations in GI images, and the calculations are formulated as Eq.4, Eq.7 and Eq.10. The Table 2 shows that the average variation of red signal is 0.09, the average variance of green one is 0.03, and the average variance of blue one is 0.02. It signifies that the color information of red signal must be preserved carefully more than other two primary colors; green and blue,

Fig. 3. The twelve tested GI images.

Fig. 2. (a)The chip layout of the locally-raster-scanning raw image sensor (b)The package

layout and the chip specification of the locally-raster-scanning raw image sensor.

Output Analog output

Power 8.8586 mW

S ensor Array 32-by-32

Voltage 3.3 V Technology 0.35 um

C hip Size

C onsumption

Size

1.000651.01845 mm2

> for GI images because the dynamic range of red signal is broader than green and blue ones. In addition, the secondary is green signal and the last is blue signal.

$$VAR\_R = E[(1 - \frac{R(i, j)}{R\_{\max}})^2] - \{E[(1 - \frac{R(i, j)}{R\_{\max}})] \}^2 \tag{4}$$

$$\hat{\mathbf{y}} = (\frac{1}{M \times N}) \sum\_{i=0}^{M-1} \sum\_{j=0}^{N-1} [1 - \frac{\mathcal{R}(i, j)}{\mathcal{R}\_{\max}}]^2 - \tag{5}$$

$$[(\frac{1}{M \times N})\sum\_{i=0}^{M-1}\sum\_{j=0}^{N-1}(1-\frac{R(i,j)}{R\_{\max}})]^2\tag{6}$$

$$\text{VAR}\_G = E[(1 - \frac{G(i, j)}{G\_{\text{max}}})^2] - \{E[(1 - \frac{G(i, j)}{G\_{\text{max}}})] \}^2 \tag{7}$$

$$= \left(\frac{1}{M \times N}\right) \sum\_{i=0}^{M-1} \sum\_{j=0}^{N-1} [1 - \frac{G(i, j)}{G\_{\text{max}}}]^2 - \tag{8}$$

$$[(\frac{1}{M \times N})\sum\_{i=0}^{M-1}\sum\_{j=0}^{N-1}(1-\frac{G(i,j)}{G\_{\max}})]^2\tag{9}$$

$$VAR\_B = E[(1 - \frac{B(i, j)}{B\_{\text{max}}})^2] - \left\{ E[(1 - \frac{B(i, j)}{B\_{\text{max}}})] \right\}^2 \tag{10}$$

$$\hat{\lambda} = (\frac{1}{M \times N}) \sum\_{i=0}^{M-1} \sum\_{j=0}^{N-1} [1 - \frac{B(i, j)}{B\_{\text{max}}}]^2 - \tag{11}$$

$$[(\frac{1}{M \times N})\sum\_{i=0}^{M-1}\sum\_{j=0}^{N-1}(1-\frac{B(i,j)}{B\_{\max}})]^2\tag{12}$$

invisible. In addition to the sensitivity of blue, the sensitivity of red is close to the one of green

Study on Low-Power Image Processing for Gastrointestinal Endoscopy 251

*M*−1 ∑ *i*=0

*M*−1 ∑ *i*=0

*M*−1 ∑ *i*=0

*N*−1 ∑ *j*=0 *S Ri*,*<sup>j</sup>*

*N*−1 ∑ *j*=0 *S Gi*,*<sup>j</sup>*

*N*−1 ∑ *j*=0 *S Bi*,*<sup>j</sup>*

*<sup>Y</sup> <sup>S</sup><sup>B</sup>*

*Y*

*Yi*,*<sup>j</sup>* (17)

*Yi*,*<sup>j</sup>* (18)

*Yi*,*<sup>j</sup>* (19)

*<sup>M</sup>* <sup>×</sup> *<sup>N</sup>* )

*<sup>M</sup>* <sup>×</sup> *<sup>N</sup>* )

*<sup>M</sup>* <sup>×</sup> *<sup>N</sup>* )

*<sup>Y</sup> <sup>S</sup><sup>G</sup>*

 0.49 0.43 0.08 0.44 0.48 0.08 0.55 0.39 0.06 0.47 0.46 0.07 0.45 0.47 0.08 0.48 0.45 0.07 0.52 0.42 0.06 0.44 0.48 0.08 0.51 0.43 0.06 0.54 0.40 0.06 0.55 0.39 0.06 0.49 0.44 0.07 Average 0.49 0.44 0.07

most insensitive color in the GI images. Therefore, the blue component can be further downsampled without significant sharpness degradation. Moreover, comparing the red signal with the green signal, they both have a very close influence on the variation of luminance, because they have very close sensitivities. However, the chrominance of red varies more than the chrominance of green and hence the information completeness of red has higher priority than the green. Because the proposed compression coding belongs to the DCT-based image coding, the coding is processed in the spatial-frequency domain. To let the priority relationship between red and green also response in the spatial-frequency domain, the analysis of alternating current (AC) variance will be accomplished to demonstrate the

According to the analysis results from the distributions of primary colors in the RGB color space and the proportion of primary colors in the luminance for GI images, the red signal

**2.2.3 The analysis of AC variance in the 2-D DCT spatial frequency domain for**

To sum up the variance of chrominance and the sensitivity of luminance, blue is the The Sensitivity of Primary Colors in Luminance

and thus they both have a very close influence on the variation of luminance.

*<sup>Y</sup>* = ( <sup>1</sup>

*<sup>Y</sup>* = ( <sup>1</sup>

*<sup>Y</sup>* = ( <sup>1</sup>

*SR*

*SG*

*SB*

Test Picture ID *S<sup>R</sup>*

Table 3. The Analysis of Average Sensitivities.

inference mentioned above in the next subsection.

**gastrointestinal images**


Table 2. The Analysis of Variance.

#### **2.2.2 The analysis of sharpness sensitivity to primary colors for gastrointestinal images**

Based on the analysis of RGB color space, the importance of chrominance is quantitatively demonstrated for GI images. Except for the chrominance, the luminance is another important index because it can efficiently represent the sharpness of an object. Eq.13 is the formula of luminance (Y) and the parameters ; a1, a2 and a3 are 0.299, 0.587 and 0.114 respectively.

$$Y = a\mathbf{1} \times \mathbf{R} + a\mathbf{2} \times \mathbf{G} + a\mathbf{3} \times \mathbf{B} \tag{13}$$

To efficiently analyze the importance of primary colors in the luminance, the analysis of sensitivity is applied. Through the analysis of sensitivity, the variation of luminance can actually reflect the influence of each primary colors. Eq.14, Eq.15 and Eq.16 define the sensitivity of red (*S Ri*,*<sup>j</sup> Yi*,*<sup>j</sup>* ), the sensitivity of green (*S Gi*,*<sup>j</sup> Yi*,*<sup>j</sup>* ), and the sensitivity of blue (*S Bi*,*<sup>j</sup> Yi*,*<sup>j</sup>* ) at position (i,j), respectively for a color pixel of a GI image.

$$S\_{Y\_{i,j}}^{R\_{i,j}} = \frac{\Delta Y\_{i,j}/Y\_{i,j}}{\Delta R\_{i,j}/R\_{i,j}} = \frac{R\_{i,j}}{Y\_{i,j}} \times \frac{\Delta Y\_{i,j}}{\Delta R\_{i,j}} = \frac{a1 \times R\_{i,j}}{Y\_{i,j}} \tag{14}$$

$$\mathbf{S}\_{Y\_{i\_{\downarrow}}}^{\mathbf{G}\_{i\_{\downarrow}}} = \frac{\Delta Y\_{i\_{\downarrow}j}/Y\_{i\_{\uparrow}j}}{\Delta \mathbf{G}\_{i\_{\downarrow}j}/\mathbf{G}\_{i\_{\uparrow}j}} = \frac{\mathbf{G}\_{i\_{\downarrow}j}}{Y\_{i\_{\uparrow}j}} \times \frac{\Delta Y\_{i}}{\Delta \mathbf{G}\_{i\_{\downarrow}j}} = \frac{a\mathbf{2} \times \mathbf{G}\_{i\_{\downarrow}j}}{Y\_{i\_{\uparrow}j}} \tag{15}$$

$$\mathbf{S}\_{Y\_{i,j}}^{B\_{i,j}} = \frac{\Delta Y\_{i,j} / Y\_{i,j}}{\Delta B\_{i,j} / B\_{i,j}} = \frac{B\_{i,j}}{Y\_{i,j}} \times \frac{\Delta Y\_i}{\Delta B\_{i,j}} = \frac{a\mathbf{3} \times B\_{i,j}}{Y\_{i,j}} \tag{16}$$

After calculating the sensitivity of each primary colors for a GI image, the average sensitivity of red (*S<sup>R</sup> Y*), the average sensitivity of green (*S<sup>G</sup> <sup>Y</sup>* ), and the average sensitivity of blue (*S<sup>B</sup> Y*) are calculated by Eq.17, Eq.18 and Eq.19 for each GI images. *M* and *N* represent the width and length for a GI image, respectively. Table 3 shows the average sensitivities of red, green and blue for all tested GI images. From the calculational results, the sensitivity of blue is the slightest and hence the variation of luminance arising from the aliasing of blue is very 8 Will-be-set-by-IN-TECH

Variance of Distance Test Picture ID *VARR VARG VARB* 0.08 0.02 0.02 0.11 0.05 0.03 0.10 0.03 0.02 0.10 0.04 0.02 0.07 0.02 0.01 0.08 0.02 0.01 0.09 0.02 0.01 0.06 0.02 0.02 0.09 0.03 0.01 0.10 0.03 0.02 0.10 0.03 0.02 0.10 0.04 0.02 Average 0.09 0.03 0.02

**2.2.2 The analysis of sharpness sensitivity to primary colors for gastrointestinal images**

Based on the analysis of RGB color space, the importance of chrominance is quantitatively demonstrated for GI images. Except for the chrominance, the luminance is another important index because it can efficiently represent the sharpness of an object. Eq.13 is the formula of luminance (Y) and the parameters ; a1, a2 and a3 are 0.299, 0.587 and 0.114 respectively.

To efficiently analyze the importance of primary colors in the luminance, the analysis of sensitivity is applied. Through the analysis of sensitivity, the variation of luminance can actually reflect the influence of each primary colors. Eq.14, Eq.15 and Eq.16 define the

> <sup>=</sup> *Ri*,*<sup>j</sup> Yi*,*<sup>j</sup>* ×

<sup>=</sup> *Gi*,*<sup>j</sup> Yi*,*<sup>j</sup>* × Δ*Yi* Δ*Gi*,*<sup>j</sup>*

<sup>=</sup> *Bi*,*<sup>j</sup> Yi*,*<sup>j</sup>* × Δ*Yi* Δ*Bi*,*<sup>j</sup>*

After calculating the sensitivity of each primary colors for a GI image, the average sensitivity

are calculated by Eq.17, Eq.18 and Eq.19 for each GI images. *M* and *N* represent the width and length for a GI image, respectively. Table 3 shows the average sensitivities of red, green and blue for all tested GI images. From the calculational results, the sensitivity of blue is the slightest and hence the variation of luminance arising from the aliasing of blue is very

*Gi*,*<sup>j</sup> Yi*,*<sup>j</sup>*

Δ*Yi*,*<sup>j</sup>* Δ*Ri*,*<sup>j</sup>*

), the sensitivity of green (*S*

*Y* = *a*1 × *R* + *a*2 × *G* + *a*3 × *B* (13)

<sup>=</sup> *<sup>a</sup>*<sup>1</sup> <sup>×</sup> *Ri*,*<sup>j</sup> Yi*,*<sup>j</sup>*

<sup>=</sup> *<sup>a</sup>*<sup>2</sup> <sup>×</sup> *Gi*,*<sup>j</sup> Yi*,*<sup>j</sup>*

<sup>=</sup> *<sup>a</sup>*<sup>3</sup> <sup>×</sup> *Bi*,*<sup>j</sup> Yi*,*<sup>j</sup>*

), and the sensitivity of blue (*S*

*<sup>Y</sup>* ), and the average sensitivity of blue (*S<sup>B</sup>*

*Bi*,*<sup>j</sup> Yi*,*<sup>j</sup>* ) at

(14)

(15)

(16)

*Y*)

Table 2. The Analysis of Variance.

sensitivity of red (*S*

of red (*S<sup>R</sup>*

*Ri*,*<sup>j</sup> Yi*,*<sup>j</sup>*

position (i,j), respectively for a color pixel of a GI image.

*Yi*,*<sup>j</sup>* <sup>=</sup> <sup>Δ</sup>*Yi*,*j*/*Yi*,*<sup>j</sup>* Δ*Ri*,*j*/*Ri*,*<sup>j</sup>*

*Yi*,*<sup>j</sup>* <sup>=</sup> <sup>Δ</sup>*Yi*,*j*/*Yi*,*<sup>j</sup>* Δ*Gi*,*j*/*Gi*,*<sup>j</sup>*

*Yi*,*<sup>j</sup>* <sup>=</sup> <sup>Δ</sup>*Yi*,*j*/*Yi*,*<sup>j</sup>* Δ*Bi*,*j*/*Bi*,*<sup>j</sup>*

*Y*), the average sensitivity of green (*S<sup>G</sup>*

*S Ri*,*<sup>j</sup>*

*S Gi*,*<sup>j</sup>*

*S Bi*,*<sup>j</sup>* invisible. In addition to the sensitivity of blue, the sensitivity of red is close to the one of green and thus they both have a very close influence on the variation of luminance.

$$\overline{S\_Y^R} = (\frac{1}{M \times N}) \sum\_{i=0}^{M-1} \sum\_{j=0}^{N-1} S\_{Y\_{i,j}}^{R\_{i,j}} \tag{17}$$

$$\overline{\mathcal{S}\_Y^G} = (\frac{1}{M \times N}) \sum\_{i=0}^{M-1} \sum\_{j=0}^{N-1} \mathcal{S}\_{Y\_{lj}}^{G\_{lj}} \tag{18}$$

$$\overline{S\_Y^B} = (\frac{1}{M \times N}) \sum\_{i=0}^{M-1} \sum\_{j=0}^{N-1} S\_{Y\_{lj}}^{B\_{lj}} \tag{19}$$

To sum up the variance of chrominance and the sensitivity of luminance, blue is the


Table 3. The Analysis of Average Sensitivities.

most insensitive color in the GI images. Therefore, the blue component can be further downsampled without significant sharpness degradation. Moreover, comparing the red signal with the green signal, they both have a very close influence on the variation of luminance, because they have very close sensitivities. However, the chrominance of red varies more than the chrominance of green and hence the information completeness of red has higher priority than the green. Because the proposed compression coding belongs to the DCT-based image coding, the coding is processed in the spatial-frequency domain. To let the priority relationship between red and green also response in the spatial-frequency domain, the analysis of alternating current (AC) variance will be accomplished to demonstrate the inference mentioned above in the next subsection.

#### **2.2.3 The analysis of AC variance in the 2-D DCT spatial frequency domain for gastrointestinal images**

According to the analysis results from the distributions of primary colors in the RGB color space and the proportion of primary colors in the luminance for GI images, the red signal

Fig.4(a) shows the zig-zag scanning order for 8×8 block. Fig.4(b) shows the 1-D signal distribution after zig-zag scanning order and Fig.4(c) shows the symmetric type of frequency

Study on Low-Power Image Processing for Gastrointestinal Endoscopy 253

Through the converting method of Fig.4, the 1-D signal distributions of each R, G1, G2, B components are shown in Fig.5. The variances of frequency are 1193, 1192, 1209 and 1244 for G1, G2, R and B respectively, and the variance of R is very close to the ones of G1 and G2 from the result. However, the datum of G are twice the datum of R based on the Bayer pattern and hence, the datum of G can be reduced to half at the most. Based

Frequency

Fig. 4. (a) zigazg scanning for a 8×8 block (b) 1-D signal distribution after zigzag scanning

on the analysis result mentioned above, the R component is very decisive for GI images and it needs to be compressed completely. However, the G1, G2 and B components do not need to be compressed completely because they are of less than the R component. Therefore, in order to efficiently reduce the memory access to expend the battery life of capsule endoscopy, the datum of G1, G2 and B components should be appropriately decreased according to the proportion of their importance prior to the compression process. In this

order (c) The symmetric type of frequency for the 1-D signal distribution.

Frequency

for the 1-D signal distribution.

plays a decisive role in the raw image. The green signal plays a secondary role and the blue signal is very indecisive. To verify the validity of observation mentioned above, we first use the two-dimensional (2-D) 8×8 discrete cosine transform (DCT) to transfer the spatial domain into the spatial-frequency domain for each of the components, R, G1, G2 and B. The 2-D 8×8 DCT transformation can be perceived as the process of finding for each waveform in the 2-D 8×8 DCT basic functions and also can be formulated as Eq.20, Eq.21, Eq.22, Eq.23 and Eq.24 for each 8×8 block in R, G1, G2 and B subimages respectively. *M* and *N* represent the width and length for one GI image respectively. *k*, *l*=0, 1, ..., 7 and *ykl* is the corresponding weight of DCT basic function in the *k*th row and the *l*th column. *P* represents the total number of pictures and *B* represents the total number of 8×8 blocks in the GI images.

$$R\_{pb}(kl) = \frac{c(k)}{2} \sum\_{i=0}^{7} [\frac{c(l)}{2} \sum\_{j=0}^{7} r\_{ij} \cos(\frac{(2j+1)l\pi}{16})] \cos(\frac{(2i+1)k\pi}{16})\tag{20}$$

$$G\_{pb}(kl) = \frac{c(k)}{2} \sum\_{i=0}^{7} [\frac{c(l)}{2} \sum\_{j=0}^{7} g\_{ij} \cos(\frac{(2j+1)l\pi}{16})] \cos(\frac{(2i+1)k\pi}{16})\tag{21}$$

$$B\_{pb}(kl) = \frac{c(k)}{2} \sum\_{i=0}^{7} [\frac{c(l)}{2} \sum\_{j=0}^{7} b\_{ij} \cos(\frac{(2j+1)l\pi}{16})] \cos(\frac{(2i+1)k\pi}{16})\tag{22}$$

$$c\_k(k) = \begin{cases} \frac{1}{\sqrt{2}}, & \text{if } k = 0\\ 1, & \text{otherwise.} \end{cases} \tag{23}$$

$$c\left(l\right) = \begin{cases} \frac{1}{\sqrt{2}}, & \text{if } l = 0\\ 1, & \text{otherwise.} \end{cases} \tag{24}$$

Next, we calculate the average energy amplitude of all alternating current (AC) coefficients of all tested GI images, in order to observe the variation of energy for each of the components R, G1, G2 and B, and the calculations are formulated as Eq.25, Eq.26, Eq.27.

$$A\_R(kl) = \frac{1}{P} \sum\_{p=1}^{P} \left[ \sum\_{b=0}^{B-1} |R\_{pb}(kl)| \right] \tag{25}$$

$$A\_G(kl) = \frac{1}{P} \sum\_{p=1}^{P} \left[ \sum\_{b=0}^{B-1} |G\_{pb}(kl)| \right] \tag{26}$$

$$A\_B(kl) = \frac{1}{P} \sum\_{p=1}^{P} \left[ \sum\_{b=0}^{B-1} |B\_{pb}(kl)| \right] \tag{27}$$

After calculating the average energy amplitude, we convert the 2-D DCT domain into one-dimensional (1-D) signal distribution in order to conveniently observe the variation of frequency. Consequently, a tool for transforming two-dimensional signals into one dimension is needed. There are many schemes to convert 2-D into 1-D, including row-major scan, column-major scan, peano-scan, and zig-zag scan. Majority of the DCT coding schemes adopt zig-zag scan to accomplish the goal of conversion, and we use it here. The benefit of zig-zag is its property of compacting energy to low frequency regions after discrete cosine transformation. The arrangement sorts the coefficients from low to high frequency, and 10 Will-be-set-by-IN-TECH

plays a decisive role in the raw image. The green signal plays a secondary role and the blue signal is very indecisive. To verify the validity of observation mentioned above, we first use the two-dimensional (2-D) 8×8 discrete cosine transform (DCT) to transfer the spatial domain into the spatial-frequency domain for each of the components, R, G1, G2 and B. The 2-D 8×8 DCT transformation can be perceived as the process of finding for each waveform in the 2-D 8×8 DCT basic functions and also can be formulated as Eq.20, Eq.21, Eq.22, Eq.23 and Eq.24 for each 8×8 block in R, G1, G2 and B subimages respectively. *M* and *N* represent the width and length for one GI image respectively. *k*, *l*=0, 1, ..., 7 and *ykl* is the corresponding weight of DCT basic function in the *k*th row and the *l*th column. *P* represents the total number of

pictures and *B* represents the total number of 8×8 blocks in the GI images.

7 ∑ *j*=0

7 ∑ *j*=0

7 ∑ *j*=0

, *if k* = 0

, *if l* = 0

G1, G2 and B, and the calculations are formulated as Eq.25, Eq.26, Eq.27.

*AR*(*kl*) = <sup>1</sup>

*AG*(*kl*) = <sup>1</sup>

*AB*(*kl*) = <sup>1</sup>

*P*

*P*

*P*

*rijcos*(

*gijcos*(

*bijcos*(

Next, we calculate the average energy amplitude of all alternating current (AC) coefficients of all tested GI images, in order to observe the variation of energy for each of the components R,

> *P* ∑ *p*=1 [ *B*−1 ∑ *b*=0

> *P* ∑ *p*=1 [ *B*−1 ∑ *b*=0

> *P* ∑ *p*=1 [ *B*−1 ∑ *b*=0

After calculating the average energy amplitude, we convert the 2-D DCT domain into one-dimensional (1-D) signal distribution in order to conveniently observe the variation of frequency. Consequently, a tool for transforming two-dimensional signals into one dimension is needed. There are many schemes to convert 2-D into 1-D, including row-major scan, column-major scan, peano-scan, and zig-zag scan. Majority of the DCT coding schemes adopt zig-zag scan to accomplish the goal of conversion, and we use it here. The benefit of zig-zag is its property of compacting energy to low frequency regions after discrete cosine transformation. The arrangement sorts the coefficients from low to high frequency, and

(2*j* + 1)*lπ*

(2*j* + 1)*lπ*

(2*j* + 1)*lπ*

<sup>16</sup> )]*cos*(

<sup>16</sup> )]*cos*(

<sup>16</sup> )]*cos*(

1, *otherwise*. (23)

1, *otherwise*. (24)

(2*i* + 1)*kπ*

(2*i* + 1)*kπ*

(2*i* + 1)*kπ*




<sup>16</sup> ) (20)

<sup>16</sup> ) (21)

<sup>16</sup> ) (22)

*Rpb*(*kl*) = *<sup>c</sup>*(*k*)

*Gpb*(*kl*) = *<sup>c</sup>*(*k*)

*Bpb*(*kl*) = *<sup>c</sup>*(*k*)

*c* (*k*) =

*c* (*l*) =

2

2

2

 <sup>√</sup> 1 2

 <sup>√</sup> 1 2

7 ∑ *i*=0 [ *c*(*l*) 2

7 ∑ *i*=0 [ *c*(*l*) 2

7 ∑ *i*=0 [ *c*(*l*) 2

Fig.4(a) shows the zig-zag scanning order for 8×8 block. Fig.4(b) shows the 1-D signal distribution after zig-zag scanning order and Fig.4(c) shows the symmetric type of frequency for the 1-D signal distribution.

Through the converting method of Fig.4, the 1-D signal distributions of each R, G1, G2, B components are shown in Fig.5. The variances of frequency are 1193, 1192, 1209 and 1244 for G1, G2, R and B respectively, and the variance of R is very close to the ones of G1 and G2 from the result. However, the datum of G are twice the datum of R based on the Bayer pattern and hence, the datum of G can be reduced to half at the most. Based

Fig. 4. (a) zigazg scanning for a 8×8 block (b) 1-D signal distribution after zigzag scanning order (c) The symmetric type of frequency for the 1-D signal distribution.

on the analysis result mentioned above, the R component is very decisive for GI images and it needs to be compressed completely. However, the G1, G2 and B components do not need to be compressed completely because they are of less than the R component. Therefore, in order to efficiently reduce the memory access to expend the battery life of capsule endoscopy, the datum of G1, G2 and B components should be appropriately decreased according to the proportion of their importance prior to the compression process. In this

the compression process for G1, G2 and B components, and Eq.28 and Eq.29 are formulas for the subsample technique. *SM*16:2*<sup>m</sup>* is the subsample mask for the subsample ratio 16-to-2m as shown in Eq.28, and the subsample mask *SM*16:2*<sup>m</sup>* is generated from basic mask as shown in Eq.29. The type of subample direction is block-based, when certain positions in the subsample mask are one, their pixels in the same position will be compressed, or otherwise they are not processed. For the G1 and G2 components, the low subsample ratio must be assigned, considering their secondary importance in GI images. Thus, the 2:1 subsample ratio is candidate one, and the subsample pattern is shown in Fig.7 (a). Finally, for the B component, the 4:1 subsample ratio is assigned and the subsample pattern is shown in Fig.7 (b). In the GICam-II image compression algorithm, the 8×8 2-D DCT is still used to transfer the R component. However, the 4×4 2-D DCT is used for G1 and G2 components because the incoming datum are reduced by subsample technique. Moreover, the G quantization table is also modified and shown in the Fig.8. Finally, the B component is directly transmitted; not be compressed, after extremely decreasing the incoming datum. Because of the non-compression for the B component, the 8×8 and 4×4 zig-zag scanning techniques are added into the GICam-II to further increase the compression rate for R, G1 and G2 components before entering the entropy encoding. In the GICam-II, the Lempel-Ziv (LZ) coding (18) is also employed for the entropy coding because of non-look-up tables and low

Study on Low-Power Image Processing for Gastrointestinal Endoscopy 255

*SM*16:2*<sup>m</sup>* (*i*, *j*) = *BM*16:2*<sup>m</sup>* (*i* mod 4, *j* mod 4)

*u* (*m* − 1) *u* (*m* − 5) *u* (*m* − 2) *u* (*m* − 6) *u* (*m* − 7) *u* (*m* − 3) *u* (*m* − 8) *u* (*m* − 4) *u* (*m* − 2) *u* (*m* − 5) *u* (*m* − 1) *u* (*m* − 6) *u* (*m* − 7) *u* (*m* − 3) *u* (*m* − 8) *u* (*m* − 4)

where *u*(*n*) is a step function,*u* (*n*) =

*BM*16:2*<sup>m</sup>* (*k*, *<sup>l</sup>*) <sup>=</sup> <sup>⎡</sup>

Fig. 7. (a) 2:1 subsample pattern (b) 4:1 subsample pattern.

**2.4 The architecture of subsample-based GICam image compressor**

Fig.9 shows the architecture of the GICam-II image compressor and it faithfully executes the proposed GICam-II image compression algorithm shown in Fig.6. The window size, *w*,

⎢ ⎢ ⎣ *m* = 1, 2, 3, 4, 5, 6, 7, 8. (28)

(29)

⎤ ⎥ ⎥ ⎦

� 1, *f or n* <sup>≥</sup> <sup>0</sup> 0, *f or n* < 0.

complex computation.

Fig. 5. (a) Spatial-frequency distribution converting into one-dimension for G1 component (b) Spatial-frequency distribution converting into one-dimension for G2 component (c) Spatial-frequency distribution converting into one-dimension for R component (d) Spatial-frequency distribution converting into one-dimension for B component.

paper, we successfully propose a subsample-based GICam image compression algorithm and the proposed algorithm firstly uses the subsample technique to reduce the incoming datum of G1, G2 and B components before the compression process. The next section will describe the proposed algorithm in detail.

#### **2.3 The subsample-based GICam image compression algorithm**

Fig.6 illustrates the GICam-II compression algorithm. For a 512×512 raw image, the raw image firstly divides into four parts, namely, R, G1, G2, and B components and each of the components has 256×256 pixels. For the R component, the incoming image size to the 2-D DCT is 256×256×8 bits, Where, the incoming image datum are completely compressed because of the importance itself in GI images. Except for the R component, the GICam-II

Fig. 6. The GICam-II image compression algorithm.

algorithm can use an appropriate subsample ratio to pick out the necessary image pixels into

12 Will-be-set-by-IN-TECH


(b)


(c)


(d)

paper, we successfully propose a subsample-based GICam image compression algorithm and the proposed algorithm firstly uses the subsample technique to reduce the incoming datum of G1, G2 and B components before the compression process. The next section will describe the

Fig.6 illustrates the GICam-II compression algorithm. For a 512×512 raw image, the raw image firstly divides into four parts, namely, R, G1, G2, and B components and each of the components has 256×256 pixels. For the R component, the incoming image size to the 2-D DCT is 256×256×8 bits, Where, the incoming image datum are completely compressed because of the importance itself in GI images. Except for the R component, the GICam-II

> 4-by-4 Quantization G-table 4-by-4 Quantization G-table

algorithm can use an appropriate subsample ratio to pick out the necessary image pixels into

Quantization R-table

**2.3 The subsample-based GICam image compression algorithm**

Fig. 5. (a) Spatial-frequency distribution converting into one-dimension for G1 component (b) Spatial-frequency distribution converting into one-dimension for G2 component (c) Spatial-frequency distribution converting into one-dimension for R component (d) Spatial-frequency distribution converting into one-dimension for B component.



> |AC value|



proposed algorithm in detail.

Raw Image

R

G1

2:1 Subsample

2-D 4-by-4 DCT

2-D 8-by-8 DCT

2-D 4-by-4 DCT

2:1 Subsample

4:1 Subsample

G2

B

Fig. 6. The GICam-II image compression algorithm.

Frequency

Frequency

Frequency

Frequency

Entropy Coding

4-by-4 Zig-Zag Scan 4-by-4 Zig-Zag Scan

8-by-8 Zig-Zag Scan

Entropy Coding

Entropy Coding

Compression Image For G1

Compression Image For R

Compression Image For G2

Non-compression Image For B

the compression process for G1, G2 and B components, and Eq.28 and Eq.29 are formulas for the subsample technique. *SM*16:2*<sup>m</sup>* is the subsample mask for the subsample ratio 16-to-2m as shown in Eq.28, and the subsample mask *SM*16:2*<sup>m</sup>* is generated from basic mask as shown in Eq.29. The type of subample direction is block-based, when certain positions in the subsample mask are one, their pixels in the same position will be compressed, or otherwise they are not processed. For the G1 and G2 components, the low subsample ratio must be assigned, considering their secondary importance in GI images. Thus, the 2:1 subsample ratio is candidate one, and the subsample pattern is shown in Fig.7 (a). Finally, for the B component, the 4:1 subsample ratio is assigned and the subsample pattern is shown in Fig.7 (b). In the GICam-II image compression algorithm, the 8×8 2-D DCT is still used to transfer the R component. However, the 4×4 2-D DCT is used for G1 and G2 components because the incoming datum are reduced by subsample technique. Moreover, the G quantization table is also modified and shown in the Fig.8. Finally, the B component is directly transmitted; not be compressed, after extremely decreasing the incoming datum. Because of the non-compression for the B component, the 8×8 and 4×4 zig-zag scanning techniques are added into the GICam-II to further increase the compression rate for R, G1 and G2 components before entering the entropy encoding. In the GICam-II, the Lempel-Ziv (LZ) coding (18) is also employed for the entropy coding because of non-look-up tables and low complex computation.

$$SM\_{16:2m}(i,j) = BM\_{16:2m}(i \mod 4, j \mod 4)$$

$$m = 1,2,3,4,5,6,7,8. \tag{28}$$

$$\begin{aligned} BRM\_{16\cdot 2m}(k,l) &= \\ \begin{bmatrix} \mu\left(m-1\right)\ u\left(m-5\right)\ u\left(m-2\right)\ u\left(m-6\right) \\ \mu\left(m-7\right)\ u\left(m-3\right)\ u\left(m-8\right)\ u\left(m-4\right) \\ \mu\left(m-2\right)\ u\left(m-5\right)\ u\left(m-1\right)\ u\left(m-6\right) \\ \mu\left(m-7\right)\ u\left(m-3\right)\ u\left(m-8\right)\ u\left(m-4\right) \end{bmatrix} \\ \text{where } \mu(n) \text{ is a step function,} \mu\left(n\right) &= \begin{cases} 1, \text{ } for \ n \ge 0 \\ 0, \text{ } for \ n < 0. \end{cases} \end{aligned} \tag{29}$$

Fig. 7. (a) 2:1 subsample pattern (b) 4:1 subsample pattern.

#### **2.4 The architecture of subsample-based GICam image compressor**

Fig.9 shows the architecture of the GICam-II image compressor and it faithfully executes the proposed GICam-II image compression algorithm shown in Fig.6. The window size, *w*,

Controller receives the valid data and then selects the candidate subsample ratio to sample the candidate image data in the block order of G1, R, G2 and B. The Ping-Pong Write Controller can accurately receive the data loading command from the Down-Sample Controller and then pushes the downsample image data into the candidate one of the ping-pong memory. At the same time, the Ping-Pong Read Controller pushes the stored image data from another memory into the Transformation Coding. The Ping-Pong Write Controller and the Ping-Pong Read Controller will issue an announcement to the Ping-Pong Switch Controller, respectively while each data-access is finished. When all announcement arrives in turn, the Ping-Pong Switch Controller will generate a pulse-type Ping-Pong Switching signal, one clock cycle, to release each announcement signal from the high-level to zero for the Ping-Pong Write Controller and the Ping-Pong Read Controller. The Ping-Pong Switch Counter also uses the Ping-Pong Switching signal to switch the read/write polarity for each memory in the structure of the

Study on Low-Power Image Processing for Gastrointestinal Endoscopy 257

The Transformation Coding consists of the 2-D DCT and the quantizer. The goal of the transformation coding is to transform processing data from the spatial domain into the spatial frequency domain and further to shorten the range in the spatial frequency domain before entropy coding in order to increasing the compression ratio. The 2-D DCT alternatively calculates row or column 1-D DCTs. The 1-D DCT is a multiplier-less implementation using the algebraic integer encoding (11). The algebraic integer encoding can minimize the number of addition operations. As regards the RG quantizer, the GICam-II image compressor utilizes the barrel shifter for power-of-two products. The power-of-two quantization table shown in Fig.8 can reduce the cost of multiplication while quality degradation is quite little. In addition, the 8-by-8 memory array between the quantizer and the LZ77 encoder is used to synchronize the operations of quantization and LZ77 encoding. Since the frame rate of GICam-II image compressor is 2 frames/second, the 2-D DCT can be folded to trade the hardware cost with the computing speed, and the other two data processing units, quantization and LZ77 encoder, can operate at low data rate. Due to non-compression for the B component, the B component is directly transmitted from the ping-pong memory, not be compressed. Finally, the LZ77 encoder is implemented by block-matching approach and the detail of each processing

We have particularly introduced the method of efficiently decreasing the incoming datum with the subsmaple technique in the GICam-II compression algorithm. The performance of the compression rate, the quality degradation and the ability of power saving will then be

In this paper, twelve GI images are tested and shown in the Fig.3. First of all, the target compression performance of the GICam-II image compression is to reduce image size by at least 75% . To meet the specification, we have to exploit the cost-optimal LZ coding parameters. There are two parameters in the LZ coding to be determined: the window size, *w*, and the maximum matching length,*l*. The larger the parameters, the higher the compression ratio will be; however,the implementation cost will be higher. In addition, there are two kinds

element and overall architecture have been also shown in paper (11).

experimentally analyzed using the GICamm-II compressor.

**2.5.1 The analysis of compression rate for GI images**

Ping-Pong Memory.

**2.5 Experimental results**



(a) (b)

Fig. 8. (a)The modified R quantization table (b) The modified G quantization table.

and the maximum matching length,*l* parameters for LZ77 encoder can be loaded into the parameter register file via a serial interface after the initial setting of the hardware reset. Similarly, coefficients of 2-D DCT and parameters of initial setting for all controllers shown in Fig.9 can be also loaded into the parameter register file. The GICam-II image compressor processes the image in the block order of G1, R, G2 and B. Because the data stream from the image sensor is block-based, the GICam-II image compressor adopts the structure of ping-pong memory to hold each block of data. The advantage of using this structure is the high parallelism between the data loading and data precessing.

Fig. 9. The GICam-II image compressor.

When the GICam-II image compressor begins, the proposed architecture first loads the incoming image in the block order of G1, R, G2 and B from the image sensor and passes them with the valid signal control via the Raw-Data Sensor Interface. The Raw-Data Sensor Interface is a simple register structure with one clock cycle delay. This design absolutely makes sure that no any glue-logic circuits that can affects the timing of logic synthesis exists between the raw image sensor and the the GICam-II image compressor. The Down-Sample

14 Will-be-set-by-IN-TECH

(a) (b)

Fig. 8. (a)The modified R quantization table (b) The modified G quantization table.

and the maximum matching length,*l* parameters for LZ77 encoder can be loaded into the parameter register file via a serial interface after the initial setting of the hardware reset. Similarly, coefficients of 2-D DCT and parameters of initial setting for all controllers shown in Fig.9 can be also loaded into the parameter register file. The GICam-II image compressor processes the image in the block order of G1, R, G2 and B. Because the data stream from the image sensor is block-based, the GICam-II image compressor adopts the structure of ping-pong memory to hold each block of data. The advantage of using this structure is the

> Ping-Pong Read Controller

0

1

Memory Read Done

When the GICam-II image compressor begins, the proposed architecture first loads the incoming image in the block order of G1, R, G2 and B from the image sensor and passes them with the valid signal control via the Raw-Data Sensor Interface. The Raw-Data Sensor Interface is a simple register structure with one clock cycle delay. This design absolutely makes sure that no any glue-logic circuits that can affects the timing of logic synthesis exists between the raw image sensor and the the GICam-II image compressor. The Down-Sample

Register File

> 8x8/4x4 2-D DCT

*Transformation Coding*

Parameters From Serial Interface

8x8/4x4 Quantizer

*Entropy Coding Buffer*

4x4 Memory 4x4 Memory 4x4 Memory 4x4 Memory

LZ77 Encoder

*Entropy Coding*

Compressed Data Selector

Entropy Coding Buffer Controller

> Compressed Image

Down sample B

Memory Data Selector

Ping-Pong Switch Controller

Ping-Pong Counter

Ping-Pong Switching

*Ping-Pong Memory*

Top Controller

01

Read Address

01

4x4 Memory 4x4 Memory 4x4 Memory 4x4 Memory

4x4 Memory 4x4 Memory 4x4 Memory 4x4 Memory

R/W

G1/G2/R

0/1

32 32 32 32 32 32 64 64 32 16 16 32 32 64 64 128 32 16 16 32 32 64 128 128 32 32 32 32 64 64 128 256 32 32 32 64 64 128 128 256 64 64 64 128 128 128 256 256 64 128 128 128 256 256 256 256 128 128 128 256 256 256 256 512

high parallelism between the data loading and data precessing.

Hardware Reset Parameter

Down-Sample Controller

Raw-data Sensor Interface

System Clock

G1, R, G2, B, Raw Image

> Data Bus Control Bus

Fig. 9. The GICam-II image compressor.

Ping-Pong Write Controller

> Memory Write Done

Write Address 16 16 32 32 16 16 32 64 32 32 64 64 64 64 128 128 Controller receives the valid data and then selects the candidate subsample ratio to sample the candidate image data in the block order of G1, R, G2 and B. The Ping-Pong Write Controller can accurately receive the data loading command from the Down-Sample Controller and then pushes the downsample image data into the candidate one of the ping-pong memory. At the same time, the Ping-Pong Read Controller pushes the stored image data from another memory into the Transformation Coding. The Ping-Pong Write Controller and the Ping-Pong Read Controller will issue an announcement to the Ping-Pong Switch Controller, respectively while each data-access is finished. When all announcement arrives in turn, the Ping-Pong Switch Controller will generate a pulse-type Ping-Pong Switching signal, one clock cycle, to release each announcement signal from the high-level to zero for the Ping-Pong Write Controller and the Ping-Pong Read Controller. The Ping-Pong Switch Counter also uses the Ping-Pong Switching signal to switch the read/write polarity for each memory in the structure of the Ping-Pong Memory.

The Transformation Coding consists of the 2-D DCT and the quantizer. The goal of the transformation coding is to transform processing data from the spatial domain into the spatial frequency domain and further to shorten the range in the spatial frequency domain before entropy coding in order to increasing the compression ratio. The 2-D DCT alternatively calculates row or column 1-D DCTs. The 1-D DCT is a multiplier-less implementation using the algebraic integer encoding (11). The algebraic integer encoding can minimize the number of addition operations. As regards the RG quantizer, the GICam-II image compressor utilizes the barrel shifter for power-of-two products. The power-of-two quantization table shown in Fig.8 can reduce the cost of multiplication while quality degradation is quite little. In addition, the 8-by-8 memory array between the quantizer and the LZ77 encoder is used to synchronize the operations of quantization and LZ77 encoding. Since the frame rate of GICam-II image compressor is 2 frames/second, the 2-D DCT can be folded to trade the hardware cost with the computing speed, and the other two data processing units, quantization and LZ77 encoder, can operate at low data rate. Due to non-compression for the B component, the B component is directly transmitted from the ping-pong memory, not be compressed. Finally, the LZ77 encoder is implemented by block-matching approach and the detail of each processing element and overall architecture have been also shown in paper (11).

#### **2.5 Experimental results**

We have particularly introduced the method of efficiently decreasing the incoming datum with the subsmaple technique in the GICam-II compression algorithm. The performance of the compression rate, the quality degradation and the ability of power saving will then be experimentally analyzed using the GICamm-II compressor.

#### **2.5.1 The analysis of compression rate for GI images**

In this paper, twelve GI images are tested and shown in the Fig.3. First of all, the target compression performance of the GICam-II image compression is to reduce image size by at least 75% . To meet the specification, we have to exploit the cost-optimal LZ coding parameters. There are two parameters in the LZ coding to be determined: the window size, *w*, and the maximum matching length,*l*. The larger the parameters, the higher the compression ratio will be; however,the implementation cost will be higher. In addition, there are two kinds

79.00 80.00 81.00 82.00 83.00 84.00 85.00 86.00 87.00

Compression rate (%)

the GICam-II image compressor .

image is invisible.

1 2 3 4 5 6 7 8 9 10 11 12 Test Picture ID

Study on Low-Power Image Processing for Gastrointestinal Endoscopy 259

Fig. 11. The compression performance of LZ77 coding that combines with the quantization in

*M*−1 ∑ *i*=0

To demonstrate the validity of decompressed images, five professional gastroenterology doctors from the Division of Gastroenterology, Taipei Medical University Hospital are invited to verify whether or not the decoded image quality is suitable for practical diagnosis. The criterion of evaluation is shown in Table 5. The score between 0 and 2 means that the diagnosis is affected, the score between 3 and 5 means that the diagnosis is slightly affected and the score between 6 and 9 means that the diagnosis is not affected. According to the evaluation results of Fig.13, all decoded GI images are suitable for practical diagnosis because of high evaluation score and the diagnoses are absolutely not affected, except for the 5th and 8th decoded images. The degrees of diagnoses are between no affection and extremely slight affection for the 5th and the 8th decoded images because only two doctors subjectively feel their diagnoses are slightly affected. However, these two decoded images are not mistaken in

*N*−1 ∑ *j*=0

(*αij* − *βij*)

*PSNRY* <sup>=</sup> <sup>10</sup>*log*10( <sup>2552</sup>

*<sup>M</sup>* <sup>×</sup> *<sup>N</sup>* )

*MSE* = ( <sup>1</sup>

Fig. 10. The compression performance of the GICam-II image compressor.

R(W,l)=(32,32) G(W,l)=(16,8) R(W,l)=(32,32) G(W,l)=(16,16) R(W,l)=(32,32) G(W,l)=(32,8) R(W,l)=(32,32) G(W,l)=(32,16) R(W,l)=(32,64) G(W,l)=(16,8) R(W,l)=(32,64) G(W,l)=(16,16) R(W,l)=(32,64) G(W,l)=(32,8) R(W,l)=(32,64) G(W,l)=(32,16) R(W,l)=(64,32) G(W,l)=(16,8) R(W,l)=(64,32) G(W,l)=(16,16) R(W,l)=(64,32) G(W,l)=(32,8) R(W,l)=(64,32) G(W,l)=(32,16) R(W,l)=(64,64) G(W,l)=(16,8) R(W,l)=(64,64) G(W,l)=(16,16) R(W,l)=(64,64) G(W,l)=(32,8) R(W,l)=(64,64) G(W,l)=(32,16)

*MSE*) (32)

<sup>2</sup> (33)

of LZ codings in the GICam-II compressor, one is R(*w*, *l*) for R component and the other is G(*w*, *l*) for G1 and G2 components. We set the values of parameters by using a compression ratio of 4:1 as the threshold. Our goal is to determine the minimum R(*w*, *l*) and G(*w*, *l*) sets under the constraint of 4:1 compression ratio.

The compression ratio (CR) is defined as the ratio of the raw image size to the compressed image size and formulated as Eq.30. The measure of the compression ratio is the compression rate. The formula of the compression rate is calculated by Eq.31. The results in Fig.10 are shown by simulating the behavior model of GICam-II compressor; it is generated by MATLAB. As seen in Fig.10, simulating with twelve endoscopic pictures, (32, 32) and (16, 8) are the minimum R(*w*, *l*) and G(*w*, *l*) sets to meet the compression ratio requirement. The subsample technique of the GICam-II compressor initially reduces the input image size by 43.75% ((1-1/4-(1/4\*1/2\*2)-(1/4\*1/4))\*100%) before executing the entropy coding, LZ77 coding. Therefore, the overall compression ratio of GICam-II compressor minus 43.75% is the compression effect of LZ77 coding that combines with the quantization, and the simulation results are shown in Fig.11.

This research paper focuses to propose a subsample-based low-power image compressor for capsule gastrointestinal endoscopy. This obvious reddish characteristic is due to the slightly luminous intensity of LEDs and the formation of image in the capsule gastrointestinal endoscopy. The GICam-II compression algorithm is motivated on the basis of this reddish pattern. Therefore, we do not consider compressing other endoscopic images except for gastrointestinal images to avoid the confusion of topic for this research. However, general endoscopic images generated via a wired endoscopic takes on the yellow characteristic due to the vividly luminous intensity of LEDs. The yellow pattern mainly consists of red and green and it also complies with the color sensitivity result in this research work. Therefore, I believe that the proposed GICam-II still supports good compression ratio for general endoscopic images.

$$\text{Compression Ratio (CR)} = \frac{\text{bits before compression}}{\text{bits after compression}}\tag{30}$$

$$\text{Compression Rate} = (1 - \text{CR}^{-1}) \times 100\% \tag{31}$$

#### **2.5.2 The analysis of compression quality for GI images**

Using (32, 32) and (16, 8) as the parameter sets, in Table 4, we can see the performance in terms of the quality degradation and compression ratio. The measure of compression quality is the peak signal-to-noise ratio of luminance (PSNRY). The calculation of PSNRY is formulated as Eq.32. Where MSE is the mean square error of decompressed image and is formulated as Eq.33. In Eq.33, *αij* is the luminance value of original GI image and *βij* is the luminance value of decompressed GI image. The result shows that the degradation of decompressed images is quite low while the average PSNRY is 40.73 dB. Fig.12 illustrates the compression quality of decoded test pictures. The difference between the original image and the decompressed

Fig. 10. The compression performance of the GICam-II image compressor.

Fig. 11. The compression performance of LZ77 coding that combines with the quantization in the GICam-II image compressor .

image is invisible.

16 Will-be-set-by-IN-TECH

of LZ codings in the GICam-II compressor, one is R(*w*, *l*) for R component and the other is G(*w*, *l*) for G1 and G2 components. We set the values of parameters by using a compression ratio of 4:1 as the threshold. Our goal is to determine the minimum R(*w*, *l*) and G(*w*, *l*) sets

The compression ratio (CR) is defined as the ratio of the raw image size to the compressed image size and formulated as Eq.30. The measure of the compression ratio is the compression rate. The formula of the compression rate is calculated by Eq.31. The results in Fig.10 are shown by simulating the behavior model of GICam-II compressor; it is generated by MATLAB. As seen in Fig.10, simulating with twelve endoscopic pictures, (32, 32) and (16, 8) are the minimum R(*w*, *l*) and G(*w*, *l*) sets to meet the compression ratio requirement. The subsample technique of the GICam-II compressor initially reduces the input image size by 43.75% ((1-1/4-(1/4\*1/2\*2)-(1/4\*1/4))\*100%) before executing the entropy coding, LZ77 coding. Therefore, the overall compression ratio of GICam-II compressor minus 43.75% is the compression effect of LZ77 coding that combines with the quantization, and the simulation

This research paper focuses to propose a subsample-based low-power image compressor for capsule gastrointestinal endoscopy. This obvious reddish characteristic is due to the slightly luminous intensity of LEDs and the formation of image in the capsule gastrointestinal endoscopy. The GICam-II compression algorithm is motivated on the basis of this reddish pattern. Therefore, we do not consider compressing other endoscopic images except for gastrointestinal images to avoid the confusion of topic for this research. However, general endoscopic images generated via a wired endoscopic takes on the yellow characteristic due to the vividly luminous intensity of LEDs. The yellow pattern mainly consists of red and green and it also complies with the color sensitivity result in this research work. Therefore, I believe that the proposed GICam-II still supports good compression ratio for general endoscopic

*Compression Ratio* (*CR*) = *bits be f ore compression*

Using (32, 32) and (16, 8) as the parameter sets, in Table 4, we can see the performance in terms of the quality degradation and compression ratio. The measure of compression quality is the peak signal-to-noise ratio of luminance (PSNRY). The calculation of PSNRY is formulated as Eq.32. Where MSE is the mean square error of decompressed image and is formulated as Eq.33. In Eq.33, *αij* is the luminance value of original GI image and *βij* is the luminance value of decompressed GI image. The result shows that the degradation of decompressed images is quite low while the average PSNRY is 40.73 dB. Fig.12 illustrates the compression quality of decoded test pictures. The difference between the original image and the decompressed

**2.5.2 The analysis of compression quality for GI images**

*bits a f ter compression* (30)

*Compression Rate* = (<sup>1</sup> <sup>−</sup> *CR*−1) <sup>×</sup> 100% (31)

under the constraint of 4:1 compression ratio.

results are shown in Fig.11.

images.

$$PSNRY = 10 \log\_{10}(\frac{255^2}{MSE}) \tag{32}$$

$$MSE = (\frac{1}{M \times N}) \sum\_{i=0}^{M-1} \sum\_{j=0}^{N-1} (\alpha\_{ij} - \beta\_{ij})^2 \tag{33}$$

To demonstrate the validity of decompressed images, five professional gastroenterology doctors from the Division of Gastroenterology, Taipei Medical University Hospital are invited to verify whether or not the decoded image quality is suitable for practical diagnosis. The criterion of evaluation is shown in Table 5. The score between 0 and 2 means that the diagnosis is affected, the score between 3 and 5 means that the diagnosis is slightly affected and the score between 6 and 9 means that the diagnosis is not affected. According to the evaluation results of Fig.13, all decoded GI images are suitable for practical diagnosis because of high evaluation score and the diagnoses are absolutely not affected, except for the 5th and 8th decoded images. The degrees of diagnoses are between no affection and extremely slight affection for the 5th and the 8th decoded images because only two doctors subjectively feel their diagnoses are slightly affected. However, these two decoded images are not mistaken in

Fig. 13. The evaluation results of professional gastroenterology doctors.

professional gastroenterology doctors can be shown in the last subsection.

**3. Rank-Order Filtering (ROF) with a maskable memory**

To validate the GICam-II image processor, we used the FPGA board of Altera APEX 2100 K to verify the function of the GICam-II image processor and the prototype is shown in Fig.14. After FPGA verification, we used the TSMC 0.18 *μ*m 1P6M process to implement the GICam-II image compressor. When operating at 1.8 V, the power consumption of logic part is 3.88 mW, estimated by using PrimePower*TM*. The memory blocks are generated by Artisan memory compiler and consume 5.29 mW. The total power consumption is 9.17 mW for the proposed design. When comparing the proposed GICam-II image compressor with our previous GICam one in Table 6, the power dissipation can further save 38.5% under the approximate condition of quality degradation and compression ratio because of the reduction of memory requirement

Study on Low-Power Image Processing for Gastrointestinal Endoscopy 261

The GICam-II compressor has poorer image reconstruction than JPEG and our previous GICam one because the GICam-II compressor uses the subsample scheme to down sample green and blue components according to the 2:1 and the 4:1 subsample ratios. The raw data before compression has lost some raw data information. Hence, the decoded raw data should be reconstructed (the first interpolation) before reconstructing the color images (the second interpolation). Using two level interpolations to reconstruct the color images has poorer image quality than one level interpolation. Fortunately, the decoded image quality using GICam-II compressor can be accepted and suitable for practical diagnosis and the evaluation results of

Finally, we compare the GICam-II image processor with other works and the comparison results are shown in the Table 7. According to the comparison results, our proposed GICam-II image compressor has lower area and lower operation frequency. It can fit into the existing

Rank-order filtering (ROF), or order-statistical filtering, has been widely applied for various speech and image processing applications [1]-[6]. Given a sequence of input samples *{xi*−*k*, *xi*−*k*<sup>+</sup>1, ..., *xi*, ..., *xi*+*l}*, the basic operation of rank order filtering is to choose the *<sup>r</sup>*-th largest sample as the output *yi*, where *r* is the rank-order of the filter. This type of ROF is normally classified as *the non-recursive ROF* . Another type of ROF is called *the recursive ROF*. The difference between the recursive ROF and the non-recursive ROF is that

**2.5.3 The analysis of power saving**

for G1, G2 and B components.

designs.


Table 4. The simulation results of twelve tested pictures.

Fig. 12. Demosaicked GI images.

diagnosis for these professional gastroenterology doctors. Therefore, the PSNRY being higher than 38 dB is acceptable according to the objective criterion of gastroenterology doctors.


Table 5. The criterion of evaluation.

Fig. 13. The evaluation results of professional gastroenterology doctors.

### **2.5.3 The analysis of power saving**

18 Will-be-set-by-IN-TECH

Test Picture ID PSNRY Compression rate

 40.76 82.36 41.38 82.84 39.39 80.62 38.16 79.70 42.56 84.25 41.60 83.00 41.03 82.74 43.05 84.63 40.21 82.11 40.36 81.84 39.39 80.66 40.85 82.60 Average 40.73 82.28

#1 #2 #3 #4

#5 #6 #7 #8

#9 #10 #11 #12

diagnosis for these professional gastroenterology doctors. Therefore, the PSNRY being higher than 38 dB is acceptable according to the objective criterion of gastroenterology doctors. Score Description 0 ∼ 2 diagnosis is affected 3 ∼ 5 diagnosis is slightly affected 6 ∼ 9 diagnosis is not affected

Table 4. The simulation results of twelve tested pictures.

Fig. 12. Demosaicked GI images.

Table 5. The criterion of evaluation.

(dB) (%)

To validate the GICam-II image processor, we used the FPGA board of Altera APEX 2100 K to verify the function of the GICam-II image processor and the prototype is shown in Fig.14. After FPGA verification, we used the TSMC 0.18 *μ*m 1P6M process to implement the GICam-II image compressor. When operating at 1.8 V, the power consumption of logic part is 3.88 mW, estimated by using PrimePower*TM*. The memory blocks are generated by Artisan memory compiler and consume 5.29 mW. The total power consumption is 9.17 mW for the proposed design. When comparing the proposed GICam-II image compressor with our previous GICam one in Table 6, the power dissipation can further save 38.5% under the approximate condition of quality degradation and compression ratio because of the reduction of memory requirement for G1, G2 and B components.

The GICam-II compressor has poorer image reconstruction than JPEG and our previous GICam one because the GICam-II compressor uses the subsample scheme to down sample green and blue components according to the 2:1 and the 4:1 subsample ratios. The raw data before compression has lost some raw data information. Hence, the decoded raw data should be reconstructed (the first interpolation) before reconstructing the color images (the second interpolation). Using two level interpolations to reconstruct the color images has poorer image quality than one level interpolation. Fortunately, the decoded image quality using GICam-II compressor can be accepted and suitable for practical diagnosis and the evaluation results of professional gastroenterology doctors can be shown in the last subsection.

Finally, we compare the GICam-II image processor with other works and the comparison results are shown in the Table 7. According to the comparison results, our proposed GICam-II image compressor has lower area and lower operation frequency. It can fit into the existing designs.
