Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

It's absolutely normal. Just check the code:

frame= new Mat(frame.size(), CvType.CV_8UC1); //8 bit/pixel, one channel (grayscale)
...
Imgproc.cvtColor(frame, grayFrame, Imgproc.COLOR_BGR2GRAY); //trying to convert a color (BGR) image to grayscale

The error says that for a color->grayscale (COLOR_BGR2GRAY) conversion it needs a color (3 or 4 channel) image as input.