Sorry, I’m not able to give a precise answer as this is a complex topic and Opencv4Tegra sources have not been published, AFAIK.
However, I’d advise to build from source now for various reasons:
- Opencv4Tegra was mainly developped for TK1 and for TX1 when it was 32 bits versions, although some versions have been released with 64 bits L4Ts.
- The GPU functions were linked to old CUDA versions.
- Some optimizations in OpencvTegra were acheived through Carotene library, that NVIDIA published and has been included in opencv-3.1 IIRC.
- Most of other optimizations were achieved through compiler options. Using opencv function getBuildInformation() with Opencv4Tgera you may have a look to these. These may be related to the compiler used at that time. Not sure, but I think this was gcc-4.9. Newer compilers may be able to automatically perform better optimizations. I had acheived some good speedup on TX2 using machine flags. At that time lto did not give improvement (nor llvm), but that might have been related to the old cmake version I was using, and it would probably be different now.
- There are many new features available (and bugs fixed) in recent versions.
- Note that Opencv4Tegra is no longer provided in JetPack in recent releases.
However, I never got a version which was absolutely better than another. Depending on the test case, it was common to see a version performing better for a part of code, while another one was performing better on another part. So I’d say you have to try and benchmark with your application. The hell starts here…there are so many options that the number of possibilities is huge, and building a new version of opencv is quite long (I was natively building), so I’m far from having tried 5% from these.
Having changed my codes to support opencv3, I’m no longer using opencv4tegra (nor any other opencv2 version). Now I’m also using opencv4 (so far, I think the only change required was adding opencv4 at the end of include path in Makefiles).
Sorry for not being able to give a more definite answer. Other users or NVIDIA folks may provide their opinion and advise further.