-
Notifications
You must be signed in to change notification settings - Fork 10
/
CalibImage.h
73 lines (52 loc) · 1.32 KB
/
CalibImage.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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
// -*- c++ -*-
// Copyright 2008 Isis Innovation Limited
#ifndef __CALIB_IMAGE_H
#define __CALIB_IMAGE_H
#include "ATANCamera.h"
#include "CalibCornerPatch.h"
#include <vector>
#include <TooN/se3.h>
namespace PTAMM {
const int N_NOT_TRIED=-1;
const int N_FAILED=-2;
struct CalibGridCorner
{
struct NeighborState
{
NeighborState() {val = N_NOT_TRIED;}
int val;
};
CalibCornerPatch::Params Params;
CVD::ImageRef irGridPos;
NeighborState aNeighborStates[4];
Matrix<2> GetSteps(std::vector<CalibGridCorner> &vgc);
Matrix<2> mInheritedSteps;
void Draw();
double ExpansionPotential();
};
class CalibImage
{
public:
bool MakeFromImage(CVD::Image<CVD::byte> &im);
SE3<> mse3CamFromWorld;
void DrawImageGrid();
void Draw3DGrid(ATANCamera &Camera, bool bDrawErrors);
void GuessInitialPose(ATANCamera &Camera);
struct ErrorAndJacobians
{
Vector<2> v2Error;
Matrix<2,6> m26PoseJac;
Matrix<2,NUMTRACKERCAMPARAMETERS> m2NCameraJac;
};
std::vector<ErrorAndJacobians> Project(ATANCamera &Camera);
CVD::Image<CVD::byte> mim;
protected:
std::vector<CVD::ImageRef> mvCorners;
std::vector<CalibGridCorner> mvGridCorners;
bool ExpandByAngle(int nSrc, int nDirn);
int NextToExpand();
void ExpandByStep(int n);
CVD::ImageRef IR_from_dirn(int nDirn);
};
}
#endif