How much space is required to install OpenCV on Ra

2019-07-13 08:39发布

问题:

I am new user to the Raspberry Pi 3. How much space is required to install OpenCV on Raspberry?

回答1:

Installing OpenCV on your Raspberry Pi can be done in two ways, both having different space requirements:

  • You can use the Debian repositories with the sudo apt-get install libopencv-dev command. This is the easiest way to install OpenCV on your Pi, and also takes the least amount of space (if that's a concern for you). It will take around 80M when installed. The downsides of this approach is that you get OpenCV 2.4.9., there isn't and upgrade to OpenCV 3.0 yet. Also you can't customize the installation.
  • The second and more difficult option is to compile the sources yourself. To compile the code you will need more than 4GB of disk space as the compiled code takes a lot more space. However the installed libraries (.lib) are under a 100M. If you want to use this option I recommend you to connect a USB stick or external HDD to your Pi. Use the USB or HDD (with more than 4GB of free space) to compile and build OpenCV. After installing OpenCV you can delete this directory again as you only need the library files (of course, this changes when you actually want to develop code on your Pi).


回答2:

Mmmm... how long is a piece of string?

It depends on what/how you install and what/how you count. The following factors, and others, will affect the answer:

  • debug or release versions
  • examples installed or not
  • documentation installed or not
  • contrib code installed or not

It also depends on whether you count the fact that to build it, you will need a compiler and all its associated stuff, cmake and a bunch of V4L, video formats and image formats and libraries.

Also, you can build it and install it and then delete the source yet continue to use the product.

FWIW, my build area on a Raspberry Pi amounts to 2.1GB - that is the source and a release build without contrib.