# Segmentation of Rice Seedings Using the YCrCb Color Space and an Improved Otsu Method
## 2 Materials and Methods
### Color Space Analysis  
It is well known that the green chromaticity of rice seedlings is higher than that of red and blue in the RGB color space. Moreover, the background of paddy field cannot be assumed to be soils  
Figure 1: Image acquisition. (**A**) image acquisition device; (**B**) experimental field.  
due to water, mud, residual straws, shadow and so on, and rice seedling images are always taken under outdoor illumination. Therefore, it can be expected that an appropriate color space needs to be selected for the color-index-based segmentation method, which can reduce the influence of outdoor illumination on the segmentation quality of green rice seedlings. At present, most images taken by digital cameras are in RGB format. The RGB color space is adequate for image displaying, but not suitable for color-based segmentation because of the high correlation between the components R, G and B [20]. To achieve good segmentation results, the RGB color space is generally converted into other color spaces such as HSV (hue, saturation, value), HIS (hue, saturation, intensity), YCrCb, and L*a*b*and L*u*v*. Among these color spaces, the YCrCb color space is employed to standardize the images for television and is derived from the RGB color space using Equation (1) [21]:  
\[\left[\begin{array}{c}\mathrm{Y}\\ \mathrm{Cb}\\ \mathrm{Cr}\end{array}\right]=\left[\begin{array}{c}16\\ 128\\ 128\end{array}\right]+\left[\begin{array}{ccc}0.279&0.504&0.098\\ -0.148&-0.291&0.439\\ 0.439&-0.368&-0.071\end{array}\right]\left[\begin{array}{c}\mathrm{R}\\ \mathrm{G}\\ \mathrm{B}\end{array}\right], \tag{1}\]  
\[\mathrm{Cg}=128+\left[\begin{array}{cc}-0.318&0.439&-0.121\end{array}\right] \left[\begin{array}{c}\mathrm{R}\\ \mathrm{G}\\ \mathrm{B}\end{array}\right], \tag{2}\]  
where Y is a luminance component and Cr and Cb are two chrominance components. Cr and Cb essentially correspond to the color differences R-Y and B-Y, respectively. It can be seen that the luminance is decoupled from the chrominance in the YCrCb color space, and mapping an RGB color to the YCrCb space is a straightforward linear transformation that can simplify the calculation and speed up the conversion. Unlike the RGB color space, the green chrominance component is not described in the YCrCb color space, while rice seedling has a larger green chroma value than that of the background. Therefore, the selected color space should be able to describe the green chrominance component. In this regard, the Cg component is introduced to denote the color difference G-Y. It is defined as Equation (2), derived from Equation (1).  
Figure 2 shows the conversion results of typical rice seedling images in different color spaces. The first column shows the original images taken under different natural illumination (sunny or cloudy conditions) and different paddy field backgrounds (water, soil) in RGB format. The corresponding G component images are shown in the second column. The contrast between rice seedling and the background in the G images is not obvious, and is affected by the variation of illumination. As shown in Figure 2(C1), rice seedlings and the background cannot even be distinguished by human vision. Unlike the G component, green chrominance information without luminance is described in the Cg component. As seen in Figure 2(A2,B2,C2), rice seedlings are clear and can be differentiated from the background with interference factors such as highlight, shadow and mud. Therefore, the Cg component is discarded mainly due to the color itself rather than the luminance component, which can enhance rice seedling information in paddy fields with illumination variations.  
Figure 2: \(Cont.\)