Fish Counter (Machine Vision)

Fish Counter How to estimate the number of live objects, which are in constant motion, in an industrial setting, using machine vision? An estimation of the number of larvae fish, in a basin, for aquaculture is necessary in order to calculate livestock value, food requirements and cost. But it is a difficult machine vision application (it is difficult for humans). The results of this study was published  Fish Quality Control by Computer Vision – (Pau/Olafsson) Spratt M., (1991) – Fish Quality Control by Computer Vision – (Pau/Olafsson) – Preliminary Results of a Computer Imaging System Applied to Estimating the Quantity of Larvae and Fingerling Fish for Aquaculture. – January 1991, Marcel Dekker, Inc. p 263-281. [tabs slidertype=”left tabs”] [tabcontainer] [tabtext]Introduction[/tabtext] [tabtext]Machine Vision[/tabtext] [tabtext]Image Processing[/tabtext] [tabtext]Data Analysis[/tabtext] [tabtext]Example [/tabtext] [tabtext]Conclusion [/tabtext] [/tabcontainer] [tabcontent] [tab] There are many approaches. I tried an approach using simple but robust imaging techniques with a database and statistical / probability calculations. The process consists of calibrating a relationship between 3 shades (white, grey and black), with a database containing the extremes and probably number of larvae and the quality of the estimation. Video Setup _________________________________________ [/tab] [tab] A computer processes an image in rows and columns, much like a spread sheet (i.e. 512 x 512). A pixel is at the intersection of a line and column and the computer stores a value for each pixel. In most cases the value is between 0 and 255 representing the number of photons which strike the sensor associated to a pixel. 0 for no photons, or black and 255 for photon saturation, or white. Thus an image of a fish, to a computer, is a series of values (i.e. grey levels) organized into rows and columns. As seen from above, a larva is black against a white background. A zone of transition surrounds each larva as it moves about the basin. Histogram The line drawn through the image and the larva (see above) is represented graphically*. The dip in the graph represent the larva. A transition zone exists between the basin and larva. * A histogram is graphic representation of the pixel values found in an image Larva  Diagram _________________________________________ [/tab] [tab] As an image is composed of numerical values, a computer can rapidly manipulate then. In this case an “input look-up table” converts incoming grey scale values to another grey scale value. For example : all pixels with a value of 100 or less are converted to 0 (all dark shades are converted to black), all pixels between 101 and 150 are converted to 128 (the mathematical center of the grey scale), all pixels greater than 151 are converted to 255 (all light shades are converted to white). The histogram before and after the input look-up table converts the pixel’s values. The conversion of the image into three grey levels is done upon input, in real time (25images/second) Histogram ___________________________________________ [/tab] [tab] The approach consists of calibrating relationships between the 3 (white, grey and black) shades. The number of pixels for each shade are counted and stored, with other information, in a database. The information contained in the database is then used to direct calculations concerning the maximum, probable and minimum number of larva in an actual situation. The system takes an image, consults the database, and makes calculations several dozen times before proposing an estimate. Several relations exist which aid in evaluating the quality of the image. For example : The ratio’s between each value. To much relative grey and black indicates an overfilled basin, thus a low quality calculation and relatively inaccurate estimation. The dispersion factor. Dividing the image into equal sizes and comparing the different grey level data sets can provide an idea of larvae dispersion. If the larvae are to grouped into one area of the basin the estimation is also less reliable. The main problems with this system are : 1) Automatic gain is a feature in most cameras and image acquisition material which enhances an image by adjusting the gain or automatically making the image lighter as it becomes darker. This feature, which is often undocumented and uncontrollable by the user, automatically lightens the image as more fish are added. Thus interfering with the linear relation between the three grey levels. So, no automatic gain. 2) Camera height & resolution, are difficult to adjust and keep stable. The higher the camera is above the basin, the larger the field of vision so the more larvae there are per image. In theory increasing throughput, but this is at the expense of resolution and accuracy. The trade off also includes higher resolution (i.e. more pixels) cameras, but this will require more processing time. 3) The Objective, provides an element of flexibility between image quality and camera location. The diaphragm and focus can be adjusted to permit a clear, bright image from a given height. Certain types of objectives (i.e. fisheye) have a tendency to distort an image around the edges, thus the pixel counting program would only consider data within a window, who’s coordinates are passed to the program via a user interface. 4) Basins which worked well in these experiments were white, translucent rectangles of various sizes. 5) Lighting, consists of both under the basin (back light) and ambient light. The back light shines through the translucence basin while the ambient light is a combination of sun and artificial light. Experience has shown that this application is very sensitive to changes in ambient light thus requiring protection. 6) Processing is probably the most un-explored component of this application. We tried several “manual ” methods of placing the fish in the field of vision but none seemed to satisfy all the processing constraints. A better approach would be an “in situ” system which passively separates and counts larva at the same time. A system permanently installed in the tank through which larvae could pass, (probably only one way) which would count the individual as they entered. Example __________________________________ [/tab] [tab] As larva are added to a basin the number of white pixels declines as the number of black and grey pixels increase. But practical application faces many obstacles.

  • Fishcounter But practical application faces many obstacles.Fishcounter2
  • Fishcounter3
___________________________________________ [/tab] [tab] Look for an other method !! This method had several advantages and disadvantages. Advantages uses larva’s constant motion as aid its simple, using grey scale values, good for slow equipment -better on faster machines uses fast hardware pre-processing instead of software and CPU processing repeat images – estimate, within a range the number of fish and the quality of the evaluation. uses margin of error and statistical probability ratios and percentages as aids (indication of density, probable image quality, ) system improves performance and reliability with use Disadvantages requires separation of large lots into smaller units for counting, rapid consumption of O2 , stresses weaker larvae. Not 100% accurate, difficult to verify results, reliability is questionable, requires calibration. subject to environmental light changes (i.e. cloud cover) difficult environment (saltwater, humid, etc.) for material A positive note is a spin-off for this application in robotic and autonomous agents. The application consists of a fast vision system for following walls and the edges of objects. In theory, the software could use grey scales to follow contours. In theory, Images acquired and processed while the camera is paining (slowly rotating back and forth) will provide the direction of white, gray and black. Each image will have a different count for each gray level. The contour is likely to follow the direction of the image with the greatest number of gray pixel __________________________________________________ [/tab] [/tabcontent] [/tabs] .]]>