I do not have any idea why it did not work before but now it works with the following code :
VideoCapture cap(1); // open the default camera
if(!cap.isOpened()) // check if we succeeded
return -1;
Mat edges;
namedWindow("edges",1);
for(;;)
{
Mat frame;
cap >> frame; // get a new frame from camera
// cvtColor(frame, edges, CV_BGR2GRAY);
// GaussianBlur(edges, edges, Size(7,7), 1.5, 1.5);
// Canny(edges, edges, 0, 30, 3);
imshow("edges", frame);
if(waitKey(30) >= 0) break;
}
// the camera will be deinitialized automatically in VideoCapture destructor
return 0;
I used to change cap(index) from -1, 0, 1 ,2 ,… just to test and make sure if I am reading the right camera. Usually index values of either -1 or 0 were okay but this time index of ‘1’ worked !!!
Still Cheese program does not work but I do not need it anyway.
Now I have my camera frames and opencv4tegra with full GPU functionality.
Thanks for being so supportive and quick ^^
My problem is SOLVED :)