Commit Graph

691 Commits

Author SHA1 Message Date
Campbell Barton
0c8ebad16e add cmake option WITH_SYSTEM_OPENJPEG so linux can build cycles without having libopenjpeg installed. 2012-06-23 14:23:44 +00:00
Campbell Barton
263be14811 rename WITH_BUILTIN_GLEW, WITH_SYSTEM_GLEW & negate. 2012-06-23 13:42:14 +00:00
Campbell Barton
c250ab893c update libopenjpeg from 1.3 to 1.5, since 1.3 has a bug saving alpha channels.
the patches/ dir is NOT applied but perhaps we can get OSX and BSD working using the opj_config.h
2012-06-21 09:47:30 +00:00
Campbell Barton
f5f25b81e8 style cleanup:
also fix for building ghost test and fix double free in one of the tests
2012-06-17 09:58:26 +00:00
Sergey Sharybin
554107b6a1 Disable fixed-sized specializations for schur solver
As far as i remember Keir, this should be safe for our usages of ceres
and it should save noticeable amount of time and used memory when
compiling blender with libmv support.

Quick tests with tracking went smooth after this.
2012-06-14 13:33:37 +00:00
Campbell Barton
17d5ac0abf quiet compiler warning 2012-06-14 10:54:14 +00:00
Sergey Sharybin
552887251f Masking support for motion tracks
Added option to use Grease Pencil datablock as a mask for pattern
when doing motion tracking. Option could be found in Tracking Settings
panel.

All strokes would be rasterized separately from each other and every
stroke is treating as a closed spline.

Also added option to apply a mask on track preview which is situated
just after B/B/W channel button under track preview.
2012-06-12 11:13:53 +00:00
Antony Riakiotakis
5f1eec564f Fix compilation of new tracker for MinGW/MinGW64 2012-06-11 13:00:35 +00:00
Sergey Sharybin
6ab087ff99 Scale search area when doing planar tracking
Helps keeping features tracked when there's large scale happens
without need to manually re-adjust search area.

Currently using factor of pattern's boundbox scale, but probably
could be done in more accurate way?
2012-06-11 11:40:54 +00:00
Guillermo S. Romero
379cf37b38 SVN maintenance. 2012-06-11 02:29:25 +00:00
Sergey Sharybin
84b734a4df Commit patch from Stephan Kassemeyer sent to ML
This patch aims to solve unaligned operation assert
happens in Eigen library.

This is short-term solution which in fact shall be reverted
as soon as real solution would be added to Ceres. Meanwhile
this should be acceptable to have for a while.
2012-06-10 15:28:29 +00:00
Sergey Sharybin
25bb441301 Planar tracking support for motion tracking
===========================================

Major list of changes done in tomato branch:

- Add a planar tracking implementation to libmv
  This adds a new planar tracking implementation to libmv. The
  tracker is based on Ceres[1], the new nonlinear minimizer that
  myself and Sameer released from Google as open source. Since
  the motion model is more involved, the interface is
  different than the RegionTracker interface used previously
  in Blender.

  The start of a C API in libmv-capi.{cpp,h} is also included.

- Migrate from pat_{min,max} for markers to 4 corners representation

  Convert markers in the movie clip editor / 2D tracker from using
  pat_min and pat_max notation to using the a more general, 4-corner
  representation.

  There is still considerable porting work to do; in particular
  sliding from preview widget does not work correct for rotated
  markers.

  All other areas should be ported to new representation:

  * Added support of sliding individual corners. LMB slide + Ctrl
    would scale the whole pattern
  * S would scale the whole marker, S-S would scale pattern only
  * Added support of marker's rotation which is currently rotates
    only patterns around their centers or all markers around median,

    Rotation or other non-translation/scaling transformation of search
    area doesn't make sense.

  * Track Preview widget would display transformed pattern which
    libmv actually operates with.

- "Efficient Second-order Minimization" for the planar tracker

  This implements the "Efficient Second-order Minimization"
  scheme, as supported by the existing translation tracker.
  This increases the amount of per-iteration work, but
  decreases the number of iterations required to converge and
  also increases the size of the basin of attraction for the
  optimization.

