708 The International Arab Journal of Information Technology, Vol. 15, No. 4, July 2018
Identification of an Efficient Filtering-
Segmentation Technique for Automated Counting
of Fish Fingerlings
Lilibeth Coronel1, Wilfredo Badoy2, and Consorcio Namoco3
1College of Science and Environment, Mindanao State University at Naawan, Philippines
2Department of Information Systems and Computer Science, Ateneo de Davao University, Philippines
3College of Industrial and Information Technology Mindanao, University of Science and Technology, Philippines
Abstract: The counting of fish fingerlings is an important process in determining the accurate consumption of feeds for a
certain density of fingerlings in a pond. Image processing is a modern approach to automate the counting process. It involves
six basic steps, namely, image acquisition, cropping, scaling, filtering, segmentation, and measurement and analysis. In this
study, two (2) filtering and two (2) segmentation algorithms are identified based on the following observations: the non-
uniform brightness and contrast of the image; random noise brought about by feeds, waste, and spots in the container; and the
likelihood of the image samples or application used by the different authors of the smoothing and clustering algorithms in their
respective experiments. Four (4) combinations of filtering-segmentation algorithms are implemented and tested. Results show
that combination of local normalization filter and iterative selection threshold yield a very high counting accuracy using the
measurement function such as Precision, Recall, and F-measure. A Graphical User Interface (GUI) is also presented to
visualize the image processing steps and its counting results.
Keywords: Digital image processing, filtering, segmentation, image normalization, threshold.
Received July 9, 2015; accepted February 3, 2016
Fish fingerling has to be handled several times before
stocking into ponds or containers. Fingerling stocking
marks the beginning of a production cycle. It is among
the most delicate and stressful processes the fingerlings
go through in the course of production. The process of
stocking starts with the counting of fingerlings from
the hatchery, transporting them to the farm and, finally,
putting them into the pond. Traditional process of
counting fish fingerlings such as manual, volumetric,
and surface area methods are still adopted nowadays.
Problem like handling of fingerlings are very critical
since the fingerlings are weighted in volume in a
container and again count them manually. But today,
through the continuous advancement of information
technology, innovations and integration between
computer science and aquaculture facet is very
promising and remarkable. Image processing is a
rapidly growing area of computer science. It involves
six basic steps, namely, image acquisition, cropping,
scaling, filtering, segmentation, and measurement and
Several studies have been conducted to automate the
counting of fish using image processing [2, 5, 6, 10].
Different filtering and segmentation algorithms have
been used for different purposes of the studies, namely,
counting accuracy, classification, behavioural aspects
of the fish, and the overall installation and setup of
image/video acquisition. Problems like error of
counting escalate as the number of fish increases; fish
sizes are unknown; and fish orientation differ.
Sometimes fish may not be segmented reliably,
lighting variations in acquiring image and changes in
water quality, thus causes an error in counting. In
addition, installations and the use of fragile equipment
can be problematic when used in remote locations.
In this study, we identify two filtering and two
segmentation algorithms based on the following
observations: the non-uniform brightness and contrast
of the image; random noise brought about by feeds,
waste, and spots in the container; and the likelihood of
the image samples or application used by the different
authors of the smoothing and clustering algorithms in
their respective experiments. Such filtering and
segmentation algorithms considered in this study
include Local Normalization filter , Median filter
, Iterative Selection threshold  and Minimum-
Error threshold .
The study also designed and developed a prototype
to automate the counting of fish fingerlings employing
the image processing steps with the identified
combinations of filtering and segmentation techniques
using java-programming language and an open source
image processing and analysis program.
Identification of an Efficient Filtering-Segmentation Technique for ... 709
2. The Research Method
Figure 1 shows the overall image processing system
model used in this study. Combinations of filtering and
segmentation algorithms are applied to identify the
efficient technique for counting the fish fingerlings.
2.1. Image Acquisition
In this step, images of tilapia fish fingerlings are
acquired using a Canon PowerShot A3200 IS digital
camera with 14.1 megapixels. The samples are placed
in a white plastic dishpan of size 48x12 cm with water
level of 4.45 cm in height. The size and age of the
samples are approximately 14-16 mm and 21-28 days
Figure 1. Image processing system model used.
The position of the camera must be stable and the
distance from the dish is 60 cm in height with respect
to the dimension and areas inside the dishpan. The
images are taken between 1:00 to 3:00 in the afternoon
notwithstanding the lighting installation and setup.
Figure 2 shows the image acquisition setup used in the
implementation. The camera settings applied include:
ISO speed at ISO-80, F-stop of f/8, focal length of 5
mm with aperture of 2.968, and flash mode is set to
Off. The dimension of the image is 4320 x 3240 pixels.
The image file is in Joint Photographic Experts Group
Figure 2. Image acquisition setup.
2.1.1. Input Image Representation
The image is denoted as two-dimensional function of
the form f(x, y). The amplitude of the image
(plane) coordinates (x, y) is a positive scalar quantity
whose physical meaning is determined by the source of
the image. The image result has
rows and H
columns. The complete W x H digital image in a
compact matrix form is:
The right side of this equation is by definition a digital
image. Each element of this matrix array is called
2.2. Image Cropping
In this process, the image is cropped using ImageJ
built-in cropping function as seen in Figure 3.
Figure 3. Image cropping.
2.3. Image Scaling
After cropping, the image passes through the image
scaling using again the ImageJ built-in scaling function
as seen in Figure 4.
Figure 4. Image scaling.
In the filtering step, two techniques are used separately
as filtering step in the image processing system.
2.4.1. Local Normalization
The local normalization  is a modern and efficient
filtering technique used for correcting non-uniform
710 The International Arab Journal of Information Technology, Vol. 15, No. 4, July 2018
illumination or brightness and eliminates the effects of
uneven noise in an image. The local normalization of
is computed as:
( , ) ( , )
( , )
( , ) f
f x y m x y
g x y
Where f(x,y) is the input image, mf (x,y) and σf (x,y)
represents the estimation of the local mean and
variance of f(x,y) and g(x,y) is the output filtered
image. The local mean and variance of the image are
estimated by a recursive Gaussian filter. The
parameters of the algorithm are the sizes of the
smoothing window σ1 and σ2 which value is larger than
σ1 that controls the estimation of the local mean and
2.4.2. Median Filter
The median algorithm  is the simplest and widely
used median filtering that normally reduces random
noise in an image. The values of the pixel in the
window are stored and the median – the middle value
in the sorted list (or average of the middle two if the
list has an even number of elements)-is the one plotted
into the output image. The median filtered image g(x,y)
can be obtained from the median pixel values in a
neighborhood of (x,y) in the input image f(x,y) , as
defined by the following formula:
),(),( i j
Similarly, two techniques are used separately as
segmentation step in the image processing system.
2.5.1. Iterative Selection Threshold
The simplest of all the thresholding techniques is the
iterative selection method . The method models the
gray level distribution in an image as mixture of two
Gaussian distributions representing, the background
and foreground region. The threshold is computed as:
Where at iteration n, a new threshold Tn is computed
using the average of the foreground mf,0 and
background mb,0class means. On each iteration, the
mean gray level for all pixels greater than
determined, and is denoted asG1. The mean gray level
for all pixels lesser than or equal to T is also
determined, and is denoted asG2. Iteration terminates
when the changes |Tn¯Tn+1 becomes sufficiently small.
2.5.2. Minimum Error Threshold
The minimum error threshold algorithm  is based on
the assumption of object and background pixels gray
level values in the image being normally distributed.
Normal distributions are defined by their means µi,
standard deviations σi, and a priori probabilities Pi. The
background and foreground represents two different
classes (i=1, 2) and a given threshold T. The minimum
error threshold can be computed by minimizing the
criterion function J(T) calculated as:
1 1 2 2
1 1 1 2 2 2
2 log log
( ) 1 2 P T T P T T
P T P T P T P T
This is applied since some of the images have non-
uniform brightness or poor intensity condition with
fishes as object of interest.
Measurement of the object of interest or the fingerlings
thru defining the size, circularity ranges of the
fingerlings as pixels and its height-to-width-ratio is
implemented. The output of this measurement method
is the summary of the total number of fish fingerlings
identified. The parameters of this method are the sizes
and circularity that specifies the range pixel values
inside the object and its shape. The parameters may
vary depending on the age of the fingerlings.
The number of pixels it contains defines the size of
an object. A patch P consisting represents each object
of a list of lines l, the number of pixels n is given by:
PLl se lxlxn
The circularity Cr specifies the object-based shape
measurement calculated by the formula:
Where A is the area and
is the perimeter.
In determining the object of interest, the Height-To-
Width Ration (HTWR) is applied represented by a
patch P is given by:
y i P y i P
x i P x i P
Which helps identify objects that are either too long
compared to their height or too tall compare to their
breadths. Thus, if either of the following conditions for
patch P is satisfied,
P is classified as noise and taken off from the
2.6.1. Identifying Combinations of Filtering and
In identifying Combinations C for the experiments,
where F stands for filtering (Local Normalization,
Median filter) and S stand for segmentation (Iterative
Identification of an Efficient Filtering-Segmentation Technique for ... 711
Selection threshold, Minimum Error threshold), the
product F x S is the set of all pairs (f,s) where f denotes
filtering techniques such as Local Normalization and
Median, f ϵ F and s denotes segmentation techniques
such as Iterative Selection and Minimum Error, s ϵ S.
The groupings must satisfy the following rules for each
of the image processing model:
1. A group must have only one filtering and one
2. The filtering technique must come first before
These combinations are evaluated based on the
accuracy of counting the fish fingerlings, namely,
Combination A (Local Normalization and Iterative
Selection), B (Local Normalization and Minimum
Error), C (Median and Iterative Selection) and D
(Median and Minimum Error), respectively.
2.6.2. Counting Evaluation
Four combinations of filtering and segmentation
algorithms are compared and evaluated thru calculating
the following information retrieval measures, namely,
Precision, Recall, and F measure. The evaluation is
widely used in other studies in terms of image analysis
[1, 2, 3]. The Precision (P), Recall (R), and F-measure
are calculated by:
F measure =2* P*R
where True Positives (TP) represent the number of fish
fingerlings correctly identified as fish fingerlings,
False Positive (FP) represents incorrectly identified by
the method as a fish fingerlings such as noise in the
image and False Negative (FN) represents fish
fingerlings that are not identified as fish fingerlings but
Furthermore, the best F measure among the four
combinations is compared with the actual number of
fish fingerlings. That is, the level of closeness of
measurements of the total number of fish fingerlings to
that of the actual (true) number of fish fingerlings. The
computed F measure are between 0 and 1. A higher
value of F measure indicates a higher classification or
clustering quality and lower error rates or
misclassification of fish fingerlings.
3. Experimental Results
The image processing system is implemented as a
plugin to an image processing software and analysis
tool (ImageJ, ) employing the four identified
combinations of filtering and segmentation techniques
to automate the counting of fish fingerlings.
Figures 5, 6, and 7 show the visualization results of
the image processing system employing the
Combination A technique. Figure 5 shows the sample
acquired JPEG format image of Tilapia fish fingerlings
with the dimension of 4320x3240 pixels used as input
image. The input image is cropped to approximate the
region of interest. The dimension of the image is
reduced to 3180 x 3180 pixels as shown in Figure 6.
The cropped image is rescaled to half of its
dimension to downsize and classify the pixel values
that surrounds the image as shown in Figure 7. The
dimension of the image is reduced to 1590x1590
pixels. The scaled image is filtered according to the
parameters set. The filtered image is segmented to
cluster the object of interest from its background
region. The segmented image is then processed to
measure the object of interest being identified.
Figure 8 shows the visualization results of the image
processing systems employing Combination A. The
image results show significantly very high in noise
reduction and feature identification thus generating
remarkable counting results. Combination B shows
significantly very high in noise reduction but very poor
in feature identification thus generating very poor
counting results. This is shown in Figure 9. Figures 10
and 11 shows significantly poor in noise reduction and
relatively poor in feature identification thus also
generating poor counting results for both Combinations
C and D. Figure 12 shows the ImageJ Graphical User
Interface (GUI) of the automated system using
The parameters defined are based on the actual size
of the fish fingerling samples, the non-uniform
brightness and contrast of the image; random noise
brought about by feeds, waste, and spots in the
container. Combinations A and C requires two input
parameters since these combinations used Local
Normalization as the filtering method. Such parameters
includeσ1=2, σ2=50, size=80-300pixels, and
circularity=0.09-1.0. While Combinations B and D
only requires radius=2 as input parameter with the
same size and circularity values.
Table 1 shows the average measurement result of
the image processing system employing the four
different combinations of the filtering and
segmentation techniques. The experiment considered 2
groups of images, each group having 5 images. Group
A contains 50 Tilapia fish fingerlings in each image
and Group B has 100 fish fingerlings in each image.
The result shows that Combination A has the
highest Precision, Recall, and F measure values as
compared to other combinations of the filtering and
712 The International Arab Journal of Information Technology, Vol. 15, No. 4, July 2018
Figure 5. Sample tilapia fish fingerling.
Figure 6. Cropped image.
Figure 7. Scaled image.
a) Local Normalization filter. b) Iterative Selection threshold.
Figure 8. Image result using combination A.
Table 1. Average measurement results of the four combinations of
Filtering and Segmentation techniques.
a) Local Normalization filter. b) Minimum Error threshold.
Figure 9. Image result using combination B.
a) Median filter b) Iterative Selection threshold.
Figure 10. Image result using 1Combination C.
a) Median filter. b) Minimum Error threshold.
Figure 11. Image result using combination D.
Figure 12. ImageJ GUI of the automated system.
Table 2. Detailed experimental results comparing the combination
A and the manual counting process.
Automated Counting System using
Combination A technique
( with 50
Identification of an Efficient Filtering-Segmentation Technique for ... 713
This means that Combination A has the highest
percentage of correctly identified fish fingerlings, the
lowest percentage of incorrectly identified fish
fingerlings and the lowest percentage of noise
identified. It is observed that the Combination B yields
insignificant results in which Precision and F measure
result are Not-a-Number (NaN). It can be seen from
Table 1 that Combinations C and D cannot outperform
the accuracy of Combination A.
On the other hand, the efficiency of the local
normalization technique to correct non-uniform
lighting and the reduction of noise in an image are very
significant. The Iterative Selection technique also
achieves significant results in feature identification.
It can also be observed from Table 2 that the
variance of counting results between Combination A
and the manual counting are 0.20%, 2.10% and 1.17%
in average Precision, Recall and F measure values,
which are very minimal. These measurements indicate
that result of the automated system is very close to the
manual counting results.
The automated counting system results show that
the total number of correctly identified fish fingerlings
(tp) are very high in the two groups of images but it is
observed that as the number of fish fingerlings
increases, the number of fish fingerlings that are
present but are not actually counted (as if they did not
existed) (fn) also increases. Moreover, the automated
counting system using Combination A obtained the
value of zero (0) in terms of the number of incorrectly
identified as fish fingerlings (fp) such as noise, hence it
is very close to that of the manual counting.
Furthermore, the rate of time in counting the fish
between automated and manual system is also
compared as seen in Table 3. The automated system is
tested on an Intel Core i5 processor with 4Gb of
memory. The time measurement indicates that
automated system significantly performs best
compared to manual counting process.
Combination A (Local Normalization and Iterative
Selection) provides significantly very high in
correcting non-uniform lighting in an image, noise
reduction and feature identification compare with other
combinations of filtering and segmentation techniques.
In terms of counting accuracy, Combination A
obtained an average Precision, Recall and F measure
of as high as 99.80%, 97.90% and 98.83% which
outperformed other combinations, respectively.
Moreover, with the automated system, manual-
counting delays can be resolved. Mortality rate of the
fish fingerlings also decreases, thus, providing an
increase in production of fish fingerlings among the
growers and aquatic biological experts.
Table 3. Time measurement results between automated counting
system using combination A and manual counting process.
Automated Counting System
using Combination A technique
For future work, it is suggested to further enhance the
identified technique to improve the counting efficiency
of the automated system with higher number of
samples that would not just provide counting statistics
but as well as identify the type of fingerlings.
Implementation of connected and independent
components algorithm is also recommended for
accidentally connected or overlapping fingerlings. The
algorithms used in the study may also be enhanced for
possible applications in other non-aquatic and non-
 Alhutaish R. and Omar N., “Arabic Text
Classification using K-Nearest Neightbour
Algorithm,” The Internation Arab Journal of
Information Technology, vol. 12, no. 2, pp. 190-
 Cadieux S., Michaud F., and Lalonde F.,
“Intelligent System for Automated Fish Sorting
and Counting,” in Proceedings of International
Conference on Intelligent Robots and Systems,
Takamatsu, pp. 1279-1284, 2000.
 Faustino G., Gattass M., Rehen S., and de Lucena
C., “Automatic Embryonic Stem Cells Detection
and Counting Method in Fluorescence
Microscopy Images,” in Proceedings of IEEE
International Symposium on Biomedical
Imaging: from Nano to Macro, Boston, pp. 799-
 Kittler J. and Illingworth J., “Minimum Error
Thresholding,” Pattern Recognition, vol. 19, no.
1, pp. 41-47, 1986.
 Labuguen R., Volante E., Causo A., Bayot R.,
Peren G., Macaraig R., Libatique N., and
Tangonan G., “Automated Fish Fry Counting and
Schooling Behavior Analysis Using Computer
Vision,” in Proceedings of IEEE 8th International
Colloquium on Signal Processing and its
Applications, Melaka, pp. 255-260, 2012.
 Morais E., Campos M., Padua F., and Carceroni
R., “Particle Filter-Based Predictive Tracking for
Robust Fish Counting,” in Proceedings of 18th
714 The International Arab Journal of Information Technology, Vol. 15, No. 4, July 2018
Brazilian Symposium on Computer Graphics and
Image Processing, Brazil, pp. 367-374, 2005.
 Rasband W., ImageJ, U. S. National Institutes of
Health, Bethesda, Maryland, USA,
http://imagej.nih.gov/ij/, Last Visited, 2014.
 Ridler T. and Calvard S., “Picture Thresholding
Using an Iterative Selection Method,” IEEE
Transactions on Systems, Man, and Cybernetics,
vol. 8, no. 8, pp. 630-632, 1978.
 Sage D., “Local Normalization.” Biomedical
Image Group. April 2009. Online. Nov. 6, 2011.
Last Visited, 2014.
 Toh Y., Ng T., and Liew B., “Automated Fish
Counting Using Image Processing,” International
Conference on Computational Intelligence and
Software Engineering, Wuhan, pp. 1-5, 2009.
Lilibeth Coronel completed her
Master’s Degree in Information
Technology at Mindanao University
of Science and Technology,
Philippines last 2014 and Bachelor’s
Degree in Computer Science at
AMA Computer College,
Philippines last 2001. Presently, she is an assistant
professor in the Department of Information
Technology at Mindanao State University-Naawan
Campus, Philippines and at the same time ICT Unit
Head of the Campus.
Wilfredo Badoy received an
Electronics Engineering degree at
Mindanao Polytechnic State College
in 1995, his MS Information
Technology at Ateneo de Davao
University in 2009. He is currently
finishing his Ph.D. in Computer
Science at Ateneo De Manila University. He has
worked with various schools in Northern and Southern
Mindanao for more than 15 years. His interests are in
Artificial Intelligence, Affective Computing, and
Computer Simulation. He has published researches in
journals and conference proceedings.
Consorcio Namoco completed his
Doctor of Engineering from Kyoto
Institute of Technology, Kyoto City,
Japan last 2012. His research
interests are in the fields of metal
forming, computer simulation,
materials processing, industrial
technology and information technology education.
Presently, he is a full professor and the vice chancellor
for academic and student affairs, University of Science
and Technology in Southern Philippines, Cagayan de
Oro City, Philippines. He also serves as editorial board
member and peer reviewer to various local and
international research journals.