programming language: python imaging library: opencv …qil.uh.edu › dip › media › cosc6380...

19
Required Installation Programming Language: Python Imaging Library: OpenCV (Open Source Computer Vision Library)

Upload: others

Post on 28-Jun-2020

19 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Programming Language: Python Imaging Library: OpenCV …qil.uh.edu › dip › media › cosc6380 › Opecv_Installation.pdfStep 5: Setup PyCharm and OpenCV • Right click on the

Required Installation

• Programming Language: Python • Imaging Library: OpenCV (Open Source Computer

Vision Library)

Page 2: Programming Language: Python Imaging Library: OpenCV …qil.uh.edu › dip › media › cosc6380 › Opecv_Installation.pdfStep 5: Setup PyCharm and OpenCV • Right click on the

Step 1: Install Python

https://www.python.org/downloads/

Page 3: Programming Language: Python Imaging Library: OpenCV …qil.uh.edu › dip › media › cosc6380 › Opecv_Installation.pdfStep 5: Setup PyCharm and OpenCV • Right click on the

Step 1: Install Python

Scroll down

Page 4: Programming Language: Python Imaging Library: OpenCV …qil.uh.edu › dip › media › cosc6380 › Opecv_Installation.pdfStep 5: Setup PyCharm and OpenCV • Right click on the
Page 5: Programming Language: Python Imaging Library: OpenCV …qil.uh.edu › dip › media › cosc6380 › Opecv_Installation.pdfStep 5: Setup PyCharm and OpenCV • Right click on the
Page 6: Programming Language: Python Imaging Library: OpenCV …qil.uh.edu › dip › media › cosc6380 › Opecv_Installation.pdfStep 5: Setup PyCharm and OpenCV • Right click on the
Page 7: Programming Language: Python Imaging Library: OpenCV …qil.uh.edu › dip › media › cosc6380 › Opecv_Installation.pdfStep 5: Setup PyCharm and OpenCV • Right click on the

Step2: Install OpenCV

1. Open command prompt (Run as administrator, if permission error)

2. Install numpy>python -m pip install numpy

3. Install OpenCV>python -m pip install opencv-python

Page 8: Programming Language: Python Imaging Library: OpenCV …qil.uh.edu › dip › media › cosc6380 › Opecv_Installation.pdfStep 5: Setup PyCharm and OpenCV • Right click on the

Step 4: Install Python IDE

• Numerous options.– Atom– Geany– PyDev(Eclipse)– PyCharm

Page 9: Programming Language: Python Imaging Library: OpenCV …qil.uh.edu › dip › media › cosc6380 › Opecv_Installation.pdfStep 5: Setup PyCharm and OpenCV • Right click on the

Step 4: Install PyCharm

• https://www.jetbrains.com/pycharm/download/#section=windows

• Install Community version (Free to use)

Page 10: Programming Language: Python Imaging Library: OpenCV …qil.uh.edu › dip › media › cosc6380 › Opecv_Installation.pdfStep 5: Setup PyCharm and OpenCV • Right click on the

Step 5: Setup PyCharm and OpenCV

• Start PyCharm• Create New Project

Page 11: Programming Language: Python Imaging Library: OpenCV …qil.uh.edu › dip › media › cosc6380 › Opecv_Installation.pdfStep 5: Setup PyCharm and OpenCV • Right click on the

• Select Interpreter: Select the one that has Anaconda in it.

Step 5: Setup PyCharm and OpenCV

Page 12: Programming Language: Python Imaging Library: OpenCV …qil.uh.edu › dip › media › cosc6380 › Opecv_Installation.pdfStep 5: Setup PyCharm and OpenCV • Right click on the

Step 5: Setup PyCharm and OpenCV

• Right click on the project and open a new python file.• Note PyCharm may take some to index files (will appear in the lower right

corner in IDE). Let it run through.

Page 13: Programming Language: Python Imaging Library: OpenCV …qil.uh.edu › dip › media › cosc6380 › Opecv_Installation.pdfStep 5: Setup PyCharm and OpenCV • Right click on the

Step 5: Setup PyCharm and OpenCV

• Right click on the project and open a new python file.

Page 14: Programming Language: Python Imaging Library: OpenCV …qil.uh.edu › dip › media › cosc6380 › Opecv_Installation.pdfStep 5: Setup PyCharm and OpenCV • Right click on the

Step 5: Setup PyCharm and OpenCV

• Type in code

import cv2

print(cv2.__version__)

• Go to run> Run

Page 15: Programming Language: Python Imaging Library: OpenCV …qil.uh.edu › dip › media › cosc6380 › Opecv_Installation.pdfStep 5: Setup PyCharm and OpenCV • Right click on the

Step 5: Setup PyCharm and OpenCV

Check for output version here

Page 16: Programming Language: Python Imaging Library: OpenCV …qil.uh.edu › dip › media › cosc6380 › Opecv_Installation.pdfStep 5: Setup PyCharm and OpenCV • Right click on the

Troubleshooting

• If you get an error likeTraceback (most recent call last):

File "<stdin>", line 1, in <module>ImportError: No module named ‘cv2‘

• Pycharm has failed to load Opencv

Page 17: Programming Language: Python Imaging Library: OpenCV …qil.uh.edu › dip › media › cosc6380 › Opecv_Installation.pdfStep 5: Setup PyCharm and OpenCV • Right click on the

Troubleshooting

• Go to File > Settings

Page 18: Programming Language: Python Imaging Library: OpenCV …qil.uh.edu › dip › media › cosc6380 › Opecv_Installation.pdfStep 5: Setup PyCharm and OpenCV • Right click on the

Troubleshooting

• Go to Project : <your project name > project interpreter

Page 19: Programming Language: Python Imaging Library: OpenCV …qil.uh.edu › dip › media › cosc6380 › Opecv_Installation.pdfStep 5: Setup PyCharm and OpenCV • Right click on the

Troubleshooting

• Choose package (double click) opencv3 install package

Try running your file again