# Raw Material Flow Rate Measurement on Belt Conveyor System Using Visual Data
## 3 Methodology
### Pre-Processing  
The conveyor belt is installed in an outdoor environment due to its long length and the materials it carries; hence, the environmental factor varies significantly with the weather and other environmental conditions. Furthermore, being outdoors, the raw material contains much dust and sometimes affects the video quality by adding much noise. Due to this, it is essential to pre-process the data to make sure that the material is fairly visible. For this, a kernel is convolved on an image by computing some function of that pixel and its neighbors, to perform a transformation, such as highlighting or sharpening its edges [29] or  
Figure 4: (**a**) Original image, (**b**) Lines drawn to separate the region of interest, (**c**) Masked region inside the lines and, (**d**) Extracted region.  
Figure 3: Conceptual map of the proposed framewrk.  
removing the noise by blurring the image [30, 31]. These transformations serve as features for many machine learning or deep learning tasks, especially in the case of convolution neural networks [32], where it helps the network extract important features. Hence, as a pre-processing step, we first sharpen the image by convolving it using a kernel of size \(3\times 3\) shown in Figure 5. Convolving the kernel allows us to give a value that best represents the area under that kernel and aids in extracting features of the image.  
Sharpening the image helps distinguish the raw material transferred on the belt, providing grounds for better segmentation. However, with sharpening, the noise in the image is also enhanced, which damages the overall quality of the image; thus, blurring is applied to each frame to suppress the noise. Gaussian smoothing [33] is the most famous technique which uses Gaussian distribution as its kernel. The disadvantage of Gaussian blurring is that it blurs the image uniformly, meaning that each region has equal importance. However, in our scenario, the edges of the raw material should be maintained to keep it easily distinguishable. Thus, for this case, we have used the bilateral filtering technique [34] which serves as an advanced version of Gaussian blurring as it maintains the edge information while removing noises. These two differences can be seen in Figure 6. It utilizes the Gaussian distribution values but considers distance and pixel value differences. The bilateral filter starts with linear Gaussian smoothing.  
\[g(x)=(f*G^{s})(x)=\int_{\mathcal{R}}f(y)G^{s}(x-y)dy \tag{1}\]  
The weight is only dependent on the spatial distance \(\|x-y\|\). The bilateral filter adds a weighting term that depends on the total distance \(f(y)-f(x)\). This results in:  
\[g(x)=\frac{\int_{\mathcal{R}}f(y)G^{s}(x-y)G^{t}(f(x)-f(y))dy}{\int_{\mathcal{ R}}G^{s}(x-y)G^{t}(f(x)-f(y))dy} \tag{2}\]  
The camera is mounted on top of the conveyor belt, which increases its field of vision and makes it capture a lot of unnecessary areas. We also do not need the entire belt region for our study; therefore, we have only selected the region close to the camera. Since the limestone will always be between 63.5-127 mm and coke between 35-55 mm in size, based on this information, given its maximum size limits, we have chosen the optimal region of size \(420\times 100\) at the end of the belt, which is closest to the camera (see Figure 7). It saves computation as the region to process in a frame has reduced.  
Figure 5: Kernel used for image sharpening in pre-processing step.  
Figure 6: Image blurring results on a sample frame from the dataset using a Gaussian blur kernel (**a**) and bilateral filtering (**b**).