Microplastic Detection in Water Using Image Processing
Microplastic Detection in Water Using Image Processing
PROCESSING
A
PROJECT REPORT
Submitted in partial fulfillment of the requirements for the award of the degree
of
BACHELOR OF TECHNOLOGY
IN
CIVIL ENGINEERING
Under the supervision
of
I hereby declare that the work presented in the Project report entitled “MICROPLASTIC
authentic record of my work carried out under the supervision of Dr. Rishi Rana. This
work has not been submitted elsewhere for the reward of any other degree/diploma. I am fully
responsible for the contents of my project report.
i
CERTIFICATE
This is to certify that the work which is being presented in the project report titled
“MICROPLASTIC DETECTION IN WATER USING IMAGE
PROCESSING”in partial fulfillment of the requirements for the award of the degree of
Bachelor of Technology in Civil Engineering submitted to the Department of Civil
Engineering, Jaypee University of Information Technology, Waknaghat is an
authentic record of work carried out by Abhinesh Thakur (181639) and Dechen
Tshomo (181654) during a period from August 2021 to May 2022 under the supervision
of Dr. Rishi Rana (Assistant Professor, Senior Grade), Department of Civil Engineering,
Jaypee University of Information Technology, Waknaghat.
Date: …………………..
ii
ACKNOWLEDGEMENT
The success and final end of this project necessitated a great deal of direction and assistance
from a large number of people, and we are really fortunate to have received it over the
duration of our project. All of what we have accomplished is due to such oversight and
support, and we would want to thank everyone who gave their time and expertise to this
project.
We would like to thank Dr. Rishi Rana (Project Supervisor) for her invaluable assistance and
compassionate supervision during the project. We owe her a great debt of gratitude for her
leadership and unwavering support.
Our sincere gratitude to Prof. Ashish Kumar, Head of the Civil Engineering Department, for
all the facilities rendered. We are also grateful to the faculty members of the department for
their unwavering support throughout the project.
We'd like to express our gratitude to our panel members, who provided us with feedbacks and
suggestions throughout the process. We would want to thank our parents for leading by
example and demonstrating the importance of hard work.
Lastly, our heartfelt gratitude goes to our friends who were involved in giving us suggestions
and recommendations.
iii
ABSTRACT
iv
TABLE OF CONTENTS
v
1.7 SESONAL VARIATION OF MIROPLASTICS 9
10
CHAPTER 2: LITERATURE REVIEW
2.1 GENERAL 10
2.2 RESEARCH GAP 14
2.3 RESEARCH OBJECTIVES 14
15
CHAPTER 3: METHODOLOGY
3.1 GENERAL 15
3.2 IMAGE PROCESSING 16
3.2.1 OpenCV 16
3.2.2 PYTHON 17
3.3 MATERIALS AND METHODS 18
3.3.1 OVERALL IMAGE PROCESSING WORKFLOW 18
3.3.2 SAMPLE IMAGE ACQUISITION 19
3.3.3 MACHINE LEARNING WORKFLOW 21
3.3.4 IMAGE PROCESSING WORKFLOW 22
Importing libraries 22
Read, resize and show images 24
Grey scaling and setting blur 25
Detecting the edges of the microplastic particles 27
Drawing contour lines over the original image 28
Quantification of microplastic particles present in the sample 29
image
Graphical representation of the result 31
CHAPTER 4: RESULTS 42
4.1 GENERAL 42
4.2 RESULTS 42
4.3 INFERENCE 51
CHAPTER 5: CONCLUSION 52
REFERENCE 54
vi
LIST OF FIGUREURES
3.2 OpenCV 17
3.3 Python 18
3.10 Slider 24
vii
3.11 Sample 1: Read, Resize and Show image in OpenCV- 25
Python
3.12 Sample 1: Grey scaled image 26
viii
3.32 Sample 7: (a) Read, Resize and Show image in OpenCV- 39
Python; (b) Grey scaled image
3.33 Sample 7: (a) Edge detection; (b) Dilation of edges 39
ix
LIST OF TABLES
x
LIST OF ACRONYMS & ABBREVIATIONS
MP Microplastic
ML Machine Learning
UV Ultraviolet
PS Polystyrene
PA Polyamide
PP Polypropylene
xi
ABS Acrylonitrile-butadiene-styrene
PTFE Polytetrafluoroethylene
CA Cellulose Acetate
PC Polycarbonate
xii
CHAPTER 1
INTRODUCTION
1.1 GENERAL
Richard Thompson, a marine biologist at the University of Plymouth in the United Kingdom
and Professor introduced the term “microplastics” in the year 2004 [1].
According to the U.S. National Oceanic and Atmospheric Administration (NOAA) and
the European Chemicals Agency, microplastics are fragments of any type of plastic less than
5 mm (0.20 in) in length [1,3]. MPs cause contamination in normal ecosystems by entering
from different assortment of sources, including beauty care products, clothing, and industrial
cycles.
Microplastics are normal in our present reality. In 2014, it was assessed that there are
somewhere in the range of 15 and 51 trillion individual bits of MPs on the planet’s seas,
which was assessed to weigh somewhere in the range of 93,000 and 236,000 metric tons [6,8].
Since plastics corrupt gradually (frequently more than hundreds to millennia), MP particles
stand a greater likelihood of ingestion, consolidation into, and collection in the body as well
as tissues of numerous life forms[5,8]. In earthbound environments, MP particles have been
exhibited to decrease the practicality of soil biological systems and lessen weight of worms.
The cycle and development of MP particles in the climate are not completely known, yet
research is in progress to explore wonders.
Plastic is mostly made from fossil fuels, but biomass is occasionally utilized as a feedstock.
Polyethylene (PE), Polypropylene (PP), polyethylene terephthalate (PET), polyvinyl chloride
(PVC), and polystyrene (PS) are the most common plastic polymers, accounting for over 90%
of global plastic manufacturing. These polymers are nonbiodegradable and have a high
molecular weight. As a result, they are constantly present in the environment. PE, PP, PVC,
PS, PET, and PUR resins account for 29, 19, 12, 8, 6, and 7% of total global output,
respectively. Carbon and hydrogen are fundamental components in nearly all plastics, and
1
PVC also contains chloride as a major component alongside carbon and hydrogen. To
i0mprove the performance of plastics, a number of additives such as thermal stabilizers,
inorganic fillers, plasticizers, UV stabilizers, and fire retardants are used [22,20].
Degradation is the chemical alteration of a polymer’s structure to reduce its molecular weight.
The most essential characteristic of synthetic polymers is their high resilience to
environmental conditions, which extends their residence duration and reduces environmental
deterioration. During the degradation process, polymers are broken down into smaller
molecular units called oligomers and monomers. There are two types of degradation of
synthetic polymers: biotic and abiotic [19,44].
UV-B radiation from the sun is the principal source of photo oxidative degradation in low-
density polyethylene (LDPE), high-density polyethylene (HDPE), PP, and nylons. Thermo-
oxidation can help to speed up the deterioration process [19]. Polymers become embrittled as
a result of extensive breakdown, resulting in micro and nano-sized plastics. Microorganisms
degrade these micro and nano pieces further. The time required for complete mineralization of
plastic is estimated to be between a hundred and a thousand years. Because of the decreased
exposure to UV light and oxygen in aquatic systems, plastic breakdown is slower than in
terrestrial systems [44].
2
1.4 CLASSIFICATION OF MICROPLASTICS
Primary MPs are small bits of plastic which have been deliberately fabricated. They are
normally utilized in facial cleaning agents and beauty care products, or in air impacting
innovation. These processes include impacting acrylic, melamine, or polyester microplastic
scrubbers at apparatus, motors, and boat structures to eliminate paint and rust. As these
scrubbers are utilized over and over until they decrease in size and their cutting force is lost,
they frequently become polluted with heavy metals like cadmium(Cd), chromium(Cr), and
lead(Pb). There are numerous bioplastic microbeads that have a long degradation life cycle
like ordinary plastic, although many organizations are focused on lessening the creation of
microbeads [1,2].
Secondary microplastics are little bits of plastic got by the breaking down of bigger debris of
plastic, both on land and at sea. This process whereby huge plastic matters disintegrate into
smaller bits is known as fragmentation [5,7,19]. MPs may further breakdown into smaller
size, though the smallest MP particle apparently recognized in the seas at present is 1.6
micrometers (6.3×10−5 in) in diameter. The predominance of MPs with irregular shapes is a
prove that fragmentation is the main source of MPs.
3
1.5 SOURCES OF MICROPLASTIC
Most MP contamination comes from the clothing, tires and urban pollution which are
responsible for more than 80% of all MP pathogens in the climate.
1.5.1 Manufacturing
Manufacturing of plastic items utilizes granules and little pellets as their crude material.
Through incidental spillage during land or water transportation, improper use as packaging
materials, these crude materials can enter aquatic ecosystem. There is a huge lack of research
focused on companies and organizations that contribute to microplastics contamination.
1.5.3 Clothing
Studies have shown that numerous synthetic fibers, like nylon, acrylics, polyester, and
spandex, can be shed from clothing and persist in the environment. Each item in a heap of
4
clothing can shed in excess of 1,900 strands of microplastics. For a normal wash heap of 6
kilograms (13 lb), more than 700,000 fibers could be released per wash. Primary fiber that
endures all through the clothing business is polyester which is a cheaper cotton alternative
that can be easily produced. The methods involved with washing garments makes articles of
clothing lose a normal of more than 100 fibers for each liter of water.
With a removal efficiency of about 99.9%, one molecule for every liter of microplastics is
being delivered back to the environment,. Sewage treatment plants eliminate pollutants from
wastewater, essentially from household sewage. Microplastics pass through the filtration
processes at some WWTPs. In some countries, sewage sludge is used for soil fertilizers,
exposing the plastic present in sludge to sunlight, weather and other biological variables,
causing fragmentation. From these biosolids the microplastic frequently ends up in storm
drains and eventually into the water bodies.
Commercial and recreational fishing, maritime boats, and the marine industry are all sources
of plastic that can enter the marine environment directly. Beaching of items carried by inshore
and ocean currents also results in the accumulation of marine debris on beaches. Fishing gear
is a type of marine-derived plastic waste. Lost or discarded fishing gear, such as plastic nylon
netting and monofilament line, is usually neutrally buoyant and can float at different depths in
the ocean. MPs from industry and other sources have been found in many types of sea foods,
according to reports from various countries.
The shipping industry has made a considerable contribution to maritime pollution. According
to some estimates, commercial cargo fleets throughout the world spilled over 23,000 tons of
plastic garbage into the ocean in 1970. The dumping of rubbish from ships into the marine
5
environment was forbidden by an international agreement (MARPOL 73/78, Annex V) in
1988. Shipping continues to be a major source of plastic pollution, accounting for roughly 6.5
million tons in the early 1990s.
Microplastics have been found in freshwater systems such as streams, marshes, ponds, rivers,
and lakes, as well as in marine systems (South America, Asia and Australia, Europe, North
America).
MPs can become entrenched in the tissue of animals, through respiration or ingestion.
Microplastics can take up to 14 days to pass through an animal, but entanglement of the
particles in the gills of animals can hinder removal completely. Plastic particles are frequently
mistaken as food by fishes there by clogging their digestive processes and transmitting false
feeding signals to their brains. Chemical contaminants can also be absorbed by microplastics
and transmitted into the tissues of the organism. The presence of microplastics in the
intestines of 11 species of coastal freshwater fish was discovered in the Argentinean shore of
the Rio de la Plata estuary.
6
1.6.2 Effect of microplastic on human health
The entry of hazardous chemicals and microplastics into the food web can endanger human
health. Microplastics are consumed by a number of marine species, which are then eaten
directly by humans, according to various studies. Microplastics have also been studied in the
gastrointestinal tracts of individuals who eat freshwater fish. Nonetheless, the level of
microplastic absorption by intestinal cells and their translocation into the tissues of aquatic
creatures determines the risk of microplastics to human health.
7
1.6.4 Buoyancy
Around half of the plastic material delivered to the marine environment is buoyant. Foul
fouling by organisms can cause plastic trash to sink to the sea floor, interfering with sediment-
dwelling species and sediment-gas exchange processes. This problem is especially serious in
the case of larger plastic trash. On the ocean’s surface, MPs can also form a bio-film layer that
is buoyant in nature. The microplastics’ buoyancy is a direct result of density of the plastic it
is made of, the shape and size of the microplastic fragments themselves.
8
1.7 SEASONAL VARIATIONS OF MIROPLASTICS
Seasonality can have an impact on the rate of microplastic buildup in sediments. Microplastic
abundance in aquatic systems has been linked by freshwater researchers to rain events. During
rainy seasons, surface runoff promotes microplastic entry into storm drains, rivers, streams,
and eventually the marine environment [7,9].
Microplastics can be trapped by frozen soil in the winter and released during spring flooding;
therefore seasonal trends can have an impact on their accessibility in catchment areas.
Thawed soil is better at releasing microplastics into the environment. During growth seasons,
this might result in a larger influx of microplastics, which is amplified by additional particles
released by snow melting [9,11,17].
9
CHAPTER 2
LITERATURE REVIEW
2.1 GENERAL
This chapter includes critical analysis of various articles, books and journals about detection
of microplastics. Different literature has been evaluated, which helped us in understanding
different methods and techniques used for the detection of microplastics. In this chapter we
could also identify the research gaps. Brief summary of few other research papers are also
provided below.
2.1.1 Shivika Sharma and Subhankar Chatterjee, April 2017, Microplastic pollution, a
threat to marine ecosystem and human health, Environ Sci Pollut Res (2017)
They conducted a general investigation into plastic pollution in the marine ecology in their
report. They conclude that plastic pollution in the marine ecosystem is a serious problem since
it is ubiquitous in the natural environment, has detrimental impacts on marine biota, and is
passed down the food chain. They also emphasize the necessity of raising public knowledge
about microplastic pollution and implementing various public awareness initiatives and
campaigns. They also offer some future approaches in this paper, such as the government
establishing a “zero tolerance” policy for this issue and requiring enterprises to utilize
biodegradable materials such as starch rather than non-degradable materials.
2.1.2 Neeta K, et al., 2020, Microplastic detection in water using image processing,
International Journal of Applied Engineering Research ISSN 0973-4562 Volume 15
The study proposes assessments of the currently used methodologies for detecting the
presence of microplastics in water, with an emphasis on the most practical techniques and
approaches. For image classification, they employ the deep learning CNN method.
In this study they use image processing to detect the presence of microplastics in water. The
detection of microplastic takes place in two stages: training stage and testing stage. For
10
classification, a deep learning architecture called the Convolution Neural Network (CNN) is
used. CNN method was used to analyze and classify photos of water taken in real time.
(a) (b)
Figure 2.1 (a) Detection of microplastics; (b) microplastic count and density (Source; [1])
The aim of this research was to Figureure out seasonal variation of microplastic accumulation
in lake sediments. The sediment trap technique was used to gather sediments from Lake
Kallavesi, and the sediment trap monitoring lasted two years (winter 2016 – summer 2018).
Microplastics were extracted from sediments using the heavy-liquid density separation
method then the microplastics were visually selected under a stereo microscope for FTIR
analysis. The FTIR spectra were examined using the siMPLe program. Winter samples had
higher microplastic contents than summer samples.
11
2.1.4 Carmine Massarelli, et al., July 2021, A handy open-source application based on
computer vision and machine learning algorithms to count and classify microplastics,
Water Research Institute, Italian National Research Council (IRSA-CNR), 70132 Bari,
Italy
In this research, they developed a Computer Vision and Machine Learning-based system to
count and identify microplastics in four morphological and size categories rapidly and
automatically, avoiding human procedures. The proposed application provided a viable
automated method for microplastic quantification based on counts of particles caught in a
photograph, size distribution, and morphology, with significant method standardization
potential [3].
(a) (b)
Figure 2.3 (a) MP sample before image processing; (b) MP sample after image processing
(Source: [3])
2.1.5 Javier Lorenzo-navarro, et al., January 2020, SMACC: A System for Microplastics
Automatic Counting and Classification
In this report, they counted and classify microplastic particles (1-5 mm) into five visual
classes automatically using a computer vision-based system. The technique starts with a
segmentation stage that uses the Sauvola thresholding method, then moves on to feature
extraction and classification. The technique was tested on a total of 2507 microplastic
particles from 12 distinct beach samples.
12
2.1.6 Thuhin K. Dey, et al., July 2021, Detection and removal of microplastics in
wastewater: evolution and impact, Environmental Science and Pollution Research
(2021)
This study examines existing and newly developed methods for detecting and separating
microplastics from discharged wastewater, which is one of the most difficult problems in
microplastic treatment systems. They also discuss a critical study on the impact of
microplastics on aquatic life and human health [6]. As a result, this study gives a thorough
grasp of various strategies for detecting and removing microplastics, as well as their related
difficulties, in order to provide a waste discharge standard that minimizes the final potential
impact in aquatic habitats.
2.1.7 Viktor Wegmayr, et al., 2020, Instance Segmentation for the Quantification of
Microplastic Fiber Images, Proceedings of the IEEE/CVF Winter Conference on
Applications of Computer Vision (WACV)
In this report they employ a fiber instance detection pipeline, which breaks down fiber
detection and segmentation into digestible chunks. Robust image processing techniques, such
as adaptive threshold and morphological skeleton analysis, are used to identify well separated
instances, while an algorithm based on deep pixel embedding is used to separate tangled
fibers. Their method enhances out-of-sample data dramatically, especially in tough
circumstances with intersecting fibers.
13
2.2 RESEARCH GAP
Most of the research papers and report done on microplastic detection and quantification
involve laboratory techniques and manual procedures.
Demonstrating the presence of microplastic particles in real time and in fresh water sources.
Image processing of microplastic sample images and determining the exact number of
particles contained in the images.
14
CHAPTER 3
METHODOLOGY
3.1 GENERAL
MPs in water samples were detected and automatically quantified using OpenCV-Python.
Image processing using OpenCV-Python takes substantially less time than manual techniques
and produces more accurate results. As sampling was difficult due to the current pandemic
situation, real-time sample images from various sources were used for image processing.
Literature Review
Selection of samples
Image acquisition
Image Processing
Evaluation
15
3.2 IMAGE PROCESSING
Images define the world; each image contains a large amount of vital information that can be
applied in a variety of ways. Image Processing is a technique that can be used to obtain this
information.
It is the foundation of computer vision and is essential in many real-world applications such
as robotics, self-driving cars, and object detection. Image processing allows us to transform
and manipulate thousands of images at once while obtaining important insights. It has nearly
limitless applications in almost every field.
Image quantification is the process of measuring image attributes using human sense or
machine observations and experiences and mapping them into members of a set of numbers or
coded concepts.
3.2.1 OpenCV
OpenCV (Open Source Computer Vision) is an open-source library that contains hundreds of
computer vision algorithms. OpenCV is accessible on a range of platforms, including
Windows, Linux, OS X, Android, and iOS, and supports a variety of programming languages
such as C++, Python, Java, etc.
The OpenCV package has a modular structure, which means it includes a number of shared or
static libraries.
16
v. 2D Features Framework (features2d)
vi. Object Detection (objdetect)
vii. High-level GUI (highgui)
viii. Video I/O (videoio)
The OpenCV-Python library is a set of Python bindings for solving computer vision issues.
The fundamental advantage of OpenCV is its enormous access to algorithms, as well as its
widespread use and algorithmic efficiency. OpenCV provides access to over 2,500 algorithms
for deploying machine learning and computer vision capabilities such as object recognition
and facial recognition.In this research the OpenCV version that we are using is 4.1.2.
3.2.2Python
Python is a widely used programming language for image processing. It’s incredible libraries
and tools aid in the efficient completion of image processing tasks.
Displays; basic manipulations such as cropping, flipping, rotating, and so on; picture
segmentation, classification, and feature extractions; image restoration; and image recognition
17
are all common image processing tasks. Due to its growing popularity as a scientific
programming language and the free availability of numerous state-of-the-art image processing
tools in its ecosystem, Python is a great choice for these types of image processing
applications. In our research we are using Python version 3.7.13.
Already clicked images of microplastic particles from water sources found from different
online sources are processed in this report. Python is used for image processing. The library to
be used is OpenCV a open source computer vision library which has almost all the functions
18
required to perform the image processing work on the sample images of the microplastic
particles. The images will be processed and then the count of particles present in each sample
image will be generated. Following flow chart shows how the image processing will work.
Image acquisition
Python
Evaluation Control
Acquisition of image can be done with any digital camera, it can be the simple cameras found
on smart phone to the more complex cameras found in digital microscopes. It is preferable to
utilize cameras with high-resolutions placed over a tripod and operated with a remote control
to obtain an image totally orthogonal to the focal plane and, much better, to eliminate any
vibration that could cause a little shadow exchanged by a particle contour. Even using a smart
phone camera has shown to be beneficial because, to date, these devices have powerful
19
software tool for regulating the acquisition process, including the ability to reduce motion blur
while same resolution being maintained and boosting image quality (contrast, sharp colors,
etc) automatically.
(a) (b)
(a) (b)
(Image source: sample 3 from Research Gate and sample 4 by Kevin Tallec)
In hand-made images, however, the presence of a minor distortion has no bearing on the
categorization performed by the algorithm, which takes into account numerous variables
rather than just one, as well as distinct rules and their ratios, as illustrated in the next section.
The smaller the minimum size of detectable microplastics, the higher the camera's resolution
power. The resolution will be higher or lower depending on the image quality [4,33.21].
High-resolution photos indicate a higher level of particle detail, but also a more obvious
20
identification of any background flaws. This could introduce noise that could be confused
with certain forms of microplastics, leading to the measurement ofparticles other than MP
particles [22,30].
For our research we acquired sample photographs of MP captured in real time from other
sources to proceed with the image processing because capturing samples on our own was
challenging. To move on, a total of eight freshwater sample photos are considered as shown
below [47].
(a) (b)
(Image source: Sample 3 from Ecologica Montenegrina and Sample 6 from MitsuiO.S.K.
Lines)
(a) (b)
(Image source: Sample 7 from Jean-Pierre Desforges, Vancouver Aquarium and Sample 8
from Research Gate)
21
3.3.3 Machine Learning workflow
Computer vision research aims to transfer human perceptions to computers, allowing them to
detect the surroundings, take actions, and learn from the experiences. Target recognition,
manufacturing, photo interpretation, remote sensing, and navigation are all examples of real-
world challenges that computer vision systems are employed to tackle [18,19]. Machine
learning, on the other hand, is the concept that computer algorithms and information and
communication technology (ICT) systems can improve their performance over time,
progressing from general-purpose learning systems to symbolic learning of high-level
knowledge and artificial neural networks[44]. Because of the learning-based approach,
machine learning algorithms have been popular in recent years as a very reliable tool for
developing computer vision performance. In this research we intend to find solutions to
practical problems.
The first step is feature engineering, which is mostly based on a code implementation to
determine the optimal method to represent data in this case, data derived from an image for
use in machine learning algorithms.
The second step is feature extraction, which includes Linear Blend Threshold, Binarization,
Bounding Box generation, particle feature extraction, and size and morphology classification.
The process of overlaying a foreground image with transparency (typically the fourth channel
of an image) over a background image is known as Linear Blend Threshold [12,5]. This
transparency mask, also known as the alpha mask, is useful in the Binarization process, in
which we apply Otsu's thresholding to convert the sample image to black and white.
Importing libraries
22
Different libraries make it easier for us to continue working on the sample photos' image
processing. For image processing and computer vision, OpenCV is a great tool. It's an open-
source library for tasks including face recognition, objection detection, landmark
identification, and much more.
NumPy is a Python module that helps us to use arrays. Numpy provides functions for working
with matrices, fourier transforms, and linear algebra. Matplotlib is a Python library that allows
you to create static, animated, and interactive visualisations. Matplotlib makes simple things
simple and difficult things possible. Seaborn is a matplotlib-based Python data visualisation
library [22,17,8]. It offers a high-level interface for creating visually appealing and
informative statistical graphics.
import cv2
import numpy as np
import matplotlib.pyplot as plt
import sys
import seaborn as sns
While OpenCV was designed for full-scale applications and can be used within functionally
rich UI frameworks or without any UI at all, it is sometimes necessary to try functionality
quickly and visualize the results. The HighGUI module was created for this purpose.
It provides a simple interface to:
We have added sliders and drop down menu to make it simpler and user friendly.
23
Figure 3.10 Slider
Then the images are read, resized/scaled and shown using OpenCV. Scaling an image means
changing its dimensions, which can be only its width, only its height, or both.
The imread() function is used to read an image in Python using OpenCV. Depending on the
number of color channels in the image, imread() outputs a 2D or 3D matrix. Imshow() in
matplotlib makes a picture from a 2-dimensional numpy array. Every element of the array will
be represented by a square in the image. The value of the relevant array element and the color
map used by imshow() define the color of each square[ 22.24.27].
We can specify the width and height of a Figureure in unit inches using the Figuresize
attribute. The Figuresize property is a Figureure function parameter ().
24
Figure 3.11 Read, Resize and Show image in OpenCV-Python
A grayscale image is one in which each pixel indicates the quantity of light or just provides
information about light intensity. It's a single-dimensional graphic with simply varied shades
of grey.
Grey scaling is the process of transforming an image to shades of grey from various color
spaces such as RGB, CMYK, HSV, and so on.
Greyscale representations are frequently employed for extracting descriptors rather than
operating directly on color images since they simplify the technique and reduce computational
requirements [20,22].
i. Dimension is reduced: In RGB photographs, for example, there are three color
channels and three dimensions, whereas grayscale images are single-dimensional.
ii. Model complexity is reduced: Consider using RGB images of 10x10x3 pixels to train
neural articles. There will be 300 input nodes in the input layer. For grayscale photos,
however, the same neural network will only require 100 input nodes.
iii. Helps in other algorithms to function: Many algorithms, for example, are tailored to
function solely with grayscale photos. The pre-implemented Canny edge detection
function in the OpenCV library only works on Grayscale images.
25
The image is blurred by using a low-pass filter kernel to convolve it. It can be used to reduce
noise. It really removes high frequency material from the image (such as noise and edges).
This procedure blurs the margins a little (there are other blurring techniques that just don't
blur the edges).
A Gaussian kernel is utilized in the Gaussian blurring approach. It's done with the
cv2.GaussianBlur function (). We must define the kernel's width and height, which must be
positive and odd. When it comes to reducing Gaussian noise from the image, Gaussian
blurring is extremely successful [16,19].
plt.Figureure(Figuresize=(8,8))
plt.imshow(gray,cmap="gray")
A prominent edge detection algorithm is Canny Edge Detection. John F. Canny came up with
the idea. This function determines which edges are genuine and which are not. We will
26
require two threshold values, minimum value and maximum value, for this. Any edges with
an intensity gradient more than maximum value are certain to be edges, whereas those with an
intensity gradient less than minimum value are certain to be non-edges, and should be rejected
[40]. Based on their connectedness, those who fall between these two thresholds are classed
as edges or non-edges. They are considered as part of edges if they are related to "sure-edge"
pixels. Otherwise, they are eliminated as well [41].
(a) (b)
Figure 3.13 (a) Edge detection; (b) Dilation of edges
Contours are simply defined as a curve that connects all continuous points (along a boundary)
that are of the same hue or intensity. The contours are an effective tool for form analysis as
27
well as object tracking. Binary images are used for higher accuracy. We use thresholding and
canny edge detection before finding contours [41].
Finding contours in OpenCV is similar to detecting a white object against a black background.
So keep in mind that the thing you're looking for should be white and the background should
be dark.
The cv2.findContours() function takes three arguments: source picture, contour retrieval
mode, and contour approximation method. It also generates a changed image, as well as the
contours and hierarchy [42].
# we have to convert BGR to RGB and then draw the image contou
rs
rgb = cv2.cvtColor(image,cv2.COLOR_BGR2RGB)
cv2.drawContours(rgb, cnt,-1 ,(0,255,0),4)
plt.Figureure(Figuresize=(8,6))
plt.imshow(rgb)
28
Quantification of microplastic particles present in the sample image
Plastic pellets, often known as nurdles or beads, are shaped and sized like lentils (2-5 mm
diameter). Polymeric producers and recycling facilities produce them, which are then
delivered to facilities where they are melted and molded into the final shape of the plastic
product.
Tiny bits of plastic that break away from bigger pieces of plastic are called fragments.
Cutlery, lids, and single-use goods are all common examples. The sun's ultraviolet radiation
breaks down these shards further into smaller pieces [42,43].
Fibers are responsible for 71% of all microplastic pollution in the Great Lakes. Fleece
garments, cigarette butts and diapers are all sources of microfibers. Microfibers enter our
lakes in a variety of ways, including through our own washing machines. A single wash of a
fleece jacket can release 2,000 microfibers into our rivers. According to Patagonia-funded
research, 40% of microfibers are not cleaned out at wastewater treatment plants. As a result,
sewage drains may become plugged. Fleece microfibers, unlike cotton or wool, are not
biodegradable [4].
iii. Fibers
ii. Fragments
i. Pellets
Firstly we initialize the number of pellets, fragments and fibers as zero. Then a ‘for loop’ is
applied to count the number of each individual type of microplastic particles. The total
number of microplastic particles detected in the sample image is stored in cnt variable. If-else
statement is used to check if the conditions we provide are true or false. We make use of the
function cv2.approxPolyDP to differentiate pellets, fragments and fibers. If the len(approx) is
equal to 2 it is taken as fiber. Else-if the len(approx) is 8 it is counted as a pellet. If both the
above mentioned conditions are false then the particle detected is counted as a fragment.
29
#Circular
pellet = 0
#Unstructured
fragment = 0
#line
fiber = 0
for cn in cnt:
peri = cv2.arcLength(cn, True)
approx = cv2.approxPolyDP(cn, 0.04 * peri, True)
x,y,w,h = cv2.boundingRect(cn)
if(len(approx) == 2):
fiber = fiber + 1
elif(len(approx) == 8 ):
pallet = pallet + 1
else:
midX = (approx[0][0][0] + approx[-1][0][0]) / 2
midY = (approx[0][0][1]+ approx[-1][0][1]) / 2
sizeX = image.shape[0]
sizeY = image.shape[1]
if(midX < sizeX and midY < sizeY):
(b, g, r) = image[int(midX),int(midY)]
if( b == 0 and g == 0 and r ==0):
fiber = fiber + 1
else:
fragment = fragment + 1
else:
fragment = fragment + 1
30
print("Number of fiber: ", fiber)
print("Number of pellet: ",pallet)
Number of fragment: 57
Number of fiber: 2
Number of pellet: 3
31
#X-values
types = ["Fragment", "Fiber", "Pellet"]
plt.xlabel("Micro-plastics")
plt.ylabel("No. of plastics detected")
plt.title("Various micro-plastics")
plt.show()
32
Sample 2
(a) (b)
Figure 3.17 (a) Read, Resize and Show image in OpenCV-Python; (b) Grey scaled image
(a) (b)
33
Figure 3.19 Drawing contour lines over the original image
Sample 3
(a) (b)
Figure 3.20 (a) Read, Resize and Show image in OpenCV-Python; (b) Grey scaled image
34
(a) (b)
35
Sample 4
(a) (b)
Figure 3.23 (a) Read, Resize and Show image in OpenCV-Python; (b) Grey scaled image
(a) (b)
36
Figure 3.25 Drawing contour lines over the original image
Sample 5
(a) (b)
Figure 3.26 (a) Read, Resize and Show image in OpenCV-Python; (b) Grey scaled image
(a) (b)
37
Figure 3.28 Drawing contour lines over the original image
Sample 6
(a) (b)
Figure 3.29 (a) Read, Resize and Show image in OpenCV-Python; (b) Grey scaled image
(a) (b)
38
Figure 3.31 Drawing contour lines over the original image
Sample 7
(a) (b)
Figure 3.32 (a) Read, Resize and Show image in OpenCV-Python; (b) Grey scaled image
(a) (b)
39
Figure 3.34 Drawing contour lines over the original image
Sample 8
(a) (b)
Figure 3.35 (a) Read, Resize and Show image in OpenCV-Python; (b) Grey scaled image
40
(a) (b)
41
CHAPTER 4
RESULTS
4.1 GENERAL
In this section, we will demonstrate and discuss the results of image processing of the sample
images in OpenCV-python. We will also discuss the benefits of using digital image
processing and how automatic generation of particle counts is easier and faster using image
processing technique than the manual lab processes.
4.2 RESULTS
The main objective of our project was to employ image processing technique to detect and
quantify the microplastic particles present in the water sample images. For greater accuracy of
particle counts, it is essential to have images of great quality. For our project, since we
couldn’t take sample images on our own and had to take the sample images from online
sources, the image quality aren’t up to the mark. Due to that there are few deviations in the
counts of microplastic particles in each sample.
Since the particles are three-dimensional particles, they adopt various spatial conformations
when placed on a flat surface. For example, rolling fibers are sometimes incorrectly classified
as pellets because they look circular like pellets when they are placed in that way. Also the
pellets that are white in color are difficult to detect as they look similar to the white
background and are sometimes neglected.
Depending on the sample images used, the algorithm sometimes shows the count more than
the actual particle count present in the image and sometimes shows less count then the actual
number of particles present in the sample images. Overestimation could occur if the image
had a very high resolution and a dust grain was sometimes confused with a particle;
underestimation could occur if the resolution was low and the particles were too close
together. These differences, however, are within the acceptable range for monitoring studies.
The particle counting process has produced the most satisfactory results. It is important to
emphasize that by automating this phase, human errors are avoided, which can occur due to
42
tiredness due to the prolonged process time of the images required in the manual particle
count.
The bar graph for each sample image shows the total number of microplastic particles
subdivided in different morphologies (fragments, fibers and pellets).
43
Microplastic particles detected in sample image 2:
44
Microplastic particles detected in sample image 3:
Number of fragment: 4
Number of fiber: 67
Number of pallet: 2
45
Number of fragment: 86
Number of fiber: 1
Number of pallet: 3
47
Total number of micor_plactics: 67
48
Figure 4.7 Microplastic particles detected in sample image 7
49
Figure 4.8 Microplastic particles detected in sample image 8
50
4.3 INFERENCE
Overall, the MPs' automatic counting and categorization via OpenCV-python produced
promising results that were significantly comparable to the outcomes of human experts. The
obtained results show that the differences revealed were within acceptable error range for
monitoring studies [21].
It is important to emphasize that automatic particle counting eliminates human errors, which
can occur due to exhaustion due to long process time of the images required in manual
particle counting.
However, it is worth noting that in order to achieve satisfactory results, particles must be
precisely placed over the background, separated one by one manually to prevent overlapping.
This process does take time, but it is also a procedure that should be performed in the
traditional counting of particles underneath a microscope.
Furthermore, by moving the microscope's slide upon which particles are placed to focus the
particles, they will move afterwards, implying yet another waste of time [31]. With automated
technique, however, this operation is only required once, but once the image has indeed been
acquired, we work in post-processing.
Last but not least, there is this significant benefit of this automated methodology in terms of
time savings. Simply take a picture of the particles after they have been placed on a base with
an appropriate background [34]. In a few seconds, a report with all of the information about
the particles in the photo will be available.
51
CHAPTER 5
CONCLUSION
This project describes a method for counting and classifying microplastic particles into
different morphological classifications that shows promising results. Computer Vision
techniques are used in the procedure to count the particles present in the sample images.
Because of the use of computer vision techniques, it is possible to count and divide MPs into
different types automatically and save a significant amount of time. Counting each particle in
every sample becomes time consuming and hectic when there is large number of samples to
be analyzed. Where-as when we use image processing techniques, quantification and counting
of microplastic particles in different samples becomes simpler and quicker. The algorithms
can be directly employed to different sample images and the results can be generated in a
short span of time.
For greater accuracy of particle counts, it is very important to have good picture quality so
that the distortions and noise are minimized. A sample image with less to no shadow cast
gives more accurate particle count.
The morphology of microplastic particles detected in this paper are fragments, fibers and
pellets. Fragments were the most common shape in the samples, with fibers coming in second.
In comparison to fragments and fibers, pellets were quite few in count.
Microplastic pollution is becoming an issue of concern now considering the amount of plastic
product being used in today’s world. Plastic waste in the marine environment is alarming
because it is constantly present in the natural environment and has detrimental effects on
marine biota, and is transferred along the food web, which is a concern. At the international,
national, and local levels, there is an urgent need to take tough steps to address the problem.
Bigger plastic particles disintegrate into smaller pieces which get into our water system and
pollute them.
Our approach has the potential to be used for a wide range of monitoring operations due to its
ease of use and versatility, such as the detection and quantification of microplastic particles in
different water systems using aerial images. This method will help in quality checking the
water samples which are polluted by plastic.
52
Computer vision techniques can help speed up the quantification, characterization, and
categorization of microplastic particles, and they can make a significant contribution to this
growing subject about microplastic pollution.
53
REFERENCE
54
[9] Blair Crawford, Christopher; Quinn, Brian , Microplastic Pollutants (1st ed). Elsevier
Science.
[10] Collignon, Amandine; Hecq, Jean-Henri; Galgani, François; Collard, France; Goffart,
Anne (2014), Annual variation in neustonic micro- and meso-plastic particles and
zooplankton in the Bay of Calvi (Mediterranean–Corsica), Marine Pollution
Bulletin. 79 (12):2938.
[11] Rochman, Chelsea M.; Kross, Sara M.; Armstrong, Jonathan B.; Bogan, Michael T.;
Darling, Emily S.; Green, Stephanie J.; Smyth, Ashley R.; Veríssimo, Diogo (2015),
Scientific Evidence Supports a Ban on Microbeads, Environmental Science &
Technology. 49 (18): 10759–61.
[12] Rochman, Chelsea M.; Tahir, Akbar; Williams, Susan L.; Baxa, Dolores V.; Lam,
Rosalyn; Miller, Jeffrey T.; Teh, Foo-Ching; Werorilangi, Shinta; Teh, Swee J. (2015),
Anthropogenic debris in seafood: Plastic debris and fibers from textiles in fish and
bivalves sold for human consumption, Scientific Reports. 5: 14340.
[13] Liu, Zhiquan; Cai, Mingqi; Yu, Ping; Chen, Minghai; Wu, Donglei; Zhang, Meng;
Zhao, Yunlong (2018), Age-dependent survival, stress defense, and AMPK in Daphnia
pulex after short-term exposure to a polystyrene nanoplastic, Aquatic Toxicology. 204:
1–8.
[14] Shahina, Karim , Seasonal variation of microplastic accumulation in lake sediments,
University of Eastern Finland, Faculty of Science and Forestry.
[15] S. Primpke, C. Lorenz, R. Rascher-Friesenhausen, and G. Gerdts, ‘‘An automated
approach for microplastics analysis using focal plane array (FPA) FTIR microscopy
and image analysis,’’ Anal. Methods, vol. 9, no. 9, pp. 1499–1511, Jan. 2017.
[16] J. Lorenzo-Navarro, M. Castrillón-Santana, M. Gómez, A. Herrera, and P. A. Marín-
Reyes, ‘‘Automatic counting and classification of microplastic particles,’’ in Proc. 7th
Int. Conf. Pattern Recognit. Appl. Methods, 2018, pp. 646–652.
[17] K. Moy, B. Neilson, A. Chung, A. Meadows, M. Castrence, S. Ambagis, and K.
Davidson, ‘‘Mapping coastal marine debris using aerial imagery and spatial analysis,’’
Mar. Pollut. Bull., vol. 132, pp. 52–59, Jul. 2018.
[18] L. Van Cauwenberghe, L. Devriese, F. Galgani, J. Robbens, and C. R. Janssen,
‘‘Microplastics in sediments: A review of techniques, occurrence and effects,’’ Marine
Environ. Res., vol. 111, pp. 5–17, Oct. 2015. [Online]. Available:
http://www.sciencedirect. com/science/article/pii/S0141113615000938
55
[19] C. B. Crawford and B. Quinn, Microplastic Pollutants. Amsterdam, The Netherlands:
Elsevier, 2017.
[20] MICRO 2016 authors. (2016). MICRO 2016: Fate and Impact of Microplastics in
Marine Ecosystems: From the Coastline to the Open Sea. [Online]. Available:
https://micro2016.sciencesconf.org/
[21] S. Iwasaki, A. Isobe, S. Kako, K. Uchida, and T. Tokai, ‘‘Fate of microplastics and
mesoplastics carried by surface currents and wind waves: A numerical model approach
in the Sea of Japan,’’ Mar. Pollut. Bull., vol. 121, nos. 1–2, pp. 85–96, Aug. 2017.
[22] X. Yu, S. Ladewig, S. Bao, C. A. Toline, S. Whitmire, and A. T. Chow, ‘‘Occurrence
and distribution of microplastics at selected coastal sites along the southeastern United
States,’’ Sci. Total Environ., vols. 613–614, pp. 298–305, Feb. 2018
[23] R. L. Coppock, M. Cole, P. K. Lindeque, A. M. Queirós, and T. S. Galloway, ‘‘A
small-scale, portable method for extracting microplastics from marine sediments,’’
Environ. Pollut., vol. 230, pp. 829–837, Nov. 2017.
[24] A. Herrera, M. Asensio, I. Martínez, A. Santana, T. Packard, and M. Gómez,
‘‘Microplastic and tar pollution on three Canary Islands beaches: An annual study,’’
Mar. Pollut. Bull., vol. 129, no. 2, pp. 494–502, Apr. 2018.
[25] B. Sankur, ‘‘Survey over image thresholding techniques and quantitative performance
evaluation,’’ J. Electron. Imag., vol. 13, no. 1, p. 146, Jan. 2004. [Online]. Available:
http://dblp.uni-trier.de/ db/journals/jei/jei13.html#SezginS04
[26] N. Otsu, ‘‘A threshold selection method from gray-level histograms,’’ IEEE Trans.
Syst., Man, Cybern., vol. SMC-9, no. 1, pp. 62–66, Jan. 1979, doi:
10.1109/tsmc.1979.4310076.
[27] J. Sauvola and M. PietikÄinen, ‘‘Adaptive document image binarization,’’ Pattern
Recognit., vol. 33, no. 2, pp. 225–236, Feb. 2000.
[28] H. Bay, A. Ess, T. Tuytelaars, and L. Van Gool, ‘‘Speeded-up robust features
(SURF),’’ Comput. Vis. Image Understand., vol. 110, no. 3, pp. 346–359, Jun. 2008.
[29] Z. Hossein-Nejad and M. Nasri, ‘‘An adaptive image registration method based on
SIFT features and RANSAC transform,’’ Comput. Electr. Eng., vol. 62, pp. 524–537,
Aug. 2017.
[30] T. Ojala, M. Pietikainen, and T. Maenpaa, ‘‘Multiresolution gray-scale and rotation
invariant texture classification with local binary patterns,’’ IEEE Trans. Pattern Anal.
Mach. Intell., vol. 24, no. 7, pp. 971–987, Jul. 2002.
56
[31] D. W. Aha, D. Kibler, and M. K. Albert, ‘‘Instance-based learning algorithms,’’
Mach. Learn., vol. 6, no. 1, pp. 37–66, Jan. 1991.
[32] J. R. Quinlan, Constructing the Decision Tree, vol. 5. Burlington, MA, USA: Morgan
Kaufmann, 1993, pp. 17–26.
[33] L. Breiman, ‘‘Random forests,’’ Mach. Learn., vol. 45, no. 1, pp. 5–32, 2001. [54] V.
Vapnik, ‘‘An overview of statistical learning theory,’’ IEEE Trans. Neural Netw., vol.
10, no. 5, pp. 988–999, Sep. 1999.
[34] A. Krizhevsky, I. Sutskever, and G. E. Hinton, ‘‘ImageNet classification with deep
convolutional neural networks,’’ in Proc. 25th Int. Conf. Neural Inf. Process. Syst.
(NIPS), vol. 1. New York, NY, USA: Curran Associates, 2012, pp. 1097–1105.
[Online]. Available: http://dl. acm.org/citation.cfm?id=2999134.2999257
[35] K. Simonyan and A. Zisserman, ‘‘Very deep convolutional networks for large-scale
image recognition,’’ in Proc. 3rd Int. Conf. Learn. Representations (ICLR), San Diego,
CA, USA, May 2015. [Online]. Available: http://arxiv.org/abs/1409.1556
[36] M. Carbery, W. O’connor, and T. Palanisami, ‘‘Trophic transfer of microplastics and
mixed contaminants in the marine food Web and implications for human health,’’
Environ. Int., vol. 115, pp. 400–409, Jun. 2018.
[37] O. Setälä, V. Fleming-Lehtinen, and M. Lehtiniemi, ‘‘Ingestion and transfer of
microplastics in the planktonic food Web,’’ Environ. Pollut., vol. 185, pp. 77–83, Feb.
2014. [Online]. Available:
http://www.sciencedirect.com/science/article/pii/S0269749113005411
[38] A. Bakir, I. A. O’connor, S. J. Rowland, A. J. Hendriks, and R. C. Thompson,
‘‘Relative importance of microplastics as a pathway for the transfer of hydrophobic
organic chemicals to marine life,’’ Environ. Pollut., vol. 219, pp. 56–65, Dec. 2016.
[Online]. Available:
http://www.sciencedirect.com/science/article/pii/S0269749116313112 [4] C.
Rochman, E. Hoh, T. Kurobe, and S. Teh, ‘‘Ingested plastic transfers hazardous
chemicals to fish and induces hepatic stress,’’ Sci. Rep., vol. 3, Nov. 2013, Art. no.
3263.
[39] C. M. Rochman, T. Kurobe, I. Flores, and S. J. Teh, ‘‘Early warning signs of
endocrine disruption in adult fish from the ingestion of polyethylene with and without
sorbed chemical pollutants from the marine environment,’’ Sci. Total Environ., vol.
57
493, pp. 656–661, Sep. 2014. [Online]. Available:
http://www.sciencedirect.com/science/article/pii/S0048969714009073
[40] Commission Decision (EU) 2017/848 of 17 May 2017 Laying Down Criteria and
Methodological Standards on Good Environmental Status of Marine Waters and
Specifications and Standardised Methods for Monitoring and Assessment, and
Repealing Decision 2010/477/EU, document 32017D0848, Eur. Comission, 2017.
[41] ‘‘Guidance on monitoring of marine litter in European seas,’’ MSFD Tech. Subgroup
Mar. Litter, Eur. Commision, Tech. Rep. JRC83985, 2013.
[42] A. Besley, M. G. Vijver, P. Behrens, and T. Bosker, ‘‘A standardized method for
sampling and extraction methods for quantifying microplastics in beach sand,’’
Marine Pollution Bull., vol. 114, no. 1, pp. 77–83, Jan. 2017. [Online]. Available:
http://www.sciencedirect. com/science/article/pii/S0025326X16306877
[43] J. S. Hanvey, P. J. Lewis, J. L. Lavers, N. D. Crosbie, K. Pozo, and B. O. Clarke, ‘‘A
review of analytical techniques for quantifying microplastics in sediments,’’ Anal.
Methods, vol. 9, no. 9, pp. 1369–1383, Dec. 2016, doi: 10.1039/c6ay02707e.
[44] V. S. Mukhanov, D. A. Litvinyuk, E. G. Sakhon, A. V. Bagaev, S. Veerasingam, and
R. Venkatachalapathy, ‘‘A new method for analyzing microplastic particle size
distribution in marine environmental samples,’’ Ecologica Montenegrina, vol. 23, pp.
77–86, Oct. 2019.
[45] L. Van Cauwenberghe, L. Devriese, F. Galgani, J. Robbens, and C. R. Janssen,
Microplastics in sediments: A review of techniques, occurrence and effects, Marine
Environ. Res., vol. 111, pp. 5–17, Oct. 2015. [Online]. Available:
http://www.sciencedirect. com/science/article/pii/S0141113615000938
58