-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathdemo2.cpp
More file actions
41 lines (38 loc) · 1.17 KB
/
Copy pathdemo2.cpp
File metadata and controls
41 lines (38 loc) · 1.17 KB
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
/*==========================================================
* Filename: demo2.cpp
* Author: Weiqi Chen (https://wiki77777.github.io/)
* Version: 1.0
* Date: 2017-11-27
* Description:
* A demo of bestcurve. Create consecutive curve.
* Environment:
* C++11, OpenCV 2.4.13
* ATTENTION:
* Please verify the DISPLAYMSG in "bestcruve.h" have
* not defined.
===========================================================*/
#include "bestcruve.h"
#include <random>
#define AIM_NUM 5
static Car car;
static struct aims{
Point center; int radius;
}cirs[AIM_NUM];
void continuous(void){
random_device rd;
car.center = Point(rd()%600,rd()%600);
car.direction = rd()%360;
car.radius = IMGSIZE/10;
car.RS = 1;
double length; int angle;
Mat img = Mat(IMGSIZE, IMGSIZE, CV_8UC3, Scalar::all(255));
for(int i=0;i<AIM_NUM;i++){
cirs[i].center = Point(rd()%600,rd()%600);
cirs[i].radius = rd()%20+10;
getLine(img,length,angle,car.center,car.direction,car.radius,cirs[i].center,car.RS,false);
car.center = cirs[i].center;
car.direction = angle;
}
imshow("Result",img);
waitKey();
}