How to download and install OpenCV4Tegra

I have been working with a TX2 for quite some time, but I decided to mess around with OpenCV. I have found out that it has not been installed on my TX2 and was wondering if there is anyway to install it without re-flashing the entire TX2 since I have multiple files on it that I don’t want deleted.

I currently have Jetson 3.3

In my opinion, the best way to download and install OpenCV4Tegra is to use Jetpack installation and select corresponding checkbox during the installation.

It would depend on what you want to do and what L4T release you are running.
There has been OpenCV4tegra versions that were opencv 2.4 based and optimized for TK1, TX1 and maybe TX2.
After some time (I’d say around opencv3.1), some NVIDIA code has been published and integrated into opencv. Then the opencv versions provided in JetPack (I’d say from R28.2) were not so optimized (provided mainly for compatibilty I think) and I have found better to build own opencv versions, enabling CUDA, gstreamer, using appropriate build options.

As mentionned by @Andrey1984, if you just want to install current JetPack’s version you can do this from JetPack. You’d only need a Ethernet connection from Host to Jetson and only select Post-install in JetPack on host and check opencv in Post-install steps. This wouldn’t reflash the Jetson, just upload opencv package and install.

If you want to use CUDA, gstreamer, and optimize opencv for your application, you may find some good links for building you own opencv here.