OLD | NEW |
(Empty) | |
| 1 /* |
| 2 * ***** BEGIN GPL LICENSE BLOCK ***** |
| 3 * |
| 4 * This program is free software; you can redistribute it and/or |
| 5 * modify it under the terms of the GNU General Public License |
| 6 * as published by the Free Software Foundation; either version 2 |
| 7 * of the License, or (at your option) any later version. |
| 8 * |
| 9 * This program is distributed in the hope that it will be useful, |
| 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 12 * GNU General Public License for more details. |
| 13 * |
| 14 * You should have received a copy of the GNU General Public License |
| 15 * along with this program; if not, write to the Free Software Foundation, |
| 16 * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. |
| 17 * |
| 18 * The Original Code is Copyright (C) 2011 Blender Foundation. |
| 19 * All rights reserved. |
| 20 * |
| 21 * Contributor(s): Blender Foundation, |
| 22 * Sergey Sharybin |
| 23 * |
| 24 * ***** END GPL LICENSE BLOCK ***** |
| 25 */ |
| 26 |
| 27 #ifndef LIBMV_C_API_H |
| 28 #define LIBMV_C_API_H |
| 29 |
| 30 #ifdef __cplusplus |
| 31 extern "C" { |
| 32 #endif |
| 33 |
| 34 struct libmv_RegionTracker; |
| 35 struct libmv_Tracks; |
| 36 struct libmv_Reconstruction; |
| 37 struct libmv_Features; |
| 38 struct libmv_CameraIntrinsics; |
| 39 |
| 40 /* Logging */ |
| 41 void libmv_initLogging(const char *argv0); |
| 42 void libmv_startDebugLogging(void); |
| 43 void libmv_setLoggingVerbosity(int verbosity); |
| 44 |
| 45 /* RegionTracker */ |
| 46 struct libmv_RegionTracker *libmv_regionTrackerNew(int max_iterations, int pyram
id_level, double tolerance); |
| 47 int libmv_regionTrackerTrack(struct libmv_RegionTracker *libmv_tracker, const fl
oat *ima1, const float *ima2, |
| 48 int width, int height, int half_window_size, |
| 49 double x1, double y1, double *x2, double *y2); |
| 50 void libmv_regionTrackerDestroy(struct libmv_RegionTracker *libmv_tracker); |
| 51 |
| 52 /* SAD Tracker */ |
| 53 void libmv_SADSamplePattern(unsigned char *image, int stride, |
| 54 float warp[3][2], unsigned char *pattern); |
| 55 float libmv_SADTrackerTrack(unsigned char *pattern, unsigned char *warped, unsig
ned char *image, |
| 56 int stride, int width, int height, float warp[3][2]); |
| 57 |
| 58 /* Tracks */ |
| 59 struct libmv_Tracks *libmv_tracksNew(void); |
| 60 void libmv_tracksInsert(struct libmv_Tracks *libmv_tracks, int image, int track,
double x, double y); |
| 61 void libmv_tracksDestroy(struct libmv_Tracks *libmv_tracks); |
| 62 |
| 63 /* Reconstruction solver */ |
| 64 struct libmv_Reconstruction *libmv_solveReconstruction(struct libmv_Tracks *trac
ks, int keyframe1, int keyframe2, |
| 65 double focal_length, double principal_x, double principa
l_y, double k1, double k2, double k3); |
| 66 int libmv_reporojectionPointForTrack(struct libmv_Reconstruction *libmv_reconstr
uction, int track, double pos[3]); |
| 67 double libmv_reporojectionErrorForTrack(struct libmv_Reconstruction *libmv_recon
struction, int track); |
| 68 double libmv_reporojectionErrorForImage(struct libmv_Reconstruction *libmv_recon
struction, int image); |
| 69 int libmv_reporojectionCameraForImage(struct libmv_Reconstruction *libmv_reconst
ruction, int image, double mat[4][4]); |
| 70 double libmv_reprojectionError(struct libmv_Reconstruction *libmv_reconstruction
); |
| 71 void libmv_destroyReconstruction(struct libmv_Reconstruction *libmv_reconstructi
on); |
| 72 |
| 73 /* feature detector */ |
| 74 struct libmv_Features *libmv_detectFeaturesFAST(unsigned char *data, int width,
int height, int stride, |
| 75 int margin, int min_trackness, int min_distance); |
| 76 struct libmv_Features *libmv_detectFeaturesMORAVEC(unsigned char *data, int widt
h, int height, int stride, |
| 77 int margin, int count, int min_distance); |
| 78 int libmv_countFeatures(struct libmv_Features *libmv_features); |
| 79 void libmv_getFeature(struct libmv_Features *libmv_features, int number, double
*x, double *y, double *score, double *size); |
| 80 void libmv_destroyFeatures(struct libmv_Features *libmv_features); |
| 81 |
| 82 /* camera intrinsics */ |
| 83 struct libmv_CameraIntrinsics *libmv_CameraIntrinsicsNew(double focal_length, do
uble principal_x, double principal_y, |
| 84 double k1, double k2, double k3, int width, int height); |
| 85 |
| 86 struct libmv_CameraIntrinsics *libmv_CameraIntrinsicsCopy(struct libmv_CameraInt
rinsics *libmvIntrinsics); |
| 87 |
| 88 struct libmv_CameraIntrinsics *libmv_CameraIntrinsicsCopy(struct libmv_CameraInt
rinsics *libmvIntrinsics); |
| 89 |
| 90 void libmv_CameraIntrinsicsDestroy(struct libmv_CameraIntrinsics *libmvIntrinsic
s); |
| 91 |
| 92 void libmv_CameraIntrinsicsUpdate(struct libmv_CameraIntrinsics *libmvIntrinsics
, double focal_length, |
| 93 double principal_x, double principal_y, double k1, doubl
e k2, double k3, int width, int height); |
| 94 |
| 95 void libmv_CameraIntrinsicsUndistortByte(struct libmv_CameraIntrinsics *libmvInt
rinsics, |
| 96 unsigned char *src, unsigned char *dst, int width, int h
eight, float overscan, int channels); |
| 97 |
| 98 void libmv_CameraIntrinsicsUndistortFloat(struct libmv_CameraIntrinsics *libmvIn
trinsics, |
| 99 float *src, float *dst, int width, int height, float ove
rscan, int channels); |
| 100 |
| 101 void libmv_CameraIntrinsicsDistortByte(struct libmv_CameraIntrinsics *libmvIntri
nsics, |
| 102 unsigned char *src, unsigned char *dst, int width, int h
eight, float overscan, int channels); |
| 103 |
| 104 void libmv_CameraIntrinsicsDistortFloat(struct libmv_CameraIntrinsics *libmvIntr
insics, |
| 105 float *src, float *dst, int width, int height, float ove
rscan, int channels); |
| 106 |
| 107 /* dsitortion */ |
| 108 void libmv_undistortByte(double focal_length, double principal_x, double princip
al_y, double k1, double k2, double k3, |
| 109 unsigned char *src, unsigned char *dst, int width, int h
eight, int channels); |
| 110 void libmv_undistortFloat(double focal_length, double principal_x, double princi
pal_y, double k1, double k2, double k3, |
| 111 float *src, float *dst, int width, int height, int chann
els); |
| 112 |
| 113 void libmv_distortByte(double focal_length, double principal_x, double principal
_y, double k1, double k2, double k3, |
| 114 unsigned char *src, unsigned char *dst, int width, int h
eight, int channels); |
| 115 void libmv_distortFloat(double focal_length, double principal_x, double principa
l_y, double k1, double k2, double k3, |
| 116 float *src, float *dst, int width, int height, int chann
els); |
| 117 |
| 118 /* utils */ |
| 119 void libmv_applyCameraIntrinsics(double focal_length, double principal_x, double
principal_y, double k1, double k2, double k3, |
| 120 double x, double y, double *x1, double *y1); |
| 121 void libmv_InvertIntrinsics(double focal_length, double principal_x, double prin
cipal_y, double k1, double k2, double k3, |
| 122 double x, double y, double *x1, double *y1); |
| 123 |
| 124 #ifdef __cplusplus |
| 125 } |
| 126 #endif |
| 127 |
| 128 #endif // LIBMV_C_API_H |
OLD | NEW |