Docsity

An Application for counting objects using recursive blob counting method, Thesis of Digital Image Processing

Toggle sidebar
bg1
Mobile Application to Fish Farms for Counting the
Fish Fries from a Captured Image
Gabriel Vimarshan Victor
Submitted to the
Computing School
in partial fulfilment of the requirements for the Degree of
Bachelor’s of Engineering in
Computing Science (Hons)
Supervised By:
Mr. Udesh Amarasinghe
Staffordshire University
July 2014, Colombo
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff
pf12
pf13
pf14
pf15
pf16
pf17
pf18
pf19
pf1a
pf1b
pf1c
pf1d
pf1e
pf1f
pf20
pf21
pf22
pf23
pf24
pf25
pf26
pf27
pf28
pf29
pf2a
pf2b
pf2c
pf2d
pf2e
pf2f
pf30
pf31
pf32
pf33
pf34
pf35
pf36
pf37
pf38
pf39
pf3a
pf3b
pf3c
pf3d
pf3e
pf3f
pf40
pf41
pf42
pf43
pf44
pf45
pf46
pf47
pf48
pf49
pf4a
pf4b
pf4c
pf4d
pf4e
pf4f
pf50
pf51
pf52
pf53
pf54
pf55
pf56
pf57
pf58
pf59
pf5a
pf5b
pf5c
pf5d
pf5e

Partial preview of the text

Download An Application for counting objects using recursive blob counting method and more Thesis Digital Image Processing in PDF only on Docsity!

Mobile Application to Fish Farms for Counting the

Fish Fries from a Captured Image

Gabriel Vimarshan Victor

Submitted to the

Computing School

in partial fulfilment of the requirements for the Degree of

Bachelor’s of Engineering in

Computing Science (Hons)

Supervised By:

Mr. Udesh Amarasinghe

Staffordshire University

July 2014, Colombo

Approval of the Project Manager

(Mr.Balachandran Gnanasekarayer.) Project Manager

I certify that this dissertation satisfies the requirements for the degree of Computing Science (BEng)

(Dr. Harindra Fernando.) Assessor.

I certify that I have read this dissertation and that in my opinion it is adequate in scope and quality for the degree of Computing Science (BEng)

(Mr. Udesh Amarasinghe.) Supervisor.

ii

ACKNOWLEDGEMENTS

The author would like to give the heartiest gratitude to Mr. Udesh Amarasinghe for his continuous supervision and enormous support all the way through the project from beginning of this research. Without the advices and supervisory effort received by him on the research requirements and the aspects of the project, achieving the current milestone of the project would be unmanageable and the feedback for all the process was encouraging author to work enthusiastically.

The author would also like to thank specially the Project Manager Mr.Balachandran and Assessor Dr. Harindra Fernando for supporting in numerous ways for the completion of this project and providing guidance throughout the entire course which helped and motivated with many morale guidance.

Last but not least author would like to thank Asia Pacific Institute of Information Technology for providing the facilities of computer laboratories, library and studying materials.

Finally, the author is responsible for all the errors remain in this dissertation.

iii

TABLE OF CONTENTS

ABSTRACT ..............................................................................................................i

ACKNOWLEDGEMENTS ..................................................................................... ii

TABLE OF CONTENTS ........................................................................................ iii

LIST OF TABLES ................................................................................................ viii

LIST OF FIGURES ................................................................................................. ix

LIST OF ABBREVIATIONS .................................................................................. xi

CHAPTER 1............................................................................................................. 1

INTRODUCTION .................................................................................................... 1

1.1 Domain Background ................................................................................... 1 1.2 Problem Background .................................................................................. 2 1.3 Project Objectives ....................................................................................... 2 1.4 Solution Outline ......................................................................................... 3

CHAPTER 2............................................................................................................. 4

SECONDARY RESEARCH..................................................................................... 4

