You are on page 1of 32

ABSTRACT

Deforestation has always been a major problem to tackle with. It has been one

of the majorfactors that have caused drastic changes in environment and

climate. Today, global warming (the increase in sea water levels) which is a

major concern, is caused largely by deforestation. Deforestation also causes

many natural calamities and disasters like soil erosion, floods during heavy

rains, increase in greenhouse gases and adverse effects on ecosystem. To

prevent deforestation, one of very useful solutions can be, to make use of

satellite images of the deforested areas that are provided by various feeds from

NASA satellites, Indian Remote Sensing Satellites etc and to increase the

protection in those areas. This paper presents a method to study the change in

forest in a particular area using two images downloaded from Google Earth

using image processing techniques. First, asimple color segmentation

method is used to identify the changes in the two images and then the RGB

color model is used to indicate the changes in the forest area using Red, Brown

and Green colors.


VI
Executive Summary -

For our MEng. Design Project, we wanted to utilize the opportunity to design something
which could be a contribution in our own small way to the society.
Deforestation, clearance, clear cutting or clearing is the removal of a forest or stand of
trees from land which is then converted to a non-forest use. Deforestation can involve
conversion of forest land to farms, ranches, or urban use. The most concentrated
deforestation occurs in tropical rainforests. About 31% of Earth's land surface is covered by
forests.

The removal of trees without sufficient reforestation has resulted in habitat


damage, biodiversity loss, and aridity. It has adverse impacts on bio sequestration of
atmospheric carbon dioxide.

Our aim is an attempt to curb deforestation by making use of the technology available. We
have used image processing techniques on images of a forest getting deforested. These
images were downloaded from Google Earth. As Google Earth uses US Navy and Remote
Sensing Satellites, they have to be mentioned too. The technique can also be applied to
images taken from Indian Remote Sensing Satellites.

We have developed a MATLAB algorithm that uses image processing techniques including
image segmentation method and RGB color model. The task requires MATLAB software
that includes an image processing toolbox running on a Windows Operating System.

The images of forest area, before and after deforestation is fed as inputs after running the
code that we developed. The output obtained is the image after deforestation with it showing
and marking the deforested parts with red, brown and green colors and also calculating the
area of the deforested areas.

VII
Table of Contents –

1. Introduction 8-11
1.1Problem Statement 9
1.2Range of Solutions 9-10
1.3Product Design Overview 10-11
2. High Level Design 11-13
2.1Eye Detection and Motion Tracking 12
2.2AtMega1284P Controlled Motor Assembly 12-13
3. Software Design 14-19
3.1MATLAB Component 14-18
3.2 Firmware Design 19
4. Hardware Design 19-23
4.1Motor Circuit 20-23

5. Mechanical Design 23
6. Testing and Results 23-25
6.1 Testing Strategy 23-24
6.2Speed of Execution 24
6.3Accuracy 24-25
6.4Safety Features 25
7. Conclusions 26
7.1Performance 26
7.2Future Modifications 26

Appendix A –User Manual 27


Appendix B –MATLAB Script 28-36
Acknowledgements 37
References 38

8
1. Introduction

Deforestation, clearance, clearcutting or clearing is the removal of a forest or stand of trees


from land which is then converted to a non-forest use. Deforestation can involve conversion
of forest land to farms, ranches, or urban use. The most concentrated deforestation occurs
in tropical rainforests. About 31% of Earth's land surface is covered by forests.

Deforestation can occur for several reasons: trees can be cut down to be used for building or
sold as fuel (sometimes in the form of charcoalor timber), while cleared land can be used
as pasture for livestock and plantation. The removal of trees without
sufficient reforestation has resulted in habitat damage, biodiversity loss, and aridity. It has
adverse impacts on biosequestration of atmospheric carbon dioxide. Deforestation has also
been used in war to deprive the enemy of vital resources and cover for its forces. Modern
examples of this were the use of Agent Orange by the British military in Malaya during
the Malayan Emergency and by the United States military in Vietnam during the Vietnam
War. As of 2005, net deforestation rates had ceased to increase in countries with a per
capita GDP of at least US$4,600.Deforested regions typically incur significant adverse soil
erosion and frequently degrade into wasteland.

