Installing OpenCV on Raspberry Pi Zero 1.3/ W with Python, PiCamera

Installing OpenCV on Raspberry Pi Zero

For all those who would like to install OpenCV on Raspberry Pi Zero 1.3 (and possibly W but not tested), here are the instructions:

Instructions

  1. Run following commands:
$ sudo apt-get update
$ sudo apt-get upgrade
  1. Enable and check camera interface. Run commands below:
$ sudo raspi-config
$ raspistill -o image.jpg
  1. Check if python is installed. If not installed, run the second command (Numpy and other python libraries possibly included. No extra installation required.):
$ python --version
$ sudo apt install python3-opencv
  1. Run Python 3 and check if OpenCV works.
>>> import cv2
>>> import numpy

>>> cv2.__version__
>>> numpy.__version__
  1. Install picamera module if not installed and checked through Python CLI.
$ sudo apt-get install python3-picamera
  1. Test camera through Linux Terminal
raspistill -o image.jpg

Please let me know if there are any changes that can be made to this or updates as well. These instructions to installing OpenCV on Raspberry Pi Zero 1.3 can change any time.

1 Like