How to install Opencv-contrib-python on Xavier?

I had already try “pip3 install opencv-contrib-python”, but because of arm64, I can’t use pip to get opencv-contrib-python.
I want to use “xfeature2d” for video stitching, any advice for using Xavier to make 360 degree video, please me too.
Sorry that I’m not good at English, it may be weird in my narrative.

Hi,

It may because that OpenCV doesn’t release the module for ARM.
To fix this, you can build it from source. Here is a script for your reference:
https://github.com/AastaNV/JEP/blob/master/script/install_opencv4.0.0_Xavier.sh

For the 360 degree video, here is a related sample for your reference:
https://github.com/NVIDIA-AI-IOT/deepstream_360_d_smart_parking_application

Thanks.

After build it from source, I still got the error message “AttributeError: module ‘cv2’ has no attribute ‘xfeatures2d’” after running cmake and make. Is there anyway that I might make a mistake?
I change the version 4.0.0 =>3.1.1, is it might be the problem?

I can get the attribute now! after the command “make install”

Hi,

You may not link the OpenCV library correctly.
Please noticed that the python library is located at {folder}/opencv-4.0.0/release/python_loader.

Please update the library path like this:

export PYTHONPATH=$PYTHONPATH:/path/to/your/folder/opencv-4.0.0/release/python_loader/

Thanks.

Hi,
i tried the script by suggested in the first answer on a jetson xavier nx (newest jetpack i think) and it completed successfully. However it seems like opencv-contrib-python still does not work. I still get the error

AttributeError: ‘module’ object has no attribute ‘TrackerKCF_create’

Can someone help?

Cheers