Wednesday, February 20, 2013

Convert mp4 to mp3 using avconv


Want to convert mp4 to mp3 on linux ?
avconv -i input.mp4 -vn -f mp3 output.mp3

Monday, February 18, 2013

mexopencv

mexopencv is a matlab library that acts as a wrapper around opencv

Downloading the opencv version from Feb 18 2013 and building mexopencv, you will encounter a compilation error at src/+cv/private/FeatureDetector_.cpp .

Apparently SHORT was removed from the list of Param types in OpenCV. To fix, modify the FeatureDetector_.cpp and remove references to cv::Param::Short from three lines 27, 46, and 63 and it compiles without a problem.

Installing OpenCL on Ubuntu

Found a blog post about installing OpenCL on Ubuntu.

http://develnoter.blogspot.com/2012/05/installing-opencl-in-ubuntu-1204.html

Will follow and update post accordingly.

Installing OpenCV on Ubuntu 12.10

mkdir OpenCV
cd OpenCV
git clone git://code.opencv.org/opencv.git
sudo apt-get install libtbb-dev libtbb2
sudo apt-get install libqt4-dev
sudo apt-get install libavformat-dev libswscale-dev
mkdir build
cd build
mkdir release
cd released
cmake -D CMAKE_BUILD_TYPE=RELEASE -D CMAKE_INSTALL_PREFIX=/usr/local -D WITH_TBB=ON -D WITH_OPENCL ../../


Thursday, February 4, 2010

Renumbering files in consecutive order

Here is a small script I used to renumber files in consecutive order. Of course you need to change it to suite your needs.
files=`find . -name "images*.pgm"`
i=0
for f in $files;
do
i=`expr $i + 1`
newf=`printf "test/images%03d.pgm" $i`
mv $f $newf;
done

Sunday, August 30, 2009

How to batch extract frames from video

I also needed to extract frames from a video , for that I used ffmpeg
ffmpeg -i movie1.MPG -r 1 -f image2 frames/images%d.png

Batch converting images

Today I had to batch convert images from png to pgm. Here how you can do it using Imagemagick
mogrify -format pgm *.png