Ask Your Question

Revision history [back]

How to access android camera using opencv 2.4.10 c++?

int main{
VideoCapture capture(0);
namedWindows("Video");
string filename;

while(1){

    Mat frame;

    capture>>frame;
    imshow("video", frame);

    if(waitKey(30)=='c') break;

    //image capture
    if(waitKey(30)=='q'){
        imshow("preview", frame);
        cout<<"Please enter file name => ";
        cin>>filename;
        imwrite(filename, frame);
        cout<<"SUCCESSFULLY STORED"<<endl;
    }
}
return 0;
}

This is a code that access the PC webcam, but I don't know how to access the camera of my android phone which is plugged into my laptop. How to implement this in opencv 2.4.10 c++?