Assorted camera tracker improvements
authorKeir Mierle <mierle@gmail.com>
Wed, 9 Nov 2011 10:07:43 +0000 (10:07 +0000)
committerKeir Mierle <mierle@gmail.com>
Wed, 9 Nov 2011 10:07:43 +0000 (10:07 +0000)
commitd4fec9f19f2b726a0cf6991c1572ef3bc4de865f
tree750879fcd8f1fb3bb420e2c89a2a8ce78f0e39fb
parentaf5526e58c7e148e95c013cd17d3a962cfeb74b0
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.
23 files changed:
extern/libmv/CMakeLists.txt
extern/libmv/libmv-capi.cpp
extern/libmv/libmv-capi.h
extern/libmv/libmv/simple_pipeline/bundle.cc
extern/libmv/libmv/simple_pipeline/bundle.h
extern/libmv/libmv/simple_pipeline/camera_intrinsics.cc
extern/libmv/libmv/simple_pipeline/camera_intrinsics.h
extern/libmv/libmv/simple_pipeline/initialize_reconstruction.cc
extern/libmv/libmv/simple_pipeline/pipeline.cc
extern/libmv/libmv/tracking/esm_region_tracker.cc [new file with mode: 0644]
extern/libmv/libmv/tracking/esm_region_tracker.h [new file with mode: 0644]
extern/libmv/libmv/tracking/klt_region_tracker.cc
extern/libmv/libmv/tracking/lmicklt_region_tracker.cc [new file with mode: 0644]
extern/libmv/libmv/tracking/lmicklt_region_tracker.h [new file with mode: 0644]
extern/libmv/libmv/tracking/pyramid_region_tracker.cc
extern/libmv/libmv/tracking/trklt_region_tracker.cc
extern/libmv/third_party/ssba/Geometry/v3d_metricbundle.cpp
extern/libmv/third_party/ssba/Geometry/v3d_metricbundle.h
release/scripts/startup/bl_ui/space_clip.py
source/blender/blenkernel/intern/tracking.c
source/blender/editors/space_clip/tracking_ops.c
source/blender/makesdna/DNA_tracking_types.h
source/blender/makesrna/intern/rna_tracking.c