Disregard of ascribed value, lax forest management, and deficient environmental laws are
some of the factors that lead to large-scale deforestation. In many countries, deforestation–
both naturally occurring and human-induced–is an ongoing issue. Deforestation
causes extinction, changes to climatic conditions, desertification, and displacement of
populations, as observed by current conditions and in the past through the fossil record. More
than half of all plant and land animal species in the world live in tropical forests.

Between 2000 and 2012, 2.3 million square kilometers (890,000 sq mi) of forests around the
world were cut down. As a result of deforestation, only 6.2 million square kilometers
(2.4 million square miles) remain of the original 16 million square kilometers(6 million
squaremiles) of tropical rainforest that formerly covered the Earth. An area the size of
a football pitch is cleared from the Amazon rainforest every minute, with 136 million acres
(55 million hectares) of rainforest cleared for animal agriculture overall.
Deforestation in the Maranhão state of
Brazil, 2016

Causes of deforestation

According to the United Nations Framework Convention on Climate Change (UNFCCC)


secretariat, the overwhelming direct cause of deforestation is agriculture. Subsistence
farming is responsible for 48% of deforestation; commercial agriculture is responsible for
32%; logging is responsible for 14%, and fuel wood removals make up 5%.

Experts do not agree on whether industrial logging is an important contributor to global


deforestation.[13][14] Some argue that poor people are more likely to clear forest because they
have no alternatives, others that the poor lack the ability to pay for the materials and labour
needed to clear forest. One study found that population increases due to high fertility rates
were a primary driver of tropical deforestation in only 8% of cases.

Other causes of contemporary deforestation may include corruption of government


institutions, the inequitable distribution of wealth and power, [18] population
growth and overpopulation and urbanization. Globalization is often viewed as another root
cause of deforestation, though there are cases in which the impacts of globalization (new
flows of labor, capital, commodities, and ideas) have promoted localized forest recovery.

In 2000 the United Nations Food and Agriculture Organization (FAO) found that "the role of
population dynamics in a local setting may vary from decisive to negligible", and that
deforestation can result from "a combination of population pressure and stagnating economic,
social and technological conditions"

The degradation of forest ecosystems has also been traced to economic incentives that make
forest conversion appear more profitable than forest conservation. Many important forest
functions have no markets, and hence, no economic value that is readily apparent to the
forests' owners or the communities that rely on forests for their well-being. From the
perspective of the developing world, the benefits of forest as carbon sinks or biodiversity
reserves go primarily to richer developed nations and there is insufficient compensation for
these services. Developing countries feel that some countries in the developed world, such as
the United States of America, cut down their forests centuries ago and benefited economically
from this deforestation, and that it is hypocritical to deny developing countries the same
opportunities, i.e. that the poor shouldn't have to bear the cost of preservation when the rich
created the problem.

Some commentators have noted a shift in the drivers of deforestation over the past 30
years. Whereas deforestation was primarily driven by subsistence activities and government-
sponsored development projects like transmigration in countries
like Indonesia and colonization in Latin America, India, Java, and so on, during the late 19th
century and the earlier half of the 20th century, by the 1990s the majority of deforestation
was caused by industrial factors, including extractive industries, large-scale cattle ranching,
and extensive agriculture. Since 2001, commodity-driven deforestation, which is more likely
to be permanent, has accounted for about a quarter of all forest disturbance and this loss has
been concentrated in South America and Southeast Asia.
Satellite image of deforestation in progress in eastern Bolivia. Worldwide, 10% of wilderness areas were
lost between 1990 and 2015.

Effects of Deforestation

1. Atmospheric

Deforestation is a contributor
to global warming and is often
cited as one of the major causes of
the enhanced greenhouse effect. Tropical deforestation is responsible for approximately
20% of world greenhouse gas emissions.
Deforestation causes carbon dioxide to linger in the atmosphere. As carbon dioxide
accrues, it produces a layer in the atmosphere that traps radiation from the sun. The
radiation converts to heat which causes global warming, which is better known as the
greenhouse effect. Plants remove carbonin the form of carbon dioxide from
the atmosphere during the process of photosynthesis, but release some carbon dioxide
back into the atmosphere during normal respiration. Only when actively growing can a
tree or forest remove carbon, by storing it in plant tissues. Both the decay and the burning
of wood release much of this stored carbon back into the atmosphere.

2. Hydrological
The water cycle is also affected by deforestation. Trees extract groundwater through
their roots and release it into the atmosphere. When part of a forest is removed, the
trees no longer transpire this water, resulting in a much drier climate. Deforestation
reduces the content of water in the soil and groundwater as well as atmospheric
moisture. The dry soil leads to lower water intake for the trees to extract.Deforestation
reduces soil cohesion, so that erosion, flooding and landslides ensue.

3. Soil

Due to surface plant litter, forests that are undisturbed have a minimal rate of erosion.
The rate of erosion occurs from deforestation, because it decreases the amount of litter
cover, which provides protection from surface runoff. The rate of erosion is around 2
metric tons per square kilometre. This can be an advantage in excessively leached
tropical rain forest soils. Forestry operations themselves also increase erosion through
the development of (forest) roads and the use of mechanized equipment.

4. Biodiversity

Deforestation on a human scale results in decline in biodiversity, and on a natural


global scale is known to cause the extinction of many species. The removal or
destruction of areas of forest cover has resulted in a degraded environment with
reduced biodiversity. Forests support biodiversity, providing habitat
for wildlife. Moreover, forests foster medicinal conservation. With forest biotopes
being irreplaceable source of new drugs (such as taxol), deforestation can
destroy genetic variations (such as crop resistance) irretrievably.

1.1ProblemStatement

Thus, we can summarize our project as follows: the main aim of this project is to
develop an algorithm using image processing techniques that will be helpful in
identifying and calculating the changes in forest area and prevent deforestation up to
certain extent.
1.2 Range Of Solutions

We wanted to come up with a solution that is not expensive and thus can be afforded
by all. The main task in this project was develop a MATLAB script that would help in
providing solution for deforestation making use of image processing techniques.

This algorithm contains the image segmentation model and RGB color model. These
two models combine and the result is the image marked with red, brown and green
colors on the deforested areas. The image segmentation helps to identify the
deforested areas and the RGB color model acts on the deforested areas marking it
with colors to help developers and users to identify the deforested areas.

A script for calculating the area of deforested areas has also been developed and is a
part of the algorithm that we developed. Once the two models have been applied, the
area of the deforested parts can be calculated in any unit desired.

The final output will be the image marked with red, brown and green colors and the
area of the deforested parts in standard unit system.

The area of the deforested parts is calculated using total number of pixels that
represent the deforested image and the size of each pixel. With this, the total
increment or decrement in the forest areas is calculated.

Area of each pixel is equal to the total area divided by the number of pixels. First, the
total number of pixels is determined and the total area of the image is also determined.
This is then used to find the area of each pixel and subsequently the total decrement of
the forest areas is found out.

The modified image is then compared with the original image to get a clear picture of
the amount of deforestation that has taken place in a particular period of time. Since
the deforested areas will be marked with RGB colors, a clear picture of the
deforestation that has happened will be presented to those willing to study the effects.
An alternative method is to use the image segmentation and the edge detection
algorithm to clearly outline the deforested areas. This, we thought would change the
purpose of the project as our main aim was to make use of the RGB color model
algorithm.
1.3 Design Overview

We decided to use the above mentioned models in image processing to create more
impact and to increase the purpose of the project. We decided to implement the design
in the MATLAB software due to its excellent available features and its versatility.

