Files
test/extern/libmv/third_party/ssba
Sergey Sharybin d279e8891f 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
..
2011-07-07 17:58:33 +00:00
2011-07-07 17:58:33 +00:00
2011-07-07 17:58:33 +00:00
2011-07-07 17:58:33 +00:00
2011-07-07 17:58:33 +00:00

Description

This is an implementation of a sparse Levenberg-Marquardt optimization
procedure and several bundle adjustment modules based on it. There are three
versions of bundle adjustment:
1) Pure metric adjustment. Camera poses have 6 dof and 3D points have 3 dof.
2) Common, but adjustable intrinsic and distortion parameters. This is useful,
   if the set of images are taken with the same camera under constant zoom
   settings.
3) Variable intrinsics and distortion parameters for each view. This addresses
   the "community photo collection" setting, where each image is captured with
   a different camera and/or with varying zoom setting.

There are two demo applications in the Apps directory, bundle_common and
bundle_varying, which correspond to item 2) and 3) above.

The input data file for both applications is a text file with the following
numerical values:

First, the number of 3D points, views and 2D measurements:
<M> <N> <K>
Then, the values of the intrinsic matrix
    [ fx  skew  cx ]
K = [  0   fy   cy ]
    [  0    0    1 ],
and the distortion parameters according to the convention of the Bouget
toolbox:

  <fx> <skew> <cx> <fy> <cy> <k1> <k2> <p1> <p2>

For the bundle_varying application this is given <N> times, one for each
camera/view.
Then the <M> 3D point positions are given:

  <point-id> <X> <Y> <Z>

Note: the point-ids need not to be exactly from 0 to M-1, any (unique) ids
will do.
The camera poses are given subsequently:

  <view-id> <12 entries of the RT matrix>

There is a lot of confusion how to specify the orientation of cameras. We use
projection matrix notation, i.e. P = K [R|T], and a 3D point X in world
coordinates is transformed into the camera coordinate system by XX=R*X+T.

Finally, the <K> 2d image measurements (given in pixels) are provided:

  <view-id> <point-id> <x> <y> 1

See the example in the Dataset folder.


Performance

This software is able to perform successful loop closing for a video sequence
containing 1745 views, 37920 3D points and 627228 image measurements in about
16min on a 2.2 GHz Core 2. The footprint in memory was <700MB.


Requirements

Solving the augmented normal equation in the LM optimizer is done with LDL, a
Cholsky like decomposition method for sparse matrices (see
http://www.cise.ufl.edu/research/sparse/ldl). The appropriate column
reordering is done with COLAMD (see
http://www.cise.ufl.edu/research/sparse/colamd). Both packages are licensed
under the GNU LGPL.

This software was developed under Linux, but should compile equally well on
other operating systems.

-Christopher Zach (cmzach@cs.unc.edu)

/*
Copyright (c) 2008 University of North Carolina at Chapel Hill

This file is part of SSBA (Simple Sparse Bundle Adjustment).

SSBA is free software: you can redistribute it and/or modify it under the
terms of the GNU Lesser General Public License as published by the Free
Software Foundation, either version 3 of the License, or (at your option) any
later version.

SSBA 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 Lesser General Public License for more
details.

You should have received a copy of the GNU Lesser General Public License along
with SSBA. If not, see <http://www.gnu.org/licenses/>.
*/