# Segmentation of Rice Seedings Using the YCrCb Color Space and an Improved Otsu Method
## 2 Materials and Methods
### Image Graying Based on Color Index  
Considering that the green characteristic can be used to separate rice seedlings from the background, the green chrominance of the rice seedling region should be accentuated in the image graying process based on color-index, while that of the paddy field background region will be attenuated to improve segmentation results. Figure 3 shows 50 rice seedling images taken under different paddy field environments. Afterwards, the test images in the RGB color space are converted into Cr, Cg and Cb components and 150 rice seedling and background sampling points are randomly selected from the Cr, Cg and Cb images, respectively. Values of the Cr, Cg and Cb components for the rice seedling and background sampling points are shown in Figure 4. As seen in Figure 4, pixel values of rice seedlings in the Cg image are larger than that of the background, and pixel values of rice seedlings in the Cg image are greater than pixel values of rice seedlings in the Cr and Cb images.  
Figure 3: \(Cont.\)  
Figure 2: The typical rice seedling images in paddy fields and conversion results in different color spaces. (**A**) the original rice seedling image with highlight on a sunny day; (**A1**,**A2**) correspond to images of G and Cg; (**B**) the original seedling image with shadow on a sunny day; (**B1**,**B2**) correspond to images of G and Cg; (**C**) the original seedling image with much mud on a cloudy day; (**C1**,**C2**) correspond to images of G and Cg.  
In order to describe the color difference between the rice seedlings and the background effectively, the differences between the Cg and Cr, and between the Cg and Cb of the sampling points are calculated, respectively. Figure 5 describes the relationship between Cg-Cr and Cg-Cb for the rice seedling and background sampling points. In Figure 5, the horizontal axis shows the value of Cg-Cr and the vertical axis shows the value of Cg-Cb From Figure 5, it can be noted that the rice seedling points and the background points converge in different bounded regions of the (Cg-Cr, Cg-Cb) plane. Therefore, one or more boundary lines can separate rice seedlings and the background. According to the definition of a straight line, the boundary line can be defined as:  
\[a(Cg-Cr)+b(Cg-Cb)>T, \tag{3}\]  
where \(Cg\), \(Cr\) and \(Cb\) are the Cg component value, Cr component value and Cb component value, respectively; \(T\) is a threshold; \(a\) and \(b\) are the weight of \(Cg\)-\(Cr\) and \(Cg\)-\(Cb\). Motivated by the idea of  
Figure 4: Values of the Cr, Cg and Cb components for (**A**) rice seedling and (**B**) background sampling points.  
Figure 3: The test rice seedling images.  
ExG(2G-R-B) defined by Equation (4) in which \(R\), \(G\), \(B\) denote values of the R, G and B components, we set the values of a and b mentioned in Equation (3) to 1. Thus, Equation (3) is rewritten as Equation (5):  
\[\text{ExG}=\left\{\begin{array}{lr}0&2G-R-B<0\\ 2G-R-B&0<2G-R-B<255\\ 255&2G-R-B>255,\end{array}\right. \tag{4}\]  
\[2 Cg-Cr-Cb>T. \tag{5}\]  
Figure 6 shows the distribution of 2 Cg-Cr-Cb of the rice seedling and background sampling points, where the contrast between the rice seedlings and the background is clear. As a result, we are motivated to use 2 Cg-Cr-Cb as the color index to extract the gray image.