Report of Dimensions Measurement of An Object in 2D Image Using Image Processing in Python

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 70

A PRELIMINARY PROJECT REPORT ON

Dimension Measurement of an Object in 2D Image using image processing in Python

BACHELOR OF ENGINEERING (Mechanical Engineering)

BY

Yash Kachave BE B 73
Atharva Shirvalkar BE B 48
Adarsh Meshram BE B 53
Siddhesh Jagtap BE A 30

Guide
Prof. S.M. Narayankar

DEPARTMENT OF MECHANICAL Pimpri Chinchwad College


of Engineering And
Research, Ravet-412101
2021 -2022

Page 1 of 61
PCET’S
Pimpri Chinchwad College of Engineering And
Research,Pune - 412101

CERTIFICATE

This is to certify that Yash Kachave ,Atharva Shirvalkar , Adarsh Meshram ,Siddhesh
Jagtap has successfully completed the Project Stage – II entitled “ Dimensions mea-
surement of an Object in 2D Image using image processing in Python” under my
supervision, in the partial fulfillment of Bachelor of Engineering - Mechanical En-
gineering of Savitribai Phule Pune University..

Prof. S.M. Narayankar


Project Guide Internal Examiner

Prof.Dr. Ramesh K. Rathod Prof.Dr. H. U. Tiwari


Head of Department Principal

External Examiner
Vision and Mission of PCCOER Ravet
Vision:
To be a Premier institute of technical education amp; research to serve the need of
society and all the stakeholders.
Mission:
To establish state-of-the-art facilities to create an environment resulting in individu-
als who are technically sound having professionalism, research and innovative apti-
tude with high moral and ethical values.
Vision and Mission of Mechanical Engineering Department
Vision:
To be a Premier Department of Mechanical Engineering and research to serve the
need of the society and all the stakeholders.
Mission:
1. To provide state of art facilities to impart quality education.
2. To undertake various value added and add on courses to make students technically
sound and thorough professionals.
3. To collaborate with the industries and academia and strive to transform the re-
search and innovative aptitude in the students and faculties.
4. To inculcate high moral, ethical values and national pride in students and faculties

Page 3 of 61
Acknowledgments

We are greatly indebted to my project guide Prof. S.M. Narayankar for his able
guidance throughout the course of this work. It has been an altogether different expe-
rience to work with him and we would like to thank him for his help, suggestions and
numerous discussions on ‘ Dimension Measurement of an Object in 2D Image
using image processing in Python ’.

We are gladly taking this opportunity to thank Head of Mechanical Engineering


Prof. R. K. Rathod and Prof. S.M. Narayankar project Coordinator for their valu-
able guidance and providing facility during progress of seminar.

We are heartily thankful to Prof. H. U. Tiwari (Principal, Pimpri Chinchwad College


of Engineering Research, Ravet) for providing research environment; also for his
kind inspiration. Last but not least we are also thankful to all those who help directly
or indirectly to develop this Project work and complete it successfully.With Deep
Reverence,

Yash Kachave
Atharva Shirvalkar
Adarsh Meshram
Siddhesh Jagtap

Date:-
Place :- Ravet, Pune

Page 4 of 61
Abstract
This paper proposes a method to automatically measure object size with
high accuracy by a simple camera system. The approach includes four
steps namely preprocessing, object detection, key points extraction and
depth interpolation before size calculation. The RGB and depth frames
are firstly aligned in the preprocessing step. Then, the object is detected
by depth threshold and key points are extracted by ShiTomasi corner de-
tector combined with our proposed key point extraction algorithm. An
interpolation algorithm is developed to handle incorrect depth at the edge
of objects. Last but not least, the object dimensions are calculated by
Euclidean distance through the 3D coordinate of the key points. Exper-
imental results of three-object measurement show that average accuracy
is about 96% which is close to those of manual and theoretical methods.
These also outperform the results of recently published papers.
Index Terms—Size measurement, 2D camera, automatic measurement,
key point extraction, depth interpolation.

Page 5 of 61
Contents

1 Introduction 1
1.1 About Object detection . . . . . . . . . . . . . . . . . . . . . . . . 2
1.2 Objectives . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2
1.3 Software Requirements . . . . . . . . . . . . . . . . . . . . . . . . 2
1.4 Hardware Requirements . . . . . . . . . . . . . . . . . . . . . . . 2
1.5 Problem Statement . . . . . . . . . . . . . . . . . . . . . . . . . . 3

2 Literature Survey 4
2.1 Study Of Research Paper . . . . . . . . . . . . . . . . . . . . . . . 5

3 Software Requirements Specification 8


3.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
3.1.1 User Classes and characteristics . . . . . . . . . . . . . . . 9
3.1.2 Assumptions and Dependencies . . . . . . . . . . . . . . 9
3.2 Functional Requirements . . . . . . . . . . . . . . . . . . . . . . . 10
3.2.1 System Feature (Functional Requirement) . . . . . . . . . 10
3.3 External Interface Requirements . . . . . . . . . . . . . . . . . . 10
3.3.1 User Interfaces . . . . . . . . . . . . . . . . . . . . . . . 10
3.3.2 Hardware Interfaces and software interfaces . . . . . . . . 11
3.4 Nonfunctional Requirements . . . . . . . . . . . . . . . . . . . . 12
3.4.1 Performance Requirements . . . . . . . . . . . . . . . . . 12
3.4.2 Safety Requirements . . . . . . . . . . . . . . . . . . . . 12
3.4.3 Security Requirements . . . . . . . . . . . . . . . . . . . . 12
3.4.4 Software Quality Attributes . . . . . . . . . . . . . . . . . 13

6
3.5 System Requirements . . . . . . . . . . . . . . . . . . . . . . . . 14
3.5.1 Database Requirements . . . . . . . . . . . . . . . . . . . 14
3.5.2 Software Requirements . . . . . . . . . . . . . . . . . . . 14
3.5.3 Hardware Requirements . . . . . . . . . . . . . . . . . . . 14
3.6 Analysis Models: SDLC Model to be applied . . . . . . . . . . . . 15