- Remove the use of the legacy RegionTracker API from Blender,
  and replaces it with the new TrackRegion API. This also
  adds several features to the planar tracker in libmv:

  * Do a brute-force initialization of tracking similar to "Hybrid"
    mode in the stable release, but using all floats. This is slower
    but more accurate. It is still necessary to evaluate if the
    performance loss is worth it. In particular, this change is
    necessary to support high bit depth imagery.

  * Add support for masks over the search window. This is a step
    towards supporting user-defined tracker masks. The tracker masks
    will make it easy for users to make a mask for e.g. a ball.

    Not exposed into interface yet/

  * Add Pearson product moment correlation coefficient checking (aka
    "Correlation" in the UI. This causes tracking failure if the
    tracked patch is not linearly related to the template.

  * Add support for warping a few points in addition to the supplied
    points. This is useful because the tracking code deliberately
    does not expose the underlying warp representation. Instead,
    warps are specified in an aparametric way via the correspondences.

- Replace the old style tracker configuration panel with the
  new planar tracking panel. From a users perspective, this means:

  * The old "tracking algorithm" picker is gone. There is only 1
    algorithm now. We may revisit this later, but I would much
    prefer to have only 1 algorithm. So far no optimization work
    has been done so the speed is not there yet.

  * There is now a dropdown to select the motion model. Choices:

        * Translation
        * Translation, rotation
        * Translation, scale
        * Translation, rotation, scale
        * Affine
        * Perspective

  * The old "Hybrid" mode is gone; instead there is a toggle to
    enable or disable translation-only tracker initialization. This
    is the equivalent of the hyrbid mode before, but rewritten to work
    with the new planar tracking modes.

  * The pyramid levels setting is gone. At a future date, the planar
    tracker will decide to use pyramids or not automatically. The
    pyramid setting was ultimately a mistake; with the brute force
    initialization it is unnecessary.

- Add light-normalized tracking

  Added the ability to normalize patterns by their average value while
  tracking, to make them invariant to global illumination changes.

Additional details could be found at wiki page [2]

  [1] http://code.google.com/p/ceres-solver
  [2] http://wiki.blender.org/index.php/Dev:Ref/Release_Notes/2.64/Motion_Tracker
2012-06-10 15:28:19 +00:00
Sergey Sharybin
59ef51aa27 Initial Ceres integration into Blender
Currently only put sources of Ceres library into extern/libmv/third_party and
setup CMake and SCons building systems.

Integration details:

- Even CMake build files are not re-used from Ceres's trunk: they're using some
  automatic stuff detection like glog, pthreads, protobuf and so and it's not
  so clear how to re-use that files without modifications.
  And IMO it's easier if build files are getting re-generated automatically to
  match Blender-specific setup rather than keeping changes made locally in
  Blender in sync when re-bundling Ceres library. Especially in case when it's
  already needed to support SCons build system.
- Integrated only actual sources, all tests were stripped. Probably it'll be nice
  to have them, but they'll need clear integration with current module test stuff
  in Blender.
- Suitesparse was disabled. It'll help a lot having it, but there are some difficulties
  making cholmod working fine on windows. Would be added in future
- collections_port.cc was also stripped. It's not used by Ceres's upstream and
  it gives compilation error (undefined uint32 -- looks like namespace issue).
- Currently all schur eliminators are included. Not sure if it makes sense,
  also not sure if it makes sense having them switchable on and off -- IMO better
  to have single configuration which works and does not require special tweaks
  after everything was set up.

To bundle updated version of Ceres:
- Go to extern/libmv/third_party/ceres folder
- Run ./bundle.sh

This will checkout fresh Ceres snapshot of Windows branch (which is currently
most interesting from integration into Blender POV), apply all patches listed
in patches/series and copy needed files into Blender's working copy. This will
also re-generate CMake/SCons build rules.

If you'll need extra files from Ceres repository which are not present in
Blender, you'll need to copy them manually and then run ./mkfiles.sh from
extern/libmv/third_party/ceres folder which will update list of files used
by Blender.

Thanks to Leir Mierle and Sameer Agarwal (and all others who helped developing
Ceres) this library and thanks to Keir Mierle with help integrating it into Blender!
2012-06-10 15:27:41 +00:00
Sergej Reich
82d3d9f2ba Update Bullet to version 2.80 (bullet svn revision 2537)
Remove Jamfiles and other unused files that stuck around during previous updates.

Add patches for local changes to the patches directory.

Update readme.txt, it had outdated infromation.
2012-06-08 16:13:01 +00:00
Benoit Bolsee
dfc19a1ff7 BGE patch #28476: Character object physics type
===============================================
This patch adds a new "Character" BGE physics type which uses Bullet's btKinematicCharacter for simulation instead of full-blown dynamics. It is appropiate for (player-controlled) characters, for which the other physics types often result unexpected results (bouncing off walls, sliding etc.) and for which simple kinematics offers much more precision.

"Character" can be chosen like any other physics type in the "Physics" section of the properties window. Current settings for tweaking are "Step Height" (to make the object automatically climb small steps if it collides with them), "Fall Speed" (the maximum speed that the object can have when falling) and "Jump Speed", which is currently not used.

See http://projects.blender.org/tracker/?func=detail&atid=127&aid=28476&group_id=9
for sample blends and a discussion on the patch: how to use it and what influences the behavior of the character object.

Known problem: there is a crash if the "compound" option is set in the physics panel of the Character object.
2012-05-28 21:36:29 +00:00
Campbell Barton
857dedbc58 style cleanup 2012-05-27 00:36:50 +00:00
Sergey Sharybin
a7a79322bf Make blender compilable by gcc-4.7 and strict compilation flags:
- Remove strict flags from files, which are using FFmpeg stuff
  We're still using some symbols which are marked as deprecated.
  Ideally, we shall switch to new API, but it's a bit larger challenge
  because we don't want to break compatibility withotu actual need.
- Replace MAKE_ID with BT_MAKE_ID in bullet library.
  This is needed to prevent re-definition of MAKE_ID in bullet library.
  Seems it's only used to read blender files, so should be quite safe
  change.
2012-05-14 13:31:38 +00:00
Sergey Sharybin
4bf0e61de2 Style cleanup: use 2 spaces for indentation in bundle scripts 2012-05-10 11:17:15 +00:00
Sergey Sharybin
cc5f18693f Carve and libmv bundling scripts: should work with svn checkout now 2012-05-10 11:08:25 +00:00
Sergey Sharybin
89b61e5430 Bundle updated version of carve. Should be no functional changes, small code cleanup 2012-05-10 11:00:02 +00:00
Sergey Sharybin
b73307471f Synchronize libmv with changes in git branch 2012-05-10 10:39:28 +00:00
Sergey Sharybin
e6a022816c Remove unneeded and unused patch for libmv 2012-05-09 12:30:15 +00:00
Sergey Sharybin
91227ff6d0 Update Eigen3 library, would be needed for some further integraiton. 2012-05-09 08:33:05 +00:00
Keir Mierle
f33080532c Enhance logging in libmv's trackers.
Cleanups in brute_region_tracker.cc.
2012-05-08 23:13:53 +00:00
Jason Wilkins
8ce144b856 typo, agle -> angle 2012-05-06 05:50:50 +00:00
Sergey Sharybin
51a4188105 Camera tracking: support of tripod motion solving
Expose option into interface to use modal solver which currently
supports only tripod motion.

This solver requires two tracks at least to reconstruct motion.
Using more tracks aren't improving solution in general, just adds
instability into solution and slows down things a lot.

Refirement of camera intrinsics was disabled due to it's not only
refines camera intrinsics but also adjusts camera position which
isn't necessary here

To use this solver just activate "Tripod Motion" checkbox in
solver panel.

Merged from tomato: svn merge ^/branches/soc-2011-tomato -r45622:45624 -r46036:46037

P.S. Quite experimental yet, requires more checking and probably
tweaks to prevent camera jumps when tracks apperars/disappears
from the screen.
2012-04-28 14:54:45 +00:00
Antony Riakiotakis
791933b9a7 remove leftover files from last commit 2012-04-24 16:23:47 +00:00
Antony Riakiotakis
4e6590067d revert 45924, not a very clean solution, especially for external libraries and looks like -fpermissive is used in linux too 2012-04-24 16:14:23 +00:00
Antony Riakiotakis
0db3c5f743 Remove mingw-w64 errors from loss of precision by converting 64bit pointers to ints. All cases found were harmless and the error behaviour could be turned off by the -fpermissive flag but I'd rather keep that off to detect any real problems should they arise. 2012-04-24 14:33:44 +00:00
Antony Riakiotakis
4782522379 Add libMV and Scons support for MinGW-w64, patches by Caleb Joseph with slight modifications.
Thanks!
2012-04-24 12:57:58 +00:00
Erwin Coumans
782cf3f844 Peer pressure :) Fix some very public (but probably harmless) errors in extern/bullet2, it will propagate to the Bullet soon from here:
https://www.assembla.com/code/bullet3/subversion/nodes
Thanks to Campbell for letting me know
Fixed described by Sean here:
http://stackoverflow.com/questions/818535/how-can-i-set-all-bits-to-1-in-a-binary-number-of-an-unknown-size
2012-04-24 05:28:19 +00:00
Sergey Sharybin
f9d9b4635d Camera tracking: support of tripod motion solving
Expose option into interface to use modal solver which currently
supports only tripod motion.

