

Install developer tools: $ sudo apt-get install build-essential cmake pkg-config If you are using Raspbian Buster run the following command: $sudo apt update $sudo apt upgrade $ sudo reboot STEP 3: Installing dependencies:įirst lets update & upgrade existing packages: $ sudo apt-get update $ sudo apt-get upgrade # where we want the swapfile to be, this is the default #CONF_SWAPFILE=/var/swap # set size to absolute value, leaving empty (default) then uses computed value # you most likely don't want this, unless you have an special disk situation #CONF_SWAPSIZE=100 CONF_SWAPSIZE=2048. Go to Swap size and change it to 2048 from 100. To increase the Swapsize open the swap file of your pi zero using the following command: $ sudo nano /etc/dphys-swapfile


Otherwise you end up with memory exhausted error. This will increase up the compiling process of openCV. Having a swap file allows your computer’s operating system to pretend that you have more RAM than you actually do. Swap space is a portion of a hard disk drive (HDD) that is used for virtual memory. But just to make sure that the system is expanded run the following command: $ raspi-config -expand-rootfs STEP 2: Increase Swap Space STEP 1: File System Expansion:Įxpand filesystem is rarely needed anymore as both NOOBs and the standalone install of Raspbian will automatically expand the filesystem on first boot. I recomend you following this blog during night time as the compilation of OpenCV alone will takes 12 + hours.ģ> Any Raspbian OS (I have used Raspbian Buster) installed on your pi zeroĪssuming you have the given requirements lets start with the setup. While the Pi Zero isn’t quite fast enough for advanced video processing, it’s still a great tool that you can use to learn the basics of computer vision and OpenCV. Most of us have faced issue in installing openCV in Pi.In this blog I will tell you step by step installation of opencv in your pi-zero W.
