Commit Graph

641 Commits

Author SHA1 Message Date
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
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
Campbell Barton
758c228263 update gpl header in cmake files 2012-02-11 04:05:00 +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
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
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
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
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
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
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
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
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
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