Wednesday, October 8, 2008

read and save video file by opencv

I spent two days to test the program as one of my friend want to save frames in video file.

I find that opencv work on video things by FFMPEG library.So before you install opencv ,you mush check if you have install ffmpeg and libgtk2.0-dev libavcodec-dev libavformat-dev libjpeg62-dev libtiff4-dev.

After that ,you can recompile the opencv :
./configure
make
sudo make install

If when you do ./configure ,you can see "ffmpeg yes", then it said opencv can work on ffmpeg..


When I do recompile the source code of opencv , I find something interesting.
Afger configure,I find opencv can find ffmpeg..but it still can not read and write video files.
but after I change something in highgui's source code and do recompile again, it's working..

I think maybe that's because if you dont change anything in the source code .It does not refresh the library...


More information about opencv and Ubuntu
http://dircweb.king.ac.uk/reason/opencv_cvs.php

Friday, September 26, 2008

Switch in c++

Today I start use switch to do something . But I missed a important thing , that's the term 'break' in Switch just make program get out "switch". I have though "break " just work for loop ,like "for" and "while". Now I know it also work for "switch".

switch(flag)
{
case 1:
//here break just make program get out switch ,dont check case 2 and 3.
break;
case 2:
//do sth, if you dont add break , the program will go to case 3 to check;
case 3:
break;

}

Wednesday, September 24, 2008

Thursday, September 11, 2008

choose octave editor from emacs to gvim

To be honest, I don't familiar with emacs. Gvim is my favor editor under linux. Now I want to choose gvim as default editor.
Just one command line:

# export EDITOR=gvim

It seems octave use environment variable to decide which editor it should use.
I add this line to ".bashrc" to make sure it always work after start my pc;

Tuesday, September 9, 2008

Scp's error information

When I use scp to copy one file from server to laptop, it gives me a error, said:
pemission denied(publickey,password......)
lost connection

But ssh works , so I google for a while and find the resolution .

If you work on a server ,don't do :
scp -r usr@ip(server):path usr@ip:path
because maybe you don't have right to transfer files on ip server.
So you can do:
scp -r path usr@ip:path

Because the path is on your local folder, so it works for me..

Use Octave instead of Matlab

I don't want to pay money for Matlab, so I am using Octave which is a open source math tool for Linux and Windows.
I tried it today. Its command very like Matlab and convenient.

Friday, September 5, 2008

Linker and compiler

In the Makefile, if you want to get object file ,you just need headfile and cpp file. If you build the execute file ,you should add lib files .