4 System Design 16
4.1 system Architecture . . . . . . . . . . . . . . . . . . . . . . . . . . 17
4.2 Data Flow Diagram . . . . . . . . . . . . . . . . . . . . . . . . . . 18
4.3 UML DIAGRAMS . . . . . . . . . . . . . . . . . . . . . . . . . . 19
4.3.1 Use case Diagram . . . . . . . . . . . . . . . . . . . . . . 20

5 Project Plan 24
5.1 Project Estimates . . . . . . . . . . . . . . . . . . . . . . . . . . . 25
5.1.1 Reconciled Estimates . . . . . . . . . . . . . . . . . . . . . 25
5.1.2 Project Resources . . . . . . . . . . . . . . . . . . . . . . 25
5.2 Risk Management . . . . . . . . . . . . . . . . . . . . . . . . . . . 26
5.2.1 Risk Identification . . . . . . . . . . . . . . . . . . . . . . 26
5.2.2 Risk Analysis . . . . . . . . . . . . . . . . . . . . . . . . . 26
5.2.3 Risk Mitigation Risk Monitoring and Risk Management . . 27
5.3 Project Schedule . . . . . . . . . . . . . . . . . . . . . . . . . . . 29
5.3.1 Project Task Set . . . . . . . . . . . . . . . . . . . . . . . 29
5.3.2 Task Network . . . . . . . . . . . . . . . . . . . . . . . . 29
5.3.3 Timeline Chart . . . . . . . . . . . . . . . . . . . . . . . . 30
5.4 Team Organization . . . . . . . . . . . . . . . . . . . . . . . . . . 30
5.4.1 Team Structure . . . . . . . . . . . . . . . . . . . . . . . . 30
5.4.2 Management reporting and communication: . . . . . . . . 31

6 Project Implementation 32
6.1 Overview of Project Modules . . . . . . . . . . . . . . . . . . . . 33
6.2 Tools and Technologies Used . . . . . . . . . . . . . . . . . . . . . 33
6.3 Algorithm . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37

Page 7 of 61
7 Softwere Testing 38
7.1 Types of Testing . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39
7.1.1 Unit Testing . . . . . . . . . . . . . . . . . . . . . . . . . . 39
7.1.2 Regression Testing . . . . . . . . . . . . . . . . . . . . . . 39
7.1.3 Smoke Testing . . . . . . . . . . . . . . . . . . . . . . . . 39
7.1.4 System Testing . . . . . . . . . . . . . . . . . . . . . . . . 39

8 Result 40

9 Test Cases 44

10 Conclusion 48
10.1 Conclusion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49

Appendix A 50

Appendix B 54
B.1 Gui: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55
B.1.1 Login Gui: . . . . . . . . . . . . . . . . . . . . . . . . . . 55
10.1.2 Object Detection Gui: . . . . . . . . . . . . . . . . . . . . 57

11 Bibliography 59

Page 8 of 61
List of Figures

3.1 waterfall model . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15

4.1 system Architecture . . . . . . . . . . . . . . . . . . . . . . . . . . 17


4.2 Data Flow diagram . . . . . . . . . . . . . . . . . . . . . . . . . . 19
4.3 Data Flow diagram . . . . . . . . . . . . . . . . . . . . . . . . . . 19
4.4 Data Flow diagram . . . . . . . . . . . . . . . . . . . . . . . . . . 20
4.5 Use case Diagram Diagram . . . . . . . . . . . . . . . . . . . . . . 21
4.6 Activity Diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . 22
4.7 Sequence Diagram . . . . . . . . . . . . . . . . . . . . . . . . . . 23

5.1 Risk Table . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27


5.2 Risk Probability definitions . . . . . . . . . . . . . . . . . . . . . . 27
5.3 Risk Impact definitions . . . . . . . . . . . . . . . . . . . . . . . . 27
5.4 Task Network . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29
5.5 Timeline Chart . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30

6.1 CNN Algorithm . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37

A.1 P Problem . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51
A.2 NP Problem . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52
A.3 NP Complete Problem . . . . . . . . . . . . . . . . . . . . . . . . 53

9
CHAPTER 1

INTRODUCTION
1.1 ABOUT OBJECT DETECTION

It consumes lot of time to measure the dimensions of any object manually . To reduce
that time delay we are going to measure dimensions of any object with 2D image
processing . We will measure dimensions of detected objects from any distance
within visible range . With the help of reference image we are going to calculate the
dimensions. Basically we are going to use Opencv3.0 for the detection of our object.
Opencv is the library of pre-trained object detection set which helps in the detection
of the objects after training them for a particular amount of times. With the help of
Opencv we are using to use YOLOv3.0 algorithm for the detection of the objects
with more accuracy, both Yolo and Openvcv will work together to detect the object

1.2 OBJECTIVES

• Measuring distance of object from camera .

• Measuring dimensions of an object from known distance .

• Measuring dimensions of an object from unknown distance.

• Using artificial intelligence and the YOLOv3 Algorithm, detect an object and
measure its distance and dimensions.

1.3 SOFTWARE REQUIREMENTS

• Python V3.0 (Coding Language)

• Spyder (As IDE)

• Windows 10 (Operating System)

1.4 HARDWARE REQUIREMENTS

• Processor : Pentium-IV

• Speed : 1.1 GHz

Page 2 of 61
• RAM : 8 GB

• Hard Disk : 1.0 TB

1.5 PROBLEM STATEMENT

Measure accurate and true dimensions of any object from an unspecified distance
using python Language and Artificial Intelligence Image Processing Technique.

Page 3 of 61
CHAPTER 2

LITERATURE SURVEY
2.1 STUDY OF RESEARCH PAPER

A research paper is a document of a scientific article that contains relevant ex- per-
tise, including substantive observations, and also references to a specific subject of
philosophy and technique. Use-secondary references are reviewed in literature and
no current or initial experimental work is published.

