0

I have a medical device that saves uncompressed grayscale AVI videos on which I would like to conduct some offline analyses. The pixels in the videos are unsigned 8 bit with only one color channel. When I use OpenCV's VideoCapture class and the read method to extract frames from these videos, I get matrices that have 3 color channels and are low contrast,sheared versions of the originals. I have tried cvtCOlor to convert the 3 color channel to grayscale but that not solve the problem. If I change the number of channels in the video to 3 (using MATLAB), this problem goes away. Is there a method to read in frames from the uncompressed grayscale single channel video without having to increase the number of channels? I am running OpenCV 2.3.1 on a PC runniNg ubuntu 12.04.

Thank you in advance

cheers

gkr

Girish
  • 1
  • possible duplicate of [opencv VideoCapture.set greyscale?](http://stackoverflow.com/questions/11159506/opencv-videocapture-set-greyscale) – baci Sep 27 '13 at 23:00

1 Answers1

0

From the doc:

VideoCapture::read() calls grab() and retrieve() in one call

Note sure, but if you try using grab() and then retrieve() with 1 channel Mat, maybe it can solve the problem.

Bull
  • 11,771
  • 9
  • 42
  • 53
baci
  • 2,528
  • 15
  • 28