cut with active speed auto correction, add locale pref, mod prores dft profile to...
[goodguy/cinelerra.git] / cinelerra-5.1 / plugins / motion / opencvwrapper.h
1 /*
2  * CINELERRA
3  * Copyright (C) 1997-2012 Adam Williams <broadcast at earthling dot net>
4  * 
5  * This program is free software; you can redistribute it and/or modify
6  * it under the terms of the GNU General Public License as published by
7  * the Free Software Foundation; either version 2 of the License, or
8  * (at your option) any later version.
9  * 
10  * This program is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13  * GNU General Public License for more details.
14  * 
15  * You should have received a copy of the GNU General Public License
16  * along with this program; if not, write to the Free Software
17  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
18  * 
19  */
20
21
22
23 #ifndef OPENCVWRAPPER_H
24 #define OPENCVWRAPPER_H
25
26 #include "opencv2/core/core_c.h"
27
28 #include "vframe.inc"
29
30 class OpenCVWrapper
31 {
32 public:
33         OpenCVWrapper();
34         ~OpenCVWrapper();
35
36
37         float get_dst_x(int number);
38         float get_dst_y(int number);
39
40         void grey_crop(unsigned char *dst, 
41                 VFrame *src, 
42                 int x1, 
43                 int y1,
44                 int x2,
45                 int y2,
46                 int dst_w,
47                 int dst_h);
48
49 // Returns 1 when it got something
50         int scan(VFrame *object_frame,
51                 VFrame *scene_frame,
52                 int object_x1, 
53                 int object_y1,
54                 int object_x2,
55                 int object_y2,
56                 int scene_x1,
57                 int scene_y1,
58                 int scene_x2,
59                 int scene_y2);
60
61 private:
62         int locatePlanarObject(const CvSeq* objectKeypoints, 
63                 const CvSeq* objectDescriptors,
64         const CvSeq* imageKeypoints, 
65                 const CvSeq* imageDescriptors,
66         const CvPoint src_corners[4], 
67                 int *(*point_pairs),
68                 int (*total_pairs));
69
70 // Images in the format OpenCV requires
71         IplImage *object_image;
72         IplImage *scene_image;
73 // Quantized sizes
74         int object_image_w;
75         int object_image_h;
76         int scene_image_w;
77         int scene_image_h;
78         CvSeq *object_keypoints;
79         CvSeq *object_descriptors;
80         CvSeq *scene_keypoints;
81         CvSeq *scene_descriptors;
82         CvMemStorage *storage;
83         int *point_pairs;
84         int total_pairs;
85
86 // x, y pairs
87         float dst_corners[8];
88 };
89
90
91
92
93 #endif
94
95