1.Paper Name: An Embedded Real-Time Object Detection and Measurement of its


Size [19]
Author: Nashwan Adnan OTHMAN,Mehmet Umut SALUR
Abstract : In these days, real-time object detection and dimensioning of objects is
an important issue from many areas of industry. This is a vital topic of computer vi-
sion problems. This study presents an enhanced technique for detecting objects and
computing their measurements in real time from video streams. We suggested an
object measurement technique for real-time video by utilizing OpenCV libraries and
includes the canny edge detection, dilation, and erosion algorithms. The suggested
technique comprises of four stages: (1) identifying an object to be measured by using
canny edge detection algorithm, (2) using morphological operators includes dilation
and erosion algorithm to close gaps between edges, (3) find and sort contours, (4)
measuring the dimensions of objects. In the implementation of the proposed tech-
nique, we designed a system that used OpenCV software library, Raspberry Pi 3 and
Raspberry Camera. The proposed technique was nearly achieved 98% success in
determines the size of the objects.

2.Paper Name: Automatic Method for Measuring Object Size Using 3D Camera
[20]
Author:Cuong Vo-Le, Pham Van Muoi, Nguyen Hong Son, Nguyen Van San, Vu
Khac Duong and Nguyen Thi Huyen
Abstract : This paper proposes a method to automatically measure object size with
high accuracy by a structure-light based stereo camera system. The approach in-
cludes four steps namely preprocessing, object detection, key points extraction and

Page 5 of 61
depth interpolation before size calculation. The RGB and depth frames are firstly
aligned in the preprocessing step. Then, the object is detected by depth threshold and
key points are extracted by ShiTomasi corner detector combined with our proposed
key point extraction algorithm. An interpolation algorithm is developed to handle
incorrect depth at the edge of objects. Last but not least, the object dimensions are
calculated by Euclidean distance through the 3D coordinate of the key points. Ex-
perimental results of three-object measurement show that average accuracy is about
99These also outperform the results of recently published papers.

3.Paper Name:Deep Hash Assisted Network for Object Detection in Remote Sens-
ing Images [20]

Author name:MIN WANG, ZEPEI SUN, GUANGYING XU, HONGBIN MA


abstract : Remote Sensing Images (RSIs) often have extremely wide width and
abundant terrain. In order to achieve rapid object detection in large RSIs, in this pa-
per, a Deep Hash Assisted Network (DHAN) is constructed by introducing a hashing
encoding of images in a two-stage deep neural network. Different with the available
detection networks, DHAN first locates candidate object regions and then transfers
the learned features to another Region Proposal Network (RPN) for detection. On
the one hand, it can avoid the calculations on the background irrelevant to objects.
On the other hand, the built hash encoding layer in DHAN can accelerate the de-
tection via binary hash features. Moreover, a self attention layer is designed and
combined with the convolution layer, to distinguish relatively small objects regions
from a very large scene. The proposed method is tested on several public data sets,
and the comparison results show that DHAN can remarkably improve the detection
efficiency on large RSIs and simultaneously achieve high detection accuracy.

4.Paper Name: Visual-LiDAR Based 3D Object Detection and Tracking for Em-
bedded Systems[21]
Author:MUHAMMAD SUALEH AND GON-WOO KIM
abstract :In recent years, persistent news updates on autonomous vehicles and the
claims of companies entering the space, brace the notion that vehicular autonomy of

Page 6 of 61
level 5 is just around the corner. However, the main hindrance in asserting the full
autonomy still boils down to environmental perception that affects the autonomous
decisions. An efficient perceptual system requires redundancy in sensor modalities
capable of performing in varying environmental conditions, and providing a reliable
information using limited computational resources. This work addresses the task of
3D object detection and tracking in the vehicles’ environment, using camera and 3D
LiDAR as primary sensors. The proposed framework is designed to operate in an
embedded system that visually classifies the objects using a lightweight neural net-
work, while tracking is performed in 3D space using LiDAR information. The main
contribution of this work is 3D LiDAR point cloud classification using visual object
detector, and an IMM-UKF-JPDAF based object tracker that jointly performs 3D ob-
ject detection and tracking. The performance evaluation is carried out using MOT16
metrics and ground truths provided by KITTI Datasets. Furthermore, the proposed
tracker is evaluated and compared with state-of-the-art approaches. The experiments
suggest that the proposed framework offers a suitable solution for embedded systems
to solve 3D object detection and tracking problem, with added benefits.

5.Paper Name:The development of image-based distance measurement system.[22]


Author:Lawrence Y.Deng
Abstract: The system uses two parallel laser lights as a scale to compute the actual
horizontal or vertical distance rapidly. Although the basic idea of using surrounding
lights to eliminate image noise worked perfectly in many conditions, but there were
some gotchas when there isn’t much light that proved challenging when developing
Night Sight 1)Auto white balancing (AWB) failing in low light. 2)Tone mapping of
scenes that are too dark to see.

Page 7 of 61
CHAPTER 3

SOFTWARE REQUIREMENTS
SPECIFICATION
3.1 INTRODUCTION

3.1.1 User Classes and characteristics

A user class is a set of developer-defined attributes (characteristics) and methods


(behaviors) that you can use to refer to multiple data items as a single entity. You
create user classes are classes that you create in the visual development environment
as part of an application. A user class is a convenient way to manipulate related data
elements as a single object.
In this system, the user must first register and then log in. If the login is successful,
the user is directed to the system, where they can enter the details of their disease.
The machine then determines whether the user has Alzheimer’s disease or not.

3.1.2 Assumptions and Dependencies

Assumption: In this system, we take an image dataset as input and, using the YOLOV3
algorithm, determine whether a object and measure distance and dimension. YOLOV3
algorithm:
YOLOv3 (You Only Look Once, Version 3) is a real-time object detection algorithm
that identifies specific objects in videos, live feeds, or images. YOLO uses features
learned by a deep convolutional neural network to detect an object.

