> #include <iostream>
> #include <opencv/cv.h>
> #include <opencv/highgui.h>
>
> using namespace std;
>
> char key;
>
> int main() {
> cvNamedWindow("Camera_Output",1);
> //create a window CvCapture* capture
> =cvCaptureFromCAM(0); // Capture using any camera, we can
> aslo use 0 as a parameter if we are
> using single camera. if(capture ==
> NULL) { printf("cannot open
> camera#n"); return -1; }
> while(1){
> //creating any infinite loop for live
> streaming
> IplImage* frame = cvQueryFrame(capture);
> //capture image frames from camera
> cvShowImage("Camera_Output",frame);
> //show image frames on created window
> key = cvWaitKey(10);
> //Capture keyboard storke
> if(char(key) == 27){
> break; } } cvReleaseCapture(&capture);
> //Release capture Image
> cvDestroyWindow("camera_Output");
> //Destroy Window
>
> return 0; }
please advice