rework histogram_bezier, init wm icon set_icon(gg), update de.po+msg/txt
[goodguy/history.git] / cinelerra-5.1 / plugins / findobj / findobj.h
index 8c291b28ba701f903a706948fe245dd0ecffd091..d27ac056315b361d7bdf7a80aee536c36a33219a 100644 (file)
@@ -45,6 +45,7 @@
 #include "pluginvclient.h"
 #include "vframe.inc"
 
+#define Mutex CvMutex
 #include "opencv2/core/types.hpp"
 #include "opencv2/core/mat.hpp"
 #include "opencv2/imgproc/imgproc.hpp"
@@ -52,6 +53,7 @@
 #include "opencv2/calib3d.hpp"
 #include "opencv2/flann/defines.h"
 #include "opencv2/flann/params.h"
+#undef Mutex
 
 #include <vector>
 
@@ -81,32 +83,46 @@ using namespace cvflann;
 #define MIN_BLEND 1
 #define MAX_BLEND 100
 
-#define NO_ALGORITHM 0
+#define NO_ALGORITHM   -1
 #define ALGORITHM_SIFT  1
 #define ALGORITHM_SURF  2
 #define ALGORITHM_ORB   3
 #define ALGORITHM_AKAZE 4
 #define ALGORITHM_BRISK 5
 
+#define MODE_NONE          -1
+#define MODE_SQUARE         0
+#define MODE_RHOMBUS        1
+#define MODE_RECTANGLE      2
+#define MODE_PARALLELOGRAM  3
+#define MODE_QUADRILATERAL  4
+#define MODE_MAX            5
+
 class FindObjConfig
 {
 public:
        FindObjConfig();
 
+       void reset();
        int equivalent(FindObjConfig &that);
        void copy_from(FindObjConfig &that);
        void interpolate(FindObjConfig &prev, FindObjConfig &next,
                int64_t prev_frame, int64_t next_frame, int64_t current_frame);
        void boundaries();
 
-       int algorithm, use_flann;
+       int algorithm, use_flann, mode;
+       int drag_object, drag_scene, drag_replace;
        float object_x, object_y, object_w, object_h;
-       float scene_x, scene_y,   scene_w, scene_h;
+       float scene_x, scene_y, scene_w, scene_h;
+       float replace_x, replace_y, replace_w, replace_h;
+       float replace_dx, replace_dy;
 
-       int draw_keypoints;
-       int draw_border;
+       int aspect, scale, translate, rotate;
+       int draw_keypoints, draw_match;
+       int draw_scene_border;
        int replace_object;
        int draw_object_border;
+       int draw_replace_border;
 
        int object_layer;
        int replace_layer;
@@ -137,6 +153,7 @@ public:
        void set_brisk();
 #endif
        void process_match();
+       void reshape();
 
        void draw_vectors(VFrame *frame);
        int is_multichannel();
@@ -151,28 +168,30 @@ public:
        OverlayFrame *overlayer;
        VFrame *object, *scene, *replace;
 
+       static void draw_point(VFrame *vframe,int x1, int y1);
        static void draw_line(VFrame *vframe, int x1, int y1, int x2, int y2);
+       static void draw_quad(VFrame *vframe,
+                       int x1, int y1, int x2, int y2,
+                       int x3, int y3, int x4, int y4);
        static void draw_rect(VFrame *vframe, int x1, int y1, int x2, int y2);
        static void draw_circle(VFrame *vframe, int x, int y, int r);
 
-       int object_x, object_y, object_w, object_h;
-       int scene_x, scene_y, scene_w, scene_h;
+       float object_x, object_y, object_w, object_h;
+       float scene_x, scene_y, scene_w, scene_h;
+       float replace_x, replace_y, replace_w, replace_h;
+       float replace_dx, replace_dy;
 
        int w, h;
        int object_layer;
        int scene_layer;
        int replace_layer;
 
-// Latest coordinates of object in scene
-       int border_x1, border_y1;
-       int border_x2, border_y2;
-       int border_x3, border_y3;
-       int border_x4, border_y4;
+// Latest coordinates of match / shape / object in scene
+       float match_x1, match_y1, shape_x1, shape_y1, out_x1, out_y1;
+       float match_x2, match_y2, shape_x2, shape_y2, out_x2, out_y2;
+       float match_x3, match_y3, shape_x3, shape_y3, out_x3, out_y3;
+       float match_x4, match_y4, shape_x4, shape_y4, out_x4, out_y4;
 // Coordinates of object in scene with blending
-       float obj_x1, obj_y1;
-       float obj_x2, obj_y2;
-       float obj_x3, obj_y3;
-       float obj_x4, obj_y4;
        int init_border;
 
 //opencv