Install Python
Install Python
Learning Outcomes
At the end of this lab session, the student should be able to:
Procedure:
1. Below Python packages are to be downloaded and installed to their default locations.
• Python-2.7.x.
• Numpy.
• Matplotlib
2. Install all packages into their default locations. Python will be installed to C:/Python27/.
3. After installation, open Python IDLE. Enter import numpy and make sure Numpy is
working fine.
4. Download latest OpenCV release from sourceforge site and double-click to extract it.
Page 1
Lab 1: Install OpenCV-Python
2. Save as xxxx.py.
Step 1
Click on the Download Windows x86-64 executable installer link under the top-
left Stable Releases.
Step 2
PTSB Page 2
Lab 1: Install OpenCV-Python
Step 3
A new Python 3.7.4 (64-bit) Setup pop-up window will appear with a Setup Progress message
and a progress bar.
PTSB Page 3
Lab 1: Install OpenCV-Python
Step 4
During installation, it will show the various components it is installing and move the progress bar
towards completion. Soon, a new Python 3.7.4 (64-bit) Setup pop-up window will appear with
a Setup was successfuly message.
PTSB Page 4
Lab 1: Install OpenCV-Python
Step 5
1. Navigate to the
directory C:\Users\Pattis\AppData\Local\Programs\Python\Python37 (or to whatever
directory Python was installed: see the pop-up window for Installing step 3).
2. Double-click the icon/file python.exe.
The following pop-up window will appear.A pop-up window with the
title C:\Users\Pattis\AppData\Local\Programs\Python\Python37\python.exe appears,
and inside the window; on the first line is the text Python 3.7.4 ... (notice that it should
also say 64 bit). Inside the window, at the bottom left, is the prompt >>>: type exit() to
this prompt and press enter to terminate Python
PTSB Page 5
Lab 1: Install OpenCV-Python
Step 6
Step 7
PTSB Page 6
Lab 1: Install OpenCV-Python
Step 8
Step 9
PTSB Page 7
Lab 1: Install OpenCV-Python
Step 10
PTSB Page 8
Lab 1: Install OpenCV-Python
Task
1. Develop a program to produce an output as Figure 1.
Figure 1
Task
Input
Output
PTSB Page 9
Lab 1: Install OpenCV-Python
Discussion
In this discussion, student can learn how to use python in this lab. The task given is to
download python, numpy, scipy, cv2 and matplotlib program. After downloading, the
students need to download python and inatall into their respective computers and
follow the instructions given in the lab. After installing python, students need to open a
Command Prompt and run as administrator. After that, students need to install numpy
in the Command Prompt using coding (pip install numpy). The next step, students need
to install opencv using coding (pip install opencv-phython). After that, students need to
install scipy by using coding (pip install scipy). And the last step, students need to install
matplotlib using coding (pip install matplotlib). After installing all the programs, students
need to check the program is installed or not in python by using coding (import numpy,
import scipy import cv2 import matplotlib).
PTSB Page 10
Lab 1: Install OpenCV-Python
Conclusion
In this conclusion on this lab 1, the students can learn how to setup OpenCV-Python in
their windows system. Python is an interpreted, object-oriented, high-level programming
language with dynamic semantics. Its high level built in data structures, combined with
dynamic typing and dynamic binding, make it very attractive for Rapid Application
Development, as well as for use as a scripting or glue language to connect existing
components together. OpenCV-Python is a library of Python bindings designed to solve
computer vision problems. Python is a general purpose programming language started
by Guido van Rossum that became very popular very quickly, mainly because of its
simplicity and code readability. It enables the programmer to express ideas in fewer
lines of code without reducing readability
PTSB Page 11