原文地址:http://blog.sina.com.cn/s/blog_78fd98af0100vbwt.html
string test_video_path("E:\\VIDEO_For_Diag\\20081023110925.avi");
CvCapture* captrue = cvCreateFileCapture(test_video_path.c_str());
IPLImage* input_image=cvQueryFrame(captrue);
所获取图像input_image是倒着的,虽然cvShowImage显示为正着的,以及cvSaveImage都为正着的,是因为这两个函数先进行了数据排列判断,但实际数据是倒着排列的。可以查看input_image.origin是1。而正常cvLoadImage进来的图像input_image.origin是0。
因此,对于cvQueryFrame后获取的图像input_image先要进行flip,即:cvFlip(input_image);此时图像数据为直观所显示的图像一致了。