Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 5

st

21 International Conference on Mechatronics Technology


October 20 – 23, 2017 in Ho Chi Minh City, Vietnam

Design the Yellow head virus syndrome recognition application for


shrimp on embedded system
Chi Cuong TRAN1, Dinh Tu NGUYEN1, Hoang Dang LE1, Trong Hieu LUU2 and Quoc Bao TRUONG2*
1Graduate School of College of Engineering, CanTho of University, Vietnam
2Collegeof Engineering, CanTho of University, Vietnam
*Corresponding: tqbao@ctu.edu.vn

Abstract –One of the most serious problems confronted image processing on embedded with Raspberry Pi 3
by the shrimp farming industry is the disease caused by module. Applicability of the system to observe,
yellow head virus (YHV). This research promotes an analyze and identify diseased shrimp of the shrimp
image processing algorithm to detect, identify and classification process in the industry.
eliminate shrimp with yellow head virus from the
Litopenaeus vannamei gathering lines. Beside that, this
research also give the image processing algorithms that 2 OVERVIEW THE SYSTEM
is embedded in Raspberry Pi 3 module with the support The input image are recognized by the Pi Camera and
of the OpenCV library. First, the shrimp object will be connect with Raspberry Pi 3 via the Camera driver, the
identified and separated from the background using the image is recorded in raw form which will be processed
image segmentation technique and the boundary that
using specific algorithms with support of the OpenCV
surrounds the object. Then, identification of diseased
shrimp was analyzed based on color threshold. The library. This paper proposes the extraction method and
experimental results show that the system can identify, sends a series of coodinates to the actuator block. At
accurately determine the coordinates of shrimp with the same time, the features of the images will be shown
yellow head virus disease and send information to the on a PC/ Laptop with support of SSH/ Putty through
shrimp classification system.
IP address that is provided by Router. This model is
Keywords - Litopenaeus vannamei, Yellow head shown in Fig. 1.
virus disease, Image processing.
Camera PC/Laptop
1 INTRODUCTION
At present, YHV yellow head virus syndrome occurs
on Penaeus monodon, Litopenaeus vannamei,

SSH/ Putty
OpenCV
Metapenaeus ensis, Penaeus semisulcatus, and other
shrimps in Vietnam, Thailand and India. The yellow
head virus (YHV) is a shrimp virus that causes Raw Image
Image Processing
significant damage to farmed penaeid shrimp Camera Driver
Object
Image View
Recognition
throughout Asia through mass pond fatalities, which
results in heavy production losses and consequent RASPBERRY PI 3 Coordinates
severe economic damage [1, 2]. Susceptible species
include Penaeus monodon [1], P. aztecus, P.
duorarum, P. merguiensis, and P. setiferus [2-4]. Actuator

The traditional diagnostic methods include


pathological observations or pathologic histology that Fig. 1 The diagram of overall system.
do not allow for accurate detection of pathogens early. 3 PROPOSED METHOD
Many molecular method like in situ, western blot, 3.1 Object detection
polymerase chain reaction (PCR), reverse The input image contains objects that will be reduced
transcription polymerase chain reaction (RT-PCR) noise and removed background using the image
which are developed to overcome these segmentation algorithm. Adaptive threshold solution
disadvantanges. The PCR methods are currently being specifically is used specifically for this process. The
used widely and effectively in shrimp testing. detailed disposition steps are shown in Fig. 2. This
However, one of the significantly limitations of PCR
method is based on homogeneity – the same in term of
are false- negative phenomenon that takes a lot of time
gray level, color,… which is a simple and common
and low- efficiency detection [5].
Considering some practical applications in this field, method in image segmentation because of its simplicity
the authors realize the making shrimp identification and fast performance.
and classification system during process of gathering
is very important. This paper proposes the method of

1
st
21 International Conference on Mechatronics Technology
October 20 – 23, 2017 in Ho Chi Minh City, Vietnam
L- 1 L- 1
INPUT IMAGE RESULTS m2 (T ) = å iP(i / C2 ) = å ipi / w2 (T ) (6)
i= T i= T

CONVERT FROM BACKGROUND


RGB TO GRAY SUBTRACTION

SEGMENTATION FIND CONTOURS

Fig. 2 The object detection.

