programming language: python imaging library: opencv …qil.uh.edu › dip › media › cosc6380...
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](https://reader030.vdocument.in/reader030/viewer/2022041111/5f11ad2dcac9ad7f504e024a/html5/thumbnails/1.jpg)
Required Installation
• Programming Language: Python • Imaging Library: OpenCV (Open Source Computer
Vision Library)
![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](https://reader030.vdocument.in/reader030/viewer/2022041111/5f11ad2dcac9ad7f504e024a/html5/thumbnails/3.jpg)
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](https://reader030.vdocument.in/reader030/viewer/2022041111/5f11ad2dcac9ad7f504e024a/html5/thumbnails/4.jpg)
![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](https://reader030.vdocument.in/reader030/viewer/2022041111/5f11ad2dcac9ad7f504e024a/html5/thumbnails/5.jpg)
![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](https://reader030.vdocument.in/reader030/viewer/2022041111/5f11ad2dcac9ad7f504e024a/html5/thumbnails/6.jpg)
![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](https://reader030.vdocument.in/reader030/viewer/2022041111/5f11ad2dcac9ad7f504e024a/html5/thumbnails/7.jpg)
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](https://reader030.vdocument.in/reader030/viewer/2022041111/5f11ad2dcac9ad7f504e024a/html5/thumbnails/8.jpg)
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](https://reader030.vdocument.in/reader030/viewer/2022041111/5f11ad2dcac9ad7f504e024a/html5/thumbnails/9.jpg)
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](https://reader030.vdocument.in/reader030/viewer/2022041111/5f11ad2dcac9ad7f504e024a/html5/thumbnails/10.jpg)
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](https://reader030.vdocument.in/reader030/viewer/2022041111/5f11ad2dcac9ad7f504e024a/html5/thumbnails/11.jpg)
• 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](https://reader030.vdocument.in/reader030/viewer/2022041111/5f11ad2dcac9ad7f504e024a/html5/thumbnails/12.jpg)
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](https://reader030.vdocument.in/reader030/viewer/2022041111/5f11ad2dcac9ad7f504e024a/html5/thumbnails/13.jpg)
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](https://reader030.vdocument.in/reader030/viewer/2022041111/5f11ad2dcac9ad7f504e024a/html5/thumbnails/14.jpg)
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](https://reader030.vdocument.in/reader030/viewer/2022041111/5f11ad2dcac9ad7f504e024a/html5/thumbnails/15.jpg)
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](https://reader030.vdocument.in/reader030/viewer/2022041111/5f11ad2dcac9ad7f504e024a/html5/thumbnails/16.jpg)
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](https://reader030.vdocument.in/reader030/viewer/2022041111/5f11ad2dcac9ad7f504e024a/html5/thumbnails/17.jpg)
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](https://reader030.vdocument.in/reader030/viewer/2022041111/5f11ad2dcac9ad7f504e024a/html5/thumbnails/18.jpg)
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](https://reader030.vdocument.in/reader030/viewer/2022041111/5f11ad2dcac9ad7f504e024a/html5/thumbnails/19.jpg)
Troubleshooting
• Choose package (double click) opencv3 install package
Try running your file again