-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathimwrite_path.cpp
45 lines (37 loc) · 923 Bytes
/
imwrite_path.cpp
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
33
34
35
36
37
38
39
40
41
42
43
44
45
#include "opencv2/highgui/highgui.hpp"
#include "opencv2/imgproc/imgproc.hpp"
#include <iostream>
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
using namespace cv;
using namespace std;
Mat frame;
int main()
{
//打开一个默认的相机
VideoCapture capture(0);
printf("aa\n");
//检查是否成功打开
if (!capture.isOpened())
{ printf("err");
return -1;}
while (1)
{
capture >> frame;
int redp=2,step=13;
char tt2[10]="",tt4[10]="";
string str;
string str0="/home/zhx02/qtceshi003/",str1="POINT:",str2,str3=";LINE:",str4,str5="(from_the_TOP,CCW).jpg";
sprintf(tt2, "%d", redp);
sprintf(tt4, "%d", step+1);
str2=tt2;
str4=tt4;
str=str0+str1+str2+str3+str4+str5;
cout<<str<<endl;
imshow("nnn",frame);
//imwrite(str, frame);
waitKey(1);
}
return 0;
}