I'm trying to run opencv on colab with c++ after running the commands as mentioned in a tutorial given here. However it is giving error of cvstd.hpp dependency inaccessible on running a sample code.
C++:
%%cu
#include "opencv2/opencv.hpp"
#include <iostream>
using namespace std;
using namespace cv;
int main(){
VideoCapture cap("/content/drive/My Drive/video.mp4");
if(!cap.isOpened()){
cout << "Error opening video stream or file" << endl;
return -1;
}
while(1){
Mat frame;
cap >> frame;
if (frame.empty())
break;
imshow( "Frame", frame );
char c=(char)waitKey(25);
if(c==27)
break;
}
cap.release();
destroyAllWindows();
return 0;
}
Error after running the notebook:
/tmp/tmpmqnpzz6a/118ab454-d448-48e9-9a1d-1f70bf66c348.cu(18): warning: too many characters in character literal -- extra leading characters ignored
/tmp/tmpmqnpzz6a/118ab454-d448-48e9-9a1d-1f70bf66c348.cu(18): error: "cv::String::String(int)" /usr/include/opencv2/core/cvstd.hpp(577): here is inaccessible
1 error detected in the compilation of "/tmp/tmpxft_00006b50_00000000-8_118ab454-d448-48e9-9a1d-1f70bf66c348.cpp1.ii".
My goal is to compare the compilation time of opencv c++ video reading in both cpu and gpu on colab. Any help will be highly appreciated!