Ask Your Question

Revision history [back]

Unable to query number of channels

when I am using opencv-3.0.0 function VideoCapture cap(0); It throws a error VIDEOIO ERROR: V4L: device /dev/video0: Unable to query number of channels

Here is my code :

include "opencv2/opencv.hpp"

using namespace cv: int main(int,char**) { VideoCapture cap(0); if(!cap.isOpened()) return -1; Mat edges; namedWindow("edges",1); for(;;) { Mat frame; cap >> frame; cvtColor(frame,edges,COLOR_BGR2GRAY); GaussianBlur(edges,edges,Size(7,7),1.5,1.5); Canny(edges,edges,0,30,3); imshow("edges",edges); if(waitKey(30)>=0) break;

}

}

Can someone help me what might be the issue,btw I am using MIPI camera to Tinker Board

click to hide/show revision 2
None

updated 2018-04-02 06:16:51 -0500

berak gravatar image

Unable to query number of channels

when I am using opencv-3.0.0 function VideoCapture cap(0); It throws a error VIDEOIO ERROR: V4L: device /dev/video0: Unable to query number of channels

Here is my code :

include "opencv2/opencv.hpp"

#include "opencv2/opencv.hpp"

using namespace cv:
int main(int,char**)
{
    VideoCapture cap(0);
    if(!cap.isOpened())
        return -1;
    Mat edges;
    namedWindow("edges",1);
    for(;;)
    {
        Mat frame;
        cap >> frame;
        cvtColor(frame,edges,COLOR_BGR2GRAY);
        GaussianBlur(edges,edges,Size(7,7),1.5,1.5);
        Canny(edges,edges,0,30,3);
        imshow("edges",edges);
        if(waitKey(30)>=0)
        break;

break;

    }
}

}

Can someone help me what might be the issue,btw I am using MIPI camera to Tinker Board