-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCalibration.h
52 lines (43 loc) · 1.38 KB
/
Calibration.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
#pragma once
#include <opencv2/opencv.hpp>
typedef struct {
int width;
int height;
int stride;
unsigned char* buf;
} image_u8;
typedef struct {
double fx;
double fy;
double cx;
double cy;
} intrinsics;
#ifdef __cplusplus
extern "C" {
#endif
/// <summary>
/// Given img, attempts to find
/// the checkerboard calibration image. If successful,
/// appends the image to the calibration buffer
/// </summary>
/// <param name="img">one-channel 8 byte image</param>
/// <returns>the number of images currently in the calibration buffer</returns>
__declspec(dllexport)
int __cdecl supply_calibration_image(image_u8* img);
/// <summary>
/// Clears the calibration buffer
/// </summary>
/// <returns>the number of images currently in the calibration buffer</returns>
__declspec(dllexport)
int __cdecl clear_calibration_images();
/// <summary>
/// Uses the current calibration buffer to compute the camera intrinsics
/// </summary>
/// <param name="squareSize">the size in meters of a checker on the printed calibration board</param>
/// <param name="outputIntrinsics">A caller-allocated intrinsics struct output variable. This function populates it.</param>
/// <returns>whether or not the calibration succeeded (requires enough calibration images)</returns>
__declspec(dllexport)
bool __cdecl calibrate(float squareSize, intrinsics* outputIntrinsics);
#ifdef __cplusplus
}
#endif