Commit Graph

5 Commits

Author SHA1 Message Date
Sergey Sharybin
08bd300f0e Camera tracking integration
===========================

- Changed libmv api to use doubles instead of floats.
  No real benefit rather than keeping API uniform.
- Optimized reconstructed camera search. It's optimized for
  playback, not random access.
- Added option to show projection of bundles into footage.
  To see bundles "Show Bundles" from Display panel should
  be enabled. Used very rough limit of 3 px to consider projection
  is fine. Colors are still hard-coded. Not sure it could be useful
  to make them configurable.
- Added option to mute footage. It could be useful to check
  if markers/bundles are moving smoothly.
- Added selector for focal length units.
2011-07-11 09:04:00 +00:00
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
Sergey Sharybin
0bb215eece 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
Sergey Sharybin
02ace953a9 Camera tracking integration
===========================

- itasc adopted for Eigen3 library.
  It compiles well, but need deeper testing for regressions.
- Removed Eigen2 library.
- Added settings to tracker which could be changed from UI.
- Pattern area is now affects on tracker.
  Currently libmv supports square patterns which are centered
  to marker's position. Maximal pattern dimensions is sending
  to libmv as pattern size. Would be changed when libmv would
  support non-centered and non-square patterns.
- Fixed bug with syncing pattern's flags when tracking.
- Current frame in cache line became a bit more visible.
  It's useful for me to when debugging.
- Changed behaviour of "Add Marekr" operator: not it's non-modal
  and places marker on mouse position at click.
- Added macro "Add Marekr and Move" which is used to place
  markers from toolbar button.
- Added some utility functions to get image buffer under search
  and pattern area which also returns relative position of
  marker center for this images.
  Generated images are more "correct" from coords rounding
  POV, but  re-calculation of marker position back to
  frame coords is more complicated and not implemented yet,
  so old not very accurate logic is still used.
- Added preview widget with content of pattern area.

NOTE: files saved in previous versions of this branch could
      easily crash on tracking. Use "Reset To Settings" button
      from Tracking Settings before tracking selected markers
      for such files.

TODO:
- Implement adjusting marker position from marker's
  preview widget.
- We've got an idea of sliding marker after click before
  releasing mouse button.
2011-06-14 16:22:06 +00:00
Sergey Sharybin
084040acf4 Camera tracking integration
===========================

- Added missed stub for blenderplayer, so it should
  compile again fine.
- libmv is added to extern/.
  Script for bundling needed subset of sourcses from
  libmv repo is included there.
- Eigen3 is also added to extern/.
  libmv depends on Eigen3 (which isnt't compatible with Eigen2
  from API point of view). So both of versions are going to
  be in worktree for time (until code which used Eigen2 would be
  ported to Eigen3).
- Added some functions to libmv-capi, so some things from
  this library could already be used.
- Added the very basic implementation of 2D tracking.
  It should be treated as draft for tracking architecture
  which probably would be cleaned up, changed or whatever else.
  Current implementation was supposed to demonstrate that our
  structures and understading is correct to interact with libmv easily.
2011-06-10 17:17:25 +00:00