Created
September 19, 2012 16:42
-
-
Save jayrambhia/3750683 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
compiling opencv_webcam.cpp | |
opencv_webcam.cpp: In function ‘int main()’: | |
opencv_webcam.cpp:8:9: error: ‘cap’ was not declared in this scope | |
opencv_webcam.cpp:11:9: error: ‘k’ was not declared in this scope | |
opencv_webcam.cpp:11:23: error: ‘waitkey’ was not declared in this scope | |
opencv_webcam.cpp:12:9: error: expected ‘;’ before ‘if’ | |
Output file => opencv_webcam |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
compiling opencv_webcam.cpp | |
opencv_webcam.cpp: In function ‘int main()’: | |
opencv_webcam.cpp:8:9: error: ‘cap’ was not declared in this scope | |
opencv_webcam.cpp:11:9: error: ‘k’ was not declared in this scope | |
opencv_webcam.cpp:11:23: error: ‘waitkey’ was not declared in this scope | |
opencv_webcam.cpp:12:9: error: expected ‘;’ before ‘if’ | |
Output file => opencv_webcam |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include<opencv2/highgui/highgui.hpp> | |
using namespace cv; | |
int main() | |
{ | |
while(1) | |
{ | |
cap = VideoCapture(0); | |
Mat img = cap.read(); | |
imshow("image",img); | |
k = waitkey(10) | |
if k == 27: | |
break; | |
} | |
return 0; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include<opencv2/highgui/highgui.hpp> | |
using namespace cv; | |
int main() | |
{ | |
int k; | |
VideoCapture cap = VideoCapture(0); | |
while(1) | |
{ | |
Mat img; | |
cap >> img; | |
imshow("image",img); | |
k = waitKey(10); | |
if (k == 27) | |
{ | |
break; | |
} | |
} | |
return 0; | |
} | |
//This works perfectly well |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment