Commit Graph

25 Commits

Author SHA1 Message Date
Sergey Sharybin
59d1387c41 Improvements to weighted tracks behavior
First thing changed by this commit is making it so
Euclidean intersection takes track weight into account
when solving minimization problem. This behaves the
same exact way as it is for BA step.

Second thing is related on how average reprojection error
is being calculated. It didn't take track weight into
account which could confuse users. Now average reprojection
error will give the same result as intersection/BA uses
during minimization which gives much more predictable
behavior.

Differential Revision: https://developer.blender.org/D265
2014-01-28 17:25:47 +06:00
Sergey Sharybin
1c0cdc385f Fixes for keyframe selection
Using tracks with constant zero weight used to crash
keyframe selection since it was trying to use missing
parameter blocks for Jacobian evaluation,

Also fixed possible issues with wrong camera block being
marked as variable. This could technically happen when
having zero weighted tracks. Made it so all camera blocks
are marked as variable for now.
2014-01-28 16:54:50 +06:00
Sergey Sharybin
9178dc9d38 Rework detector API and implement Harris detector
Switch the detector API to a single function which accepts
a float image and detector options. This makes usage of
feature detection more unified across different algorithms.

Options structure is pretty much straightforward and contains
detector to be used and all the detector-specific settings.

Also implemented Harris feature detection algorithm which
is not as fast as FAST one but is expected to detect more
robust feature points. It is also likely that less features
are detected, but better quality than quantity.

Blender will now use Harris detector by default, later we'll
remove FAST detector.
2014-01-28 15:37:19 +06:00
Sergey Sharybin
2d8545f87e Fix compilation error on NetBSD
Original patch is by Jeorg Sonnenberger, thanks!
2014-01-09 16:03:02 +06:00
Sergey Sharybin
f9e0ac4ced Code and style cleanup
Mainly fixed some style warnings reported by cpplint.