a. Otsu’s algorithm
Otsu algorithm was launched by Nobyuki Otsu in
1979. The objective of the algorithm is a threshold T,
which is calculated automatically based on grayscale
values of the pixels in order to replace the use of fixed
segment in the problem binary image based on Fig. 3 The results of images segmentation by Otsu
algorithm
threshold grayscale. The basic content of the method
Solutions segment images by Otsu algorithm is a
is described as follows: First, convert the input images simple algorithm for calculating the threshold T. It is
to grayscale images and statistics on the number of available for global thresholding. So, threshold T is an
gray levels, assuming there is L (0 £ L £ 255) important and factor that determines the success of the
grayscale in the image. We dichotomize the pixels into algorithm. Fig. 3 (a) shows, two threshold T1 , T2 is
two classes C1 and C2 (background and objects, or determined through the average value calculated on
vice versa) by a threshold at level T; C1 denotes pixels the histogram. Area between T1 and T2 is area of
object, the rest is the background. For the case of
with levels [1,,T ], and C1 denotes pixels with levels shrimp sample 1, we detect the object easy because of
[T + 1,, L].Total number of pixels is called N, h [i ] the clearly partition of the peaks on the histogram. In
contrast, the incorrect segmental result is shown in Fig.
number of pixels in the gray level i (0 £ i £ 255) and 3 (b) because of the difficulty determination of
probability of appearance grayscale level i is: threshold T1 and T2 that based on the histogram.
h [i ]
pi = . From that, we calculate the optimal
N b. Niblack’s algorithm
threshold T* by the formula (1): A threshold T ( x, y ) is a value such that
T * = Arg Max {s B2 (T )} ìï 0 I ( x, y) £ T ( x, y)
(1) b( x, y ) = ïí (7)
0£ T < L ïïî 1 otherwise
s B2 (T ) is identified by formula from (2) to (6).
where b( x, y) is the binarized image and
Variance:
2 I ( x, y) Î [0,1] be intensity of a pixel at location ( x, y)
s B2 (T ) = w1 (T )w2 (T ) (m2 (T ) - m2 (T )) (2)
of the image I . In local adaptive technique, a
Probability appear of C1 :
threshold is calculated for each pixel, based on some
T- 1 local statistics such as range, variance, or surface-
w1 (T ) = P1 = å pi (3) fitting parameters of the neighborhood pixels. It can be
i= 0
approached in different ways such as background
Probability appear of C2 : subtraction [6], water flow model [7], mean and
L- 1 standard derivation of pixel values [8] and local image
w2 (T ) = P2 = å pi = 1- P1 (4) contrast [9]. Some drawbacks of the local thresholding
i= T techniques are region size dependant, individual image
Average gray level of C1 : characteristics, and time consuming. Therefore, some
T- 1 T- 1 researchers use a hybrid approach that applies both
m1 (T ) = å iP(i / C1 ) = å ipi / w1 (T ) (5) global and local thresholding methods [10] and some
use morphological operators [11]. Niblack [12],
i= 0 i= 0

Average gray level of C2 : Sauvola and Pietaksinen [8] use the local variance
technique while Bernsen [13] uses midrange value
within the local block.

2
st
21 International Conference on Mechatronics Technology
October 20 – 23, 2017 in Ho Chi Minh City, Vietnam
Niblack [12] proposed an algorithm that calculates a
pixelwise 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 b ´ b . Also,
the threshold Tni ( x, y) at pixel f ( x, y ) is determined
by the following equation (8):
Tni ( x, y) = mni ( x, y) + kni s ni2 ( x, y) (8)
é y+ b æ x+ b öù
ê 2 çç 2 ÷
÷ú Fig. 5 The results of find contours
1 ê çç ÷ú
mni ( x, y ) = 2 ê å ç å f (i , j ) ÷
÷
÷ú (9) The result of the subtraction process between find
b êj = y- b ççi = x- b ÷
÷ú contours and original images are shown in Fig. 6. This
êë 2 è 2 øú
û process is very important in image processing. The
ìï y + b é x + b ùü
ï purpose of the subtraction should be to eliminate noise
1 ïïï 2 ê 2 úï
2 ïï
s ni ( x, y ) = 2 í å êê å (mni ( x, y ) - f (i, j )) ú
2
úý (10) from the background and increase the accuracy of the
b ïï j = y- b êi = x- b ú
ïï next steps.
ïïî 2ë 2 ûïïþ

As in the definition of equation (9), (10), mni ( x, y) are


the local mean s ni2 ( x, y) are standard deviation values
of a local area. The size of the local window, b, should
be small enough to accurately reflect the local
illumination level and adequately large to include both
objects and the background. Trier and Jain [14]
recommend taking a 15x15 neigeborhood and
Fig. 6 The results of remove background.
kni = - 0.2 . Thus, Niblack’s algorithm cannot be
applied to the varying resolution input images. 3.2 YHV recognition
INPUT IMAGE RESULTS

