Ask Your Question
0

Book: Learning ROS for Robotics Programming 2nd Edn; Chapter 5 homography.cpp:16:39: fatal error: opencv2/nonfree/nonfree.hpp: No such file or directory

asked 2016-01-28 20:35:29 -0500

updated 2016-02-01 21:53:08 -0500

Hello, I am studying the book for beginners to understand ROS. When I compile chapter 5 tutorials, I face this problem.

/home/khan/catkin_ws/src/chapter5_tutorials/src/homography.cpp:16:39: fatal error: opencv2/nonfree/nonfree.hpp: No such file or directory

To resolve this problem, I have already gone through the following method mentioned herelink text

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

but in following that method, I got another error such as

  E: Unable to locate package libopencv-nonfree-dev

to resolve this problem, I followed the method mentioned here as

sudo gedit /etc/apt/sources.list

and then make its backup and further change by adding these lines into the source.list file

deb http://kr.archive.ubuntu.com/ubuntu precise main restricted universe
deb-src http://kr.archive.ubuntu.com/ubuntu precise restricted main multiverse universe
deb http://kr.archive.ubuntu.com/ubuntu precise-updates main restricted universe
deb-src http://kr.archive.ubuntu.com/ubuntu precise-updates restricted main multiverse universe

and then finally updating it with

sudo apt-get update

After going through this whole method, still I am seeing this error

W: Failed to fetch http://ppa.launchpad.net/xqms/opencv-nonfree/ubuntu/dists/vivid/main/binary-amd64/Packages  404  Not Found

Please, help me in it, I have spent plenty of time in figuring it out and still my chapter5 tutorials are not being compiled. I shall buy cookies for you. :)

After going through the method explained by Dear Jarvis Schultz, I followed this problem further and I am getting this message. @Jarvisschults. i.e. undo the changes I made in source.list and run the following.

sudo add-apt-repository ppa:xqms/opencv-nonfree

I am getting this message. 

Please be aware of potential patent issues when using this PPA. For a list of included algorithms see:
http://docs.opencv.org/modules/nonfree/doc/nonfree.html
More info: https://launchpad.net/~xqms/+archive/ubuntu/opencv-nonfree

I guess it is worth mentioning that I am using Linux 15.04 under ROS Jade with graphic card NVIDIA GeForce GT630. I feel there might be some issue with it as I read it from this link in which the message is,

please do not advise users to add the Proprietary GPU Drivers PPA when it is not necessary, the nvidia-352 drivers are available in the official Ubuntu repositories. Adding this PPA is an option when these drivers don't work properly and you want to install the latest official stable NVIDIA drivers from the NVIDIA short-lived branch.

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2016-01-29 09:41:25 -0500

I would undo the changes that you've made to the sources.list file. Then use the command:

sudo add-apt-repository ppa:xqms/opencv-nonfree

This command will create a new sources list file in /etc/apt/sources.list.d/, and it will automatically verify the sources and ensure you get the right strings for your version of Ubuntu.

Then try sudo apt-get update.

edit flag offensive delete link more

Comments

@Jarvisschults. Thanks. I am getting this message.

Please be aware of potential patent issues when using this PPA. For a list of included algorithms see:
http://docs.opencv.org/modules/nonfree/doc/nonfree.html
More info: https://launchpad.net/~xqms/+archive/ubuntu/opencv-nonfree
Dr Abdul Mannan gravatar imageDr Abdul Mannan ( 2016-01-29 20:29:24 -0500 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2016-01-28 20:35:29 -0500

Seen: 643 times

Last updated: Feb 01 '16