0% found this document useful (0 votes)
210 views11 pages

Install Python

This document provides instructions for students to install OpenCV-Python on their Windows systems. The steps include downloading and installing Python, NumPy, Matplotlib, and OpenCV. Students are then asked to write a program that takes input and produces simple output to demonstrate their understanding. The conclusion emphasizes that the lab teaches students how to set up OpenCV-Python and that Python is a popular language for computer vision problems due to its simplicity and code readability.
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
Download as pdf or txt
0% found this document useful (0 votes)
210 views11 pages

Install Python

This document provides instructions for students to install OpenCV-Python on their Windows systems. The steps include downloading and installing Python, NumPy, Matplotlib, and OpenCV. Students are then asked to write a program that takes input and produces simple output to demonstrate their understanding. The conclusion emphasizes that the lab teaches students how to set up OpenCV-Python and that Python is a popular language for computer vision problems due to its simplicity and code readability.
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
Download as pdf or txt
Download as pdf or txt
You are on page 1/ 11

Electrical Engineering Department

DEC40092-Computer Vision Programming

KOHILAN A/L VENUGOPAL 16DTK19F1058


ABDUL RAHMAN BIN ZABIDI 16DTK19F1048

Lab 1: Install OpenCV-Python


Lecturer: Gauri Birasamy

Title : Install OpenCV-Python

Learning Outcomes

At the end of this lab session, the student should be able to:

1. Learn to setup OpenCV-Python in your Windows system.

Material and Apparatus

Personal Computer with Python, OpenCV.

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

7. Goto opencv/build/python/2.7 folder.

8. Copy cv2.pyd to C:/Python27/lib/site-packages.

9. Open Python IDLE and type following codes in Python terminal.

1. Type the program in figure 1 in notepad++.

2. Save as xxxx.py.

3. Run the program in Command Prompt

4. Save the result and explain the program and results.

Step 1

Click on the Download Windows x86-64 executable installer link under the top-
left Stable Releases.

Step 2

Double-click the icon labeling the file python-3.7.4-


amd64.exe. A Python 3.7.4 (64-bit) Setup pop-up window
will appear.
Ensure that the Install launcher for all users
(recommended) and the Add Python 3.7 to
PATH checkboxes at the bottom are checked.

PTSB Page 2
Lab 1: Install OpenCV-Python

Step 3

Click the Yes button.

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

You might also like