This solver requires two tracks at least to reconstruct motion.
Using more tracks aren't improving solution in general, just adds
instability into solution and slows down things a lot.

Refirement of camera intrinsics is supported by this solver.

To use this solver just activate "Tripod Motion" checkbox in
solver panel.
2012-04-14 12:02:47 +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
bfca79a657 Merging r44227 through r45619 from trunk into soc-2011-tomato 2012-04-14 10:46:47 +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
81e3db364d Camera tracking refactoring:
- Deduplicate patetrn sampling used in esm and lmicklt trackers and
  move SamplePattern to image/sample.h - Move computation of Pearson
  product-moment correlation into own function in new file image/correlation.h
  so all trackers can use it to check final correlation.
- Remove SAD tracker. It's almost the same as brute tracker, with only two differences:
  1. It does brute search of affine transformation which in some cases helps to track
     rotating features 2. It didn't use common tracker api which probably gave some
     speed advantage, but lead to a real headache to use it together with other
     trackers leading to duplicated code in blender side.
- Switch blenedr to use brute tracker instead of sad tracker which tracking made
  source code much more simple to follow.
2012-03-30 10:37:39 +00:00
Campbell Barton
87681b46ea fix for cmake error on non osx systems 2012-03-23 10:39:59 +00:00
Campbell Barton
f127a0cd6f modify osx CMake hack so the CMake files can be parsed more easily by naive my error checker. 2012-03-21 12:15:02 +00:00
Sergey Sharybin
e3cfca511f Bundle latest version of Carve library which shall resolve compilation issues with clang 2012-03-12 21:18:28 +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
Guillermo S. Romero
1979679ad6 SVN maintenance. 2012-03-12 04:35:06 +00:00
Sergey Sharybin
d6b8b03305 Port changes from libmv/CMakeLists.txt to build rules files generator script 2012-03-11 20:01:26 +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
Jens Verwiebe
fa169fdcb6 OSX/libmv: restrict the unwind.h workaround to 10.6.sdk only 2012-03-11 12:15:39 +00:00
Jens Verwiebe
2382afa968 OSX/libmv: added a ahck to fix compiling with 10.6.sdk, unwind.h related 2012-03-11 11:23:30 +00:00
Campbell Barton
7f34653f59 style cleanup: + some warning fixes, also remove unused metaelem extern. 2012-03-10 22:00:55 +00:00
Campbell Barton
729ddf51b7 revert r44503, (left patch file in for now), this gives an error with gcc:
extern/libmv/third_party/glog/src/utilities.cc:318: error: undefined reference to 'google::InstallFailureFunction(void (*)())'
2012-02-28 05:50:02 +00:00
Campbell Barton
dd40560230 patch [#30331] Support clang-3.0
from Yasuhiro Fujii (y-fujii) 

 added the diff to libmv/patches so it can be applied upstream.
2012-02-28 05:26:15 +00:00
Campbell Barton
6ca7d82932 code cleanup: white space, spelling & ';;' end of lines. 2012-02-25 16:04:03 +00:00