Commit Graph

818 Commits

Author SHA1 Message Date
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
Campbell Barton
edb04d1461 bmesh docs now written in sphinx doc generator.
* http://www.blender.org/documentation/blender_python_api_2_62_0/bmesh.types.html
* http://www.blender.org/documentation/blender_python_api_2_62_0/bmesh.utils.html
2012-02-24 09:53:29 +00:00
Sergey Sharybin
6a5b34bdb5 Somehow typo was made just before commit in previous patch. 2012-02-21 13:00:58 +00:00
Sergey Sharybin
c8de268e1b Camera tracing: search area was always centered to marker's position when tracking 2012-02-21 12:59:52 +00:00
Sergey Sharybin
746e712f7a Merging r44140 through r44226 from trunk into soc-2011-tomato 2012-02-18 16:12:22 +00:00
Sergey Sharybin
0aa9ab69cc glog should now compile fine at FreeBSD 9 platform 2012-02-17 20:53:34 +00:00
Sergey Sharybin
9def83f7e0 XDND support now can be disabled using WITH_GHOST_XDND=OFF with CMake and WITH_GHOST_XDND=False with SCons
Disabled on FreeBSD platforms due to some linking errors.
2012-02-17 20:51:39 +00:00
Campbell Barton
2b7ca2304a unify include guard defines, __$FILENAME__
without the underscores these clogged up the namespace for autocompleation which was annoying.
2012-02-17 18:59:41 +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
e8a1daaf9b Drag-n-drop support on Linux
This commit implements drag-n-drop support from external applications into Blender.
Used xdnd implementation from Paul Sheer.
2012-02-17 16:58:09 +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
bcf4491304 Merging r44003 through r44069 from trunk into soc-2011-tomato 2012-02-12 19:00:13 +00:00
Campbell Barton
758c228263 update gpl header in cmake files 2012-02-11 04:05:00 +00:00
Sergey Sharybin
81048fed74 Merging r43871 through r43908 from trunk into soc-2011-tomato 2012-02-05 14:39:43 +00:00
Benoit Bolsee
d8d5bb6b9a BGE bug #18883: Softbodies being hit by ghost objects. Added a one liner fix in Bullet. I will also report the fix to Erwin so that it can be added to next Bullet version. 2012-02-05 13:04:13 +00:00
Sergey Sharybin
3719942abb Merging r43721 through r43847 from trunk into soc-2011-tomato 2012-02-02 13:04:52 +00:00
Sergey Sharybin
12a5e7e3a7 Fix #29993: Boolean modifier crashes Blender
Crash was caused by error in Carve triangulator. Fixed by upgrading Carve library.
2012-01-30 08:45:12 +00:00
Sergey Sharybin
7892739869 Merging r43501 through r43720 form trunk into soc-2011-tomato 2012-01-26 12:12:20 +00:00
Sergey Sharybin
dbe432f73f Fix build on debian ports that differs from generic i386/x86_64 like kFreeBSD
Patch by Kevin Roy, thanks!
2012-01-26 10:36:36 +00:00
Sergey Sharybin
de8612ec62 Merging r43130 through r43500 from trunk into soc-2011-tomato 2012-01-18 17:25:05 +00:00
Sergey Sharybin
0621373dd5 Updated Carve bundling script and patches 2012-01-17 18:47:02 +00:00
Brecht Van Lommel
a71d94ad7a Fix carve compile error with gcc 4.6, patch by Stephen McQuay. 2012-01-17 18:29:46 +00:00
Sergey Sharybin
7a85ad51bf Compilation error when using mingw+scons
Error was caused by boost library (which doesn't seem to be working with Cycles too
when compiling with mingw). Switched mingw to use TR1 unordered collections. Also,
there was re-declaration of strcasecmp when mingw is used.

