Installing OpenCV python binding on Ubuntu is easier using the software center. You don't have to compile the source code. You can just type
aptitude search opencv
in the command prompt to find which version you would like and then call apt-get
For instance on my computer I did:
sudo apt-get install opencv2.7-opencv
Wednesday, October 23, 2013
Tuesday, October 1, 2013
How to install Opencv 2.4.2 with ffmpeg 0.11.1 on Ubuntu 12.04
After dealing a lot of headache with trying to install Opencv to work with videos I came up with this tutorial:
http://www.ozbotz.org/opencv-installation/
I was able to confirm it works for the versions mentioned in this post. The installation of opencv with ffmpeg is so brittle and sensitive that any slight variation on the versions on either software and you will have to deal with bugs that you may or may not be able to fix. So make sure that if you follow a tutorial, that the versions you are installing are the ones on the tutorial. Good luck
http://www.ozbotz.org/opencv-installation/
I was able to confirm it works for the versions mentioned in this post. The installation of opencv with ffmpeg is so brittle and sensitive that any slight variation on the versions on either software and you will have to deal with bugs that you may or may not be able to fix. So make sure that if you follow a tutorial, that the versions you are installing are the ones on the tutorial. Good luck
Monday, September 23, 2013
Convnet issue: got nan or inf!
I was able to install the convnet library and trying to replicate the 13% accuracy on the CIFAR10 dataset claimed. but my implementation would run a few epochs and then give me a message such as " got nan or inf" and the process would die.
I would get a message such as :
5.1... logprob: 1.224800, 0.430300 (2.227 sec)
5.2... logprob: 1.251499, 0.436500 (2.165 sec)
5.3... logprob: nan, 1.000000 ^ got nan or inf!
Sometimes it would run for 5 epochs and die other times would be 40.
After emailing Alex Krizhevsky the author of the library, he said, "it can happen if the optimization becomes numerically unstable, but it can also be caused by a faulty GPU"
So I swtiched my GPU for a different one and it worked!
So if you see this problem, something simple you can do is just try a different GPU. Good luck
Thursday, February 28, 2013
prereq-opencv-linux
#!/bin/bash
echo ""
echo "starting installation of essential packages for opencv..."
apt-get install build-essential
apt-get install cmake
apt-get install pkg-config
apt-get install libpng12-0 libpng12-dev libpng++-dev libpng3
apt-get install libpnglite-dev libpngwriter0-dev libpngwriter0c2
apt-get install zlib1g-dbg zlib1g zlib1g-dev
apt-get install libjasper-dev libjasper-runtime libjasper1
apt-get install pngtools libtiff4-dev libtiff4 libtiffxx0c2 libtiff-tools
apt-get install libjpeg8 libjpeg8-dev libjpeg8-dbg libjpeg-prog
apt-get install ffmpeg libavcodec-dev libavcodec52 libavformat52 libavformat-dev
apt-get install libgstreamer0.10-0-dbg libgstreamer0.10-0 libgstreamer0.10-dev
apt-get install libxine1-ffmpeg libxine-dev libxine1-bin
apt-get install libunicap2 libunicap2-dev
apt-get install libdc1394-22-dev libdc1394-22 libdc1394-utils
apt-get install swig
apt-get install libv4l-0 libv4l-dev
apt-get install python-numpy
apt-get install git
Thursday, May 24, 2012
Getting OpenCV libraries loaded in Matlab for Linux Ubuntu with LD_LIBRARY_PATH issues
It turns out there is a bug on Ubuntu that for some reason doesn't let you change LD_LIBRARY_PATH the way it used to. This is very annoying and you can read more about this on this link
So there are a few things you can do about this. What seemed to me simple to do and worked was to follow what this thread suggested which is basically use LD_PRELOAD before calling matlab in this way:
LD_PRELOAD=/home/OpenCV-2.0.0/lib/libcv.so:/home/OpenCV-2.0.0/lib/libcxcore.so matlab
One thing that I had to do was to be a super user (sudo su) before doing all this because I also needed root access from matlab and also it didn't seem to load these libraries if you just do "sudo matlab"
This is not a long term solution but at lest can get you going. I hope this helps.
So there are a few things you can do about this. What seemed to me simple to do and worked was to follow what this thread suggested which is basically use LD_PRELOAD before calling matlab in this way:
LD_PRELOAD=/home/OpenCV-2.0.0/lib/libcv.so:/home/OpenCV-2.0.0/lib/libcxcore.so matlab
One thing that I had to do was to be a super user (sudo su) before doing all this because I also needed root access from matlab and also it didn't seem to load these libraries if you just do "sudo matlab"
This is not a long term solution but at lest can get you going. I hope this helps.
Thursday, April 19, 2012
Installing Boost in Windows 7
I got this steps from
http://www.beroux.com/english/articles/boost_unit_testing/?part=2
However, the link to the download page was wrong. Here are more updated steps:
1. Download the latest Boost installer from BoostPro Computing: http://www.boostpro.com/download/
2. Install the setup:
Select whatever mirror you like and VS version you are working with.
[X] Mulithread Debug, DLL --DLL Debug, required when BOOST_DYN_LINK defined.
[X] Mulithread, DLL --DLL Release, required when BOOST_DYN_LINK defined.
[X] Mulithread --LIB (for CRT DLL) Release, default in Release.
[X] Mulithread Debug --LIB (for CRT DLL) Debug, default in Debug.
[X] Mulithread, static runtime --LIB (for CRT LIB) Release.
[ ] Mulithread Debug, static runtime --LIB (for CRT LIB) Debug.
[ ] Single thread, static runtime
[ ] Single thread Debug, static runtime
3. Add Boost to the include and library folders of Visual Studio:
Go to the menu Tools > Options...
Go to Project and Solutions > VC++ Directories
Add to your Include files: C:\Program Files\boost\boost_X_XX_X
Add to your Include files: C:\Program Files\boost\boost_X_XX_X\boost\tr1
Add to your Library files: C:\Program Files\boost\boost_X_XX_X\lib
Optional:
Path inclusion: If you use Boost DLLs (rare) you may add C:\Program Files\boost\boost_X_XX_X\lib to your system PATH.
http://www.beroux.com/english/articles/boost_unit_testing/?part=2
However, the link to the download page was wrong. Here are more updated steps:
1. Download the latest Boost installer from BoostPro Computing: http://www.boostpro.com/download/
2. Install the setup:
Select whatever mirror you like and VS version you are working with.
[X] Mulithread Debug, DLL --DLL Debug, required when BOOST_DYN_LINK defined.
[X] Mulithread, DLL --DLL Release, required when BOOST_DYN_LINK defined.
[X] Mulithread --LIB (for CRT DLL) Release, default in Release.
[X] Mulithread Debug --LIB (for CRT DLL) Debug, default in Debug.
[X] Mulithread, static runtime --LIB (for CRT LIB) Release.
[ ] Mulithread Debug, static runtime --LIB (for CRT LIB) Debug.
[ ] Single thread, static runtime
[ ] Single thread Debug, static runtime
3. Add Boost to the include and library folders of Visual Studio:
Go to the menu Tools > Options...
Go to Project and Solutions > VC++ Directories
Add to your Include files: C:\Program Files\boost\boost_X_XX_X
Add to your Include files: C:\Program Files\boost\boost_X_XX_X\boost\tr1
Add to your Library files: C:\Program Files\boost\boost_X_XX_X\lib
Optional:
Path inclusion: If you use Boost DLLs (rare) you may add C:\Program Files\boost\boost_X_XX_X\lib to your system PATH.
Wednesday, April 4, 2012
How to use Bilateral Filter in Opencv
Here is an example of using the bilateral filter where 21 is the color sigma and and 3 is the spatial sigma
cvSmooth(gray_image_,smoothed_image,CV_BILATERAL, 0,0, 21, 3);
cvSmooth(gray_image_,smoothed_image,CV_BILATERAL, 0,0, 21, 3);
Subscribe to:
Posts (Atom)