Dependencies:
Used Python Language:Python is commonly used for developing websites and soft-
ware, task automation, data analysis, and data visualization. Since it’s relatively easy
to learn, Python has been adopted by many non-programmers such as accountants
and scientists, for a variety of everyday tasks, like organizing finances.
Python is a general-purpose programming language, so it can be used for many
things. Python is used for web development, AI, machine learning, operating sys-
tems, mobile application development, and video games. Python is a relatively easy
programming language to learn and follows an organized structure
The python language is one of the most accessible programming languages available

Page 9 of 61
because it has simplified syntax and not complicated, which gives more emphasis on
natural language. Due to its ease of learning and usage, python codes can be eas-
ily written and executed much faster than other programming languages. Machine
learning:
Machine learning (ML) is a type of artificial intelligence (AI) that allows software
applications to become more accurate at predicting outcomes without being explic-
itly programmed to do so. Machine learning algorithms use historical data as input
to predict new output values.
Machine learning is a method of data analysis that automates analytical model build-
ing. It is a branch of artificial intelligence based on the idea that systems can learn
from data, identify patterns and make decisions with minimal human intervention.

3.2 FUNCTIONAL REQUIREMENTS

3.2.1 System Feature (Functional Requirement)

Proposed system consists of 4 modules:

a) Feature point extraction: Feature points of each Dataset parameters gets detected.

b) Feature correspondence matching: Matching of selected feature points across var-


ious parameters.

c) Point estimation: Position estimation and vision system orientation during navi-
gation.

d) Position refinement: Location estimate based, accurate location derivation

3.3 EXTERNAL INTERFACE REQUIREMENTS

3.3.1 User Interfaces

Application Based Object and measure distance and dimension.

Page 10 of 61
3.3.2 Hardware Interfaces and software interfaces

RAM : 8 GB
As we are using Machine Learning Algorithm and Various High Level Libraries
Laptop
RAM minimum required is 8 GB.
Hard Disk : 40 GB
Data Set of CT Scan images is to be used hence minimum 40 GB Hard Disk memory
is required.
Processor : Intel i5 Processor

IDE : spyder
Spyder is a free and open source scientific environment written in Python, for Python,
and designed by and for scientists, engineers and data analysts. It features a unique
combination of the advanced editing, analysis, debugging, and profiling functional-
ity of a comprehensive development tool with the data exploration, interactive execu-
tion, deep inspection, and beautiful visualization capabilities of a scientific package.
Coding Language : Python Version 3.8
Highly specified Programming Language for Machine Learning because of avail-
ability of High Performance Libraries.
Operating System : Windows 10
Latest Operating System that supports all type of installation and development En-
vironment
Software Interface:

Operating System: Windows 10

IDE:Spyder

Programming Language : Python

Page 11 of 61
3.4 NONFUNCTIONAL REQUIREMENTS

3.4.1 Performance Requirements

In order to meet stringent performance requirements, system administrators must ef-


fectively detect undesirable performance behaviours, identify potential root causes,
and take adequate corrective measures. The problem of uncovering and understand-
ing performance anomalies and their causes (bottlenecks) in different system and
application domains is well studied. In order to assess progress, research trends,
and identify open challenges, we have reviewed major contributions in the area and
present our findings in this survey. Our approach provides an overview of anomaly
detection and bottleneck identification research as it relates to the performance of
computing systems. By identifying fundamental elements of the problem, we are
able to categorize existing solutions based on multiple factors such as the detection
goals, nature of applications and systems, system observability, and detection meth-
ods.

3.4.2 Safety Requirements

A cumbersome task and practically infeasible in many applications. Therefore, an


automated monitoring system is of both fundamental and practical interest.an intelli-
gent solution that uses live camera images to detect workers who breach safety rules
by not wearing high-visibility vests. The proposed solution is formulated in the form
of an anomaly detection algorithm developed in the random finite set (RFS) frame-
work.

3.4.3 Security Requirements

Anomaly detection is the process of finding outliers in a given dataset. Outliers


are the data objects that stand out amongst other objects in the dataset and do not
conform to the normal behavior in a dataset. Anomaly detection is a data science

Page 12 of 61
application that combines multiple data science tasks like classification, regression,
and clustering. The target variable to be predicted is whether a transaction is an out-
lier or not. Since clustering tasks identify outliers as a cluster, distance-based and
density-based clustering techniques can be used in anomaly detection tasks.

3.4.4 Software Quality Attributes

software has many quality attribute that are given below:-


• Adaptability: This software is adaptable by all users.

• Availability: This software is freely available to all users. The availability of


the software is easy for everyone.

• Maintainability: After the deployment of the project if any error occurs then
it can be easily maintained by the software developer.

• Reliability: The performance of the software is better which will increase


the reliabilityof the Software.

• User Friendliness: Since, the software is a GUI application; the output gener-
ated is much user friendly in its behavior.

• Integrity: Integrity refers to the extent to which access to software or data by


unauthorized persons can be controlled.

• Security: Users are authenticated using many security phases so reliable


secu- rity is provided.

• Testability: The software will be tested considering all the aspects..

Page 13 of 61
3.5 SYSTEM REQUIREMENTS

3.5.1 Database Requirements

DB Browser for SQLite (DB4S) is a high quality, visual, open source tool to create,
design, and edit database files compatible with SQLite.
DB4S is for users and developers who want to create, search, and edit databases.
DB4S uses a familiar spreadsheet-like interface, and complicated SQL commands do
not have to be learned.
Controls and wizards are available for users to:
Create and compact database files
Create, define, modify and delete tables
Create, define, and delete indexes
Browse, edit, add, and delete records
Search records
Import and export records as text
Import and export tables from/to CSV files
Import and export databases from/to SQL dump files
Issue SQL queries and inspect the results

3.5.2 Software Requirements

RAM : 8 GB
Processor : Intel i5 Processor
IDE : Spyder
Coding Language : Python Version 3.8
Operating System : Windows 10

3.5.3 Hardware Requirements

Speed : 1.1 GHz


Hard Disk : 40 GB
Key Board : Standard Windows Keyboard Mouse : Two or Three Button Mouse

