4 * ***** BEGIN GPL LICENSE BLOCK *****
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public License
8 * as published by the Free Software Foundation; either version 2
9 * of the License, or (at your option) any later version.
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software Foundation,
18 * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
20 * The Original Code is Copyright (C) 2011 Blender Foundation.
21 * All rights reserved.
23 * Contributor(s): Blender Foundation,
26 * ***** END GPL LICENSE BLOCK *****
36 struct libmv_RegionTracker;
38 struct libmv_Reconstruction;
42 void libmv_initLogging(const char *argv0);
43 void libmv_startDebugLogging(void);
44 void libmv_setLoggingVerbosity(int verbosity);
47 struct libmv_RegionTracker *libmv_regionTrackerNew(int max_iterations, int pyramid_level, double tolerance);
48 int libmv_regionTrackerTrack(struct libmv_RegionTracker *tracker, const float *ima1, const float *ima2,
49 int width, int height, int half_window_size,
50 double x1, double y1, double *x2, double *y2);
51 void libmv_regionTrackerDestroy(struct libmv_RegionTracker *tracker);
54 struct libmv_Tracks *libmv_tracksNew(void);
55 void libmv_tracksInsert(struct libmv_Tracks *tracks, int image, int track, double x, double y);
56 void libmv_tracksDestroy(struct libmv_Tracks *tracks);
58 /* Reconstruction solver */
59 struct libmv_Reconstruction *libmv_solveReconstruction(struct libmv_Tracks *tracks, int keyframe1, int keyframe2,
60 double focal_length, double principal_x, double principal_y, double k1, double k2, double k3);
61 int libmv_reporojectionPointForTrack(struct libmv_Reconstruction *libmv_reconstruction, int track, double pos[3]);
62 int libmv_reporojectionCameraForImage(struct libmv_Reconstruction *libmv_reconstruction, int image, double mat[4][4]);
63 float libmv_reprojectionError(struct libmv_Reconstruction *libmv_reconstruction);
64 void libmv_destroyReconstruction(struct libmv_Reconstruction *libmv_reconstruction);
66 /* feature detector */
68 struct libmv_Corners *libmv_detectCorners(unsigned char *data, int width, int height, int stride);
69 int libmv_countCorners(struct libmv_Corners *corners);
70 void libmv_getCorner(struct libmv_Corners *corners, int number, float *x, float *y, float *score, float *size);
71 void libmv_destroyCorners(struct libmv_Corners *corners);
74 void libmv_applyCameraIntrinsics(double focal_length, double principal_x, double principal_y, double k1, double k2, double k3,
75 double x, double y, double *x1, double *y1);
76 void libmv_InvertIntrinsics(double focal_length, double principal_x, double principal_y, double k1, double k2, double k3,
77 double x, double y, double *x1, double *y1);
83 #endif // LIBMV_C_API_H