25 October 2007

OpenCV Problem with offset into video files.

OpenCV is unable to open into video files with offset. Guess we have to do it ourselves. The code which should take care of the offset is

/****************************************************************************/
#include
#include

int main()
{
CvCapture *video;
IplImage *im;
double wait;

cvNamedWindow("Video",1);
cvMoveWindow("Video",200,200);

video = cvCaptureFromFile("/home/sysad/Misc/Snatch.avi");
if(video==NULL)
{
abort();
}
cvSetCaptureProperty(video,CV_CAP_PROP_POS_AVI_RATIO,(double)0.75); // DOES NOT WORK CURRENTLY
im = cvQueryFrame(video);
wait = 1000.0/cvGetCaptureProperty(video,CV_CAP_PROP_FPS);

while(im!=NULL)
{
cvShowImage("Video",im);
cvWaitKey((int)wait);
im = cvQueryFrame(video);
}
cvReleaseCapture(&video);

return 0;
}

/************************************************************************/

Simplest workaround is to skip frames till one reaches the frame of interest!

21 October 2007

Pandal hopping in Mumbai

Yesterday night, 14 of us from the hostel went pandal hopping at major places in Mumbai. We started at 6:30 PM and returned at 2AM. We covered Vashi, Chembur, Shivaji Park(Dadar), Bandra, Santa Cruz and finally Lokhandwala. The crowds are certainly much lesser than in Calcutta but still impressive. The expat Bong population in Bombay is impressive and from all walks and classes of life. I have put up the photos here. All comments welcome! Note that I have not added the captions for the photos. One would notice that almost all of the goddess idols look the same. This is possibly due to the fact that at least at three of the places, the supplier of the idols was same person.