summaryrefslogtreecommitdiff
path: root/ARMFCaptureD3D/Calibration.h
blob: a7c5c6e361a18a28171fdb37ce0c740c35cbd092 (plain)
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

#pragma once
#include <cstdio>
#include <map>
#include <vector>
#include <set>

class Calibration
{

    double	a1, b1, c1, a3, b3, a2, b2, c2;
    double	cal[4][2];
    double	dots[4][2];
	bool	cal_set[4];
	bool	calib_points_ok;
	bool	calibrated;
	void RazCalibration(); 

public:
    typedef enum  { TopLeft, TopRight, BottomLeft, BottomRight } Corners;

    Calibration(double width, double height, double calibInset = 0);
    void SetCalibrationPoint(Corners i, double x, double y);
	   
    void translateCoords(double X, double Y,  double *cx, double *cy);
    bool Calibrate();
	void SaveCalibration( std::string filename );
	bool RestoreCalibration(std::string filename);

};