blender/extern/libmv/libmv-capi.h

141 lines
6.8 KiB
C
Raw Normal View History

/*
* ***** BEGIN GPL LICENSE BLOCK *****
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*
Camera tracking integraiton =========================== - Corrected copyrights in my new files header. - Added debug option to dump as PNG image content of search areas tracking between which was failed. - Removed internal tracking settings like pyramid level and tolerance. Weren't useful neither for me nor for artists. - Fixed bug in BKE_tracking_get_marker which could lead to failure of getting marker for current frame when there's marker for requested frame. - Fixed bug with disappearing markers after tracking for cases when marker was added at frame different from tracking start frame and tracking start frame is equal to tracking end frame. - Stop tracking when no markers could be tracked. - Changed marker selection rules: * If marker isn't selected, all it's areas are getting selected with mouse. * If marker is selected and selection type doesn't have "extend" mode (SHIFT isn't holded down) the nearest to mouse cursor area would be selected. All the reast areas would loose selection. - Limit number of frames which would be used in "Track Markers" operator. So now you could easily track along 10/20/etc frames. - Change scene current frame after "Track Markers" operator. - Implemented speed limitors. Now tracking could happen: * As fast as possible * With reatime speed (scene FPS) * With half of realtime speed * With quarter of realtime speed. - Got rid of orig_user in MovieTrackingContext and user in TrackMarkersJob. This prevents crashes when user joins some space to SpaceClip from which tracking was started. - Made keyframes on path bigger and do not draw keyframes for non-selected markers. TODO: need to get rid of storing main, scene and screen in TrackMarkersJob. This is needed to set scene's current frame after tracking (such behavior is comfortable for artists) but this could lead to crash if scene is getting removed when tracking job is running. Render animation operator also stores scene and main, so such solution could be fine for first time before we've got something smarter.
2011-06-22 14:54:53 +00:00
* The Original Code is Copyright (C) 2011 Blender Foundation.
* All rights reserved.
*
* Contributor(s): Blender Foundation,
* Sergey Sharybin
*
* ***** END GPL LICENSE BLOCK *****
*/
#ifndef LIBMV_C_API_H
#define LIBMV_C_API_H
#ifdef __cplusplus
extern "C" {
#endif
Camera tracking integration =========================== - ColaMD moved from OpenNL to extern/. It'll be needed for libmv. Also, it's a bit updated from year 1999 to 2007. Need to be tested for regressions. - Updated bundling script for libmv. Now it uses fuller subset of this library. - Bundled new libmv. - Request from Keir: add command line argument to toggle logging stuff on. Currently, if Blender is launched with -d argument libmv would start printing logging messages. There's no argument to increase verbosity, but there's API in libmv-capi, so it'll be easy to add. - Finally fixed crash when ibuf is acquiring with user=NULL. - Added ActiveClip property to the scene. This clip is used as default value for new match-moving constraints. - Added some flags to Display panel of View3D. Related on displaying match-moving stuff. - Internal change: bundles data moved inside to MovieTrackingTrack. - Initial implementation of 3d reconstruction. - Added constraint "Camera Solver". This constraint is supposed to be used to make camera follow the reconstructed camera path. - Added "reference" property to "Follow Track" constraint. Now object could be "parented" to 2D track position or to 3D bundle position. The very quick guide: To use reconstruction you should have footage with tracked markers, choose two keyframes in "Tracking settings" panel. There should be quite noticeable parallax effect between this two frames. This is used to initialize reconstruction stuff. Camera data (focal length and optical center) should be filled in "Camera Data" panel. Optical center is often the center of image, so it'll be filled in automatically. You should also set values for undistortion (K1, K2 and K3). Currently, there's no any visualization for this parameters and approach of "change value -> reconstruct -> see what've changed" is the only way for now. Libmv team is working on auto-calibration tool, so it should be easier to gather this coefficients in nearest (i hope) future. There's also no scene orientation stuff. Basic workflow: - Open footage. - Set markers and track them. - Fill in camera data and keyframes. - Hit "Solve Camera" button. - Add "Camera Solver" constraint to camera in scene. - Choose movieclip in that constraint. - To see bundles in 3D viewport active clip should be set in scene buttons.
2011-07-07 17:58:33 +00:00
struct libmv_RegionTracker;
struct libmv_Tracks;
struct libmv_Reconstruction;
struct libmv_Features;
struct libmv_CameraIntrinsics;
Camera tracking integration =========================== - ColaMD moved from OpenNL to extern/. It'll be needed for libmv. Also, it's a bit updated from year 1999 to 2007. Need to be tested for regressions. - Updated bundling script for libmv. Now it uses fuller subset of this library. - Bundled new libmv. - Request from Keir: add command line argument to toggle logging stuff on. Currently, if Blender is launched with -d argument libmv would start printing logging messages. There's no argument to increase verbosity, but there's API in libmv-capi, so it'll be easy to add. - Finally fixed crash when ibuf is acquiring with user=NULL. - Added ActiveClip property to the scene. This clip is used as default value for new match-moving constraints. - Added some flags to Display panel of View3D. Related on displaying match-moving stuff. - Internal change: bundles data moved inside to MovieTrackingTrack. - Initial implementation of 3d reconstruction. - Added constraint "Camera Solver". This constraint is supposed to be used to make camera follow the reconstructed camera path. - Added "reference" property to "Follow Track" constraint. Now object could be "parented" to 2D track position or to 3D bundle position. The very quick guide: To use reconstruction you should have footage with tracked markers, choose two keyframes in "Tracking settings" panel. There should be quite noticeable parallax effect between this two frames. This is used to initialize reconstruction stuff. Camera data (focal length and optical center) should be filled in "Camera Data" panel. Optical center is often the center of image, so it'll be filled in automatically. You should also set values for undistortion (K1, K2 and K3). Currently, there's no any visualization for this parameters and approach of "change value -> reconstruct -> see what've changed" is the only way for now. Libmv team is working on auto-calibration tool, so it should be easier to gather this coefficients in nearest (i hope) future. There's also no scene orientation stuff. Basic workflow: - Open footage. - Set markers and track them. - Fill in camera data and keyframes. - Hit "Solve Camera" button. - Add "Camera Solver" constraint to camera in scene. - Choose movieclip in that constraint. - To see bundles in 3D viewport active clip should be set in scene buttons.
2011-07-07 17:58:33 +00:00
/* Logging */
void libmv_initLogging(const char *argv0);
void libmv_startDebugLogging(void);
void libmv_setLoggingVerbosity(int verbosity);
/* RegionTracker */
struct libmv_RegionTracker *libmv_regionTrackerNew(int max_iterations, int pyramid_level, int half_window_size);
int libmv_regionTrackerTrack(struct libmv_RegionTracker *libmv_tracker, const float *ima1, const float *ima2,
int width, int height, double x1, double y1, double *x2, double *y2);
void libmv_regionTrackerDestroy(struct libmv_RegionTracker *libmv_tracker);
Camera tracking integration =========================== - ColaMD moved from OpenNL to extern/. It'll be needed for libmv. Also, it's a bit updated from year 1999 to 2007. Need to be tested for regressions. - Updated bundling script for libmv. Now it uses fuller subset of this library. - Bundled new libmv. - Request from Keir: add command line argument to toggle logging stuff on. Currently, if Blender is launched with -d argument libmv would start printing logging messages. There's no argument to increase verbosity, but there's API in libmv-capi, so it'll be easy to add. - Finally fixed crash when ibuf is acquiring with user=NULL. - Added ActiveClip property to the scene. This clip is used as default value for new match-moving constraints. - Added some flags to Display panel of View3D. Related on displaying match-moving stuff. - Internal change: bundles data moved inside to MovieTrackingTrack. - Initial implementation of 3d reconstruction. - Added constraint "Camera Solver". This constraint is supposed to be used to make camera follow the reconstructed camera path. - Added "reference" property to "Follow Track" constraint. Now object could be "parented" to 2D track position or to 3D bundle position. The very quick guide: To use reconstruction you should have footage with tracked markers, choose two keyframes in "Tracking settings" panel. There should be quite noticeable parallax effect between this two frames. This is used to initialize reconstruction stuff. Camera data (focal length and optical center) should be filled in "Camera Data" panel. Optical center is often the center of image, so it'll be filled in automatically. You should also set values for undistortion (K1, K2 and K3). Currently, there's no any visualization for this parameters and approach of "change value -> reconstruct -> see what've changed" is the only way for now. Libmv team is working on auto-calibration tool, so it should be easier to gather this coefficients in nearest (i hope) future. There's also no scene orientation stuff. Basic workflow: - Open footage. - Set markers and track them. - Fill in camera data and keyframes. - Hit "Solve Camera" button. - Add "Camera Solver" constraint to camera in scene. - Choose movieclip in that constraint. - To see bundles in 3D viewport active clip should be set in scene buttons.
2011-07-07 17:58:33 +00:00
/* SAD Tracker */
void libmv_SADSamplePattern(unsigned char *image, int stride,
float warp[3][2], unsigned char *pattern);
float libmv_SADTrackerTrack(unsigned char *pattern, unsigned char *warped, unsigned char *image,
int stride, int width, int height, float warp[3][2]);
Camera tracking integration =========================== - ColaMD moved from OpenNL to extern/. It'll be needed for libmv. Also, it's a bit updated from year 1999 to 2007. Need to be tested for regressions. - Updated bundling script for libmv. Now it uses fuller subset of this library. - Bundled new libmv. - Request from Keir: add command line argument to toggle logging stuff on. Currently, if Blender is launched with -d argument libmv would start printing logging messages. There's no argument to increase verbosity, but there's API in libmv-capi, so it'll be easy to add. - Finally fixed crash when ibuf is acquiring with user=NULL. - Added ActiveClip property to the scene. This clip is used as default value for new match-moving constraints. - Added some flags to Display panel of View3D. Related on displaying match-moving stuff. - Internal change: bundles data moved inside to MovieTrackingTrack. - Initial implementation of 3d reconstruction. - Added constraint "Camera Solver". This constraint is supposed to be used to make camera follow the reconstructed camera path. - Added "reference" property to "Follow Track" constraint. Now object could be "parented" to 2D track position or to 3D bundle position. The very quick guide: To use reconstruction you should have footage with tracked markers, choose two keyframes in "Tracking settings" panel. There should be quite noticeable parallax effect between this two frames. This is used to initialize reconstruction stuff. Camera data (focal length and optical center) should be filled in "Camera Data" panel. Optical center is often the center of image, so it'll be filled in automatically. You should also set values for undistortion (K1, K2 and K3). Currently, there's no any visualization for this parameters and approach of "change value -> reconstruct -> see what've changed" is the only way for now. Libmv team is working on auto-calibration tool, so it should be easier to gather this coefficients in nearest (i hope) future. There's also no scene orientation stuff. Basic workflow: - Open footage. - Set markers and track them. - Fill in camera data and keyframes. - Hit "Solve Camera" button. - Add "Camera Solver" constraint to camera in scene. - Choose movieclip in that constraint. - To see bundles in 3D viewport active clip should be set in scene buttons.
2011-07-07 17:58:33 +00:00
/* Tracks */
struct libmv_Tracks *libmv_tracksNew(void);
void libmv_tracksInsert(struct libmv_Tracks *libmv_tracks, int image, int track, double x, double y);
void libmv_tracksDestroy(struct libmv_Tracks *libmv_tracks);
Camera tracking integration =========================== - ColaMD moved from OpenNL to extern/. It'll be needed for libmv. Also, it's a bit updated from year 1999 to 2007. Need to be tested for regressions. - Updated bundling script for libmv. Now it uses fuller subset of this library. - Bundled new libmv. - Request from Keir: add command line argument to toggle logging stuff on. Currently, if Blender is launched with -d argument libmv would start printing logging messages. There's no argument to increase verbosity, but there's API in libmv-capi, so it'll be easy to add. - Finally fixed crash when ibuf is acquiring with user=NULL. - Added ActiveClip property to the scene. This clip is used as default value for new match-moving constraints. - Added some flags to Display panel of View3D. Related on displaying match-moving stuff. - Internal change: bundles data moved inside to MovieTrackingTrack. - Initial implementation of 3d reconstruction. - Added constraint "Camera Solver". This constraint is supposed to be used to make camera follow the reconstructed camera path. - Added "reference" property to "Follow Track" constraint. Now object could be "parented" to 2D track position or to 3D bundle position. The very quick guide: To use reconstruction you should have footage with tracked markers, choose two keyframes in "Tracking settings" panel. There should be quite noticeable parallax effect between this two frames. This is used to initialize reconstruction stuff. Camera data (focal length and optical center) should be filled in "Camera Data" panel. Optical center is often the center of image, so it'll be filled in automatically. You should also set values for undistortion (K1, K2 and K3). Currently, there's no any visualization for this parameters and approach of "change value -> reconstruct -> see what've changed" is the only way for now. Libmv team is working on auto-calibration tool, so it should be easier to gather this coefficients in nearest (i hope) future. There's also no scene orientation stuff. Basic workflow: - Open footage. - Set markers and track them. - Fill in camera data and keyframes. - Hit "Solve Camera" button. - Add "Camera Solver" constraint to camera in scene. - Choose movieclip in that constraint. - To see bundles in 3D viewport active clip should be set in scene buttons.
2011-07-07 17:58:33 +00:00
/* Reconstruction solver */
Assorted camera tracker improvements - Add support for refining the camera's intrinsic parameters during a solve. Currently, refining supports only the following combinations of intrinsic parameters: f f, cx, cy f, cx, cy, k1, k2 f, k1 f, k1, k2 This is not the same as autocalibration, since the user must still make a reasonable initial guess about the focal length and other parameters, whereas true autocalibration would eliminate the need for the user specify intrinsic parameters at all. However, the solver works well with only rough guesses for the focal length, so perhaps full autocalibation is not that important. Adding support for the last two combinations, (f, k1) and (f, k1, k2) required changes to the library libmv depends on for bundle adjustment, SSBA. These changes should get ported upstream not just to libmv but to SSBA as well. - Improved the region of convergence for bundle adjustment by increasing the number of Levenberg-Marquardt iterations from 50 to 500. This way, the solver is able to crawl out of the bad local minima it gets stuck in when changing from, for example, bundling k1 and k2 to just k1 and resetting k2 to 0. - Add several new region tracker implementations. A region tracker is a libmv concept, which refers to tracking a template image pattern through frames. The impact to end users is that tracking should "just work better". I am reserving a more detailed writeup, and maybe a paper, for later. - Other libmv tweaks, such as detecting that a tracker is headed outside of the image bounds. This includes several changes made directly to the libmv extern code rather expecting to get those changes through normal libmv channels, because I, the libmv BDFL, decided it was faster to work on libmv directly in Blender, then later reverse-port the libmv changes from Blender back into libmv trunk. The interesting part is that I added a full Levenberg-Marquardt loop to the region tracking code, which should lead to a more stable solutions. I also added a hacky implementation of "Efficient Second-Order Minimization" for tracking, which works nicely. A more detailed quantitative evaluation will follow.
2011-11-09 10:07:43 +00:00
#define LIBMV_REFINE_FOCAL_LENGTH (1<<0)
#define LIBMV_REFINE_PRINCIPAL_POINT (1<<1)
#define LIBMV_REFINE_RADIAL_DISTORTION_K1 (1<<2)
#define LIBMV_REFINE_RADIAL_DISTORTION_K2 (1<<4)
typedef void (*reconstruct_progress_update_cb) (void *customdata, double progress, const char *message);
Assorted camera tracker improvements - Add support for refining the camera's intrinsic parameters during a solve. Currently, refining supports only the following combinations of intrinsic parameters: f f, cx, cy f, cx, cy, k1, k2 f, k1 f, k1, k2 This is not the same as autocalibration, since the user must still make a reasonable initial guess about the focal length and other parameters, whereas true autocalibration would eliminate the need for the user specify intrinsic parameters at all. However, the solver works well with only rough guesses for the focal length, so perhaps full autocalibation is not that important. Adding support for the last two combinations, (f, k1) and (f, k1, k2) required changes to the library libmv depends on for bundle adjustment, SSBA. These changes should get ported upstream not just to libmv but to SSBA as well. - Improved the region of convergence for bundle adjustment by increasing the number of Levenberg-Marquardt iterations from 50 to 500. This way, the solver is able to crawl out of the bad local minima it gets stuck in when changing from, for example, bundling k1 and k2 to just k1 and resetting k2 to 0. - Add several new region tracker implementations. A region tracker is a libmv concept, which refers to tracking a template image pattern through frames. The impact to end users is that tracking should "just work better". I am reserving a more detailed writeup, and maybe a paper, for later. - Other libmv tweaks, such as detecting that a tracker is headed outside of the image bounds. This includes several changes made directly to the libmv extern code rather expecting to get those changes through normal libmv channels, because I, the libmv BDFL, decided it was faster to work on libmv directly in Blender, then later reverse-port the libmv changes from Blender back into libmv trunk. The interesting part is that I added a full Levenberg-Marquardt loop to the region tracking code, which should lead to a more stable solutions. I also added a hacky implementation of "Efficient Second-Order Minimization" for tracking, which works nicely. A more detailed quantitative evaluation will follow.
2011-11-09 10:07:43 +00:00
int libmv_refineParametersAreValid(int parameters);
Camera tracking integration =========================== - ColaMD moved from OpenNL to extern/. It'll be needed for libmv. Also, it's a bit updated from year 1999 to 2007. Need to be tested for regressions. - Updated bundling script for libmv. Now it uses fuller subset of this library. - Bundled new libmv. - Request from Keir: add command line argument to toggle logging stuff on. Currently, if Blender is launched with -d argument libmv would start printing logging messages. There's no argument to increase verbosity, but there's API in libmv-capi, so it'll be easy to add. - Finally fixed crash when ibuf is acquiring with user=NULL. - Added ActiveClip property to the scene. This clip is used as default value for new match-moving constraints. - Added some flags to Display panel of View3D. Related on displaying match-moving stuff. - Internal change: bundles data moved inside to MovieTrackingTrack. - Initial implementation of 3d reconstruction. - Added constraint "Camera Solver". This constraint is supposed to be used to make camera follow the reconstructed camera path. - Added "reference" property to "Follow Track" constraint. Now object could be "parented" to 2D track position or to 3D bundle position. The very quick guide: To use reconstruction you should have footage with tracked markers, choose two keyframes in "Tracking settings" panel. There should be quite noticeable parallax effect between this two frames. This is used to initialize reconstruction stuff. Camera data (focal length and optical center) should be filled in "Camera Data" panel. Optical center is often the center of image, so it'll be filled in automatically. You should also set values for undistortion (K1, K2 and K3). Currently, there's no any visualization for this parameters and approach of "change value -> reconstruct -> see what've changed" is the only way for now. Libmv team is working on auto-calibration tool, so it should be easier to gather this coefficients in nearest (i hope) future. There's also no scene orientation stuff. Basic workflow: - Open footage. - Set markers and track them. - Fill in camera data and keyframes. - Hit "Solve Camera" button. - Add "Camera Solver" constraint to camera in scene. - Choose movieclip in that constraint. - To see bundles in 3D viewport active clip should be set in scene buttons.
2011-07-07 17:58:33 +00:00
struct libmv_Reconstruction *libmv_solveReconstruction(struct libmv_Tracks *tracks, int keyframe1, int keyframe2,
int refine_intrinsics, double focal_length, double principal_x, double principal_y, double k1, double k2, double k3,
reconstruct_progress_update_cb progress_update_callback, void *callback_customdata);
int libmv_reporojectionPointForTrack(struct libmv_Reconstruction *libmv_reconstruction, int track, double pos[3]);
double libmv_reporojectionErrorForTrack(struct libmv_Reconstruction *libmv_reconstruction, int track);
double libmv_reporojectionErrorForImage(struct libmv_Reconstruction *libmv_reconstruction, int image);
int libmv_reporojectionCameraForImage(struct libmv_Reconstruction *libmv_reconstruction, int image, double mat[4][4]);
double libmv_reprojectionError(struct libmv_Reconstruction *libmv_reconstruction);
void libmv_destroyReconstruction(struct libmv_Reconstruction *libmv_reconstruction);
/* feature detector */
struct libmv_Features *libmv_detectFeaturesFAST(unsigned char *data, int width, int height, int stride,
int margin, int min_trackness, int min_distance);
struct libmv_Features *libmv_detectFeaturesMORAVEC(unsigned char *data, int width, int height, int stride,
int margin, int count, int min_distance);
int libmv_countFeatures(struct libmv_Features *libmv_features);
void libmv_getFeature(struct libmv_Features *libmv_features, int number, double *x, double *y, double *score, double *size);
void libmv_destroyFeatures(struct libmv_Features *libmv_features);
/* camera intrinsics */
Assorted camera tracker improvements - Add support for refining the camera's intrinsic parameters during a solve. Currently, refining supports only the following combinations of intrinsic parameters: f f, cx, cy f, cx, cy, k1, k2 f, k1 f, k1, k2 This is not the same as autocalibration, since the user must still make a reasonable initial guess about the focal length and other parameters, whereas true autocalibration would eliminate the need for the user specify intrinsic parameters at all. However, the solver works well with only rough guesses for the focal length, so perhaps full autocalibation is not that important. Adding support for the last two combinations, (f, k1) and (f, k1, k2) required changes to the library libmv depends on for bundle adjustment, SSBA. These changes should get ported upstream not just to libmv but to SSBA as well. - Improved the region of convergence for bundle adjustment by increasing the number of Levenberg-Marquardt iterations from 50 to 500. This way, the solver is able to crawl out of the bad local minima it gets stuck in when changing from, for example, bundling k1 and k2 to just k1 and resetting k2 to 0. - Add several new region tracker implementations. A region tracker is a libmv concept, which refers to tracking a template image pattern through frames. The impact to end users is that tracking should "just work better". I am reserving a more detailed writeup, and maybe a paper, for later. - Other libmv tweaks, such as detecting that a tracker is headed outside of the image bounds. This includes several changes made directly to the libmv extern code rather expecting to get those changes through normal libmv channels, because I, the libmv BDFL, decided it was faster to work on libmv directly in Blender, then later reverse-port the libmv changes from Blender back into libmv trunk. The interesting part is that I added a full Levenberg-Marquardt loop to the region tracking code, which should lead to a more stable solutions. I also added a hacky implementation of "Efficient Second-Order Minimization" for tracking, which works nicely. A more detailed quantitative evaluation will follow.
2011-11-09 10:07:43 +00:00
struct libmv_CameraIntrinsics *libmv_ReconstructionExtractIntrinsics(struct libmv_Reconstruction *libmv_Reconstruction);
struct libmv_CameraIntrinsics *libmv_CameraIntrinsicsNew(double focal_length, double principal_x, double principal_y,
double k1, double k2, double k3, int width, int height);
struct libmv_CameraIntrinsics *libmv_CameraIntrinsicsCopy(struct libmv_CameraIntrinsics *libmvIntrinsics);
void libmv_CameraIntrinsicsDestroy(struct libmv_CameraIntrinsics *libmvIntrinsics);
void libmv_CameraIntrinsicsUpdate(struct libmv_CameraIntrinsics *libmvIntrinsics, double focal_length,
double principal_x, double principal_y, double k1, double k2, double k3, int width, int height);
Assorted camera tracker improvements - Add support for refining the camera's intrinsic parameters during a solve. Currently, refining supports only the following combinations of intrinsic parameters: f f, cx, cy f, cx, cy, k1, k2 f, k1 f, k1, k2 This is not the same as autocalibration, since the user must still make a reasonable initial guess about the focal length and other parameters, whereas true autocalibration would eliminate the need for the user specify intrinsic parameters at all. However, the solver works well with only rough guesses for the focal length, so perhaps full autocalibation is not that important. Adding support for the last two combinations, (f, k1) and (f, k1, k2) required changes to the library libmv depends on for bundle adjustment, SSBA. These changes should get ported upstream not just to libmv but to SSBA as well. - Improved the region of convergence for bundle adjustment by increasing the number of Levenberg-Marquardt iterations from 50 to 500. This way, the solver is able to crawl out of the bad local minima it gets stuck in when changing from, for example, bundling k1 and k2 to just k1 and resetting k2 to 0. - Add several new region tracker implementations. A region tracker is a libmv concept, which refers to tracking a template image pattern through frames. The impact to end users is that tracking should "just work better". I am reserving a more detailed writeup, and maybe a paper, for later. - Other libmv tweaks, such as detecting that a tracker is headed outside of the image bounds. This includes several changes made directly to the libmv extern code rather expecting to get those changes through normal libmv channels, because I, the libmv BDFL, decided it was faster to work on libmv directly in Blender, then later reverse-port the libmv changes from Blender back into libmv trunk. The interesting part is that I added a full Levenberg-Marquardt loop to the region tracking code, which should lead to a more stable solutions. I also added a hacky implementation of "Efficient Second-Order Minimization" for tracking, which works nicely. A more detailed quantitative evaluation will follow.
2011-11-09 10:07:43 +00:00
void libmv_CameraIntrinsicsExtract(struct libmv_CameraIntrinsics *libmvIntrinsics, double *focal_length,
double *principal_x, double *principal_y, double *k1, double *k2, double *k3, int *width, int *height);
void libmv_CameraIntrinsicsUndistortByte(struct libmv_CameraIntrinsics *libmvIntrinsics,
unsigned char *src, unsigned char *dst, int width, int height, float overscan, int channels);
void libmv_CameraIntrinsicsUndistortFloat(struct libmv_CameraIntrinsics *libmvIntrinsics,
float *src, float *dst, int width, int height, float overscan, int channels);
void libmv_CameraIntrinsicsDistortByte(struct libmv_CameraIntrinsics *libmvIntrinsics,
unsigned char *src, unsigned char *dst, int width, int height, float overscan, int channels);
void libmv_CameraIntrinsicsDistortFloat(struct libmv_CameraIntrinsics *libmvIntrinsics,
float *src, float *dst, int width, int height, float overscan, int channels);
/* dsitortion */
void libmv_undistortByte(double focal_length, double principal_x, double principal_y, double k1, double k2, double k3,
unsigned char *src, unsigned char *dst, int width, int height, int channels);
void libmv_undistortFloat(double focal_length, double principal_x, double principal_y, double k1, double k2, double k3,
float *src, float *dst, int width, int height, int channels);
void libmv_distortByte(double focal_length, double principal_x, double principal_y, double k1, double k2, double k3,
unsigned char *src, unsigned char *dst, int width, int height, int channels);
void libmv_distortFloat(double focal_length, double principal_x, double principal_y, double k1, double k2, double k3,
float *src, float *dst, int width, int height, int channels);
/* utils */
void libmv_applyCameraIntrinsics(double focal_length, double principal_x, double principal_y, double k1, double k2, double k3,
double x, double y, double *x1, double *y1);
void libmv_InvertIntrinsics(double focal_length, double principal_x, double principal_y, double k1, double k2, double k3,
double x, double y, double *x1, double *y1);
#ifdef __cplusplus
}
#endif
#endif // LIBMV_C_API_H