# Raw Material Flow Rate Measurement on Belt Conveyor System Using Visual Data
## 3 Methodology
### Feature Extraction  
Once the raw material on the belt is segmented, it can be further processed to extract features for estimating the flow rate. Two techniques are used to extract features; moments information and contour feature information. \begin{table}
\begin{tabular}{c c c c c} \hline \hline \multirow{2}{*}{**Operator**} & \multicolumn{3}{c}{**Frame Difference**} & \multicolumn{2}{c}{**Background Subtraction CNT**} \\ \cline{2-5}  & **SE** & **IT** & **SE** & **IT** \\ \hline Open & \(4\times 4\) & 1 & \(4\times 4\) & 1 \\ Dilation & \(7\times 7\) & 5 & \(6\times 6\) & 5 \\ Close & \(7\times 7\) & 8 & \(4\times 4\) & 10 \\ \hline \hline \end{tabular}
\end{table} 
Table 2: Morphology Parameters Setting. SE: Structuring Element. Figure 12: Rectangular structuring element (**left**), and ellipse structuring element (**right**). One of the most significant features to extract from images is moments [49]. They are useful to describe the object of interest in an image after segmentation in terms of physical properties; for instance, area, eccentricity, orientation, centroid etc. In other words, these scalar quantities have been used in statistics to describe a shape or to quantify the mass distribution [50]. Various orders of moments can be computed which can make the calculations scale invariant, translation invariant and rotation invariant. These features are calculated by taking the weighted average of the pixel intensities, as shown in the formula below:  
\[m=\sum_{x}\sum_{y}I(x,y) \tag{4}\]  
where \(I\) is a grayscale image of size \(M\times N\), and \(1\leq x\leq M\,1\leq y\leq N\). For our problem, various spatial moments, central moments, and normalized central moments have been used. The spatial moments are used to give information about the object in the image pertinent to its positioning and are computed as follows:  
\[m_{ij}=\sum_{x}\sum_{y}x^{i}y^{j}I(x,y) \tag{5}\]  
Figure 14: (**a**) Extra region segmented by frame difference, (**b**) extra region segmented by background subtraction on sample input frame. Figure 13: Flowchart of proposed end-to-end segmentation algorithm. In case of central moments, the origin of the coordinate system is moved to center of gravity or centroid of the object, for the purpose of translational invariance adjustment. These features are computed as follows:  
\[\mu_{ij}=\sum_{x}\sum_{y}(x-\bar{x})^{i}(y-\bar{y})^{j}I(x,y) \tag{6}\]  
where \(\bar{x}\) and \(\bar{y}\) represent the centroid of the object. Lastly, the normalized central moments factor in the area of object for scaling. Thus, in addition to translational invariance, they become scale invariant as well. The normalized central moments can be calculated as:  
\[v_{ij}=\frac{\mu_{ij}}{\mu_{00}^{\left(1+\frac{(i+j)}{2}\right)}} \tag{7}\]  
Contour information [51] is also extracted for each region of the segmented image to achieve better results. As a result of segmentation, the resulting image has four different regions left in it: background, a small portion of the conveyor belt close to the raw material, and the two raw materials, i.e., coke, which is of black color, and limestone in white color. First, \(k\)-means image segmentation is used to cluster each region of the image based on its color information [52]. Afterward, we extract area information of these regions using contour. Since most of the region is already segmented, it makes it easy for \(k\)-means to segment the regions of interest easily based on their color information. Based on the information about the image we have, \(k=4\) seems the optimal choice since we have four regions in the image. With \(k\) set to 4, the \(k\)-mean clustering performs well to segment each region of the image but still, for the third cluster in Figure 15, there is a region of limestone which is in the same cluster as the conveyor belt. Thus, increasing the total clusters makes segmentation at a more granular level. After clustering, we extract the area of all the clusters and used it along with the moment features.