CONVERT FROM
OBJECT POSITION
RGB TO HSV

COLOR
FIND CONTOURS
THRESHOLD

Fig. 7 The identification of YHV syndrome


Fig. 4 The results of images segmentation by Niblack
algorithm The detailed process to identify shrimp with yellow
Image segmentation techniques using Otsu algorithm head virus syndrome is shown in Fig. 7.
is not suitable for many cases such as approximately
uniform illumination or object is similar to the a. HSV color space
background. In this case, the image segment using the The image is changed from RGB space to the HSV
adaptive threshold method is quite appropriate the space after object detection. Because the HSV space
effectiveness of image segmentation using the Niblack and the HSL space are the same. Beside that it is much
algorithm is presented in Fig. 4. used in image processing and a part of the computer
vision technology.
c. Find contours and remove background HSV is not the same as RGB, which is image intensities
After splitting the objects, binary images obtained at separation of color information. This separation can be
the image segment stage are filtered using a 5x5 very helpful if we want to focus on the intensity
Median filter to eliminate noise. We will delimit the component. Actually, sometime we want to separate
object’s field and draw the boundary using the contour the different color components from intensity for many
method in order to find the boundary around objects variety reasons such as increasing the saturation of
that were binary. Then, this method saves the color or shadow removal.
boundary into the vector that is points lying on this The main reason is that it separates the color
boundary. The results of the search of the object are information from saturation or intensity. Because the
shown in Fig. 5. values are separated, you can construct a chart or a
threshold rule by saturation and hue. In theory, this will
3
st
21 International Conference on Mechatronics Technology
October 20 – 23, 2017 in Ho Chi Minh City, Vietnam
work regardless of the change of saturation on the value To determine the center of the object, we have to
channel. In fact, it is just a nice improvement. Even by compute on two axes.
indicating the color you still have a very significant æm1,0 m0,1 ö ÷
representation of the base color that would probably centroid = ççç , ÷
÷ (16)
work far better than RGB. The final result is a stronger çè m0,0 m0,0 ÷
÷
ø
color threshold than the simpler ones. The total number of pixels will be aggragated and
expressed as follows:
b. Color threshold and find contours sumx = å å xf (x, y)
Which is a simple and common method in image (17)
segmentation because of its simplicity and fast sumy = å å yf (x, y )
performance. The next steps of the algorithm will be After that, we get the average by dividing the total of
performed and show for Hue component of HSV color number pixel. Its fomula is shown in (18).
representation. In this step the image is filtered in sumx
range which is set by the user. The setting of the filter m1,0 =
m0,0
was prepared to detect YHV syndrome. White pixels (18)
are those, that satisfy the condition of the filter. Many sum y
m0,1 =
small white pixels that can be seen will be eliminated m0,0
in further steps of the algorithm. As it can be seen the
For the function in OpenCV, the coordinate of the
red colored object is easily extracted by thresholding
center is computed as follow:
HSV values. However, the drawback is that function
findContours finds any white colored contour that was cx = int (M [‘m10’]/ M [‘m00’])
found in thresholded image. The morphological (19)
c y = int (M [‘m01’]/ M [‘m00’])
operations (such as erosion and dilution) are able to
eliminate noise effects.
4 Experimental results
c. Object position In this part, YHV inflection of shrimp will be
After separating the object from the background and illustrated by some typical identification results. This
delimiting the object by the contours, we find the results are analyzed and experimented on module
center of the object. To determine the coordinates of Raspberry 3 using OpenCV library and taken on some
the object we have to find the moment of the image sample image from Raspberry Pi camera. The process
that shown in theorical [15]. of identifying the shrimp region and identifying the
The mathematical equation of moment is shown in disease location of shrimp is shown in Fig. 8. The
(11). process of identifying healthy shrimp is shown in Fig. 9.
+¥ n

mn = ò (x - c) f ( x)dx (11)
- ¥

where, n th is the monent around point c.when you


apply on the 2D space, we have two independent
variables to present (11). That is presented again in
(12):
m n
mm,n = ò ò (x - cx ) (x - cy ) 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):
¥ ¥ n
å å (x - cx ) (y - cy ) f (x, y)
m
mm, n = (13)
x= 0 y = 0

After we calculate the region of the binary image, we


