Final Internship Report
Final Internship Report
BACHELOR OF TECHNOLOGY
IN
SUBMITTED
BY
2018-2022
CERTIFICATE
HARSHA TARUN 18BK1A0482 in partial fulfillment of the requirement for the award of
the degree of B.Tech in Electronics & Communication Engineering, by Jawaharlal Nehru
Technological University Hyderabad is a record of Bonafide work carried out by them under
my guidance and supervision from 2021 to 2022.
The results presented in this report have been verified and are found to be satisfactory.
INSTITUTE VISION
To promote quality education accessible to all sections of the society without any
discrimination of caste, creed, color, gender, region, and religion and help the students to
discover their true potential.
INSTITUTE MISSION
IM1: To provide and equip the stakeholders with knowledge, skills, social values, ethics,
scientific attitude, and orientation for lifelong learning.
IM3: Provide infrastructure to arm the students with the competence to be at the forefront of
innovative technology and entrepreneurship in the highly competitive global market.
ST. PETER’S ENGINEERING
COLLEGE
(Approved by AICTE, Affiliated to JNTUH)
DEPARTMENT OF
DEPARTMENT VISION
DEPARTMENT MISSION
DM1. To adopt pedagogical processes, facilities to meet the educational objective and outcomes
of Emerging Technologies in the field of Electronics
DM3. To imparts knowledge in the field of Electronics and its related areas with a focus on
developing the required competencies and virtues to meet the requirement of society.
DEPARTMENT OF ELECTRONICS & COMMUNICATION
ENGINEERING
5: MODERN TOOL USAGE: create, select, and apply appropriate techniques, resources, and
modern engineering and IT tools including prediction and modeling to complex engineering
activities with an understanding of the limitations.
8: ETHICS: Apply ethical principles and commit to professional ethics and, responsibilities
and norms of the engineering practice.
9: INDIVIDUAL AND TEAM WORK: Function effectively as an individual, and as a
member or leader in diverse teams, and in multidisciplinary settings.
12: LIFE-LONG LEARNING: Recognize the need for, and have the preparation and ability
to engage in independent and life-long learning in the broadcast context of technological
changes.
DEPARTMENT OF ELECTRONICS AND COMMUNICATION
ENGINEERING
PEO1: Graduate shall have a solid foundation and in-depth knowledge in engineering science
and technology for a successful career in Electronics & Communication Engineering.
PEO4: Graduates shall have integrity, professional and ethical values, team spirit and ethical
values, team spirit and effective communication skills.
DEPARTMENT OF ELECTRONICS AND COMMUNICATION
ENGINEERING
PSO1: Ability to use electronic modern IT tools for the design and analysis of complex
electronic systems for additional research activities.
PDO2: Should be able to clearly understand the concepts and applications in the field of
communication/network signal processing, embedded systems, and semiconductor
technology for excellent adaptability, good interpersonal skills with professional ethics and
social responsibility.
ST. PETER’S ENGINEERING
COLLEGE
Department of
Electronics and Communication Engineering
DECLARATION
Date:
18BK1A0482
ST. PETER’S ENGINEERING COLLEGE
Department of
Electronics and Communication Engineering
ACKNOWLEDGEMENT
I would also like to extend my sincere gratitude towards the DRC's Dr. N. Srikanth MTech Ph.D.
for his continues inputs, support and for his priceless advices and continues support.
I would also like to be thankful to Dr. K. Sree latha, principal of St. Peter’s Engineering
College for all possible help and support for this internship.
I would also like to thank our parents for their support and patience to carry out research at of
St. Peter’s Engineering College, Hyderabad.
18BK1A0482
TABLE OF CONTENTS
ABSTRACT
PYTHON..................................................................................................................1
DATA TYPE:...........................................................................................................2
NUMBER DATA TYPE IN PYTHON...........................................................................3
STRINGS..................................................................................................................4
LIST.........................................................................................................................6
TUPLE.....................................................................................................................8
SET..........................................................................................................................9
DICTIONARIES.......................................................................................................11
VARIABLES AND EXPRESSIONS...................................................................13
OPERATORS........................................................................................................14
ARITHMETIC OPERATORS.....................................................................................14
ASSIGNMENT OPERATORS....................................................................................15
EXAMPLE: -...........................................................................................................16
COMPARISON OPERATORS....................................................................................17
LOGICAL OPERATORS...........................................................................................17
IDENTITY OPERATORS..........................................................................................18
MEMBERSHIP OPERATORS....................................................................................19
BITWISE OPERATORS............................................................................................20
LOOPS....................................................................................................................21
FOR LOOPS............................................................................................................21
WHILE LOOP.........................................................................................................21
CONDITIONAL STATEMENTS........................................................................23
IF STATEMENTS: -..................................................................................................23
ELIF STATEMENT: -...............................................................................................24
ELSE STATEMENT: -..............................................................................................25
NESTED IF STATEMENT: -......................................................................................25
FUNCTIONS: -......................................................................................................27
NUMPY: -..............................................................................................................29
PANDAS.................................................................................................................31
MATPLOTLIB: -......................................................................................................33
COMPUTER VISION................................................................................................34
OPENCV...............................................................................................................34
IMAGE-PROCESSING.............................................................................................35
TYPES OF MACHINE LEARNING............................................................................37
MACHINE LEARNING ALGORITHMS..........................................................39
CLASSIFICATION:..................................................................................................39
REGRESSION:.........................................................................................................40
DIFFERENCE BETWEEN REGRESSION AND CLASSIFICATION.................................40
CONCLUSION......................................................................................................44
ASSESSMENT’S...................................................................................................45
Abstract
Techieyan Technologies is a one stop solution for your engineering needs. We’re specialized in
Robotics, Artificial Intelligence, IOT, Prototyping, electronics, PCB Designing and 3D Printing.
Techieyan was awarded as top ten institutes for IoT training in India by Silicon Valley We help
engineering students, engineering colleges & universities with their academic projects,
internships, trainings, mentoring, technical workshop, faculty development program, laboratory
set up and practical experience to the industrial world. In this internship the concepts of python
are clearly explained which is required for getting start with the artificial intelligence. Here they
have covered the basis of python and various libraries like NumPy, Pandas and Matplotlib and
other libraries. The basics of machine learning concept are also explained in the internship and
machine learning algorithms such as regression and classification.
Python
Python is a widely used high level, interpreted, dynamic programing language. It is easy to use,
design emphasizes code readability and its syntax allows programmers to express concept in
fewer lines of code than would be possible in languages such as C++ or java. Python supports
multiple programming paradigms, including object-oriented, imperative and functional
programming or procedural styles. It features a dynamic type system and automatic memory
management and has a large and comprehensive standard library. Python interpreters are
available for installation on many operating systems, allowing Python code execution on a wide
variety of systems.
Features
• Interpreted in Python there is no separate compilation and execution steps like C/C++. It
directly run the program from the source code. Internally, Python converts the source code into
an intermediate form called bytecodes which is then translated into native language of specific
computer to run it.
• Platform Independent Python programs can be developed and executed on the multiple
operating system platform. Python can be used on Linux, Windows, Macintosh, Solaris and
many more.
•Multi-Paradigm Python is a multi-paradigm programming language. Object-oriented
programming and structured programming are fully supported, and many of its features support
functional programming and aspect-oriented programming.
• Simple python is a very simple language. It is a very easy to learn as it is closer to English
language. In python more emphasis is on the solution to the problem rather than the syntax.
• Rich Library Support Python standard library is very vast. It can help to do various things
involving regular expressions, documentation generation, unit testing, threading, databases, web
browsers, CGI, email, XML, HTML, WAV files, cryptography, GUI and many more.
• Free and Open Source Firstly, Python is freely available. Secondly, it is open-source. This
means that its source code is available to the public. We can download it, change it, use it, and
distribute it. This is called FLOSS
(Free/Libre and Open Source Software). As the Python community, we’re all headed toward one
goal- an ever-bettering Python
1|Page
Data Type: -
Data types determine whether an object can do something, or whether it just would not make
sense. Other programming languages often determine whether an operation makes sense for an
object by making sure the object can never be stored somewhere where the operation will be
performed on the object (this type system is called static typing). Python does not do that.
Instead, it stores the type of an object with the object, and checks when the operation is
performed whether that operation makes sense for that object.
Variables can store data of different types, and different types can do different things.
Python has the following data types built-in by default, in these categories:
Text Type: str
Numeric Type: int, float, complex
Sequence Type: list, tuple, range
Mapping Type: dict
Set Type: set, frozenset
Boolean Type: bool
Binary Type: bytes, bytearray
2|Page
Number Data Type in Python
Python supports integers, floating-point numbers and complex numbers. They are defined as int,
float, and complex classes in Python.
Integers and floating points are separated by the presence or absence of a decimal point. For
instance, 5 is an integer whereas 5.0 is a floating-point number.
Complex numbers are written in the form, x + jy, where x is the real part and y is the imaginary
part.
We can use the type() function to know which class a variable or a value belongs to and
isinstance() function to check if it belongs to a particular class.
Output: -
3|Page
Strings: -
Strings are immutable sequence objects, with each character representing an element in the
sequence. As with all objects, we use methods to perform operations. Strings, being immutable,
do not change the instance; each method simply returns a value. This value can be stored as
another variable or given as an argument to a function or method.
For Example: -
The following table is a list of some of the most commonly used string methods and their
descriptions:
Methods and their Descriptions
s.capitalize() - Returns a string with only the first character capitalized, the rest remaining
lowercase.
s.count(substring,[start,end]) - Counts occurrences of a substring.
s.expandtabs([tabsize]) - Replaces tabs with spaces.
s.endswith(substring,[start, end] - Returns True if a string ends with a specified substring.
s.find(substring,[start,end]) - Returns index of first presence of a substring.
s.isalnum() - Returns True if all chars are alphanumeric of string s.
4|Page
s.isalpha() - Returns True if all chars are alphabetic of string s.
s.isdigit() - Returns True if all chars are digits in the string.
s.split([separator],[maxsplit]) - Splits a string separated by whitespace or an optional separator.
Returns a list.
s.join(t) - Joins the strings in sequence t.
s.lower() - Converts the string to all lowercase.
s.replace(old, new[maxreplace]) - Replaces old substring with a new substring.
5|Page
List: -
Python lists are one of the most versatile data types that allow us to work with multiple elements
at once. List is a collection which is ordered and changeable. Allows duplicate members.
For Example
Output: -
The following table contains the most commonly used list methods and their descriptions:
Method Description
6|Page
list(s) - Returns a list of sequence s.
s.append(x) - Appends element x at the end of list s.
s.extend(x) - Appends list x at the end of list s.
s.count(x) - Returns the count of the occurrence of x in list s.
s.index(x,[start],[stop]) - Returns the smallest index i, where s[i]==x. We can include an optional
start and stop index for the lookup.
s.insert(i,e) - Inserts x at index i.
s.pop(i) - Returns the element i and removes it from the list s.
s.remove(x) - Removes element x from the list s.
s.reverse() - Reverses the order of list s.
s.sort(key,[reverse]) - Sorts list s with optional key and reverses it.
7|Page
Tuple: -
A tuple in Python is similar to a list. The difference between the two is that we cannot change the
elements of a tuple once it is assigned whereas we can change the elements of a list. Tuple is a
collection which is ordered and unchangeable. Allows duplicate members.
Output: -
8|Page
Set: -
Python also includes a data type for sets. A set is an unordered collection with no duplicate
elements. Basic uses include membership testing and eliminating duplicate entries. Set objects
also support mathematical operations like union, intersection, difference, and symmetric
difference.
Curly braces or the set() function can be used to create sets.
Note: to create an empty set you have to use set(), not {}; the latter creates an empty dictionary,
a data structure
For Example
Python has a set of built-in methods that you can use on sets.
Method Description
add() Adds an element to the set
intersection_update() Removes the items in this set that are not present
in other, specified set(s)
9|Page
issubset() Returns whether another set contains this set or
not
update() Update the set with the union of this set and
others
10 | P a g e
Dictionaries: -
Dictionaries are sometimes found in other languages as “associative memories” or “associative
arrays”. Unlike sequences, which are indexed by a range of numbers, dictionaries are indexed by
keys, which can be any immutable type; strings and numbers can always be keys. Tuples can be
used as keys if they contain only strings, numbers, or tuples; if a tuple contains any mutable
object either directly or indirectly, it cannot be used as a key. You can’t use lists as keys, since
lists can be modified in place using index assignments, slice assignments, or methods like
append() and extend().
It is best to think of a dictionary as a set of key: value pairs, with the requirement that the keys
are unique (within one dictionary). A pair of braces creates an empty dictionary: {}. Placing a
comma-separated list of key:value pairs within the braces adds initial key:value pairs to the
dictionary; this is also the way dictionaries are written on output.
For Example
Python has a set of built-in methods that you can use on dictionaries.
Method Description
clear() Removes all the elements from the dictionary
11 | P a g e
items() Returns a list containing a tuple for each key value pair
setdefault() Returns the value of the specified key. If the key does not exist:
insert the key, with the specified value
12 | P a g e
Variables and expressions
To solve a real-world problem through algorithm implementation, we first have to select the
variables and then apply the operations on these variables. Variables are labels that are attached
to the objects.
Variables are not objects nor containers for objects; they only act as a pointer or a reference to
the object.
In Python, variable names are attached to different data types during the program execution; it is
not required to first declare the datatype for the variables. Each value is of a type (for example, a
string or integer); however, the variable name that points to this value does not have a specific
type. More specifically, variables point to an object that can change their type depending on the
kind of values assigned to them. Consider the following example:
13 | P a g e
Operators
Operators are used to perform operations on variables and values.
Python divides the operators in the following groups:
Arithmetic operators
Assignment operators
Comparison operators
Logical operators
Identity operators
Membership operators
Bitwise operators
Arithmetic Operators
Arithmetic operators are used with numeric values to perform common mathematical operations:
- Subtraction x-y
* Multiplication x*y
/ Division x/y
% Modulus x%y
** Exponentiation x ** y
// Floor division x // y
Example: -
14 | P a g e
Output: -
Assignment Operators
Assignment operators are used to assign values to variables:
+= x += 3 x=x+3
-= x -= 3 x=x-3
*= x *= 3 x=x*3
/= x /= 3 x=x/3
%= x %= 3 x=x%3
15 | P a g e
//= x //= 3 x = x // 3
**= x **= 3 x = x ** 3
|= x |= 3 x=x|3
^= x ^= 3 x=x^3
Example: -
Output:-
16 | P a g e
Comparison Operators
Comparison operators are used to compare two values:
!= Not equal x != y
Example: -
Output: -
Logical Operators
Logical operators are used to combine conditional statements:
17 | P a g e
Or Returns True if one of the statements is x < 5 or x < 4
true
Not Reverse the result, returns False if the not (x < 5 and x < 10)
result is true
Example: -
Output: -
Identity Operators
Identity operators are used to compare the objects, not if they are equal, but if they are actually
the same object, with the same memory location:
Example: -
18 | P a g e
Output: -
Membership Operators
Membership operators are used to test if a sequence is presented in an object:
Example: -
Output: -
19 | P a g e
Bitwise Operators
Bitwise operators are used to compare (binary) numbers:
<< Zero fill left Shift left by pushing zeros in from the right and let the leftmost bits
shift fall off
>> Signed right Shift right by pushing copies of the leftmost bit in from the left, and
shift let the rightmost bits fall off
Example: -
Output: -
20 | P a g e
Loops
while loop: - Repeats a statement or group of statements while a given condition is TRUE. It
tests the condition before executing the loop body.
for loop: -Executes a sequence of statements multiple times and abbreviates
the code that manages the loop variable.
nested loops: - You can use one or more loop inside any another while, for or do.
While loop.
For Loops
A for loop is used for iterating over a sequence (that is either a list, a tuple, a dictionary, a set, or
a string).
This is less like the for keyword in other programming languages, and works more like an
iterator method as found in other object-orientated programming languages.
With the for loop, we can execute a set of statements, once for each item in a list, tuple, set etc.
For Example
Output
While Loop: -
With the while loop we can execute a set of statements as long as a condition is true.
For Example: -
21 | P a g e
Output:-
22 | P a g e
Conditional Statements:
Decision making is anticipation of conditions occurring while execution of the program and
specifying actions taken according to the conditions.
Decision structures evaluate multiple expressions which produce TRUE or FALSE as outcome.
You need to determine which action to take and which statements to execute if outcome is TRUE
or FALSE otherwise.
Python programming language provides following types of decision-making statements. Click
the following links to check their detail.
1.if statements – An if statement consists of a Boolean expression
followed by one or more statements.
2.if...else statements - An if statement can be followed by an optional
else statement, which executes when the Boolean
expression is FALSE.
3.nested if statements - You can use one if or else if statement inside Another if or else if
statement(s)
If statements: -
Python supports the usual logical conditions from mathematics:
Equals: a == b
Not Equals: a != b
23 | P a g e
Less than: a < b
Less than or equal to: a <= b
Greater than: a > b
Greater than or equal to: a >= b
These conditions can be used in several ways, most commonly in "if statements" and loops.
An "if statement" is written by using the if keyword.
For Example: -
Output: -
Elif statement: -
The elif keyword is pythons way of saying "if the previous conditions were not true, then try this
condition".
For Example: -
Output: -
24 | P a g e
Else statement: -
The else keyword catches anything which isn't caught by the preceding conditions.
For Example: -
Output: -
Nested If statement: -
You can have if statements inside if statements, this is called nested if statements.
For Example:-
25 | P a g e
Output:-
26 | P a g e
Functions: -
A function is a block of code which only runs when it is called. You can pass data, known as
parameters, into a function.
A function can return data as a result.
In Python a function is defined using the def keyword. To call a function, use the function name
followed by parenthesis. Information can be passed into functions as arguments.
Arguments are specified after the function name, inside the parentheses. You can add as many
arguments as you want, just separate them with a comma.
The following example has a function with one argument (fname). When the function is called,
we pass along a first name, which is used inside the function to print the full name:
Output: -
27 | P a g e
Why Python Is a Perfect Language for Machine Learning?
A great library ecosystem -A great choice of libraries is one of the main reasons Python is the
most popular programming language used for AI. A library is a module or a group of modules
published by different sources which include a pre-written piece of code that allows users to
reach some functionality or perform different actions. Python libraries provide base level items
so developers don’t have to code them from the very beginning every time. ML requires
continuous data processing, and Python’s libraries.
let us access, handle and transform data. These are some of the most widespread libraries you
can use for ML and AI:
Scikit-learn - It is for handling basic ML algorithms like clustering, linear and logistic
regressions, regression, classification, and others.
Pandas - It is for high-level data structures and analysis. It allows merging and filtering
of data, as well as gathering it from other external sources like Excel, for instance.
Keras - It Is for deep learning. It allows fast calculations and prototyping, as it uses the
GPU in addition to the CPU of the computer.
Tensor Flow - It is for working with deep learning by setting up, training, and utilizing
artificial neural networks with massive datasets.
Matplotlib - It is for creating 2D plots, histograms, charts, and other forms of
visualization.
NLTK - It is for working with computational linguistics, natural language recognition,
and processing.
Scikit-image – It is for image processing.
PyBrain - It is for neural networks, unsupervised and reinforcement learning.
Caffe - It is for deep learning that allows switching between the CPU and the GPU and
processing 60+ mln images a day using a single NVIDIA K40 GPU.
StatsModels - It is for statistical algorithms and data exploration. In the PyPI
repository, we can discover and compare more python libraries.
NumPy - The name “NumPy” stands for “Numerical Python”. It is the commonly used
library. It is a popular machine learning library that supports large matrices and multi-
dimensional data. It consists of in-built mathematical functions for easy computations.
Even libraries like TensorFlow use NumPy internally to perform several operations on
tensors. Array Interface is one of the key features of this library
28 | P a g e
NumPy: -
NumPy is a general-purpose array-processing package. It provides a high-performance
multidimensional array object, and tools for working with these arrays.
It is a table of elements (usually numbers), all of the same type, indexed by a tuple of
positive integers.
In NumPy dimensions are called axes. The number of axes is rank.
NumPy’s array class is called nd array. It is also known by the alias array.
Example:
Output: -
29 | P a g e
2. Array creation: There are various ways to create arrays in NumPy.
For example, you can create an array from a regular Python list or tuple using the array
function. The type of the resulting array is deduced from the type of the elements in the
sequences.
Often, the elements of an array are originally unknown, but its size is known. Hence,
NumPy offers several functions to create arrays with initial placeholder content. These
minimize the necessity of growing arrays, an expensive operation.
For example: np.zeros, np.ones, np.full, np.empty, etc.
To create sequences of numbers, NumPy provides a function analogous to range that
returns arrays instead of lists.
arange: returns evenly spaced values within a given interval. step size is specified.
linspace: returns evenly spaced values within a given interval. num no. of elements are
returned.
Reshaping array: We can use reshape method to reshape an array. Consider an array
with shape (a1, a2, a3, …, aN). We can reshape and convert it into another array with
shape (b1, b2, b3, …, bM). The only required condition is:
a1 x a2 x a3 … x aN = b1 x b2 x b3 … x bM . (i.e original size of array remains
unchanged.)
Flatten array: We can use flatten method to get a copy of array collapsed into one
dimension. It accepts order argument. Default value is ‘C’ (for row-major order). Use ‘F’
for column major order.
Note: Type of array can be explicitly defined while creating array.
3. Array Indexing: Knowing the basics of array indexing is important for analyzing and
manipulating the array object. NumPy offers many ways to do array indexing.
Slicing: Just like lists in python, NumPy arrays can be sliced. As arrays can be
multidimensional, you need to specify a slice for each dimension of the array.
Integer array indexing: In this method, lists are passed for indexing for each dimension.
One to one mapping of corresponding elements is done to construct a new arbitrary array.
Boolean array indexing: This method is used when we want to pick elements from array
which satisfy some condition.
30 | P a g e
Pandas: -
Similar to NumPy, Pandas is one of the most widely used python libraries in data science. It
provides high-performance, easy to use structures and data analysis tools. Unlike NumPy library
which provides objects for multi-dimensional arrays, Pandas provides in-memory 2d table object
called Dataframe. It is like a spreadsheet with column names and row labels.
Hence, with 2d tables, pandas is capable of providing many additional functionalities like
creating pivot tables, computing columns based on other columns and plotting graphs. Pandas
can be imported into Python using:
import pandas as pd
Some commonly used data structures in pandas are:
1. Series objects: 1D array, similar to a column in a spreadsheet
2. DataFrame objects: 2D table, similar to a spreadsheet
3. Panel objects: Dictionary of DataFrames, similar to sheet in MS Excel
Pandas Series object is created using pd.Series function. Each row is provided with an index and
by defaults is assigned numerical values starting from 0. Like NumPy, Pandas also provide the
basic mathematical functionalities like addition, subtraction and conditional operations and
broadcasting.
Pandas dataframe object represents a spreadsheet with cell values, column names, and row index
labels. Dataframe can be visualized as dictionaries of Series. Dataframe rows and columns are
simple and intuitive to access. Pandas also provide SQL-like functionality to filter, sort rows
based on conditions.
For Example:
Output:
31 | P a g e
Dataframes can also be easily exported and imported from CSV, Excel, JSON, HTML and SQL
database. Some other essential methods that are present in dataframes are:
1. head(): returns the top 5 rows in the dataframe object
2. tail(): returns the bottom 5 rows in the dataframe
3. info(): prints the summary of the dataframe
4. describe(): gives a nice overview of the main aggregated values over each column
32 | P a g e
Matplotlib: -
Matplotlib is a 2d plotting library which produces publication quality figures in a variety of
hardcopy formats and interactive environments. Matplotlib can be used in Python scripts, Python
and IPython shell, Jupyter Notebook, web application servers and GUI toolkits.
matplotlib.pyplot is a collection of functions that make matplotlib work like MATLAB. Majority
of plotting commands in pyplot have MATLAB analogs with similar arguments.
Let us take a couple of examples:
33 | P a g e
Computer Vision
Computer vision is a process by which we can understand the images and videos how they are
stored and how we can manipulate and retrieve data from them. Computer Vision is the base or
mostly used for Artificial Intelligence. Computer-Vision is playing a major role in self-driving
cars, robotics as well as in photo correction apps.
OpenCV
OpenCV is the huge open-source library for the computer vision, machine learning, and image
processing and now it plays a major role in real-time operation which is very important in
today’s systems. By using it, one can process images and videos to identify objects, faces, or
even handwriting of a human. When it integrated with various libraries, such as NumPy,
python is capable of processing the OpenCV array structure for analysis. To Identify image
pattern and its various features we use vector space and perform mathematical operations on
these features.
The first OpenCV version was 1.0. OpenCV is released under a BSD license and hence it’s
free for both academic and commercial use. It has C++, C, Python and Java interfaces and
supports Windows, Linux, Mac OS, iOS and Android. When OpenCV was designed the main
focus was real-time applications for computational efficiency. All things are written in
optimized C/C++ to take advantage of multi-core processing.
Look at the following images
from the above original image, lots of pieces of information that are present in the original
image can be obtained. Like in the above image there are two faces available and the person(I)
in the images wearing a bracelet, watch, etc. so by the help of OpenCV we can get all these
34 | P a g e
types of information from the original image.
It’s the basic introduction to OpenCV we can continue the Applications and all the things in
our upcoming articles.
Applications of OpenCV: There are lots of applications which are solved using OpenCV,
some of them are listed below
face recognition
Automated inspection and surveillance
number of people – count (foot traffic in a mall, etc.)
Vehicle counting on highways along with their speeds
Interactive art installations
Anomaly (defect) detection in the manufacturing process (the odd defective
products)
Street view image stitching
Video/image search and retrieval
Robot and driver-less car navigation and control
object recognition
Medical image analysis
Movies – 3D structure from motion
TV Channels advertisement recognition
OpenCV Functionality
Image/video I/O, processing, display (core, imgproc, highgui)
Object/feature detection (objdetect, features2d, nonfree)
Geometry-based monocular or stereo computer vision (calib3d, stitching, videostab)
Computational photography (photo, video, superres)
Machine learning & clustering (ml, flann)
CUDA acceleration (gpu)
Image-Processing
Image processing is a method to perform some operations on an image, in order to get an
enhanced image and or to extract some useful information from it.
If we talk about the basic definition of image processing then “Image processing is the analysis
and manipulation of a digitized image, especially in order to improve its quality ”.
Digital-Image:
An image may be defined as a two-dimensional function f(x, y), where x and y are
spatial(plane) coordinates, and the amplitude of fat any pair of coordinates (x, y) is called the
intensity or grey level of the image at that point.
In another word An image is nothing more than a two-dimensional matrix (3-D in case of
colored images) which is defined by the mathematical function f(x, y) at any point is giving the
pixel value at that point of an image, the pixel value describes how bright that pixel is, and
what color it should be.
Image processing is basically signal processing in which input is an image and output is image
or characteristics according to requirement associated with that image.
Image processing basically includes the following three steps:
35 | P a g e
1. Importing the image
2. Analyzing and manipulating the image
3. Output in which result can be altered image or report that is based on image analysis
36 | P a g e
Machine Language: -
Machine Learning is the science of getting computers to learn without being explicitly
programmed. It is closely related to computational statistics, which focuses on making prediction
using computer. In its application across business problems, machine learning is also referred as
predictive analysis. Machine Learning is closely related to computational statistics. Machine
Learning focuses on the development of computer programs that can access data and use it to
learn themselves. The process of learning begins with observations or data, such as examples,
direct experience, or instruction, in order to look for patterns in data and make better decisions in
the future based on the examples that we provide. The primary aim is to allow the computers
learn automatically without human intervention or assistance and adjust actions accordingly.
Supervised Learning
Supervised Learning is a type of learning in which we are given a data set and we already know
what are correct output should look like, having the idea that there is a relationship between the
input and output. Basically, it is learning task of learning a function that maps an input to an
output based on example input-output pairs. It infers a function from labeled training data
consisting of a set of training examples. Supervised learning problems are categorized
Unsupervised Learning
Unsupervised Learning is a type of learning that allows us to approach problems with little or no
idea what our problem should look like. We can derive the structure by clustering the data based
on a relationship among the variables in data. With unsupervised learning there is no feedback
based on prediction result. Basically, it is a type of self-organized learning that helps in finding
previously unknown patterns in data set without pre-existing label.
Reinforcement Learning
Reinforcement learning is a learning method that interacts with its environment by producing
actions and discovers errors or rewards. Trial and error search and delayed reward are the most
37 | P a g e
relevant characteristics of reinforcement learning. This method allows machines and software
agents to automatically determine the ideal behavior within a specific context in order to
maximize its performance. Simple reward feedback is required for the agent to learn which
action is best.
Machine Learning Algorithm don’t work so well with processing raw data. Before we can feed
such data to an ML algorithm, we must preprocess it. We must apply some transformations on it.
With data preprocessing, we convert raw data into a clean data set. To perform data this, there
are 7 techniques
1. Rescaling Data
2. Standardizing Data
3. Normalizing Data
4. Binarizing Data
5. Mean Removal
6. One Hot Encoding
7. Label Encoding
38 | P a g e
Machine Learning Algorithms
There are many types of Machine Learning Algorithms specific to different use cases. As we
work with data sets, a machine learning algorithm works in two stages. We usually split the data
around 20%-80% between testing and training stages. Under supervised learning, we split a
dataset into a training data and test data in Python ML. Followings are the Algorithms of Python
Machine Learning -
Classification:
Classification is a process of finding a function which helps in dividing the dataset into classes
based on different parameters. In Classification, a computer program is trained on the training
dataset and based on that training, it categorizes the data into different classes.
The task of the classification algorithm is to find the mapping function to map the input(x) to the
discrete output(y).
Example: The best example to understand the Classification problem is Email Spam Detection.
The model is trained on the basis of millions of emails on different parameters, and whenever it
receives a new email, it identifies whether the email is spam or not. If the email is spam, then it
is moved to the Spam folder.
Types of ML Classification Algorithms:
Classification Algorithms can be further divided into the following types:
Logistic Regression
K-Nearest Neighbours
Support Vector Machines
Kernel SVM
Naïve Bayes
Decision Tree Classification
Random Forest Classification
39 | P a g e
Regression:
Regression is a process of finding the correlations between dependent and independent variables.
It helps in predicting the continuous variables such as prediction of Market Trends, prediction
of House prices, etc.
The task of the Regression algorithm is to find the mapping function to map the input variable(x)
to the continuous output variable(y).
Example: Suppose we want to do weather forecasting, so for this, we will use the Regression
algorithm. In weather prediction, the model is trained on the past data, and once the training is
completed, it can easily predict the weather for future days.
40 | P a g e
41 | P a g e
1. Linear Regression-
Linear regressionis one of the supervised Machine learning algorithms in Python that observes
continuous features and predicts an outcome. Depending on whether it runs on a single variable
or on many features, we can call it simple linear regression or multiple linear regression.This is
one of the most popular Python ML algorithms and often under-appreciated. It assigns optimal
weights to variables to create a line ax+b to predict the output. We often use linear regression to
estimate real values like a number of calls and costs of houses based on continuous variables.
The regression line is the best line that fits Y=a*X+b to denote a relationship between
independent and dependent variables.
42 | P a g e
2. Logistic Regression -
Logistic regression is a supervised classification is unique Machine Learning algorithms in
Python that finds its use in estimating discrete values like 0/1, yes/no, and true/false. This is
based on a given set of independent variables. We use a logistic function to predict the
probability of an event and this gives us an output between 0 and 1. Although it says
‘regression’, this is actually a classification algorithm. Logistic regression fits data into a logit
function and is also called logit regression.
43 | P a g e
Conclusion: -
I believe the trial has shown conclusively that it is both possible and desirable to use
Python as the principal teaching language:
It is Free (as in both cost and source
code).
It is a flexible tool that allows both the teaching of traditional procedural programming and
modern OOP; It can be used to teach a large number of transferable skills;
It is a real-world programming language that can be and is used in academia and the
commercial world;
It appears to be quicker to learn and, in combination with its many libraries, this offers the
possibility of more rapid student development allowing the course to be made more challenging
and varied;
It is trivial to install
on a Windows PC allowing students to take their interest
further. For many the hurdle of installing a Pascal or C compiler on a Windows machine is either
too expensive or too complicated and most importantly, its clean syntax offers increased
understanding
and enjoyment for students
44 | P a g e
Assessment’s: -
Q) write a program using for loop to validate the performance of the student. The student must
have more than 75 percentage in the academic and he should score more than 35 in both internal
marks and external marks then print pass else print fail.
45 | P a g e
Q) write a program that a person should guess a name or letter in the given chance. if he guesses
correct print congo else wrong guess and so on until the guesses are over.
A) correct guess
46 | P a g e
Q) write a program using Cipher text. In which the user will give input and the number
that text should be encrypted and if the user give lower letter then the output should be
lower cases or if in upper case then output should be upper case.
47 | P a g e