Also changed how camera (un)distortion happens internally
by replacing number of channels as a template argument
with number as channels passing as function argument.
Makes code easier to follow by eliminating loads checks
how much channels are used and which argument to pass to
the template.
2014-01-02 15:24:46 +06:00
Sergey Sharybin
5d701c6d25 Re-bundle libmv from new upstream repository
No functional changes, just to make sure all the patches
are ported nicely and that update scripts works fine.
2014-01-01 22:32:48 +06:00
Sergey Sharybin
f32615653b Update libmv from own branch
Fixes compilation error on win32 and shall give few
cpu ticks boost by passing vectors by reference rather
than by value.
2013-06-01 10:30:46 +00:00
Sergey Sharybin
c5b4983eca Remove files unused by blender's tracker
They were giving compilation error with msvc2012,
and instead of having workaround in them let's
drop them away form blender (they're not used even).
2013-05-30 12:05:20 +00:00
Sergey Sharybin
d4c6ac9a60 Cleanup and small improvements to libmv
- Added const modifiers where it makes sense and
  helps keep code safe.
- Reshuffled argument to match <inputs>,<outputs>
  convention on parameters.
- Pass values to ApplyRadialDistortionCameraIntrinsics
  by a constant reference.
  This will save lots of CPU ticks passing relatively
  heavy jet objects to this function when running
  bundle adjustment.
2013-05-13 14:39:06 +00:00
Sergey Sharybin
5637b0d39b Update bundled version of libmv
- Ensures fix for msvc2012 is applying correct.
- Some code cleanup to match libmv's code style.
- Do not include points which were intersect
  behind the camera to a reconstruction.
- Includes changes needed for keyframe selection.
2013-05-12 17:06:00 +00:00
Sergey Sharybin
3a309a8313 Synchronize changes between bunded libmv and own libmv branch. 2013-05-10 06:26:01 +00:00
Sergey Sharybin
8cca2fec82 Fix for bundle adjusting with motion restricted
This commit bundles new libmv version from own branch
which brings fix for wrong parameter block used for
modal solver parameterization.

Fixes #34985: Crash with Motion tracker (Tripod Motion)
2013-04-14 23:43:00 +00:00
Sergey Sharybin
898ba93a12 Update libmv to current upstream version
- Solves some strict compilation warning
- Style/code cleanup
2013-04-05 09:23:20 +00:00
Sergey Sharybin
9da36d3ab1 Updates to libmv's bundle.sh to make sure libmv upstream
is copying properly to our sources.
2013-03-01 11:52:38 +00:00
Sergey Sharybin
a0d646d186 Synchronize libmv with own branch
Should be no functional changes, just would help a lot
checking on which stuff was/shall be merged from tomato
and which is not.
2013-02-25 09:27:57 +00:00
Sergey Sharybin
0d7e4f3229 Camera tracking: synchronize changes with own branch
Should be no functional changes.
2012-12-20 11:03:39 +00:00
Sergey Sharybin
b73307471f Synchronize libmv with changes in git branch 2012-05-10 10:39:28 +00:00
Sergey Sharybin
efb9b6c1c3 libmv: bundle new upstream version of libmv from own branch
Added modal solver module which is needed for tripod solving.
For details of this solver read changelog of libmv.
2012-04-14 12:02:39 +00:00
Sergey Sharybin
e6c45cc1de libmv: bundle new upstream version from own branch with rigid registration implementation
Currently not used in blender code but is needed for some current work.
2012-04-12 11:37:51 +00:00
Sergey Sharybin
ce95b0be1e libmv: bundle new upstream version from own branch which should support
compilation of glog on hurd platform.
2012-04-11 13:51:37 +00:00
Sergey Sharybin
b22e06bf7b Re-bundle libmv from own branch.
Should resolve compilation error on some platforms when using linux and
compilation error of libmv on FreeBSB.

It was a regression caused by not applied changes on config_linux.h
and some changes made to utilities.cc were also occasionally missed.
2012-03-12 08:45:06 +00:00
Sergey Sharybin
42b3463030 Bundle new upstream version of libmv from own branch
This version of libmv includes new gflags and glog libraries which makes
it possible to compile libmv with clang compiler.

Also remove code from CMakeLists which was disabling libmv if using clang.

Tested on linux with gcc-4.6 and clang-3.0, windows cmake+msvc and scons+mingw.
Could be some issues with other platforms/build system which shall be simple to resolve.
2012-03-11 19:52:25 +00:00
Sergey Sharybin
2fce23c99a Returning magic _USE_MATH_DEFINES to esm tracker.
Needed to make constants like M_E defined in msvc. Was occasionally
removed on moving main changes in libmv from patch files in blender
repo to won repo (rev44190).
2012-02-17 17:34:16 +00:00
Sergey Sharybin
17f6f7e2af Camera tracking: switch to own repo of libmv where most of patches are applied
and which includes latest changes from Keir's branch.

Hopefully it'll make backporting of changes back to main libmv repo easier.
2012-02-17 15:39:32 +00:00
Sergey Sharybin
27d42c63d9 Camera tracking integration
===========================

Commiting camera tracking integration gsoc project into trunk.

This commit includes:

- Bundled version of libmv library (with some changes against official repo,
  re-sync with libmv repo a bit later)
- New datatype ID called MovieClip which is optimized to work with movie
  clips (both of movie files and image sequences) and doing camera/motion
  tracking operations.
- New editor called Clip Editor which is currently used for motion/tracking
  stuff only, but which can be easily extended to work with masks too.

  This editor supports:
  * Loading movie files/image sequences
  * Build proxies with different size for loaded movie clip, also supports
    building undistorted proxies to increase speed of playback in
    undistorted mode.
  * Manual lens distortion mode calibration using grid and grease pencil
  * Supervised 2D tracking using two different algorithms KLT and SAD.
  * Basic algorithm for feature detection
  * Camera motion solving. scene orientation

- New constraints to "link" scene objects with solved motions from clip:

  * Follow Track (make object follow 2D motion of track with given name
    or parent object to reconstructed 3D position of track)
  * Camera Solver to make camera moving in the same way as reconstructed camera

This commit NOT includes changes from tomato branch:

- New nodes (they'll be commited as separated patch)
- Automatic image offset guessing for image input node and image editor
  (need to do more tests and gather more feedback)
- Code cleanup in libmv-capi. It's not so critical cleanup, just increasing
  readability and understanadability of code. Better to make this chaneg when
  Keir will finish his current patch.

More details about this project can be found on this page:
    http://wiki.blender.org/index.php/User:Nazg-gul/GSoC-2011

Further development of small features would be done in trunk, bigger/experimental
features would first be implemented in tomato branch.
2011-11-07 12:55:18 +00:00