Puppy Linux
by Amir on Dec.26, 2007, under Personal
Puppy linux is what I call it the best of lightweight linux distributions. I have a quite old machine at home, a PIII 500 MHz with 386 MB RAM. While other distros crawl on it (even those which claim to be lightweight), I found Puppy to be rocking on it blazingly fast. It has a technology to load itself to RAM and become quite fast even on old machines. It comes in less than 100 MB and has a wide range of nice applications suitable for older machines. So if you want to breathe life into your old machines, just give it a try. You won’t regret it ;).
Pascal Bootcamp 2007
by Amir on Jul.01, 2007, under Machine Learning
Here is the instructions and necessary files for Feature Selection Lab1 at Pascal Bootcamp 2007, Vilanova i la GeltrĂș, Spain:
Getting the number of frames of an AVI video file for OpenCV
by Amir on Jun.04, 2007, under Computer Vision
I’ve been using the OpenCV (ver. 1.0.0) lately and I noticed that under Linux, using the “cvCaptureFromAVI” does not detect the correct number of frames from an AVI video file. So this code returns 0 as the number of frames:
-
CvCapture *capture = cvCaptureFromAVI( path2Video );
-
cvQueryFrame( capture );
-
int nFrames = (int) cvGetCaptureProperty( capture , CV_CAP_PROP_FRAME_COUNT );
So I wrote a small piece of code which reads the number of frames directly from the AVI file. Please use it and let me know if you had any problem.
-
int nFrames;
-
char tempSize[4];
-
-
// Trying to open the video file
-
ifstream videoFile( path2Video , ios::in | ios::binary );
-
// Checking the availablity of the file
-
if ( !videoFile ) {
-
cout << “Couldn’t open the input file “ << path2Video << endl;
-
exit( 1 );
-
}
-
-
// get the number of frames
-
videoFile.seekg( 0×30 , ios::beg );
-
videoFile.read( tempSize , 4 );
-
nFrames = (unsigned char ) tempSize[0] + 0×100*(unsigned char ) tempSize[1] + 0×10000*(unsigned char ) tempSize[2] + 0×1000000*(unsigned char ) tempSize[3];
-
-
videoFile.close( );
Esfandgan
by Amir on Feb.14, 2007, under Personal
Did you know Persians have a day devoted for love called “Esfandgan-Mazdegan” and this day has its roots into more than 1700 years B.C.? And guess when is the date, 29 Bahman which is 18 Feb in Gregorian calendar, which almost coincides with the current Valentine day which is celebrated for the same reason. Is not it interesting. You can read more about it in an article published in Persian Journal.