2.1 Similar Systems .......................................................................................... 4 2.1.1 Displacement Counting........................................................................ 4 2.1.2 Infrared Counters ................................................................................. 5 2.1.3 Optical sensor Counters ....................................................................... 6 2.1.4 Pipe Digital Camera Counters .............................................................. 7 2.1.5 Line Scanning Video Camera Counters ............................................... 8 2.2 General Method for Object Counting in Image Processing .......................... 9 2.3 Image Acquisition .................................................................................... 10 2.3.1 Energy ............................................................................................... 10 2.3.1.1 Illumination ................................................................................ 12

viii

LIST OF TABLES

Table 1: Minimum and the maximum features of Pecavision Counters...................... 6

Table 2: Advantages of Canny Edge detection compared with other two ................. 36

ix

  • 2.3.2 The optical System
    • 2.3.2.1 The lens
  • 2.3.3 The Image Sensor
  • 2.3.4 Image Resolution
    • 2.3.4.1 Pixel Dimensions
    • 2.3.4.2 Bit Depth
    • 2.3.4.3 File size
  • 2.4 Image Enhancement..................................................................................
    • 2.4.1 Point processing
      • 2.4.1.1 Contrast Stretching
      • 2.4.1.2 Grey level Slicing
      • 2.4.1.3 Bit Plane Slicing
      • 2.4.1.4 Histogram processing
    • 2.4.2 Image Subtraction
    • 2.4.3 Image Averaging
    • 2.4.4 RGB to Grayscale Transformation and Binarization
  • 2.5 Image Segmentation
    • 2.5.1 Edge detection Techniques
      • 2.5.1.1 Sobel Operator
      • 2.5.1.2 Prewitt Operator
      • 2.5.1.3 Robert’s cross Operator
      • 2.5.1.4 Laplacian of Gaussian
      • 2.5.1.5 Canny Edge Detection
      • 2.5.1.6 Importance of Canny Edge Detection
    • 2.5.2 Watershed Segmentation
      • 2.5.2.1 Flooding based Watershed
        • 2.5.2.2 Rain falling based watershed v
      • 2.5.3 Blob Analysis
    • 2.6 Object Counting
      • 2.6.1 Recursive Blob Detection
    • 2.7 Analysis....................................................................................................
    • 2.8 Conclusion
  • CHAPTER 3...........................................................................................................
  • TECHNICAL RESEARCH
    • 3.1 Android.........................................................................................................
      • 3.1.1 An introduction to Android platform
      • 3.1.2 Android Architecture
        • 3.1.2.1 The Linux Kernel layer
        • 3.1.2.2 Native Libraries Layer
        • 3.1.2.3 Applications Framework Layer
        • 3.1.2.4 Applications Layer
  • CHAPTER 4...........................................................................................................
  • ANALYSIS
    • 4.1 Selection of Development Methodology........................................................
      • 4.1.1 Waterfall Model
      • 4.1.2 Spiral Model...........................................................................................
      • 4.1.3 Rapid Application Development Model
      • 4.1.4 Conclusion
    • 4.2 Requirement Specification
      • 4.2.1 Functional Requirements
      • 4.2.2 Non-Functional Requirements
    • 4.3 Resource Identification
      • 4.3.1 Hardware Requirements vi
      • 4.3.1 Software Requirements...........................................................................
  • CHAPTER 5...........................................................................................................
  • DESIGN
    • 5.1 Use Case Diagram.........................................................................................
    • 5.2 Activity Diagram
    • 5.3 Sequence Diagram
    • 5.4 Class Diagram
  • CHAPTER 6...........................................................................................................
  • IMPLEMENTATION
    • 6.1 Overview of Implementation
    • 6.2 Image Acquisition
    • 6.3 Image Enhancement
      • 6.3.1 RGB to Grayscale Conversion
      • 6.3.2 Grayscale to Binary Image Conversion
      • 6.3.3 Remove Black Borders
      • 6.3.4 Apply Modal Filter
    • 6.4 Counting the Fish on the Image
      • 6.4.1 Apply Blob Counter
  • CHAPTER 7...........................................................................................................
  • TESTING
    • 7.1 Image Acquisition
    • 7.2 Image Enhancement
    • 7.3 Object Counting
  • CHAPTER 8...........................................................................................................
  • CRITICAL EVALUATION
    • 8.1 Research and Investigation vii
    • 8.2 Design
    • 8.3 Implementation
  • CHAPTER 9...........................................................................................................
  • CONCLUSION
  • REFERENCES AND BIBLIOGRAPHY
  • Figure 1: Infrared Fish Counter (Pescavision 30) LIST OF FIGURES
  • Figure 2: Pecavision infrared Counter with Channels (Pipes)
  • Figure 3: Pipe Digital Camera Counters
  • Figure 4: Line Scanning Video Camera Counters
  • Figure 5: Generalized view for object counting
  • Figure 6: Overview of the typical image acquisition process
  • Figure 7: Electron volt, Frequency, Wavelength of rays
  • Figure 8: The effect of illuminating the face from 4 different directions
  • Figure 9: When the light source is behind the object of interest
  • upside down method Figure 10: A tree with before introducing a barrier, then the barrier introduced and
  • Figure 11: Object, Lens and Image
  • Figure 12: The inter-connected cells of sensor
  • Figure 13: An image which has the dimensions as 8,
  • Figure 14: Bit ranges are 1bit, 8bits, and 24bits
  • Figure 15:Spatial and frequency domain methods
  • Figure 16: Dark image histogram and Picture
  • Figure 17: Light image histogram and Picture
  • Figure 18: High contrast image histogram and Picture
  • Figure 19: Low contrast image histogram and Picture
  • Figure 20: RGB to Grayscale transformation with color range
  • Figure 21: Greyscale and Binary Image
  • Figure 22: Various techniques in Edge detection
  • Figure 23: Sobel Operator convolution kernel
  • Figure 24: Basic concept of Watershed based segmentation
  • Figure 25: Graphical view of Rain falling based watershed
  • Figure 26: Blob detection method for Recursive Counting
  • Figure 27: Stages of Waterfall model
  • Figure 28: Stages of Spiral model
  • Figure 29: Use Case Diagram
  • Figure 30: Activity Diagram with overall activity

