# OpenCV4Tegra Python 3 and samples

**URL:** <https://forums.developer.nvidia.com/t/opencv4tegra-python-3-and-samples/48742>\
**Category:** Jetson TX2\
**Created:** [March 23, 2017, 11:58pm UTC](https://forums.developer.nvidia.com/t/opencv4tegra-python-3-and-samples/48742 "2017-03-23T23:58:22Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![waqas\_41](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@waqas\_41](https://forums.developer.nvidia.com/u/waqas_41)\
**Post date:** [March 23, 2017, 11:58pm UTC](https://forums.developer.nvidia.com/t/opencv4tegra-python-3-and-samples/48742/1 "2017-03-23T23:58:22Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![AastaLLL](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/aastalll/32/14043_2.png) [@AastaLLL](https://forums.developer.nvidia.com/u/AastaLLL)\
**Post date:** [March 24, 2017, 3:14am UTC](https://forums.developer.nvidia.com/t/opencv4tegra-python-3-and-samples/48742/2 "2017-03-24T03:14:44Z")

</div>

Hi,

Thanks for your question.

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

Wrapper for python can be simply installed by

```auto
sudo apt-get install python-opencv

```

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

---

<div class="post-metadata">

**Author:** ![AastaLLL](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/aastalll/32/14043_2.png) [@AastaLLL](https://forums.developer.nvidia.com/u/AastaLLL)\
**Post date:** [March 28, 2017, 10:55am UTC](https://forums.developer.nvidia.com/t/opencv4tegra-python-3-and-samples/48742/3 "2017-03-28T10:55:25Z")

</div>

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/](https://devtalk.nvidia.com/default/topic/983098/jetson-tx1/opencv-3-1-with-usb-camera-support/)

---

<div class="post-metadata">

**Author:** ![waqas\_41](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@waqas\_41](https://forums.developer.nvidia.com/u/waqas_41)\
**Post date:** [March 29, 2017, 12:18am UTC](https://forums.developer.nvidia.com/t/opencv4tegra-python-3-and-samples/48742/4 "2017-03-29T00:18:47Z")

</div>

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

```auto
make -j4

```

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

---

<div class="post-metadata">

**Author:** ![AastaLLL](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/aastalll/32/14043_2.png) [@AastaLLL](https://forums.developer.nvidia.com/u/AastaLLL)\
**Post date:** [March 29, 2017, 2:10am UTC](https://forums.developer.nvidia.com/t/opencv4tegra-python-3-and-samples/48742/5 "2017-03-29T02:10:31Z")

</div>

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]](https://devtalk.nvidia.com/default/topic/987537/jetson-tx1/videocapture-fails-to-open-onboard-camera-l4t-24-2-1-opencv-3-1/%5B/url%5D)

---

<div class="post-metadata">

**Author:** ![jkjung13](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/jkjung13/32/10943_2.png) [@jkjung13](https://forums.developer.nvidia.com/u/jkjung13)\
**Post date:** [October 21, 2017, 3:12am UTC](https://forums.developer.nvidia.com/t/opencv4tegra-python-3-and-samples/48742/6 "2017-10-21T03:12:57Z")

</div>

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]](https://jkjung-avt.github.io/opencv3-on-tx2/%5B/url%5D)  
“How to Capture and Display Camera Video with Python on Jetson TX2”: [url][https://jkjung-avt.github.io/tx2-camera-with-python/[/url]](https://jkjung-avt.github.io/tx2-camera-with-python/%5B/url%5D)  
“How to Capture Camera Video and Do Caffe Inferencing with Python on Jetson TX2”: [url][https://jkjung-avt.github.io/tx2-camera-caffe/[/url]](https://jkjung-avt.github.io/tx2-camera-caffe/%5B/url%5D)

---

<div class="post-metadata">

**Author:** ![sojohans](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@sojohans](https://forums.developer.nvidia.com/u/sojohans)\
**Post date:** [July 10, 2018, 6:01am UTC](https://forums.developer.nvidia.com/t/opencv4tegra-python-3-and-samples/48742/7 "2018-07-10T06:01:17Z")

</div>

Hi Experts

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

[http://dev.t7.ai/jetson/opencv/](http://dev.t7.ai/jetson/opencv/)

Do I need to change anything in the script?

(I have already installed python3)

Any hints,

sojohans

---

<div class="post-metadata">

**Author:** ![sojohans](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@sojohans](https://forums.developer.nvidia.com/u/sojohans)\
**Post date:** [July 10, 2018, 8:29am UTC](https://forums.developer.nvidia.com/t/opencv4tegra-python-3-and-samples/48742/8 "2018-07-10T08:29:18Z")

</div>

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

sojohans,

---

<div class="post-metadata">

**Author:** ![pmikesell](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@pmikesell](https://forums.developer.nvidia.com/u/pmikesell)\
**Post date:** [November 28, 2018, 7:48am UTC](https://forums.developer.nvidia.com/t/opencv4tegra-python-3-and-samples/48742/9 "2018-11-28T07:48:24Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![pmikesell](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@pmikesell](https://forums.developer.nvidia.com/u/pmikesell)\
**Post date:** [November 28, 2018, 8:13pm UTC](https://forums.developer.nvidia.com/t/opencv4tegra-python-3-and-samples/48742/10 "2018-11-28T20:13:59Z")

</div>

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:

```auto
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:

```auto
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!

---

<div class="post-metadata">

**Author:** ![nadeemm](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/nadeemm/32/367020_2.png) [@nadeemm](https://forums.developer.nvidia.com/u/nadeemm)\
**Post date:** [October 18, 2021, 6:30pm UTC](https://forums.developer.nvidia.com/t/opencv4tegra-python-3-and-samples/48742/11 "2021-10-18T18:30:54Z")

</div>

Closed on October 18, 2021, 6:30pm UTC