Page 14 of 61
3.6 ANALYSIS MODELS: SDLC MODEL TO BE APPLIED

SDLC Models stands for Software Development Life Cycle Models. In this article,
we explore the most widely used SDLC methodologies such as Agile ... Each soft-
ware development life cycle model starts with the analysis, in which the Also, here
are defined the technologies used in the project, team load.
One of the basic notions of the software development process is SDLC models which
stands for Software Development Life Cycle models. SDLC – is a continuous pro-
cess, which starts from the moment, when it’s made a decision to launch the project,
and it ends at the moment of its full remove from the exploitation. There is no one
single SDLC model. They are divided into main groups, each with its features and
weaknesses.

Figure 3.1: waterfall model

Page 15 of 61
CHAPTER 4

SYSTEM DESIGN
4.1 SYSTEM ARCHITECTURE

System Architecture is a the conceptual Diagram that defines the structure of behav-
ior and working of the the given system with behavioral and other aspects.

Figure 4.1: system Architecture

• The input of a particular image is uploaded into the system.

• The submitted image is pre-processed into the system. i.e The raw image data
is cleaned and unnecessary images part is omitted.

• After that the parameters are extracted from the image and the Co-ordinates
are defined with the help of the given code.

• The data-set is trained and classified with the help of YOLOv3.0 algorithm.

• Then with the help of Opencv the object gets measured and the output is dis-
played.

Page 17 of 61
4.2 DATA FLOW DIAGRAM

In Data Flow Diagram,we Show that flow of data in our system in DFD0 we show
that base DFD in which rectangle present input as well as output and circle show
our system,In DFD1 we show actual input and actual output of system input of our
system is text or image and output is rumor detected like wise in DFD 2 we present
operation of user as well as admin.

Page 18 of 61
Figure 4.2: Data Flow diagram

Figure 4.3: Data Flow diagram

4.3 UML DIAGRAMS

Unified Modeling Language is a standard language for writing software blueprints.The


UML may be used to visualize,specify,construct and document the artifacts of a soft-
wareintensive system.UML is process independent,although optimally it should be

Page 19 of 61
Figure 4.4: Data Flow diagram
used in process that is use case driven,architecture-centric,iterative,and incremen-
tal.The Number of UML Diagram is available.

Use case Diagram

Class Diagram

Activity Diagram

Sequence Diagram

4.3.1 Use case Diagram

User case diagram explains the system architecture and working in aspects of user
and the system simultaneously.

Page 20 of 61
Figure 4.5: Use case Diagram Diagram

4.3.1.1 User Aspect

• Uploading of Data set.

• Measured Distance and detected object.

4.3.1.2 System Aspect

• Uploading of Data set.

• Data is pre-processed

• Features are extracted from image like co-ordination of object in X Y formats.

Page 21 of 61
• Detected objects are classified.

• Output is detected. i.e Screen is detected and displaying process is processed

• Object is measured and displayed with the detected label.

Figure 4.6: Activity Diagram

Activity diagram shows all the activities which are processed in the system
and are not visible to the users its all working is same as User Case Diagram.

Page 22 of 61
Figure 4.7: Sequence Diagram

Sequence Diagram shows the processing sequence of the system. It visually


explains how the process is completed step by step and how it’s executed from object
detection till the image dimensions output to the user.

Page 23 of 61
CHAPTER 5

PROJECT PLAN
5.1 PROJECT ESTIMATES

5.1.1 Reconciled Estimates

Cost Estimate The project cost can be found using any one of the model. COCOMO
1 Model COCOMO-2 Model Model -1: The basic COCOMO model computes soft-
ware development efforts as a function of program size expressed in estimated lines
of code. Model-2: The intermediate COCOMO model computes software develop-
ment efforts as a function of program size and a set of cost drivers that include sub-
jective assessment of the product, hardware, personnel, project attributes Model-3:
The advanced COCOMO model incorporates all characteristics of the intermediate
version with an assessment of the cost drivers impact on each step of the software
engineering process. Following is the basic COCOMO -2 model.

1.Software Project A(b) B(b) C(b) D(b)

2.Organic 2.4 1.05 2.5 0.38

3.Semi-detached 3.0 1.22 2.5 0.35

4.Embedded 3.6 1.20 2.5 0.32 25

The basic COCOMO -2 model equations take form

E=A(b)KLOCB(b)

D=C(b)ED(b)

Where E is the effort applied in person months. D is development time in chrono-


logical month. KLOC is estimated number of delivered lines of code for the project.
This project can be classified as Semidetached software project. The rough estimate
of number of lines of this project is 9.072k.Applying the above formula

E=3.0*(9.072)1.22

5.1.2 Project Resources

Well configured Laptop, Spyder software, 2 GHZ CPU speed, 2 GB RAM, Internet
connection.

Page 25 of 61
5.2 RISK MANAGEMENT

5.2.1 Risk Identification

1. Have top software and customer managers formally committed to support the
project?

Ans-Not applicable.

2. Are end-users enthusiastically committed to the project and the system/product to


be built?

Ans-Not known at this time.

3. Are requirements fully understood by the software engineering team and its cus-
tomers?

Ans-Yes

4. Have customers been involved fully in the definition of requirements?

Ans-Not applicable

5. Do end-users have realistic expectations?

Ans-Not applicable

6. Does the software engineering team have the right mix of skills?

Ans-yes

7. Are project requirements stable?

Ans-Not applicable

5.2.2 Risk Analysis

Page 26 of 61
Figure 5.1: Risk Table

Figure 5.2: Risk Probability definitions

Figure 5.3: Risk Impact definitions

5.2.3 Risk Mitigation Risk Monitoring and Risk Management

1. Risk Mitigation:

If a software team adopts a proactive approach to risk, avoidance is always the best
strategy. This is achieved by developing a plan for risk mitigation. To mitigate this
risk, you would develop a strategy for reducing turnover. Among the possible steps
to be taken are:

• Meet with current staff to determine causes for turnover (e.g., poor working condi-
tions, low pay, competitive job market).

• Mitigate those causes that are under your control before the project starts.

• Once the project commences, assume turnover will occur and develop techniques
to ensure continuity when people leave.

Page 27 of 61
• Organize project teams so that information about each development activity is
widely dispersed.

• Define work product standards and establish mechanisms to be sure that all modules
and documents are developed in a timely manner.

• Conduct peer reviews of all work.

• Assign a backup staff member for every critical technologist.

2. Risk Monitoring

As the project proceeds, risk-monitoring activities commence. The project manager


monitors factors that may provide an indication of whether the risk is becoming
more or less likely. In the case of high staff turnover, the general attitude of team
members based on project pressures, the degree to which the team has jelled, inter-
personal relationships among team members, potential problems with compensation
and benefits, and the availability of jobs within the company and outside it are all
monitored.

3. Risk Management

Risk management and contingency planning assumes that mitigation efforts have
failed and that the risk has become a reality. Continuing the example, the project is
well under way and a number of people announce that they will be leaving. If the mit-
igation strategy has been followed, backup is available, information is documented,
and knowledge has been dispersed across the team. In addition, you can temporarily
refocus resources (and readjust the project schedule) to those functions that are fully
staffed, enabling newcomers who must be added to the team to “get up to speed.”
Those individuals who are leaving are asked to stop all work and spend their last
weeks in “knowledge transfer mode.” This might include video based knowledge
capture, the development of “commentary documents or Wikis,” and/or meeting with
other team members who will remain on the project.

Page 28 of 61
5.3 PROJECT SCHEDULE

5.3.1 Project Task Set

Major Tasks in the Project stages are:

• Task 1: correctness

• Task 2: availability

• Task 3: integrity

5.3.2 Task Network

Figure 5.4: Task Network

Page 29 of 61
5.3.3 Timeline Chart

Figure 5.5: Timeline Chart

5.4 TEAM ORGANIZATION

5.4.1 Team Structure

The team structure for the project is identified. There are total 4 members in our
team and roles are defined. All members are contributing in all the phases of project.

Page 30 of 61
Sr. No. Name/Title Start Date End Date
1 Preliminary Survey 5 Aug. 2021 15 Aug. 2021
2 Introduction and Problem State- 16 Aug. 2021 22 Aug. 2021
ment
3 Literature Survey 23 Aug. 2021 30 Aug. 2021
4 Project Statement 31 Aug. 2021 5 Sept. 2021
5 Software Requirement And Specifi- 6 Sept. 2021 20 Sept. 2021
cation
6 Initial Code Writing 21 Sept. 2021 13 OCt. 2021
7 Partial Report Submission 13 Oct. 2021 1 Nov. 2021
8 Code analysis 10 Nov. 2021 25 Dec. 2021
9 Code Implementation 1 Jan. 2022 12 9 FEb. 2022
10 Code Deployment 10 Feb 2022 30 Dec. 2021
11 Testing 3 march. 2022 30 march. 2022
12 Error Fixing 1 April 2022 10 April 2022

5.4.2 Management reporting and communication:

Well planning mechanisms are used for progress reporting and inter/intra team com-
munication are identified as per requirements of the project.

Page 31 of 61
CHAPTER 6

PROJECT IMPLEMENTATION
6.1 OVERVIEW OF PROJECT MODULES

In this chapter we are going to have an overview about how much time does it took
to complete each task like- Preliminary Survey Introduction and Problem Statement,
Literature Survey, Project Statement, Software Requirement and Specification, Sys-
tem Design, Partial Report Submission, Architecture Design, Implementation, De-
ployment, Testing, Paper Publish, Report Submission. This chapter also gives focus
on stakeholder list which gives information about project type, customer of the pro-
posed system, user and project member who developed the system.

6.2 TOOLS AND TECHNOLOGIES USED

Python is an interpreted, high-level and general-purpose programming language.


Created by Guido van Rossum and first released in 1991, Python’s design philos-
ophy emphasizes code readability with its notable use of significant white space. Its
language constructs and object-oriented approach aim to help programmers write
clear, logical code for small and large-scale projects.
Python is dynamically typed and garbage-collected. It supports multiple pro-
gramming paradigms, including structured (particularly, procedural), object-oriented,
and functional programming. Python is often described as a ”batteries included” lan-
guage due to its comprehensive standard library.
Python was created in the late 1980s as a successor to the ABC language.
Python 2.0, released in 2000, introduced features like list comprehensions and a
garbage collection system with reference counting.
Python 3.0, released in 2008, was a major revision of the language that is not
completely backward-compatible, and much Python 2 code does not run unmodified
on Python 3.
The Python 2 language was officially discontinued in 2020 (first planned for
2015), and ”Python 2.7.18 is the last Python 2.7 release and therefore the last Python
2 release.”[30] No more security patches or other improvements will be released for
it. With Python 2’s end-of-life, only Python 3.6.x and later are supported.

Page 33 of 61
Python interpreters are available for many operating systems. A global com-
munity of programmers develops and maintains CPython, a free and open-source
reference implementation. A non-profit organization, the Python Software Founda-
tion, manages and directs resources for Python and CPython development.

Python was conceived in the late 1980s by Guido van Rossum at Centrum
Wiskunde Informatica (CWI) in the Netherlands as a successor to the ABC lan-
guage (itself inspired by SETL), capable of exception handling and interfacing with
the Amoeba operating system. Its implementation began in December 1989. Van
Rossum shouldered sole responsibility for the project, as the lead developer, until 12
July 2018, when he announced his ”permanent vacation” from his responsibilities
as Python’s Benevolent Dictator For Life, a title the Python community bestowed
upon him to reflect his long-term commitment as the project’s chief decision-maker.
He now shares his leadership as a member of a five-person steering council. In Jan-
uary 2019, active Python core developers elected Brett Cannon, Nick Coghlan, Barry
Warsaw, Carol Willing and Van Rossum to a five-member ”Steering Council” to lead
the project.

