aboutsummaryrefslogtreecommitdiffstats
path: root/meowpp.test/inc/autostitch.h
blob: 68df9c983fb91772584d26079429227a778b2df7 (plain) (blame)
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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
#ifndef   autostitch_H__
#define   autostitch_H__

#include "meowpp/Usage.h"

#include "meowpp/colors/RGB_Space.h"

#include "meowpp/geo/Vectors.h"

#include "meowpp/gra/FeaturePoint.h"
#include "meowpp/gra/FeaturePointsDetector.h"
#include "meowpp/gra/FeaturePointsMatch.h"
#include "meowpp/gra/FeaturePointsMatch_K_Match.h"

#include "meowpp/oo/ObjBase.h"
#include "meowpp/oo/ObjSelector.h"

#include "meowpp/math/Vector.h"

#include <utility>
#include <vector>
#include <string>

static const size_t  FPSD_ID = 5;

typedef std::vector<meow::FeaturePoint<double, double> > FeaturePoints;

class MyFeaturePointsDetector: public meow::ObjBase {
public:
  virtual meow::Usage usage() const = 0;
  virtual bool        usage(meow::Usage const& usg) = 0;
  virtual FeaturePoints detect(meow::Bitmap<meow::RGBf_Space> const& bmp)
  = 0;
};

class MyK_Match {
private:
  meow::FeaturePointsMatch_K_Match<double, double> _body;
public:
  MyK_Match();
  ~MyK_Match();
  meow::Usage usage() const;
  bool        usage(meow::Usage const& usg);
  meow::FeaturePointIndexPairs match(
    std::vector<std::vector<meow::FeaturePoint<double,double> > >const& fp);
};

class MyRansacCheck {
private:
  static double threshold;
  std::vector<meow::Vector<double> > const* _from;
  std::vector<meow::Vector<double> > const* _to  ;
  double a_, b_, c_, d_, e_, f_, A_, B_;
  double _w, _h;
  double r_, ang;
public:
  static meow::Usage usage();
  static bool        usage(meow::Usage const& usg);
  MyRansacCheck();
  MyRansacCheck(MyRansacCheck const& __rc);
  MyRansacCheck(std::vector<meow::Vector<double> > const* __from,
                std::vector<meow::Vector<double> > const* __to,
                double, double, double, double);
  ~MyRansacCheck();
  meow::Vector<double> vCalc(std::vector<meow::FeaturePointIndexPair> const& __sample) const;
  void rememberVCalc(std::vector<meow::FeaturePointIndexPair> const& __sample);
  bool ok(meow::FeaturePointIndexPair const& __m) const;
  double operator()(std::vector<meow::FeaturePointIndexPair> const& __sample,
                    std::vector<meow::FeaturePointIndexPair> const& __data) const;
  bool check();
  void print() const;
  meow::Vector2D<double> to(meow::Vector2D<double> const& __v) const;
};

#endif // autostitch_H__