fatal error: opencv2/nonfree/nonfree.hpp: No such file or directory

12,521

Solution 1

sudo apt-get update
sudo add-apt-repository --yes ppa:xqms/opencv-nonfree
sudo apt-get update
sudo apt-get install libopencv-nonfree-dev

Solution 2

You need to enable OPENCV_ENABLE_NONFREE when you build your opencv version. I guess it goes like this in the prompt command cmake -D OPENCV_ENABLE_NONFREE=ON ..

But if you prefer cmake GUI see the picture below. picture

Share:
12,521
realtekme
Author by

realtekme

I am a computer science and Engineering student I MIT(Ethiopia). I like sharing knowledge

Updated on June 06, 2022

Comments

  • realtekme
    realtekme almost 2 years

    I have installed Opencv 2.4.8 on my Linux(ubuntu 14.04) machine and it works fine. When I'm trying to test SURF descriptor using sample code from the online official documentation the compiler gave me no such file or director error for #include<opencv2/nonfree/nonfree.hpp>

    .

    From this link i have tried to update the opencv library for the nonfree modules with but still no success.

    To make history short how can include SURF descriptor to my project or any idea how to fix this?