Commit Graph

529 Commits

Author SHA1 Message Date
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
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
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
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
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
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
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
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
a25c7f647e navmesh: convert object_navmesh.cpp to plain c. 2011-09-27 09:09:43 +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
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
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
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
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
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