50
50
int width, int height, double x1, double y1, double *x2, double *y2);
51
51
void libmv_regionTrackerDestroy(struct libmv_RegionTracker *libmv_tracker);
53
/* TrackRegion (new planar tracker) */
54
struct libmv_trackRegionOptions {
58
int use_normalization;
59
double minimum_correlation;
64
struct libmv_trackRegionResult {
66
const char *termination_reason;
70
int libmv_trackRegion(const struct libmv_trackRegionOptions *options,
71
const float *image1, int image1_width, int image1_height,
72
const float *image2, int image2_width, int image2_height,
73
const double *x1, const double *y1,
74
struct libmv_trackRegionResult *result,
75
double *x2, double *y2);
77
void libmv_samplePlanarPatch(const float *image, int width, int height,
78
int channels, const double *xs, const double *ys,
79
int num_samples_x, int num_samples_y,
80
const float *mask, float *patch,
81
double *warped_position_x, double *warped_position_y);
54
84
struct libmv_Tracks *libmv_tracksNew(void);
55
85
void libmv_tracksInsert(struct libmv_Tracks *libmv_tracks, int image, int track, double x, double y);
61
91
#define LIBMV_REFINE_RADIAL_DISTORTION_K1 (1<<2)
62
92
#define LIBMV_REFINE_RADIAL_DISTORTION_K2 (1<<4)
94
/* TODO: make keyframes/distortion model a part of options? */
95
struct libmv_reconstructionOptions {
96
double success_threshold;
97
int use_fallback_reconstruction;
64
100
typedef void (*reconstruct_progress_update_cb) (void *customdata, double progress, const char *message);
66
102
int libmv_refineParametersAreValid(int parameters);
68
104
struct libmv_Reconstruction *libmv_solveReconstruction(struct libmv_Tracks *tracks, int keyframe1, int keyframe2,
69
105
int refine_intrinsics, double focal_length, double principal_x, double principal_y, double k1, double k2, double k3,
106
struct libmv_reconstructionOptions *options, reconstruct_progress_update_cb progress_update_callback,
107
void *callback_customdata);
108
struct libmv_Reconstruction *libmv_solveModal(struct libmv_Tracks *tracks, double focal_length,
109
double principal_x, double principal_y, double k1, double k2, double k3,
70
110
reconstruct_progress_update_cb progress_update_callback, void *callback_customdata);
71
111
int libmv_reporojectionPointForTrack(struct libmv_Reconstruction *libmv_reconstruction, int track, double pos[3]);
72
112
double libmv_reporojectionErrorForTrack(struct libmv_Reconstruction *libmv_reconstruction, int track);
116
156
void libmv_undistortByte(double focal_length, double principal_x, double principal_y, double k1, double k2, double k3,
117
unsigned char *src, unsigned char *dst, int width, int height, int channels);
157
unsigned char *src, unsigned char *dst, int width, int height, float overscan, int channels);
118
158
void libmv_undistortFloat(double focal_length, double principal_x, double principal_y, double k1, double k2, double k3,
119
float *src, float *dst, int width, int height, int channels);
159
float *src, float *dst, int width, int height, float overscan, int channels);
121
161
void libmv_distortByte(double focal_length, double principal_x, double principal_y, double k1, double k2, double k3,
122
unsigned char *src, unsigned char *dst, int width, int height, int channels);
162
unsigned char *src, unsigned char *dst, int width, int height, float overscan, int channels);
123
163
void libmv_distortFloat(double focal_length, double principal_x, double principal_y, double k1, double k2, double k3,
124
float *src, float *dst, int width, int height, int channels);
164
float *src, float *dst, int width, int height, float overscan, int channels);
127
167
void libmv_applyCameraIntrinsics(double focal_length, double principal_x, double principal_y, double k1, double k2, double k3,