-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathcap.cpp
More file actions
32 lines (29 loc) · 709 Bytes
/
cap.cpp
File metadata and controls
32 lines (29 loc) · 709 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#include <cassert>
#include <utility>
#include <vector>
#include <iostream>
#include <time.h>
#include <string>
#include "opencv2/opencv.hpp"
#define REP(i,n) for(int i=0;i<n;i++)
#define mp std::make_pair
#define pb push_back
using namespace cv;
void downSize(Mat& inFrame, Mat& outFrame)
{
resize(inFrame, outFrame, Size(), 0.5, 0.5, INTER_NEAREST);
}
int main(int argc, char** argv)
{
char* fileName=argv[1];
VideoCapture cap(0);
if(!cap.isOpened()) return -1;
std::cout<<"till here!"<<std::endl;
Mat frame,out;
cap >> frame; // get a new frame from camera
std::cout<<"till read!"<<std::endl;
downSize(frame,out);
std::cout<<"till size!"<<std::endl;
imwrite( fileName, out );
return 0;
}