To implement the design and to run the script of the algorithm that we developed, we
used the MATLAB installed with image processing toolbox. The toolbox contains in-
built image processing functions that the MATLAB compiler makes use of to execute
the script. The main script calls the functions from the toolbox while executing the
main script.

2. Software Design

There are multiple aspects to the software design of this project. Since all of the
computational work is done in software, a lot of our time went in software design and
debugging.

The MATLAB component is responsible for image segmenting, color segmenting and
then applying the RGB color model all by using its own in-built functions and also by
calling the image processing functions in-built in image processing toolbox.

The three main parts of the algorithm we developed includes,


1. Image Segmentation
2. Color Segmentation
3. RGB color model
2.1 Image Segmentation

In computer vision, image segmentation is the process of partitioning a digital image into
multiple segments (sets of pixels, also known as super-pixels). The goal of segmentation is to
simplify and/or change the representation of an image into something that is more
meaningfand easier to analyze. Image segmentation is typically used to locate objects
and boundaries (lines, curves, etc.) in images. More precisely, image segmentation is the
process of assigning a label to every pixel in an image such that pixels with the same label
share certain characteristics.

There are many different ways to perform image segmentation, including:

 Thresholding methods such as Otsu’s method

 Color-based Segmentation such as K-means clustering


 Transform methods such as watershed segmentation

 Texture methods such as texture filters

Image segmentation is typically used to locate objects and boundaries (lines, curves, etc.) in
images. More precisely, image segmentation is the process of assigning a label to every pixel
in an image such that pixels with the same label share certain characteristics.

The result of image segmentation is a set of segments that collectively cover the entire image,
or a set of contours extracted from the image . Each of the pixels in a region are similar with
respect to some characteristic or computed property, such as color, intensity, or texture.
Adjacent regions are significantly different with respect to the same characteristic(s). When
applied to a stack of images, typical in medical imaging, the resulting contours after image
segmentation can be used to create 3D reconstructions with the help of interpolation
algorithms like Marching cubes.

Figure 1 shows the image segmentation algorithm applied on the Google Earth image
We have used the simple image segmentation method using K-cluster method and not Otsu’s
method. The images are segmented first and then subjected to color segmentation method.

The color segmentation algorithm has been done using K-clustering method of image and
color segmentation. The images are color segmented using specific colors and then they are
segregated into two categories of images, the image of forest before and after deforestation.

2.2 Color Segmentation

The K-means clustering method of color segmentation has been used in this algorithm. Color
segmentation can be done in many ways and a brief explanation of it has been given below.
The color segmentation of the images is done to identify the different colors present in the
images. In this case, the images of forest are mostly green. But after deforestation, there is
much decrease in greenness of the images. This difference in change of colors can be
identified using the color segmentation algorithm.

Color image segmentation simplifies the vision problem by assuming that objects are colored
distinctively, and that only gross color differences matter. It therefore discards information
about color and brightness variations that provides many valuable cues about the shapes and
textures of 3D surfaces.
Figure 2 Color segmentation on deforested areas

Clustering in the color space

Clustering is the process of partitioning a set of objects (pattern vectors) into subsets of

similar objects called clusters. Pixel clustering in three-dimensional color space on the basis

of their color similarity is one of popular approaches in the field of color image segmentation.

Clustering is often seen as an unsupervised classification of pixels. Generally, the a priori

knowledge about the image is not used during a clustering process. Colors, dominated in the

image, create dense clusters in the color space in natural way. Shows three ”pixel clouds” in

the RGB color space that represent clusters. Many different clustering techniques, proposed

in the pattern recognition literature , can be applied to color image segmentation. One of the

most popular and fastest clustering techniques is the k-means technique.


Image and color segmentation applied on a Google Earth image

We have applied the image segmentation and the color segmentation and then the following
image as the output was obtained.

Figure shows the red color in the image segmented as the deforested area
The color segmentation and the image segmentation algorithm have been applied and the
output images have been shown above. Now, the final part of the algorithm is the RGB color
model.

2.3 RGB Color Model

