Is OpenCV in Jetpack 4.2.1 optimized for Tegra?

Hi

I’m using the Jetson Nano with Jetpack 4.2.1, which includes OpenCV 3.1.1. I’m thinking of upgrading to the latest release of OpenCV using the script mentioned here: https://devtalk.nvidia.com/default/topic/1051133/jetson-nano/opencv-build-script/post/5334837/#5334837. However, I’ve noticed that OpenCV code contains a HAVE_TEGRA_OPTIMIZATION flag and an internet search has led me to the following two links (neither about the Jetson Nano) which suggest there is a Tegra optimised version of OpenCV:
https://grokbase.com/t/gg/android-opencv/123tb0w9s7/how-to-make-the-option-have-tegra-optimization-enable-for-android
https://elinux.org/Jetson/Installing_OpenCV

My questions are:

  1. Is the version of OpenCV in Jetpack 4.2.1 optimized for Tegra?
  2. If so, is it possible to upgrade to a newer version of OpenCV without losing this optimization?
  3. If I choose not to upgrade, but want to recompile OpenCV in order to build it for CUDA, is it possible to do that without losing the optimization?

Thank you!

#OpenCV

Test, Test

Reply after Un-Archived

  1. Is the version of OpenCV in Jetpack 4.2.1 optimized for Tegra?
    Ans: Nope, this is just a pure Opencv as you build from source w/o CUDA/Gstreamer support.

  2. If so, is it possible to upgrade to a newer version of OpenCV without losing this optimization?
    Ans: If you need optimization, please download the source from opencv and build it with CUDA enabled.

  3. If I choose not to upgrade, but want to recompile OpenCV in order to build it for CUDA, is it possible to do that without losing the optimization?
    Ans: I think previous answer should be sufficient.

Thanks for your reply WayneWWW - much appreciated!