OpenCV4Tegra Python 3 and samples

I received the TX2 yesterday and finished installing Jetpack3. I am trying the available samples to get a feel for how the TX2 performs. Does Jetpack 3 come with OpenCV samples? I did not see it in the OpenCV4Tegra folder. Also does OpenCV4Tegra have python 3 wrapper? I know libopencv4tegra-python exists but it is for python 2.7.

Hi,

Thanks for your question.

There are some tutorials about opencv4Tegra in our webinars:
https://developer.nvidia.com/embedded/learn/tutorials#collapseOpenCV

Wrapper for python can be simply installed by

sudo apt-get install python-opencv

For python3, we need to check the compatibility. Will update to you later.

Hi,

Thanks for your patient.

Just confirmed that python 3+ support is a new feature added in opencv3.
If you want to use python3 wrapper, please upgrade your opencv to 3.x.

Following topic for building opencv 3.x on TX1 can give you some hint:
https://devtalk.nvidia.com/default/topic/983098/jetson-tx1/opencv-3-1-with-usb-camera-support/

Thank you I was able to successfully build from source but I had to turn off openGL since it was causing issues when running

make -j4

Also in python OpenCV how would I be able to get frames from the Jetson camera?

Hi,

Thanks for your feedback.

Please refer to following topic which shows how to open nvcamera with opencv
[url]https://devtalk.nvidia.com/default/topic/987537/jetson-tx1/videocapture-fails-to-open-onboard-camera-l4t-24-2-1-opencv-3-1/[/url]

I’ve written a few blog posts about how to install OpenCV 3.3.0 and how to use python3/python2 code to capture and display video from the onboard camera on Jetson TX2. Please check them out.

“How to Install OpenCV (3.3.0) on Jetson TX2”: [url]https://jkjung-avt.github.io/opencv3-on-tx2/[/url]
“How to Capture and Display Camera Video with Python on Jetson TX2”: [url]https://jkjung-avt.github.io/tx2-camera-with-python/[/url]
“How to Capture Camera Video and Do Caffe Inferencing with Python on Jetson TX2”: [url]https://jkjung-avt.github.io/tx2-camera-caffe/[/url]

Hi Experts

Quick question? I want to install opencv3 for tx1 and I would use this guide:

http://dev.t7.ai/jetson/opencv/

Do I need to change anything in the script?

(I have already installed python3)

Any hints,

sojohans

Another question: How much space do I need on the TX1 to install opencv3 on the tx1?

sojohans,

Hi - is there still no binary package for opencv2 and python3 on the tx2? The original post here was from 18 months ago?

I was able to install opencv from git and compile it and it all worked fine on my jetson tx2. I just basically followed the build instructions on the opencv website:

git clone https://github.com/opencv/opencv.git
cd opencv/
mkdir build
cd build/
cmake ../
make
sudo make install

The one issue I did have is that the make install didn’t put the .so in a spot that python3 knows about it, so I had to do this at the end:

sudo ln -s /usr/local/python/cv2/python-3.5/cv2.cpython-35m-aarch64-linux-gnu.so /usr/lib/python3/dist-packages/.

I hope this helps somebody. Thanks!