The RGB color model is an additive color model in which red, green and blue light are
added together in various ways to reproduce a broad array of colors. The name of the model
comes from the initials of the three additive primary colors, red, green, and blue.

The Image Processing Toolbox software represents colors as RGB values, either directly (in
an RGB image) or indirectly (in an indexed image, where the colormap is stored in RGB
format). However, there are other models besides RGB for representing colors numerically.
The various models are referred to as color spaces because most of them can be mapped into
a 2-D, 3-D, or 4-D coordinate system; thus, a color specification is made up of coordinates in
a 2-D, 3-D, or 4-D space.

The various color spaces exist because they present color information in ways that make
certain calculations more convenient or because they provide a way to identify colors that is
more intuitive. For example, the RGB color space defines a color as the percentages of red,
green, and blue hues mixed together. Other color models describe colors by their hue (green),
saturation (dark green), and luminance, or intensity.

The toolbox supports these color spaces by providing a means for converting color data from
one color space to another through a mathematical transformation.

Figure 3 RGB color model processing the butterfly in the above figure in MATLAB

The RGB color model marks the deforested areas of the images using red, brown and green
colors. The RGB algorithm is applied only after the image and color segmentation model
algorithms have been applied.
The above images shows the RGB color composites of the images before and after deforestation

The RGB algorithm we developed will mark the deforested areas with red, brown and green
colors. This will help the viewer to clearly differentiate and estimate the deforested parts and
the amount of deforestation that has taken place during a period of time.

3.Testing

3.1 Testing Strategy


The debug screen was the most useful aspect of our testing strategy. We tested several times
our script on MATLAB. The image processing toolbox was installed as a prerequisite in
MATLAB.

3.2 Speed of Execution

The time it took to execute was more or less same as that of time of execution of any
MATLAB script. But since the script calls functions from image processing toolbox, the time
of execution is slightly more than the average time of execution.

3.3 Accuracy
The script of the algorithm that we developed performs satisfactory with performance
accuracy of around 70-90%. The script wasexecuted for 40 to 50 times by all threeproject
members.

4. Results

4.1 Input

The inputs to the script were two images downloaded from Google Earth. The two input
images show a particular area of a forest before and after deforestation, during a period of
time. The two input images are shown below.
Input image before deforestation took place
Input image after deforestation took place

4.2 Output

The output obtained after the input images were subjected to image processing
techniques including image segmentation, color segmentation and the RGB
color model shows the deforested areas with red, green and brown colors. The
output image is shown below.
Output Image

The red, green and brown colors obtained in the output image are the deforested areas. This
clearly helps to differentiate the minutely deforested areas too, when it happens on a small
scale. The area of the deforested part can also be calculated.

4.3 Calculation of the deforested areas

Total pixels here are = 722 x 1364 = 984808 and total area of image is 65km x
65km = 4225 square km.

So, area of pixel is = total area / number of pixels

Forest loss =80828 pixels

Forest spread =57056 pixels

Total forest increment or decrement is: -23772 pixels

Therefore, In Square km, loss is 346.77, spread is 244.78, total loss in sq km is


-101.99
5. Block Diagram Of The Algorithm

6. Conclusions

Performance

The algorithm executes with an accuracy rate of more than 90 % which was above our
expectations. The algorithm for finding out the deforested areas perform very reliably as our
output obtained, displays.

The aim of this project is to contribute to the environment in our small way by setting out
an idea for a software based protection which could actually save millions of forests on the
planet from getting deforested. The results obtained in this project can be used for prevention
of deforestation and could help study the impact of deforestation. We believe we have done
great justice to the idea, and ended up getting more than satisfying results.

Appendix A - User Manual

STEP 1:Open MATLAB and create a new script.

STEP 2:Runmain.m, which contains the script we developed in command window

STEP 3:When open dialogue box pops up, select first input image and then select
second input image.

STEP 4:Process images will save in that folder as img3, img4, imgf1, imgf2.