Page 34 of 61
Anaconda: Anaconda is a free and open-source distribution of the Python and
R programming languages for scientific computing (data science, machine learning
applications, large-scale data processing, predictive analytics, etc.), that aims to sim-
plify package management and deployment. The distribution includes data-science
packages suitable for Windows, Linux, and macOS. It is developed and maintained
by Anaconda, Inc., which was founded by Peter Wang and Travis Oliphant in 2012.
As an Anaconda, Inc. product, it is also known as Anaconda Distribution or Ana-
conda Individual Edition, while other products from the company are Anaconda
Team Edition and Anaconda Enterprise Edition, both of which are not free.
Package versions in Anaconda are managed by the package management sys-
tem conda. This package manager was spun out as a separate open-source package
as it ended up being useful on its own and for other things than Python. There is
also a small, bootstrap version of Anaconda called Miniconda, which includes only
conda, Python, the packages they depend on, and a small number of other packages.
Anaconda distribution comes with over 250 packages automatically installed, and
over 7,500 additional open-source packages can be installed from PyPI as well as
the conda package and virtual environment manager. It also includes a GUI, Ana-
conda Navigator, as a graphical alternative to the command line interface (CLI).
The big difference between conda and the pip package manager is in how
package dependencies are managed, which is a significant challenge for Python data
science and the reason conda exists.
When pip installs a package, it automatically installs any dependent Python
packages without checking if these conflict with previously installed packages[citation
needed]. It will install a package and any of its dependencies regardless of the state
of the existing installation[citation needed]. Because of this, a user with a working
installation of, for example, Google Tensorflow, can find that it stops working having
used pip to install a different package that requires a different version of the depen-
dent numpy library than the one used by Tensorflow. In some cases, the package
may appear to work but produce different results in detail.

Page 35 of 61
Spyder
Spyder is a powerful scientific environment written in Python, for Python, and
designed by and for scientists, engineers and data analysts. It offers a unique com-
bination of the advanced editing, analysis, debugging, and profiling functionality of
a comprehensive development tool with the data exploration, interactive execution,
deep inspection, and beautiful visualization capabilities of a scientific package.
Beyond its many built-in features, its abilities can be extended even further via
its plugin system and API. Furthermore, Spyder can also be used as a PyQt5 exten-
sion library, allowing you to build upon its functionality and embed its components,
such as the interactive console, in your own software.

Features

• Editor Work efficiently in a multi-language editor with a function/class browser,


real-time code analysis tools (pyflakes, pylint, and pycodestyle), automatic
code completion (jedi and rope), horizontal/vertical splitting, and go-to-definition.

• Interactive console

Harness the power of as many IPython consoles as you like with full workspace
and debugging support, all within the flexibility of a full GUI interface. In-
stantly run your code by line, cell, or file, and render plots right inline with the
output or in interactive windows.

• Documentation viewer

Render documentation in real-time with Sphinx for any class or function,


whether external or user-created, from either the Editor or a Console.

Page 36 of 61
6.3 ALGORITHM

Convolutional neural network is one of the main categories to do image recogni-


tion,image classification,object detection widely used.

• CNN image classification takes the input image,process it and classify it . Com-
puter sees an input image as array of pixels depends on the image resolution.(h*w*h)

• Convolutional layer - This are the filters used during the training process

• Non Linearity(ReLU)Layer - This functions do not follow any linearity.

• Pooling Layer - The layers which help to minimise the amount of time required for
Compilation

• Fully connected Layer - This layers are interconnected to each other and used to
transfer the layers data.

Figure 6.1: CNN Algorithm

Page 37 of 61
CHAPTER 7

SOFTWERE TESTING
Testing is an investigation conducted to provide stakeholders with information about
the quality of the product or service under test. Software testing also provides an
objective, independent view of the software to allow the business to appreciate and
understand the risks of software implementation. Test techniques include, but are
not limited to, the process of executing a program or application with the intent of
finding software bugs. Software testing can also be stated as the process of validating
and verifying that a software program or application or product:

1. Meets the business and technical requirements that guided

2. Works as expected;

3. Can be implemented with the same characteristics

7.1 TYPES OF TESTING

7.1.1 Unit Testing

It focuses on smallest unit of software design. In this we test an individual unit or


group of inter related units.

7.1.2 Regression Testing

The objective is to take unit tested components and build a program structure that has
been dictated by design.Integration testing is testing in which a group of components
are combined to produce output.

7.1.3 Smoke Testing

Very time new module is added leads to changes in program. This type of testing
make sure that whole component works properly even after adding components to
the complete program.

7.1.4 System Testing

In this software is tested such that it works fine for different operating system.It is
covered under the black box testing technique.

Page 39 of 61
CHAPTER 8

RESULT
We manually need to train the dataset and then only the objects are getting detected.
We trained various objects like bottle, Mobile Phone, Cake, Human face etc. And
the dimension measurement of those objects is carried out perfectly with around 90-
95 percent of accuracy. The results of this dataset are attached below in the images
including the working of Login and registration page GUi.

Page 41 of 61
Page 42 of 61
Page 43 of 61
CHAPTER 9

TEST CASES
p

Page 45 of 61
Page 46 of 61
Page 47 of 61
CHAPTER 10

CONCLUSION
10.1 CONCLUSION

The system can detect and measure objects in a real time video. The objects need to
be trained manually to get detected and measured. After the object has been detected
by using YOLOv3 Algorithm for Object Detect, the size is obtained for each object
by using OpenCV functions and the dimensions and printed on screen.

Page 49 of 61
APPENDIX A
NP-Hard NP-Complete:

What is P?

• P is set of all decision problems which can be solved in polynomial time by a


deterministic.

• Since it can be solved in polynomial time, it can be verified in polynomial


time.

• Therefore P is a subset of NP.

P : To identify road condition or road survey requires more man power, time
and money. To resolve these problems we need effective system.

Figure A.1: P Problem

What is NP?

NP means we can solve it in polynomial time if we can break the normal rules
of step-by-step computing.

