Problem reading Uncompressed grayscale AVIs
Hi all
I have a instrument that saves videos in AVI format and would like to use OpenCV for some video analyses. The videos are grayscale, uncompressed and have only single channel. When I read a single video frame into an MAT using VideoCapture::read, the resultant MAT has three channels and if I save this retrieved frame into an image using imwrite, the result does not look anything like the actual video frame. I have tried preallocating (before reading the video frame) the MAT using MAT::zeros and setting the type to be CV_8UC1 to make sure that the MAT has only one channel but that does not work. Also tried using cvtColor and using and the VideoCapture::set(CV_CAP_PROP_FORMAT,CV_8UC1) command but these too do not work. The only thing that I tried that has worked was if I used MATLAB to make a copy of the original video that has 3 channels.
Is there any way of reading my videos properly.I am currently using OpenCV 2.3.1 on a PC running Ubuntu 12.04.
Thank you in advance
cheers
Girish