-
Notifications
You must be signed in to change notification settings - Fork 0
/
diamond.h
58 lines (45 loc) · 1.24 KB
/
diamond.h
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
46
47
48
49
50
51
52
53
54
55
56
57
58
#ifndef __MAIN_H__
#define __MAIN_H__
#include "opencv2/video/tracking.hpp"
#include "opencv2/imgproc.hpp"
#include "opencv2/videoio.hpp"
#include "opencv2/highgui.hpp"
#include <opencv2/freetype.hpp>
#include <opencv2/photo.hpp>
#include <iostream>
#include <fstream>
#include <ctype.h>
#include <unistd.h>
#include <stdlib.h>
#include "json.hpp"
#include "audio.h"
using namespace cv;
using namespace std;
using json = nlohmann::json;
#define PI 3.14159265354
typedef struct {
unsigned long start_frame_num;
unsigned long current_frame_num;
unsigned long duration;
Mat key_frame;
vector<Point2f> *motion;
Mat palette;
vector<float> *palette_weight;
struct sourceT *source;
} sceneT;
typedef struct sourceT {
json *cache;
char *filename;
VideoCapture *raw_cap;
int width, height;
unsigned long frames;
double fps;
vector<Point2f> *motion_sample_points;
vector<sceneT> *scenes;
Mat *scene_palette_distance;
Mat *scene_motion_distance;
VideoCapture *derez_cap;
} sourceT;
extern cv::Ptr<cv::freetype::FreeType2> ft2;
void showFrame(Mat frame, const char *title="", float pct=-1.0, Mat mask = Mat());
#endif // __MAIN_H__