What is NP Hard?

Page 51 of 61
A problem is NP-hard if an algorithm for solving it can be translated into one
for solving any NP-problem (nondeterministic polynomial time) problem. NP-hard
therefore means ”at least as hard as any NP-problem,” although it might, in fact, be
harder.

NP-Hard:
Propose system analyze the road condition and road surface. It identify bad road
patches and gives notification to navigation system. For that we used inbuilt ac-
celerometer sensor and gyroscope sensor. To improve the system result we use deci-
sion tree algorithm. Propose system has self-managing database which collect data
from vehicle drivers android smart phones. This data update in real time periodically.
Application utilizes this data to inform other application users about road condition.
So here in this case the ‘P’ problem is NP hard.
i.e. P=NP-Hard

Figure A.2: NP Problem

What is NP-Complete?

• Since this amazing ”N” computer can also do anything a normal computer can,
we know that ”P” problems are also in ”NP”.

• So, the easy problems are in ”P” (and ”NP”), but the really hard ones are

Page 52 of 61
*only* in ”NP”, and they are called ”NP-complete”.

• It is like saying there are things that People can do (”P”), there are things that
Super People can do (”SP”), and there are things *only* Super People can do
(”SP-complete”).

Figure A.3: NP Complete Problem

NP-Complete:

We have used inbuilt mobile sensor to identify road conditions.


Hence the ‘P’ is NP-Complete in this case.

Page 53 of 61
APPENDIX B
B.1 GUI:

The Gui(Graphical User Interface) code in this software is divided into multiple
different sections which are interlinked with each other in a single file. The different
sections implemented in this program are as follow.

• Login GUi

• Object detection Gui

B.1.1 Login Gui:

The software which is designed by us needs to be logged in before using as an extra


layer of security which is required for the protection of the software.
login Gui includes registration ui code as well, You need to register before logging
into the system. This all credentials are stored locally into the device which is being
used for the software.
login code is consisting of various different libraries which are being used for the
simplification of the project which is being executed in python. THe libraries used
in the software for login Gui are as follow

• tkinter - It is used to show the oiutput on display in graphical format.

• sqlite3 - It’s used for data storage and management of local database related
with the project.

• PIL - This library is used for image processing, It optimises the process of
image processing.

Object Detection Gui

Page 55 of 61
Login Gui

Page 56 of 61
10.1.2 Object Detection Gui:

This section of code includes every data that’s related with the detection of objects
and the dimension measurement of the detected objects.
we have used Opencv and Yolo V3.0 in this code for the detection of object and the
measurement of it.
The code is consisting 0f various different libraries and this libraries are as follow.

• cv2 - It’s image processing library which helps with dataset training for object

Page 57 of 61
detection.

• numpy - Various calculations are involved in the code which we are using so
Numpy helps to calculate this all calculations.

Page 58 of 61
CHAPTER 11

BIBLIOGRAPHY
1 Muthukrishnan.R and M.Radha “Edge Detection Techniques for image Seg-
mentation” International Journal of Computer Science Information Technol-
ogy (IJCSIT) Vol3, No 6, Dec 2011.

2 Geng Xing, Chen ken , Hu Xiaoguang “An improved Canny edge detection
algorithm for color image” IEEE TRANSATION ,2012 978-1- 4673-0311-
8/12/$31.00 ©2012 IEEE.

3 Chen.W, Yue.H, Wang.J, Wu.X. An improved edge detection algorithm for


depth map in painting. Optics and Lasers in Engineering 2014;55: 69–77.

4 Moeslund T. Canny Edge detection. Denmark: Laboratory of Computer Vi-


sion and Media Technology,AalborgUniversity. 〈http://www.cvmt.dk/ educa-
tion/teaching/f09/VGIS8/AIP/canny09gr820.pdf〉 [March 2009].

5 OpenCV, 2016. http://opencv.org/.[Accessed December 23, 2016].

6 I. Aydin and N. A. Othman, ”A new IoT combined face detection of people by


using computer vision for security application,” 2017 International Artificial
Intelligence and Data Processing Symposium (IDAP), Malatya, 2017, pp. 1-6.

7 N. A. Othman and I. Aydin, ”A new IoT combined body detection of people by


using computer vision for security application,” 2017 9th International Con-
ference on Computational Intelligence and Communication Networks (CICN),
Girne, 2017, pp. 108-112.

8 Raspberry Pi, 2015. https://www.raspberrypi.org.[Accessed may 4, 2015).

9 Virginia Menezes, Vamsikrishna Patchava, M. Surya Deekshith Gupta, ”Surveil-


lance and monitoring system using Raspberry Pi and SimpleCV”, 2015 Inter-
national Conference on Green Computing and Internet of Things (ICGCIoT),
vol. 00, no. pp. 1276-1278, 2015, doi:10.1109/ICGCIoT.2015.7380661.

10 Ms. RenukaChuimurkar, Prof. Vijay Bagdi, “Smart Surveillance International


Journal of Scientific Engineering and Applied Science (IJSEAS) – Volume-2,
Issue-1, January 2016 ISSN: 2395-3470.

Page 60 of 61
11 Dimensional analysis of objects in a 2D image by vayu sikkha and mayank
gupta by Nick tang and Lawrence Deng published in July 2017

12 A study on object detection by Laxmi tamilselvan published in December 2016

13 12Concept for Evaluation of Techniques for Trajectory Distance Measures by


In-Sub Yoo and Seung-Woo Seo.

14 Measuring Distances with only a camera https://youtu.be/OFX96ONRU18

15 Yolov4 Object Detection working https://youtu.be/JzOFWx1vZg

16 How image regression works : https://autokeras.com/tutorial/imageregression/

17 Real-time Distance Measurement Using Single Image by taha emara published


on http://emaraic.com/blog/distance-measurement

18 Object Detection and Recognition in Images by Sandeep Kumar and Amal


balyan Published by International Journal of Engineering Development and
Research (www.ijedr.org)

Page 61 of 61

You might also like