xi

LIST OF ABBREVIATIONS

[EM] - Electro Magnetic

[eV] - Electronvolts

[Hz] - Hertz

[ f ] - Frequency

[nm] - Nanometer

[ADC] - Analog to digital converter

[VO] - Video Object

[dpi] - Dots per Inch

[ppi] - Pixels per Inch

[JAD] - Joint application development

CHAPTER 1

INTRODUCTION

1.1 Domain Background

Object counting is a challenging problem in image processing. It is routinely carried out in different areas of industries, research institutes, laboratories, agriculture industries among others. Object counting is important for quantitative analysis that depends on estimation of certain elements. This research taken under the industry of agriculture where object counting continues with fish fries (Baby fish).

Digital image processing refers to the processing of digital images using digital computers or machines and electronics which are capable with smooth going concepts with images. And it is a subset of digital signal processing and employ techniques such as feature extraction, pattern recognition and various other image transformations based on unique and suitable algorithms.

Analysis based on images are the processing and retrieving meaningful information from an image such as human face recognition, finger print reading and barcode or QR code reading. Likewise object detection, Image segmentation, image transformation, motion detection are some of the techniques used in image analysis by humans for gathering information and making decision upon the output. For instance it is being used from viewing the tiny bacteria to planets and stars where they are huge in size and far away from us which would lead many years to reach by humans. In general term we can define as “medical lab to NASA labs”. This shows the importance of Image processing.

1.4 Solution Outline

This will be the first invention in Mobile platform where the image processing techniques are used to make output.

The solution is an application for a smartphone operating system such as Android, iOS or Windows Phone. The application will be capable of using the camera device to input the image of the fish fries (baby fish). And this would return the amount of available fish fries in the image with best accuracy.

The solution will involve digital image processing of the image acquired through the camera on device in order to the process of detecting and counting the fish fries within an image.

The solution exploits the following factors;

 Significantly lower investment for a mobile phone application compared to a mechanical devices.  The availability of smartphone applications to target users through online Application store.