have to calculate the 0th moment.
w h
m0,0 = å å x0 y 0 f (x, y) (14)
x= 0 y = 0

The formula is written again after x0 and y0 that is


shown in (15).
w h Fig. 8 The process of identifying the disease location of
m0,0 = å å f (x, y) (15) diseased shrimp
x= 0 y = 0

4
st
21 International Conference on Mechatronics Technology
October 20 – 23, 2017 in Ho Chi Minh City, Vietnam
[1] S. Boonyaratpalin, K. Supamattaya, J. Kasornchandra, S.
Direkbusaracom, U. Aekpanithanpong, and C.
Chantanachooklin, "Non-occluded baculo-like virus, the
causative agent of yellow head disease in the black tiger
shrimp (Penaeus monodon)," Fish Pathology, vol. 28, pp. 103-
109, 1993.
[2] T. Flegel, S. Boonyaratpalin, and B. Withyachumnarnkul,
"Progress in research on yellow-head virus and white-spot
virus in Thailand," Diseases in Asian aquaculture III, pp. 285-
295, 1997.
[3] T. W. Flegel, "Major viral diseases of the black tiger prawn
(Penaeus monodon) in Thailand," World Journal of
Microbiology and Biotechnology, vol. 13, pp. 433-442, 1997.
[4] D. Lightner, K. Hasson, B. White, and R. Redman,
"Experimental infection of western hemisphere penaeid
shrimp with Asian white spot syndrome virus and Asian
yellow head virus," Journal of aquatic animal health, vol. 10,
pp. 271-281, 1998.
[5] A. G. U. Amarakoon and P. Wijegoonawardane, "A
comparative analysis of Yellow Head Virus (YHD) diagnostic
methods adopted in Sri Lanka to investigate the accuracy and
specificity of the virus," World Scientific News, pp. 181-192,
2017.
[6] S. Lu, B. Su, and C. L. Tan, "Document image binarization
using background estimation and stroke edges," International
journal on document analysis and recognition, vol. 13, pp.
303-314, 2010.
[7] H.-H. Oh, K.-T. Lim, and S.-I. Chien, "An improved
binarization algorithm based on a water flow model for
Fig. 9 The process of identifying healthy shrimp document image with inhomogeneous backgrounds," Pattern
Recognition, vol. 38, pp. 2612-2625, 2005.
[8] J. Sauvola and M. Pietikäinen, "Adaptive document image
5 CONCLUSIONS binarization," Pattern recognition, vol. 33, pp. 225-236, 2000.
In this study, we present an image processing method [9] B. Su, S. Lu, and C. L. Tan, "Binarization of historical
for identifying the YHV location of shrimp. The document images using the local maximum and minimum," in
Experimental results show that the adaptive threshold Proceedings of the 9th IAPR International Workshop on
Document Analysis Systems, 2010, pp. 159-166.
is more effective than the Otsu algorithm in identifying
[10] B. Gatos, I. Pratikakis, and S. J. Perantonis, "Adaptive
and less noise caused by the background. The results of degraded document image binarization," Pattern recognition,
this study may be the premise for the development of vol. 39, pp. 317-327, 2006.
an automated shrimp classification system with various [11] T. H. N. Le, T. D. Bui, and C. Y. Suen, "Ternary entropy-based
binarization of degraded document images using
diseases in the industrial environment.
morphological operators," in Document Analysis and
Recognition (ICDAR), 2011 International Conference on,
ACKNOWLEDGEMENT 2011, pp. 114-118.
In this paper, these dataset picture are taken by Mr. Le [12] W. Niblack, An introduction to digital image processing:
Strandberg Publishing Company, 1985.
Be Hai who works for Viet Uc seafood groups. We [13] J. Bernse, "Dynamic thresholding of grey-level images," in
would like to express our thank you to Mr. Be Hai, Proc. 8th Int. Conf. on Pattern Recognition, 1986, 1986, pp.
former mechatronics student with the student ID 1251-1255.
B1204696 in Can Tho university, who help us initial [14] O. D. Trier and A. K. Jain, "Goal-directed evaluation of
binarization methods," IEEE transactions on Pattern analysis
searching on applying computer vision to shrimp and Machine Intelligence, vol. 17, pp. 1191-1201, 1995.
industry. [15] S. O. Belkasim, M. Shridhar, and M. Ahmadi, "Pattern
recognition with moment invariants: a comparative study and
new results," Pattern recognition, vol. 24, pp. 1117-1138,
REFERENCES 1991.

You might also like