Build OpenCV on the NVIDIA Jetson TX2

OpenCV - Jetson TX2

Note: This article has been updated for L4T 28.2. Please see Build OpenCV 3.4 with CUDA on NVIDIA Jetson TX2

As a developer, sometimes you need to build OpenCV from source to get the configuration desired. There is a script on the JetsonHacks Github account to help in the process. Looky here:


JetPack can install a CPU and GPU accelerated version of the OpenCV libraries, called OpenCV4Tegra, on the Jetson. OpenCV4Tegra is version 2.4.13 as of this writing. This is great for many applications, especially when you are writing your own apps. However, some libraries require different modules and such that require upstream OpenCV versions.


The community has gathered the recipe(s) for building OpenCV for version later than OpenCV 3.0. There is a repository on the JetsonHacks Github account which contains a build script to help in the process.

To download the source and build OpenCV:

$ git clone
$ cd buildOpenCVTX2
$ ./

Once finished building, you are ready to install.

As explained in the video, navigate to the build directory to install the newly built libraries:

$ cd ~/opencv/build
$ sudo make install

Once you have generated the build files, you can use the ccmake tool to examine the different options and modules available.

Remember to setup you OpenCV library paths correctly.


The information for this script was gathered from several places: