Monado OpenXR Runtime
Data Structures | Macros | Typedefs | Functions
t_calibration.cpp File Reference

Calibration code. More...

#include "util/u_sink.h"
#include "util/u_misc.h"
#include "util/u_debug.h"
#include "util/u_frame.h"
#include "util/u_format.h"
#include "tracking/t_tracking.h"
#include "tracking/t_calibration_opencv.hpp"
#include <opencv2/opencv.hpp>
#include <sys/stat.h>
Include dependency graph for t_calibration.cpp:

Data Structures

struct  ViewState
 Current state for each view, one view for mono cameras, two for stereo. More...
 
class  Calibration
 Main class for doing calibration. More...
 

Macros

#define P(...)   snprintf(c.text, sizeof(c.text), __VA_ARGS__)
 

Typedefs

typedef std::vector< cv::Point3f > ModelF32
 Model of the thing we are measuring to calibrate, 32 bit. More...
 
typedef std::vector< cv::Point3d > ModelF64
 Model of the thing we are measuring to calibrate, 64 bit. More...
 
typedef std::vector< cv::Point2f > MeasurementF32
 A measurement of the model as viewed on the camera. More...
 
typedef std::vector< cv::Point2d > MeasurementF64
 In doubles, because OpenCV can't agree on a single type to use. More...
 
typedef std::vector< ModelF32ArrayOfModelF32s
 For each MeasurementF32 we take we also save the ModelF32. More...
 
typedef std::vector< ModelF64ArrayOfModelF64s
 For each MeasurementF64 we take we also save the ModelF64. More...
 
typedef std::vector< MeasurementF32ArrayOfMeasurementF32s
 A array of MeasurementF32. More...
 
typedef std::vector< MeasurementF64ArrayOfMeasurementF64s
 A array of MeasurementF64. More...
 
typedef std::vector< cv::Rect > ArrayOfRects
 A array of bounding rects. More...
 

Functions

void t_calibration_frame (struct xrt_frame_sink *xsink, struct xrt_frame *xf)
 
int t_calibration_stereo_create (struct xrt_frame_context *xfctx, const struct t_calibration_params *params, struct t_calibration_status *status, struct xrt_frame_sink *gui, struct xrt_frame_sink **out_sink)
 Create the camera calibration frame sink. More...
 

Detailed Description

Calibration code.

Author
Pete Black pblac.nosp@m.k@co.nosp@m.llabo.nosp@m.ra.c.nosp@m.om
Jakob Bornecrantz jakob.nosp@m.@col.nosp@m.labor.nosp@m.a.co.nosp@m.m
Ryan Pavlik ryan..nosp@m.pavl.nosp@m.ik@co.nosp@m.llab.nosp@m.ora.c.nosp@m.om

Macro Definition Documentation

◆ P

#define P (   ...)    snprintf(c.text, sizeof(c.text), __VA_ARGS__)

Typedef Documentation

◆ ArrayOfMeasurementF32s

typedef std::vector<MeasurementF32> ArrayOfMeasurementF32s

A array of MeasurementF32.

◆ ArrayOfMeasurementF64s

typedef std::vector<MeasurementF64> ArrayOfMeasurementF64s

A array of MeasurementF64.

◆ ArrayOfModelF32s

typedef std::vector<ModelF32> ArrayOfModelF32s

For each MeasurementF32 we take we also save the ModelF32.

◆ ArrayOfModelF64s

typedef std::vector<ModelF64> ArrayOfModelF64s

For each MeasurementF64 we take we also save the ModelF64.

◆ ArrayOfRects

typedef std::vector<cv::Rect> ArrayOfRects

A array of bounding rects.

◆ MeasurementF32

typedef std::vector<cv::Point2f> MeasurementF32

A measurement of the model as viewed on the camera.

◆ MeasurementF64

typedef std::vector<cv::Point2d> MeasurementF64

In doubles, because OpenCV can't agree on a single type to use.

◆ ModelF32

typedef std::vector<cv::Point3f> ModelF32

Model of the thing we are measuring to calibrate, 32 bit.

◆ ModelF64

typedef std::vector<cv::Point3d> ModelF64

Model of the thing we are measuring to calibrate, 64 bit.

Function Documentation

◆ t_calibration_frame()

void t_calibration_frame ( struct xrt_frame_sink xsink,
struct xrt_frame xf 
)

◆ t_calibration_stereo_create()

int t_calibration_stereo_create ( struct xrt_frame_context xfctx,
const struct t_calibration_params params,
struct t_calibration_status status,
struct xrt_frame_sink gui,
struct xrt_frame_sink **  out_sink 
)

Create the camera calibration frame sink.

Parameters
xfctxContext for frame transport.
paramsParameters to use during calibration. Values copied, pointer not retained.
statusOptional pointer to structure for status information. Pointer retained, and pointed-to struct modified.
guiFrame sink
out_sinkOutput: created frame sink.

References t_calibration_params::asymmetric_circles, Calibration::base, Calibration::board, t_calibration_params::checkers, t_calibration_params::circles, t_calibration_params::cols, t_calibration_params::diagonal_distance_meters, Calibration::dims, t_calibration_params::distance_meters, Calibration::enabled, t_calibration_params::enabled, Calibration::gui, Calibration::load, t_calibration_params::load, Calibration::mirror_rgb_image, t_calibration_params::mirror_rgb_image, Calibration::num_collect_restart, t_calibration_params::num_collect_restart, Calibration::num_collect_total, t_calibration_params::num_collect_total, Calibration::num_cooldown_frames, t_calibration_params::num_cooldown_frames, Calibration::num_images, t_calibration_params::num_images, Calibration::num_wait_for, t_calibration_params::num_wait_for, P, Calibration::pattern, t_calibration_params::pattern, xrt_frame_sink::push_frame, t_calibration_params::rows, Calibration::save_images, t_calibration_params::save_images, Calibration::sink, t_calibration_params::size_meters, Calibration::spacing_meters, Calibration::status, Calibration::stereo_sbs, t_calibration_params::stereo_sbs, Calibration::subpixel_enable, t_calibration_params::subpixel_enable, Calibration::subpixel_size, t_calibration_params::subpixel_size, T_BOARD_ASYMMETRIC_CIRCLES, T_BOARD_CHECKERS, T_BOARD_CIRCLES, t_calibration_frame(), Calibration::use_fisheye, and t_calibration_params::use_fisheye.