Additional changes are related on using own process spawning when BF_TOOLSET is set to
mingw. Seems to be working fine now (i've got too long command line error) and no
warning are supressing now (as it was told in comment for commented own process spawning).
2012-01-17 10:32:17 +00:00
Sergey Sharybin
e81f2853c8 Carve booleans library integration
==================================

Merging Carve library integration project into the trunk.

This commit switches Boolean modifier to another library which handles
mesh boolean operations in much stable and faster way, resolving old
well-known limitations of intern boolop library.

Carve is integrating as alternative interface for boolop library and
which makes it totally transparent for blender sources to switch between
old-fashioned boolop and new Carve backends.

Detailed changes in this commit:

- Integrated needed subset of Carve library sources into extern/
  Added script for re-bundling it (currently works only if repo
  was cloned by git-svn).
- Added BOP_CarveInterface for boolop library which can be used by
  Boolean modifier.
- Carve backend is enabled by default, can be disabled by WITH_BF_CARVE
  SCons option and WITH_CARVE CMake option.
- If Boost library is found in build environment it'll be used for
  unordered collections. If Boost isn't found, it'll fallback to TR1
  implementation for GCC compilers. Boost is obligatory if MSVC is used.

Tested on Linux 64bit and Windows 7 64bit.

NOTE: behavior of flat objects was changed. E.g. Plane-Sphere now gives
      plane with circle hole, not plane with semisphere. Don't think
      it's really issue because it's not actually defined behavior in
      such situations and both of ways might be useful. Since it's
      only known "regression" think it's OK to deal with it.

Details are there http://wiki.blender.org/index.php/User:Nazg-gul/CarveBooleans

Special thanks to:

- Ken Hughes: author of original carve integration patch.
- Campbell Barton: help in project development, review tests.
- Tobias Sargeant: author of Carve library, help in resolving some
                   merge stoppers, bug fixing.
2012-01-16 16:46:00 +00:00
Sergey Sharybin
101e8d8624 Fixing FreeBSD x64 build
Patch by Shane Ambler, thanks!
2012-01-12 19:38:08 +00:00
Sergey Sharybin
0effb45d58 Fixed typo in comments for libmv build rules files 2012-01-11 07:19:44 +00:00
Sergey Sharybin
14423219c9 Sync changes from trunk 2011-12-31 09:29:49 +00:00
Sergey Sharybin
a666441d70 Merging r42945 through r43024 from trunk into soc-2011-tomato 2011-12-31 09:23:06 +00:00
Campbell Barton
85a97f64a7 add UNLIKELY / LIKELY util defines to help optimize iterators that are called a lot, only defined for gcc at the moment.
also some cmake formatting edits.
2011-12-29 01:46:58 +00:00
Sergey Sharybin
deb95ddb44 Merging r42621 through r42647 from trunk into soc-2011-tomato 2011-12-15 16:04:59 +00:00
Sergey Sharybin
42ae315aef Added note that cmake/scons rules are automatically generated for extern/libmv
Also updated generation scripts and templates
2011-12-15 12:44:05 +00:00
Sergey Sharybin
b865c0314f Merging r42533 through r42601 from trunk into soc-2011-tomato 2011-12-13 11:58:59 +00:00
Campbell Barton
9b762a51b1 missing config_freebsd.h from cmake file list 2011-12-11 00:53:37 +00:00
Sergey Sharybin
d568f56f18 Merging remained part of hybrid tracker which adds correlation threshold
Keir's comment:
  Add support for detecting tracking failure in the ESM tracker component of
  libmv. Since both KLT and Hybrid rely on ESM underneath, KLT and Hybrid now
  have a minimum correlation setting to match. With this fix, track failures
  should get detected quicker, with the issue that sometimes the tracker will
  give up too easily. That is fixable by reducing the required correlation (in
  the track properties).

Command used for merge: svn merge -r 42396:42397 -r 42399:42400 ^/branches/soc-2011-tomato
2011-12-07 14:54:03 +00:00
Sergey Sharybin
f55f9e95db Merging r42413 through r42441 form trunk into soc-2011-tomato 2011-12-05 18:53:09 +00:00
Brecht Van Lommel
9cac9579ae Fix #29506: libmv build issues on freebsd, patch by Shane Ambler. 2011-12-05 14:01:57 +00:00
Sergey Sharybin
8582495c16 Minor whitespace fixes 2011-12-05 07:56:31 +00:00
Antony Riakiotakis
1cb3ccd35c Fix warning for redefinition of __MSVCRT_VERSION__ 2011-12-04 14:47:21 +00:00
Antony Riakiotakis
166a6877b7 Fix MinGW compilation:
define __MSVCRT_VERSION__ to 0x0700 (microsoft runtime msvcr70.dll) so _aligned_malloc is defined.
2011-12-04 14:43:37 +00:00
Keir Mierle
4bd3a296bb Add support for detecting tracking failure in the ESM tracker component of
libmv. Since both KLT and Hybrid rely on ESM underneath, KLT and Hybrid now
have a minimum correlation setting to match. With this fix, track failures
should get detected quicker, with the issue that sometimes the tracker will
give up too easily. That is fixable by reducing the required correlation (in
the track properties).
2011-12-04 13:46:25 +00:00
Sergey Sharybin
d261623800 Camera tracking: merge hybrid tracker from tomato branch
Comment from Keir's commit:

Add a new hybrid region tracker for motion tracking to libmv, and
add it as an option (under "Hybrid") in the tracking settings. The
region tracker is a combination of brute force tracking for coarse
alignment, then refinement with the ESM/KLT algorithm already in
libmv that gives excellent subpixel precision (typically 1/50'th
of a pixel)

This also adds a new "brute force" region tracker which does a
brute force search through every pixel position in the destination
for the pattern in the first frame. It leverages SSE if available,
similar to the SAD tracker, to do this quickly. Currently it does
some unnecessary conversions to/from floating point that will get
fixed later.

The hybrid tracker glues the two trackers (brute & ESM) together
to get an overall better tracker. The algorithm is simple:

1. Track from frame 1 to frame 2 with the brute force tracker.
   This tries every possible pixel position for the pattern from
   frame 1 in frame 2. The position with the smallest
   sum-of-absolute-differences is chosen. By definition, this
   position is only accurate up to 1 pixel or so.
2. Using the result from 1, initialize a track with ESM. This does
   a least-squares fit with subpixel precision.
3. If the ESM shift was more than 2 pixels, report failure.
4. If the ESM track shifted less than 2 pixels, then the track is
   good and we're done. The rationale here is that if the
   refinement stage shifts more than 1 pixel, then the brute force
   result likely found some random position that's not a good fit.

svn command used: svn merge -r 42375:42376 -r 42377:42379 ^/branches/soc-2011-tomato
2011-12-04 13:26:11 +00:00
Keir Mierle
bc8fb9ff37 Add a fix for compiling the brute force region tracker from libmv on Mac OS X. 2011-12-03 23:30:11 +00:00
Keir Mierle
232248d2e0 Add a new hybrid region tracker for motion tracking to libmv, and
add it as an option (under "Hybrid") in the tracking settings. The
region tracker is a combination of brute force tracking for coarse
alignment, then refinement with the ESM/KLT algorithm already in
libmv that gives excellent subpixel precision (typically 1/50'th
of a pixel)

This also adds a new "brute force" region tracker which does a
brute force search through every pixel position in the destination
for the pattern in the first frame. It leverages SSE if available,
similar to the SAD tracker, to do this quickly. Currently it does
some unnecessary conversions to/from floating point that will get
fixed later.

The hybrid tracker glues the two trackers (brute & ESM) together
to get an overall better tracker. The algorithm is simple:

1. Track from frame 1 to frame 2 with the brute force tracker.
   This tries every possible pixel position for the pattern from
   frame 1 in frame 2. The position with the smallest
   sum-of-absolute-differences is chosen. By definition, this
   position is only accurate up to 1 pixel or so.
2. Using the result from 1, initialize a track with ESM. This does
   a least-squares fit with subpixel precision.
3. If the ESM shift was more than 2 pixels, report failure.
4. If the ESM track shifted less than 2 pixels, then the track is
   good and we're done. The rationale here is that if the
   refinement stage shifts more than 1 pixel, then the brute force
   result likely found some random position that's not a good fit.
2011-12-03 22:27:32 +00:00
Sergey Sharybin
b7aefff198 Merging r42193 through r42349 from trunk into soc-2011-tomato 2011-12-02 19:40:20 +00:00
Sergey Sharybin
c74f6a51b6 Fix #29469: Latest motion tracking not working.
It was error in CMakeLists.txt caused by automatic bundling script which
expanded variables instead of substituting them as-is.

Fixed both of bundling script and CMakeLists.txt
2011-12-01 10:25:16 +00:00
Antony Riakiotakis
d4bd7dcd02 Fix link errors for MinGW debug for blenderplayer. This bizarre error, not present in release builds, happens due to name clashes between tracker functions. static-fied them so the linker stops complaining. 2011-11-29 20:06:36 +00:00
Sergey Sharybin
0668ad2d55 Camera tracking: SAD tracker now supports patterns with any size
(rectangle patterns are getting enlarged to square like it's happening for KLT)
2011-11-28 21:48:49 +00:00
Sergey Sharybin
9f3c921957 Camera tracking: moved camera solver into it's own job
In some cases solving can take a while (especially when refining is used)
and keeping interface locked is a bit annoying. Now camera solver is moved
to job system and interface isn't locking.

Reporting progress isn't really accurate, but trying to make it more linear
can lead to spending more effort on it than having benefit. Also, changing
status in the information line helps to understand that blender isn't hang
up and solving is till working nicely.

Main changes in code:
- libmv_solveReconstruction now accepts additional parameters:
  * progress_update_callback - a function which is getting called
    from solver algorithm to report progress back to Blender.
  * callback_customdata - a user-defined context which is passing
    to progress_update_callback so progress can be updated in needed
    blender-side data structures.

  This parameters are optional.

- Added structure MovieTrackingStats which is placed in MovieTracking
  structure. It's supposed to be used for displaying information about
  different operations (currently it's only camera solver, but can be
  easily used for something else in the future) in clip editor.
  This statistics structure is getting allocated for time operator is
  working and not saving into .blend file.

- Clip Editor now displays statistics stored in MovieTrackingStats structure
  like it's done for rendering.
2011-11-28 13:49:42 +00:00
Sergey Sharybin
196d06a0bf Camera tracking: progress report clean-up
Send object which implements ProgressUpdateCallback to complete reconstruction
function rather than sending C-like procedure variable and context.
2011-11-27 10:35:00 +00:00
Sergey Sharybin
29b89cbc7b Camera tracking: cleaned progress reporting stuff and made a bit more verbose 2011-11-25 15:43:38 +00:00
Sergey Sharybin
aff993db55 Merging r42062 through r42159 from trunk into soc-2011-tomato 2011-11-25 15:32:23 +00:00
Jens Verwiebe
3a2cb0e3a8 libmv: don't replace flags with rel_flags but add, to preserve all flags 2011-11-25 11:31:51 +00:00
Sergey Sharybin
086b231f48 This checks shouldn't have been removed. 2011-11-23 18:28:12 +00:00
Sergey Sharybin
e228849666 Camera tracking: expose progress and status from camera solver into interface
Reporting progress isn't really accurate, but trying to make it more linear
can lead to spending more effort on it than having benefit. Also, changing
status in the information line helps to understand that blender isn't hang
up and solving is till working nicely.

Main changes in code:
- libmv_solveReconstruction now accepts additional parameters:

  * progress_update_callback - a function which is getting called
    from solver algorithm to report progress back to Blender.
  * callback_customdata - a user-defined context which is passing
    to progress_update_callback so progress can be updated in needed
    blender-side data structures.

  This parameters are optional.

- Added structure MovieTrackingStats which is placed in MovieTracking
  structure. It's supposed to be used for displaying information about
  different operations (currently it's only camera solver, but can be
  easily used for something else in the future) in clip editor.
  This statistics structure is getting allocated for time operator is
  working and not saving into .blend file.

- Clip Editor now displays statistics stored in MovieTrackingStats structure
  like it's done for rendering.
2011-11-22 14:45:22 +00:00
Sergey Sharybin
0bdbddf3d3 Merging r41937 through r42061 from trunk into soc-2011-tomato 2011-11-22 14:04:34 +00:00
Sergey Sharybin
120c0659ed Camera tracking fixes:
- Fixed incorrect memory access on distoritons more than 128 pixels
- Do not use UNDO operators flags for delete proxy operator (files can't be restored form disk),
  and also do not use UNDO for set as background operator (background images are storing in
  3d viewport which isn't getting re-loaded on undo which can lead to incorrect users count
  of movie clip user).
2011-11-19 20:14:57 +00:00
Sergey Sharybin
6e9fd309b8 Merged trunk up to rev41928 2011-11-16 20:48:21 +00:00
Sergey Sharybin
01af54c464 Camera tracking: forbid focal length=0 and small code cleanup 2011-11-16 10:00:02 +00:00
Guillermo S. Romero
4f743dd0cc SVN maintenance. 2011-11-15 19:37:09 +00:00
Sergey Sharybin
ae046bc0eb Patch from nico_ga: libmv can be compiled with icc now 2011-11-15 08:43:28 +00:00
Sergey Sharybin
1a6d884018 Fixed compilation error with msvc caused by recent libmv commit 2011-11-14 10:47:34 +00:00
Sergey Sharybin
0f82384fd0 Camera tracking: code cleanup 2011-11-14 06:41:32 +00:00
Sergey Sharybin
6fbc4186fd 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.

Original patch by Keir, cleaned a bit by myself.
2011-11-14 06:41:23 +00:00
Sergey Sharybin
d30987fd59 Camera tracking integration: more code cleanup 2011-11-10 11:16:40 +00:00
Sergey Sharybin
55d0cb04aa Camera tracking integration: cleanup and finish some parts of recent commit
- Replace set of booleans with menu, so now you'll simply be unable to choose
  unsupported refine combination
- Some internal code cleanup and minor refactor
2011-11-10 11:16:33 +00:00
Keir Mierle
d4fec9f19f 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.
2011-11-09 10:07:43 +00:00
Campbell Barton
f086201518 cmake & pep8 tidy up, also some style edits.
remove unneeded collection length function.
2011-11-08 01:32:34 +00:00
Sergey Sharybin
ae06ebcd95 Hopefully compilation with MinGW will work again.
Tested with official MinGW and SCons, not sure how ti check it when using CMake.
2011-11-07 18:14:50 +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
Sergey Sharybin
af5526e58c Camera tracking integration: Final pre-merge code clean-up 2011-11-07 12:50:26 +00:00
Keir Mierle
db86c6bcf8 Improve the KLT tracking behaviour and UI
- Remove the overly-conservative use of libmv's re-track tracker. The re-track
  tracker would take a normal tracker such as TRKLT or KLT or pyramid KLT, and
  track from frame 1 to 2, then back from the position found in 2 back to 1.
  Then, when the reverse-track doesn't match the original track with high
  precision, the track is considered "failed". This is a good approach for
  fully automatic reconstruction, but is too conservative for supervised
  tracking.

  The retrack-tracker will return when fully automatic tracking is added.

- Always solve for (dx, dy) in the TRKLT loop even if the linear system is
  ill-conditioned. The client (Blender in this case) can still use the solved
  position, even though it is less reliable.

- Expose the pyramid level setting to the tracking UI when in KLT tracking
  mode. While it was tempting to hide this detail from the user, in reality it
  does more harm than good, since the way tracking fails depends on the pyramid
  level. For now, exposing the pyramid details is a good compromise.

- Move the settings for the tracking algorithm, including search window,
  tracking algorithm, pyramid levels, etc, into the track object instead of a
  global movie clip object.
2011-10-30 12:42:56 +00:00
Sergey Sharybin
a19b0d358a Camera tracing integration
==========================

Fix for SAD tracking sliding marker.
2011-10-29 09:46:53 +00:00
Sergey Sharybin
9d2caba92e Camera tracking integration
===========================

DeBalie commit (main changes only):

- Code cleanup
- Selectable tracking graph curves and curve knots
- Graph curve and curve knots can be deleted now
- Fixed wrong write when linking libraries
  (error is caused by hardcoded cound of linkable ID blocks)
- Fixed for KLT tracker when using keyframe adjustment
2011-10-29 07:14:31 +00:00
Campbell Barton
8732ae3a0b edits to cmake 2011-10-25 13:41:43 +00:00
Sergey Sharybin
3d903ee3ff Libraries upgrade:
- Upgrade Eigen2 library to Eigen3
- Upgrade colamd library and placed in extern/ so other libraries from extern/ can use it

NOTE: With previous version of Eigen (3.0.1) it was necessary to define
      EIGEN_DONT_ALIGN_STATICALLY macro to make it compilable on windows 32bit.
      After latest upgrade it seems to be unnecessary (at least when was testing libmv),
      so i removed that defines which can reduce speed and lead to other problems.
2011-10-25 12:37:42 +00:00
Sergey Sharybin
d4be67f501 Camera tracking integration
===========================

Remove $Id$
2011-10-24 15:24:53 +00:00
Sergey Sharybin
7320f6a90a Merging trunk up to revision 41245. 2011-10-24 14:52:04 +00:00
Campbell Barton
4a04f72069 remove $Id: tags after discussion on the mailign list: http://markmail.org/message/fp7ozcywxum3ar7n 2011-10-23 17:52:20 +00:00
Sergey Sharybin
3d3a449d95 Camera tracking integration
===========================

Initial implementation of graph view for movie tracking data.
Used the same UI-side approach as preview region for sequencer:
create region for graph-related information inside clip editor.

It's easier and nicer than trying to hack graph editor which is
currently designed to work with AnimData only. Trying to make it
more abstract to deal with any kind of data doesn't seem be real
benefit for now.

Currently supported displaying per-frame average error and
selected tracks' movement speed (pixels per frame).

Additional changes:
- Collect per-frame average error after solving.
- Split space clip drawing code into different files.
- Added per-frame average solving error.
2011-10-19 12:46:30 +00:00
Sergey Sharybin
8fb37629cd Camera tracking integration
===========================

Some improvements for feature detectors:

- Sort features by score when filtering features by
  distance using FAST library.
- Added option to place markers only in areas outlined
  by grease pencil.
2011-10-15 19:30:51 +00:00
Sergey Sharybin
594e9e0689 Camera tracking integration
===========================

Added option to choose which method to use for feature detector: FAST or Moravec

Moravec was supposed to be more "stable", but it collected worse feedback.
before returning back to FAST detector added option to easier toggle between
different detector to compare it's result and find out if we can leave only FAST.
2011-10-13 17:54:05 +00:00
Sergey Sharybin
6f42be1e70 Camera tracking integration
===========================

Support for (un)distortion of images with overscan. Needed for
easier keeping this up-to-date until proper overscan support is
implemented in renderer. Not exposed into UI yet at all.
2011-10-09 20:28:29 +00:00
Sergey Sharybin
92ddc03126 Camera tracking integration
===========================

Fixed threading issues used to happen when compositor tree
and rendering happened in the same time. Problem was caused
by cached camera intrinsics stored in MovieTracking structure
and access to which wasn't thread-safe.

Now each movie distoriton mode stores it's own camera intrinsics
in it's storage which makes compositor (un)distoriton be totally
thread-safe and this also makes compositor tree faster when
(un)distortion happens on images with different resolution.
2011-10-07 19:21:29 +00:00
Sergey Sharybin
f8b081153b Merging r40653 through r40847 from trunk into soc-2011-tomato 2011-10-07 18:57:26 +00:00
Sergey Sharybin
8182a017d9 Whitespace clean-up 2011-09-30 12:24:17 +00:00
Benoit Bolsee
e6a9b68c79 Recast: upgrade library.
- Upgrade Recast library to latest portable version
- Implement recast_qsort based on FreeBSD qsort.c to have 
  portable thread safe quick sort for use in conversion routine.
- Better default value for the Build Navigation Mesh operator
2011-09-29 21:38:57 +00:00
Sergey Sharybin
424f6463c1 Camera tracking integration
===========================

MSVC should work fine now.
2011-09-28 16:46:16 +00:00
Sergey Sharybin
a36dd050ed Camera tracking integration
===========================

- Merge Movie Distort and Movie Undistort nodes into one node
  called Movie Distortion where action (distort/undistort is specified).
- Implemented more proper distortion/undistortion for scaled images.

NOTE: Please, delete distortion nodes with current blender first
      before opening files with blender versions from this commit/
2011-09-28 13:31:32 +00:00
Sergey Sharybin
03f3e7b3fc Merging r40572 through r40597 from trunk into soc-2011-tomato 2011-09-27 09:26:46 +00:00
Sergey Sharybin
a25c7f647e navmesh: convert object_navmesh.cpp to plain c. 2011-09-27 09:09:43 +00:00
Sergey Sharybin
13e63a82d2 Camera tracking integration
===========================

Fix for msvc2010 compilaiton. Patch by Nico Blends, thanks!
2011-09-26 20:16:43 +00:00
Sergey Sharybin
7505de5c59 Camera tracking integration
===========================

Attempt to fix MinGW compilaiton.
2011-09-26 20:03:07 +00:00
Sergey Sharybin
4bd96adbcf Camera tracking integration
===========================

Lookup grids used for image distortion/undistortion are now
caching and re-building if distortion settings are changing.

This speedups compositor node for cases distortion model isn't
changing, but first run and runs after changing distortion
coefficients is still slow.
2011-09-26 19:00:12 +00:00
Sergey Sharybin
8615218d57 Camera tracking integration
===========================

- If render size is set to "Full Render" and undistorted render
  is enabled, do on-fly undistortion so distortion coefficients
  can be visually verifed before baking.
- Made slight change in libmv-side to survive with large distortion
  coefficients. Hope this change is fine.
2011-09-26 15:07:06 +00:00
Sergey Sharybin
07e57233e2 Merging r40265 through r40492 from trunk into soc-2011-tomato 2011-09-23 13:20:21 +00:00
Sergey Sharybin
9d1b4b63b3 Fix for recent commit:
- Some declarations after statement left.
- Do not use static inline functions in MOD_navmesh. It produces errors
  with msvc and not sure it's actually helps -- optimizer should
  make it inlined itself.
2011-09-20 17:06:17 +00:00
Sergey Sharybin
0169079bd1 Get rid of c++ in blenkernel and modifiers
Also use guarded allocations for navmesh stuff.
2011-09-20 16:24:50 +00:00
Campbell Barton
425a81a29b remove WITH_* defines from image formats, instead just dont build the files at all. 2011-09-19 06:32:19 +00:00
Campbell Barton
049838fe0c update glew from 1.6 to 1.7:
from their site:
  adds support for OpenGL 4.2, new extensions, fixes bugs

remove ChangeLog, its missing from the 1.7 bundle, also remove html doc dir.
2011-09-18 15:37:36 +00:00
Sergey Sharybin
5a1665d64e Camera tracking integration
===========================

- Do not disable track when tracking frame-by-frame and tracking
  threshold became bad.
- Show anchored image in track preview widget.
- Do not show search area for non-selected and disabled markers.
- Keep anchor constant position when sliding offset parameters in panel.
- Re-enabled occasionally disabled openmp for tracking.
- Renamed clearing operator so now buttons are more clear.
- Updated eigen to the very recent version.

NOTE: I had to enable static aligning again due to it gave crashes
      when tracking on my new laptop. I'm not sure it'll work fine
      on another systems.
2011-09-15 19:01:32 +00:00
Sergey Sharybin
bd05d5565a Merging trunk into soc-2011-tomato up to revision 40241 2011-09-15 18:59:30 +00:00
Sergey Sharybin
41e5040e2f Use static context trick for all platforms.
Should be safe until modifier stack is not threaded.
Solves issues with mingw and older glibc version (like used in release environment).
2011-09-15 15:29:40 +00:00
Antony Riakiotakis
8a977cbcc9 fix compilation for MinGW by substituting qsort_r with qsort. What aversion do MinGW guys have for including '_r' variants of functions anyway?
Warning: a clean build will be needed probably to account for recent merge changes, or link errors will occur.
2011-09-13 19:51:58 +00:00
Sergey Sharybin
7548333b55 Fix typo in own commit for raycast library 2011-09-13 16:54:01 +00:00
Sergey Sharybin
0e3856d506 Fixes for Win+SCons and disable recastnavigationif game engine is disabled in SCons 2011-09-11 15:17:54 +00:00
Sergey Sharybin
4e9381bc35 Fixed for navmesh on FreeBSD. Oatch by sambler, thanks! 2011-09-10 14:55:14 +00:00
Sergey Sharybin
bdd4aa27b0 Another set of fixes for recats: osx uses different order of arguments for sort_r
and it's callback.

Also do not use char constants like 'NAVM' which is casting to int.
And added defautl section to switch in KX_NavMeshObject::DrawNavMesh.
2011-09-10 14:12:15 +00:00
Campbell Barton
01dca44a84 disable navmesh feature when building without the game engine. 2011-09-10 04:21:58 +00:00
Campbell Barton
fb4abf2e41 fixed linking with CMake 2011-09-10 03:42:45 +00:00
Campbell Barton
0128218254 recast and detour patch now builds again with GCC
- rearrange structs to work for 64bit
- define all vars before goto's
- ifdefs for qsort_r/qsort_s
- dont cast pointers to int only for NULL checks
- dont printf STR_String directly, get the char pointer from it

also minor change to gpu py module, no need to pass empty tuple to PyObject_CallObject, can just be NULL
2011-09-10 03:07:26 +00:00
Benoit Bolsee
dbd6658d73 svn merge -r 37306:39975 https://svn.blender.org/svnroot/bf-blender/trunk/blender 2011-09-07 15:34:04 +00:00
Sergey Sharybin
c37a32593b Camera tracking integration
===========================

Fix compilation for 32bit OSX.
2011-09-04 12:56:16 +00:00
Sergey Sharybin
ffaa5d0210 Merging trunk into soc-2011-tomato.
Pardon, lost message about which revisions are going to be merged..
2011-08-22 19:30:05 +00:00
Sergey Sharybin
62f553cc56 Camera tracking integration
===========================

Reverting commit 81613ee0cc94b315f333c9632b18b95d426aad05 from Matthias branch.
It destroyed lens distortion code.
2011-08-21 17:08:05 +00:00
Sergey Sharybin
36f20f162c Fix #28154: linux3-config.py doesn't exist
Change OURPLATFORM from "linux<major_version>" to simple "linux".
Since new policy for linux kernel versions that major version in
platform doesn't make much sense for building rules so the same
rules could be used for both of linux2 and linux3 now/

Tested on both of linux2 and linux3 systems.
2011-08-21 13:31:46 +00:00
Sergey Sharybin
3c9c5b3359 Camera tracking integration
===========================

Another fix for MSVC.
2011-08-19 15:38:11 +00:00
Sergey Sharybin
78a2086415 Camera tracking integration
===========================

Previous fix wasn't checked and it was typo there.
2011-08-19 15:17:26 +00:00
Sergey Sharybin
c15012e568 Camera tracking integration
===========================

Fixes for MSVC.
2011-08-19 14:23:09 +00:00
Sergey Sharybin
ed3e6aa972 Camera tracking integration
===========================

Bundle new libmv and add changes needed to support affine tracking.

Affine tracking itself would be added in next commit.
2011-08-19 13:41:11 +00:00
Sergey Sharybin
83b2be3749 Camera tracking integration
===========================

Bundle new libmv to fix crash caused by some errors in detector.

This commit makes SAD tracking much slower because now it supports
afgine tracking. Not implemented in Blender yet to keep commits
more clear.
2011-08-18 21:20:12 +00:00
Sergey Sharybin
b52502cd4e Camera tracking integration
===========================

Stop SAD tracker when error becomes too high.
Maximal allowed error value is controlled in Tracking Settings panel.
I haven't been able to find value which will work for most of cases
so it's now quite stupid value of 0. Currently values of 2-6 gives
quite nice result, but it depends on footage.
Upcoming changes from libmv side related on returning normalized SAD
would help here. Until this, please set max_sad manually.
2011-08-18 11:10:10 +00:00
Sergey Sharybin
07017db093 Camera tracking integration
===========================

Just another fix for MSVC.
2011-08-17 18:37:25 +00:00
Sergey Sharybin
9589668e9f Camera tracking integration
===========================

Another fix for msvc/osx. Hope it'll work now.
2011-08-17 17:44:38 +00:00
Sergey Sharybin
18f5322f7c Camera tracking integration
===========================

- Bundling new libmv, issues with undefined uint and C99 functions should gone.
- Changes to Detect operator to match new API.
2011-08-17 17:12:10 +00:00
Sergey Sharybin
8b4c115a58 Camera tracking integration
===========================

Additional code clean-up and fixed typo.
No functional changes.
2011-08-17 11:17:18 +00:00
Sergey Sharybin
90a2ac4228 Camera tracking integration
===========================

- Bundle new version of libmv.
- Use image from nearest track's keyframe as reference for tracking.
  This should reduce drifting.
- Added option to switch to new SAD tracker.
  This tracker doesn't support pattern with variable size (yet?)
  and always uses pattern 16x16px.
  Tracker could be choosed in Tracking Settings panel.
2011-08-17 07:16:11 +00:00
Sergey Sharybin
36c5f57616 Camera tracking integration
===========================

- Distortion/undistortion were accidentally swapped in both of grease
  pencil calibration and grid.

  This was fixed but distortion coefficients should be re-adjusted.

  There are some issues with high distortion coefficients but it
  came from libmv and until it'll be fixed there nothing really
  can be done here.

- Fixed displayed aspect ratio for muted footage when pixel/display
  aspect ratio is differ from 1.0 or proxy size is not Full Render,

- Added c-api for image distortion/undistortion, Not used yet.
2011-08-12 21:56:08 +00:00
Sergey Sharybin
2a5a5bcd5a Camera tracking integration
===========================

Bundling new version of libmv. It's repo is ready for
bundling again, some patches which were applied on our
side are in libmv repo now.

This new version of libmv also contains patch from John Carpenter
which makes reconstruciton a bit more "stable" -- some kind
of fallback algorithm.
2011-08-09 10:42:39 +00:00
Sergey Sharybin
8c0fb2ad64 Camera tracking integration
===========================

Expose parameters for feature detection into redo panel.
2011-08-07 08:58:03 +00:00
Sergey Sharybin
00fd8b59d1 Commiting patches needed for bundling libmv.
I've used git where patch files were in gitignore, that's why
this files were missed in repo.
2011-08-06 14:49:01 +00:00
Sergey Sharybin
1e7203ce07 Camera tracking integration
===========================

- Added function to calculate per-track average error.
  Made this in libmv c-api, probably should be ported
  to libmv pipeline.
- MovieTrackingTrack now holds average reprojection error
  which is displayed in Active Track panel and information
  text in clip editor (if displaying of names are enabled).
- Make "Clean Tracks" take average error on account.
2011-08-04 15:40:28 +00:00
Sergey Sharybin
a28867e172 Camera tracking integration
===========================

- Made naming in libmv-api more uniform.
- Move aspect ration detection of clip to movieclip.c.
- Remove unused width and height from camera intrinsics function.
- Reconstruction should now deal correct with aspect ratio.
2011-08-03 18:28:40 +00:00
Sergey Sharybin
197595125f Camera tracking integration
===========================

- Fixed occasional crash caused by conflicting access
  to non-threadsafe moviecache. Added lock on movie clip
  ibuf acquire level.
- A bit nicer feedback from libmv when doing reconstruction.
  Now if all tracks and frames were reconstructed average
  error would be reported in "notification area".
  If there's something failed to be reconstructed warning
  message would appear and failed items would be printed to
  the console.
2011-07-30 17:14:07 +00:00
Sergey Sharybin
2cefa33e86 Camera tracking integration
===========================

- glog should no flood into logs files now.
- Request from Francois - changes in sliding:
  * Anchor point is for sliding the whole marker.
  * Square on pattern moves pattern and search relative
    to anchor point.
  * Square on search moves search only.
- Bundles in 3d viewport are colored by track custom color.
2011-07-27 09:48:19 +00:00
Sergey Sharybin
1c971862bd Camera tracking integration
===========================

- Fixed discovered bug with selecting hidden marker areas with mouse.
- Refactor of context structure used for 2D tracking:
  * Tracker object is now per-track. This allows to use
    different pyramid levels for different tracks and
    now search area resizing shouldn't make tracking less
    accurate.
  * This is also be used for new optimized libmv API.
  * This allowed to use OpenMP to track different markers in
    separated threads.
    This allowed to reach quite cool speedup for multi-core CPU.
2011-07-21 14:56:13 +00:00
Sergey Sharybin
ac57527895 Camera tracking integration
===========================

- Fixed crash when holding down S and R keys.
- Fixed deleting of first marker.
- Tracking should now work fine with float buffers.
- Added option to show distortion grid. It's most probably
  temporary solution until [auto]calibration tools aren't
  merged.
  This grid defines straight lines on the image.
2011-07-20 20:31:25 +00:00
Sergey Sharybin
b18dd20aea Merging r38433 through r38453 from trunk into soc-2011-tomato 2011-07-17 17:25:11 +00:00
Campbell Barton
5792bd7cc7 cmake: cleanup include paths, some duplicates and going up some unneeded dirs. 2011-07-17 09:11:13 +00:00
Campbell Barton
410c5e3cd2 cmake source definitions:
remove missing includes and use more strict formatting.
2011-07-16 23:01:14 +00:00
Sergey Sharybin
864071a512 Camera tracking integration
===========================

- Bundle re-newed libmv library.
- Update API in libmv-capi to match new library.
- Initial implementaition of feature detection.
- Fixed bug with incorrect user sync when tracking
  for first frame.
2011-07-15 20:44:19 +00:00
Sergey Sharybin
1e7ccbba3a Camera tracking integration
===========================

Fix for camera solver on windows.

There were two problems:
- Static align in Eigen should be also disabled for libmv.
- SSBA doesn't work correct for windows when optimization is
  turned on.

There's no other way rather than disable optimization for
the whole extern/libmv. This leads to 3-4x slowdown, but it's
really the only thing we could do now.

Keir is going to drop SSBA out and replace it with Bundler,
so it shouldn't be a major problem.
2011-07-15 16:50:12 +00:00
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
f20de08afd Camera tracking integration
===========================

- 32 bit linux compilation should be fixed now.
- Camrea reconstruction data should be better now
  when there's no reconstructed cameras.
- Implemented "Set Origin" operator
- Added "Specials" W-key menu for SpaceClip.
  Supports such operators:
  * Enable track
  * Disable track
  * Set origin
2011-07-08 08:38:54 +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
7ece1ef63e Camera tracking integration
===========================

- Internal changes:
  * Fixed bundle.sh script to bundle libmv: it was generating
    incorrect CMakeLists header.
  * Rename CLIP_OP_delete to CLIP_OT_delete_track.
  * Fixed crash when BKE_movieclip_acquire_ibuf is called
    with NULL user.
  * Made MovieTrackingMarker structure 8-bytes aligned
  * Use writestruct rather than writedata for track markers.
    This allows to change MovieTrackingMarker safely.
- Added "Delete Marker" operator which deletes marker for
  current frame only. Hotkey is Shift-Del.
- Added MovieClip.size and MovieClip.resolution RNA properties.
  Use last accessed frame number to get ImBuf from sequence.
- Added different actions for "Clear Path" operator:
  * Clear path up to current frame.
  * Clear the whole path.
  * Cleat remained part of path (for frames after current).
- Changed buttons order and icons for tracking. New order is:
  * Track frame backwards.
  * Track sequence backwards.
  * Track sequence forwards.
  * Track frame forwards.

NOTE: this breaks compatibility with existing .blend files again,
      but it should be much easier to change data structures without
      breackaged in the future.
2011-06-29 18:05:07 +00:00
Sergey Sharybin
60948c955d Accidentally commited unneded change to libmv.
This change helps to track more stable, but it's a bit
hackish way of making things better.
2011-06-22 15: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
9f769c43a3 Merging r37594 through r37703 from trunk into soc-2011-tomato 2011-06-21 18:24:00 +00:00
Campbell Barton
d33b63c5d8 update cmake checker to ignore file list and add some headers to the source list. 2011-06-21 17:00:34 +00:00
Andrea Weikert
761015e6ef == CMake ==
* added same definition used for compiling openjpeg with SCons, was causing issues when linking
2011-06-20 18:16:46 +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
Nick Samarin
5ceb8b3d35 synched with trunk at revision 37212 2011-06-05 18:51:00 +00:00
Campbell Barton
97d7496c96 update to glew 1.6 from 1.5.8 2011-06-02 00:05:54 +00:00
Campbell Barton
09da9d4393 cmake maintenance
blender_add_lib now takes a separate include argument to suppress warnings in system includes (mostly ffmpeg & python).
also only build wm_apple.c on apple+carbon configuration.
2011-05-31 01:15:44 +00:00
M.G. Kishalmi
9b5800bcd7 fixed "rather then" -> "rather than" typos all over the place 2011-05-28 13:11:24 +00:00
Nick Samarin
a918040902 synched with trunk at revision 36569 2011-05-16 20:30:59 +00:00
Campbell Barton
474fe33301 fix transform code using a node space as an image space, accessing unallocated memory.
also remove bullet patch which has now been applied.
2011-05-02 05:24:59 +00:00
Campbell Barton
07ee0dcc74 build system changes to eltopo, re-applied. 2011-05-02 03:44:02 +00:00
Joseph Eagar
088899236b =trunk=
Recommitted eltopo collision code (but disabled by default)
with Genscher's permission.

To use, you need to install liblapack and libblas
2011-05-01 21:39:13 +00:00
Campbell Barton
a42bf45333 revert Joseph Eagar's eltopo commits r36073, 36075 (& some minor edits)
discussed with Janne, Ton, Nathan and we agreed this kind of change at least needs discussion with module owners.

Its also too close to release to be making these kinds of changes.

commands used:

  # reverse merge
  svn merge -r36073:36072 .
  # for some reason this gave a lot of property changes
  svn revert `svn st | grep "^ M" | awk '{print $2}'`
  # reverse merging didn't work here, removing while dir.
  svn rm extern/eltopo/


  # manually fixed conflict in
  # ./source/blenderplayer/CMakeLists.txt
  #
  # also manually removed 2 lines from
  # ./CMakeLists.txt
2011-04-12 11:09:10 +00:00
Campbell Barton
7aed432fc8 eltopo cloth solver couldnt be enabled from cmake, also dont use globbing. 2011-04-10 05:43:34 +00:00
Joseph Eagar
0a60bc14d6 =cloth collisions=
Plugged the eltopo library into the cloth solver.
I was playing with it earlier, and it's so easy to
use I decided to quickly put it in (trunk's) cloth.

See http://www.cs.ubc.ca/labs/imager/tr/2009/eltopo/eltopo.html
.  The authors are on the bleeding edge of continuous collision
detection (one of them did ILM's cloth sim).  
I
don't really have to time to plug it into softbody, particles,
bullet, fluid, etc, but doing so would be pretty straightforward.
I'll leave that up to someone else.

To use, turn on USE_ELTOPO (in cmake) or WITH_BF_ELTOPO in scons.
2011-04-09 23:19:11 +00:00
Campbell Barton
ca254dd37b add option WITH_BUILTIN_GLEW, so linux packagers can disable to use their own glew library. 2011-04-05 23:31:01 +00:00
Campbell Barton
37f3bbae90 didnt mean to commit to Eigen2 since its externally maintained. 2011-03-30 16:21:35 +00:00
Campbell Barton
bb1f20a534 includes for building with gcc 4.6 on fedora.
patch from Richard Shaw
2011-03-30 16:14:54 +00:00
Erwin Coumans
952aa9804f fixes in Bullet stuff, roll influence for raycast vehicles was broken,
enable the setPhysicsTicRate for BGE Python
2011-03-29 18:44:18 +00:00
Erwin Coumans
c7f37b84d8 remove constructors, they cause compile errors under Fedora 2011-03-22 16:30:46 +00:00
Campbell Barton
3d0a7fdccb workaround for problem compiling with glu 1.5.8 on windows 2011-03-15 01:31:07 +00:00
Campbell Barton
1e60d5136a upgrade glew 1.5.1 --> 1.5.8, from the release logs changes are mainly for maintenance & supporting new opengl functions, this also fixes FreeBSD compile error. 2011-03-15 00:08:16 +00:00
Campbell Barton
ed81c7755a quiet stricter compiler warnings/errors. 2011-03-12 23:41:57 +00:00
Sergey Sharybin
d190304c82 Fix for compilation error after bullet upgrade.
There was a typo in source file list.
2011-03-12 22:05:33 +00:00
Erwin Coumans
5e374328a8 update Bullet physics sdk to latest trunk/version 2.78
add PhysicsConstraints.exportBulletFile(char* fileName) python command
I'll be checking the bf-committers mailing list, in case this commit broke stuff
scons needs to be updated, I'll do that in a second.
2011-03-12 20:34:17 +00:00
Nathan Letwory
c1fee0a1dc doxygen: fixes 2011-02-27 19:29:07 +00:00