STEP 5:Output will popup as image as well as, output.png and output.txt will
generate.

STEP 6:Output.png will show ForestChange, red will show forest decrease and green
will show forest increase.

STEP 7:Output.txt will show calculation and rough amount of changing forest in
squarekm.

Appendix B - MATLAB script


% Reading of the input images
clear all;
close all;
[file,path] = uigetfile('*.png');
if isequal(file,0)
disp('User selected Cancel');
else
disp(['User selected ', fullfile(path,file)]);
end
pic1 = imread(file);
img = pic1;
for mm = 1:size(pic1,1)
for nn = 1:size(pic1,2)
if pic1(mm,nn,1) > pic1(mm,nn,2) -8 || pic1(mm,nn,3) > pic1(mm,nn,2)
-8
pic1(mm,nn,:) = [0 0 0];
end
end
end

% Image Segmentation
%figure
imwrite(pic1,'imgf1.png')
[file,path] = uigetfile('*.png');
if isequal(file,0)
disp('User selected Cancel');
else
disp(['User selected ', fullfile(path,file)]);
end
pic2 = imread(file);
for mm = 1:size(pic2,1)
for nn = 1:size(pic2,2)
if pic2(mm,nn,1) > pic2(mm,nn,2)-5 ||
pic2(mm,nn,3) > pic2(mm,nn,2)-5
pic2(mm,nn,:) = [0 0 0];
end
end
end
imgboth = imoverlay(img,imgf1,[1 0 0]);

%
{
figure
imshow(imgboth)
%
}

% Color Segmentation
%figure
imwrite(imgboth,'img3.png')
img3 = imread('img3.png');

cnt2 = 0;

for mm = 1:size(img1,1)
for nn = 1:size(img1,2)
if img1(mm,nn,2) > img2(mm,nn,2)+75
cnt2 = cnt2 +1;
imgf2(mm,nn,:) = [1 0 0];
end
end
end

fid = fopen('output.txt','w');

% RGB color model

function out = imoverlay(in, mask, color)


DEFAULT_COLOR = [1 1 1];
if nargin < 3
color = DEFAULT_COLOR;
end

mask = (mask ~= 0);

in_uint8 = im2uint8(in);
color_uint8 = im2uint8(color);

if ndims(in_uint8) == 2
% Input is grayscale. Initialize all output
channels the same.
out_red = in_uint8;
out_green = in_uint8;
out_blue = in_uint8;
else
% Input is RGB truecolor.
out_red = in_uint8(:,:,1);
out_green = in_uint8(:,:,2);
out_blue = in_uint8(:,:,3);
end

% Replace output channel values in the mask


locations with the appropriate
% color value.
out_red(mask) = color_uint8(1);
out_green(mask) = color_uint8(2);
out_blue(mask) = color_uint8(3);

% Form an RGB truecolor image by


concatenating the channel matrices along
% the third dimension.
out = cat(3, out_red, out_green, out_blue);
fprintf(fid,'Total pixels here are = 722 x 1364 =
984808 and total area of image is 65km x 65km
= 4225squarekm\r\nSo, area of pixel is = total
area / number of pixels\r\n')
fprintf(fid,'Forest loss is : %d pixels\r\n',cnt1-
7000);

fprintf(fid,'Forest spread is : %d pixels\r\n',cnt2);


fprintf(fid,'Total forest increasement or
decreasement is: %d pixels\r\n',cnt2-cnt1+7000);

fprintf(fid,'So, In Squarekm loss is %.2f, spread


is %.2f, total is %.2f',(cnt1-
7000)*4225/984808,cnt2*4225/984808,(cnt2-
cnt1+7000)*4225/984808);

%
{
figure
imshow(imgf2)
%
}

imwrite(imgf2,'img4.png')

img = imread('img3.png');
img1 = imread('img4.png');

imb = imoverlay(img,img1,[0 1 0]);

figure
imshow(imb)

imwrite(imb,'output.png');
ACKNOWLEDGEMENTS

You might also like