Some key assumptions are following where mandatory for a best output.

 The acquired image should have top down view.  The fish fries should be visible in dark colors such as black or brown.  The image should not contain any objects rather than fish fries such as stones or dirt.  The background should be lighter color which is close to white and its variations.  The time consuming will depend on the speed of processor built in the smartphone.  Appreciated to use with better clarity lenses from 5 megapixels to 8 megapixels because application might stop functioning when image is with over resolutions which makes the process much more linear with all pixels.

CHAPTER 2

SECONDARY RESEARCH

New discoveries do not materialize out of nowhere they build upon the findings of previous experiments and investigations which are success or failure. This review shows how the investigation was conducted and fits with what has gone before to put into context. Overall this establishes theoretical framework and methodological focus on how it is connected to the research.

2.1 Similar Systems

There are many technology has developed over the last few years, keeping pace with pump capacities, and providing very accurate inventory records. More and more commercial hatcheries are relying on fish counters to help improve the bottom line for selling process.

2.1.1 Displacement Counting

Still used by many enhancement hatcheries, and commonly used when transporting fish by truck, displacement counting is the most labor intensive and least accurate counting method currently in use. A known number of fish are placed in pre-measured amount of water. The volume of water that is displaced is divided by the number of fish, and from this the average weight of each fish can be calculated. The fish from the tank or raceway are then pumped over a dewatering system or transferred by dip-net directly into the transport truck or tank that contains a known volume of water. Once the water level on the truck or tank reaches the desired level the difference in volume is divided by the average fish weight to calculate the approximate number of fish transferred. This system requires the fish to be completely dewatered before they enter the truck or tank and is only able to provide an estimated number, which often proves to be inaccurate.

Table 1: Minimum and the maximum features of Pecavision Counters Fish Species Trouts, Salmons, Carp, Bream, Tilapia

Fish Size 50 grams to 3000 grams (3Kilograms)

Channel number (Pipes can fixed)

2 to 4 channels are possible ( Previous image shows with 3 channels)

Channels Width 100 Millimeters to 200 Millimeters

Accuracy 98 Percentage to 100 Percentage

Dimensions 1.3(Length)x0.4(Height)x0.5(Width) to 1.5(Length)x0.5(Height)x0.6(Width) Meters Machine Weight 23 to 25 Kilograms

Voltage 24 vaults

This technology has proven to be very accuracy in counting as 98% to 100% but this machinery are costly for investment therefore huge factories use this type of counting machines where they have available of space to operate indoor or outdoor field. The principle behind this counter is simple, a beam emitted by a LED crosses each of the channels. The fish that go through the beam give a counting pulse. Sizing sleeves ensure the fish pass through the beam one by one to reception tank (option) connected. (Ets, 2013)

2.1.3 Optical sensor Counters

These counters where developed to gently count small fish between 0.5g and 6g in size, and do not require the fish to be taken from the water. They are commonly used with graders and for splitting, and are easily attached to the side of a rearing tank. The fish enter the counter and are in water all the time as they pass under a bridge that

houses an optical sensor. This type of counter is a favorite of hatchery employees due to their small size, portability, and easy set-up on a variety of tank flange styles. They are battery operated and only provide the operator with a total number of fish. They have limited capacity and are restricted to counting small fish, so the use of high capacity fish pumps may overwhelm the counter.

2.1.4 Pipe Digital Camera Counters

Counting fish being transported in pipes. The fish pass a camera, which measures the size and speed of each fish. This information is then sent to the control unit, which stores the total number of fish and estimates their weight. Some counters even have the option of downloading the data to a computer so it can be printed in report format. They are ideal for use with graders and can accurately count large numbers of fish being delivered rapidly from a fish pump.

Most systems will count fish from about 10g in size. They are very accurate, but do not provide a record of each fish that can be verified in case of discrepancies in the count. The counting surface must be kept clean to prevent interference, and be shaded from direct light.

Figure 3 : Pipe Digital Camera Counters