17 lines
369 B
C++
17 lines
369 B
C++
#include <opencv2/highgui.hpp>
|
|
#include <opencv2/core/mat.hpp>
|
|
|
|
using namespace std;
|
|
|
|
int main() {
|
|
cv::VideoCapture cap = cv::VideoCapture(0);
|
|
bool running = true;
|
|
cv::Mat image = cv::Mat::zeros(480, 640, CV_8UC3);
|
|
while (running) {
|
|
cap.read(image);
|
|
imshow("image", image);
|
|
running = cv::waitKey(30) != 27;
|
|
}
|
|
return 0;
|
|
}
|