Designing the Yellow Head Virus Syndrome Recognition Application for Shrimp on an Embedded System

One of the most serious problems confronted by the shrimp farming industry is the disease caused by the yellow head virus (YHV). This research proposes an image processing algorithm to detect, identify and eliminate shrimp with the yellow head virus from the Litopenaeus vannamei gathering lines. Using a Raspberry Pi 3 module with the support of the OpenCV library which may be associated with Niblack’s algorithm is primarily suitable for segmentation. First, the shrimp object was identified and separated from the background using the image segmentation technique and the boundary that surrounds the object. Then, identification of diseased shrimp was analysed based on colour threshold. In this study, the sample of shrimp disease group had the highest amount of ratio, with about 6% to 11%. Most of the samples without the disease had a ratio of 0%. The experimental results show that the system can identify and accurately determine the coordinates of shrimp with yellow head virus disease and send information to the shrimp classification system in the food industry.

The traditional diagnostic methods include pathological observations or pathologic histology that do not allow for accurate detection of pathogens early. Many molecular methods like in situ, western blot, polymerase chain reaction (PCR), reverse transcription polymerase chain reaction (RT-PCR) (Dhar et al., 2002) which are developed to overcome these disadvantages. The PCR methods are currently being used widely and effectively in shrimp testing. However, one of the significant limitations of PCR are false-negative phenomenon which takes a lot of time and is a lowefficiency detection (Amarakoon and Wijegoonawardane, 2017).
Considering some practical applications in this field, the authors realize the shrimp identification and classification system during the process of gathering is very important. This paper proposes the method of image processing embedded with Raspberry Pi 3 module (Tran et al., 2017). It also considers the applicability of the system to observe, analyse and identify diseased shrimp of the shrimp classification process in the industry.

System Overview
The input images are recognized by the Pi Camera and connect with Raspberry Pi 3 via the Camera driver, the image is recorded in a raw form which will be processed using specific algorithms with the support of the OpenCV library (Bradski and Kaehler, 2008). This paper proposes the extraction method and sends a series of coordinates to the actuator block. At the same time, the features of the images will be shown on a PC/Laptop with the support of SSH/ Putty through IP address that is provided by Router. This model is shown in

Object Detection
The input image contains objects that will be reduced noise and removed background using the image segmentation algorithm. An adaptive threshold solution specifically is used specifically for this process. The detailed disposition steps are shown in Figure 2. This method is based on homogeneity -the same in term of grey level, colour, etc., which is a simple and common method in image segmentation because of its simplicity and fast performance.

Input images
Convert from RGB to gray Segmentation Find contours Background subtraction Results

Figure 2
The object detection

Otsu's Algorithm
Otsu algorithm was launched by Nobuyuki Otsu (Huang et al., 2012). The objective of this algorithm is to determine a threshold T automatically based on greyscale values of the pixels in order to replace the use of fixed segment in the problem binary image based on threshold greyscale. The basic content of the method is described as follows: First, convert the input images to greyscale images and statistics on the number of grey levels, assuming there is  (0 255) LL greyscale in the image. We dichotomize the . From that, we calculate the optimal threshold T* by the formula (1): T is identified by formula from (2) to (6). Variance: Probability appear of 1 C : Probability appear of 2 C : Average grey level of 1 C : Average grey level of 2 C : Solutions segment images by Otsu algorithm are a simple algorithm for calculating the threshold T . It is available for global thresholding. So, threshold T is an important and factor that determines the success of the algorithm. Figure 3(a) shows, two threshold 1 T and 2 T is determined through the average value calculated on the histogram. The area between 1 T and 2 T is the area of the object, the rest is the background. For the case of shrimp sample 1, we detect the object easy because of the clearly partition of the peaks on the histogram. In contrast, the incorrect segmental result is shown in Figure 3(b) because of the difficulty in determining threshold 1 T and 2 T based on the histogram.

Figure 3
The results of images segmentation by Otsu algorithm

Niblack's Algorithm
where ( , ) b x y is the binarized image and  ( , ) [0,1] I x y be intensity of a pixel at location ( , ) xy of the image I . In the local adaptive technique, a threshold is calculated for each pixel, based on some local statistics such as range, variance, or surface-fitting parameters of the neighboring pixels. It can be approached in different ways, such as background subtraction (Lu et al., 2010), water flow model (Oh et al., 2005), mean and standard derivation of pixel values (Sauvola and Pietikäinen, 2000) and local image contrast (Su et al., 2010). Some drawbacks of the local thresholding techniques are region size dependant, individual image characteristics, and time-consuming. Therefore, some researchers use a hybrid approach that applies both global and local thresholding methods (Gatos et al., 2006) and some use morphological operators (Le et al., 2011). Niblack (Niblack, 1985), Sauvola and Pietikäinen (Sauvola and Pietikäinen, 2000) use the local variance technique while Bernse (Bernse, 1986) uses midrange value within the local block. Niblack (Niblack, 1985) proposed an algorithm that calculates a pixel-wise threshold by shifting a rectangular window across the image. This method varies the threshold over the image, based on the local mean and local standard deviation. Let the local area be  bb . Also, the threshold ( , ) ni T x y at pixel ( , ) f x y is determined by the following equation (8): As in the definition of equation (9)

Figure 4
The results of image segmentation by Niblack's algorithm Image segmentation techniques using Otsu algorithm is not suitable for many cases such as approximately uniform illumination or object is similar to the background. In this case, the image segment using the adaptive threshold method is quite appropriate the effectiveness of image segmentation using the Niblack's algorithm is presented in

Find Contours and Remove Background
After splitting the objects, binary images obtained at the image segment stage are filtered using a  55 Median filter to eliminate noise. We will delimit the object's field and draw the boundary using the contour method in order to find the boundary around objects that were binary. Then, this method saves the boundary into the vector that points lying on this boundary. The results of the search of the object are shown in Figure 5(a).

Figure 5 The results of find contours and remove background
The result of the subtraction process between finding contours and original images are shown in Figure 5(b). This process is very important in image processing. The purpose of the subtraction should be to eliminate noise from the background and increase the accuracy of the next steps.

Input images
Convert from RGB to HSV

Color threshold
Find contours Object position Results

Figure 6
The identification of YHV syndrome The detailed process to identify shrimp with YHV syndrome is shown in Figure 6.

HSV Colour Space
The RGB image is converted into the HSV space after object detection, because the HSV space and the HSL space are the same. Besides that, it is much used in image processing and a part of the computer vision technology. HSV is not the same as RGB, which is image intensities separation of colour information. This separation can be very helpful if we want to focus on the intensity component. Actually, sometimes we want to separate the different colour components from intensity for many various reasons such as increasing the saturation of colour or shadow removal.

Tran et al. Exchanges 2019 6(2), pp. 48-63
The main reason is that it separates the colour information from saturation or intensity. Because the values are separated, you can construct a chart or a threshold rule by saturation and hue. In theory, this will work regardless of the change of saturation on the value channel. In fact, it is just a nice improvement. Even by indicating the colour you still have a very significant representation of the base colour that would probably work far better than RGB. The final result is a stronger colour threshold than the simpler ones.

Colour Threshold and Find Contours
Colour threshold is a simple and common method in image segmentation because of its simplicity and fast performance (Kulkarni, 2012). The next steps of the algorithm will be performed and show for Hue component of HSV colour representation. In this step, the image is filtered in a range which is set by the user. The setting of the filter was prepared to detect YHV syndrome. White pixels are pixels that satisfy the filter's condition. Many small white pixels that can be seen will be eliminated in further steps of the algorithm. As it can be seen the red coloured object is easily extracted by thresholding HSV values. However, the drawback is that function findContours finds any white coloured contour that was found in the thresholded image. The morphological operations (such as erosion and dilution) are able to eliminate noise effects.

Object Position
After separating the object from the background and delimiting the object by the contours, we find the centre of the object. To determine the coordinates of the object we have to find the moment of the image that is shown in theoretical (Belkasim et al., 1991).
The mathematical equation of the moment is shown in (11): where th n is the moment around point c . When you apply on the 2D space, we have two independent variables to present (11). That is presented again in (12): x c x c f x y dydx (12) where,

( )
, f x y is the continuous function. So, we have to digitize each pixel that is shown in (13) The formula is written again after 0 x and 0 y that is shown in (15).
To determine the centre of the object, we have to compute on two axes.
The total number of pixels will be aggregated and expressed as follows: After that, we get the average by dividing the total of number pixel. Its formula is shown in (18). In this part, YHV inflection of shrimp will be illustrated by some typical identification results. These results were analysed and experimented on in the module Raspberry 3 using OpenCV library and taken from some sample images on the Raspberry Pi's camera. The process of identifying the shrimp region and identifying the disease location of shrimp is shown in Figure 7. The process of identifying healthy shrimp is shown in Figure 8.

Figure 9
The result of determining the state for many samples using Otsu's algorithm Figure 10 The result of determining the state for many samples using Niblack's algorithm To examine the performance of the proposed method for identifying the YHV disease. These images are taken from many shrimps which different lighting condition and background. The results are not accurate in some cases when using the Otsu algorithm. In the above description, the incorrect segmental result is shown in Figure 9(a) and between shrimp areas and disease areas incorrect ( Table 1). The results identified in shrimp YHV disease with 100% accuracy for Niback's algorithm. However, in Figure 10(f) and Figure 10(i) appears interference from the process of taking the colour threshold. This is a common occurrence, because the shrimp head colour is similar to diseased shrimp but a lighter colour. It also caused noise due to light conditions when collecting images. This study uses a simple algorithm to solve this problem based on the noise levels of the process of obtaining a colour threshold. In this process, if the ratio between the identification area and the shrimp area is low, it is considered as interference. In Table 1, Samples of shrimp diseases have high disease rate areas from 6% to 11% by Niblack's algorithm. Most of the samples without the disease had a ratio of 0%. Except for some cases, shrimp is not sick, but rates below 5% and the disease can be excluded based on experience. This value is the ratio of the noise area after the dilating and shrimp area identified. As described in Figure 3 and Figure 4, Image segmentation techniques by Niblack's algorithm more accurate than Otsu algorithm. Therefore, the ratios of shrimp areas and disease areas of Niblack's algorithm area gives more accurate results.

Conclusions
In this study, we presented an image processing method for identifying the YHV location of shrimp. The experimental results showed that the adaptive threshold is more effective than the Otsu algorithm in identifying with less noise caused by the background. The proposed method for identification based on the characteristics of the YHV syndrome in shrimp is colour. The