Jetpack 5 comes with some parts of OpenCV. However, they are incompatible with the Ubuntu-distributed OpenCV and damage the underlying Ubuntu system.
The main problem lies in library
libopencv-dev which has the same name as the ubuntu-distributed one, but comes in version 4.5, while Ubuntu distributes 4.2.
So if you install e.g.
libopencv-core4.2 from Ubuntu, you get a non-functional hybrid, because its corresponding devel files are overwritten by the NVidia
libopencv-dev in version 4.5. Compiling anything on such system is almost impossible. You get funny errors like
undefined reference to cv::Mat::Mat() even if you correctly link to
libopencv_core.so and the library exists.
Overwriting files in OS-installed packages, e.g.
/usr/lib/aarch64-linux-gnu/libopencv_core.so is just a way to hell.
It would be much better if the nvidia-distributed OpenCV would use packages whose names do not collide with the OS-provided ones (e.g.
libopencv-dev-jetpack) and that would all get installed to a non-default directory (e.g.
/opt/jetpack/lib/...). This way, users could easily decide which applications should be built against the OS-provided OpenCV and which should be built against the NVidia provided version.