Opencv build cmake linux install#
$ sudo apt-get install libhdf5-serial-dev $ sudo apt-get install libatlas-base-dev gfortran $ sudo apt-get install libavcodec-dev libavformat-dev libswscale-dev libv4l-dev Installing OpenCV with CUDA supportīefore we can compile OpenCV with CUDA support, we first need to install some prerequisites: $ sudo apt-get install libjpeg8-dev libtiff5-dev libjasper-dev libpng12-dev Overall, the instructions are near identical, but with a few important changes inside the cmake command, allowing us to compile OpenCV with CUDA support.īy the time you finish reading this blog post, you’ll have OpenCV with CUDA support compiled and installed in your deep learning development environment. Truth be told, I’ve already covered installing OpenCV on Ubuntu in many previous blog posts, but I’ll explain the process here as well. I’ll be making the assumption that you’ll be installing OpenCV into the same environment as last week’s blog post - in this case, I’ll be continuing my example of using the Ubuntu 14.04 g2.2xlarge instance on Amazon EC2.
![opencv build cmake linux opencv build cmake linux](https://linuxx.info/wp-content/uploads/2019/08/1e0766d9ffd5eef9719f7d8f28d861ca.png)
Simply put, having OpenCV installed makes it easier to write code to facilitate the procedure of pre-processing images prior to feeding them into deep neural networks.īecause of this, we should install OpenCV into the same environment as our deep learning libraries, to at the very least, make our lives easier.įurthermore, in a GPU-enabled CUDA environment, there are a number of compile-time optimizations we can make to OpenCV, allowing it to take advantage of the GPU for faster computation (but mainly for C++ applications, not so much for Python, at least at the present time).
![opencv build cmake linux opencv build cmake linux](https://linuxconcept.com/wp-content/uploads/2020/10/ubuntu-compile-opencv.jpg)
While OpenCV itself doesn’t play a critical role in deep learning, it is used by other deep learning libraries such as Caffe, specifically in “utility” programs (such as building a dataset of images). Let’s get OpenCV installed with CUDA support as well. Click here to download the source code to this postĪlight, so you have the NVIDIA CUDA Toolkit and cuDNN library installed on your GPU-enabled system.