Commit Graph

887 Commits

Author SHA1 Message Date
Tamito Kajiyama
036d35dd24 Fix for MSVC 2008 compiler errors. 2014-02-25 01:16:52 +09:00
Sergey Sharybin
cefa733803 Followup for 90a86fe: libmv/ceres cmake/scons files are automatically generated
So don't forget to update generator scripts as well.
2014-02-24 20:13:33 +06:00
Sergey Sharybin
9643b2e5b5 Preserve non-flat faces in boolean modifier
This commit implements dissolving of edges which were used
to triangulate non-flat faces. This slows things down a bit
(around 5% on heave mesh with all faces triangulated).

We could improve speed of dissolve a bit here (so not a bell
to add an option for triangulation yet).

Also fixed wrong edge origindex mapping.
2014-02-24 18:10:33 +06:00
90a86fecee Fix T38684: cmake OS X build problem when changing deployment target.
Don't cache these variables as they are not cleared on such changes.
2014-02-18 19:38:43 +01:00
Sergey Sharybin
97b90d89f4 Fix T38637: Boolean produces faces with holes which isn't supported by BMesh
Simple fix -- use CarveHoleResolver hook for CSG which will split faces
containing holes.
2014-02-18 11:53:04 +06:00
Sergey Sharybin
7fb7ce789f Fix T38631: Blender crashes when selection faces after new boolean modifier
Own mistake in edges carve->blender export, didn't count them correct.
2014-02-14 14:26:26 +06:00
Jens Verwiebe
9185ab5d9c Fix scons compiling after carve changes 2014-02-13 23:21:13 +01:00
Sergey Sharybin
6a65161966 fixed an for loop variable type and delete operator in cave-utils.cc
Patch by wutzi (Benedikt Bergenthal), thanks!

Reviewers: sergey

Reviewed By: sergey

Differential Revision: https://developer.blender.org/D314
2014-02-13 20:09:51 +06:00
Sergey Sharybin
83617d24d5 Rework carve integration into boolean modifier
Goal of this commit is to support NGons for boolean modifier
(currently mesh is being tessellated before performing boolean
operation) and also solve the limitation of loosing edge custom
data layers after boolean operation is performed.

Main idea is to make it so boolean modifier uses Carve library
directly via it's C-API, avoiding BSP intermediate level which
was doubling amount of memory needed for the operation and which
also used quite reasonable amount of overhead time.

Perhaps memory usage and CPU usage are the same after all the
features are implemented but we've got support now:

- ORIGINDEX for all the geometry
- Interpolation of edge custom data (seams, crease)
- NGons support

Triangulation rule is changed now as well, so now non-flat
polygons are not being merged back after Carve work. This is
so because it's not so trivial to support for NGons and
having different behavior for quads and NGons is even more
creepy.

Reviewers: lukastoenne, campbellbarton

Differential Revision: https://developer.blender.org/D274
2014-02-13 17:16:53 +06:00
Sergey Sharybin
5cbddd4ca4 Bye-bye FAST!
FAST detector has been replaced with fancier Harris,
so no need to keep FAST library in the sources now.
2014-02-06 18:13:12 +06:00
Sergey Sharybin
9896508e14 Fix compilation error with msvc2012 and 2013 as well 2014-01-31 15:33:48 +06:00
Sergey Sharybin
df471369e2 Bundle latest Libmv from upstream
Currently no functional changes, but we might want
to have scoped_array in the future.
2014-01-28 18:36:32 +06:00
Sergey Sharybin
be6643b5ec Followup to the previous commit
Need to take weight into account when drawing per-frame track
reprojection curve and when computing per-track average error.
2014-01-28 18:02:22 +06:00
Sergey Sharybin
59d1387c41 Improvements to weighted tracks behavior
First thing changed by this commit is making it so
Euclidean intersection takes track weight into account
when solving minimization problem. This behaves the
same exact way as it is for BA step.

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

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

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

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

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

Blender will now use Harris detector by default, later we'll
remove FAST detector.
2014-01-28 15:37:19 +06:00
Sergey Sharybin
3d408e10a4 Correct typo in the patch file as well 2014-01-28 02:16:44 +06:00
Thomas Dinges
8870556def Fix compilation on Windows, syntax error. 2014-01-27 20:53:42 +01:00
Sergey Sharybin
efaadc3104 Attempt to fix compilation error with MSVC-2008 2014-01-28 01:37:41 +06:00
Sergey Sharybin
31d679b667 Update Carve to latest update
Fixes some issues with NaN vertices in special cases.
Also adds edge interpolation routines which are currently
unused but which are requires to implement edge CD interpolation.
2014-01-27 17:04:06 +06:00
Sergey Sharybin
ef67b9eec4 Ceres: more warnings cleanup 2014-01-14 01:18:09 +06:00
Sergey Sharybin
a6ceb4a498 Re-bundle new Ceres library
- Fixes some harmless issues (in cases blender doesn't use Ceres yet)
- Fixes some compilation warnings
2014-01-13 19:17:28 +06:00
Sergey Sharybin
113ff51476 Compilation error fix for NetBSD
Based on the patch from Joerg Sonnenberger.
2014-01-09 16:15:24 +06:00
Sergey Sharybin
2d8545f87e Fix compilation error on NetBSD
Original patch is by Jeorg Sonnenberger, thanks!
2014-01-09 16:03:02 +06:00
Sergey Sharybin
f9353b8e8d Code cleanup: remove patch series from libmv
Since we're using own libmv branch from git.blender.org
we don't need to have local patches for libmv in blender
source tree.
2014-01-02 15:24:46 +06:00
Sergey Sharybin
f9e0ac4ced Code and style cleanup
Mainly fixed some style warnings reported by cpplint.

Also changed how camera (un)distortion happens internally
by replacing number of channels as a template argument
with number as channels passing as function argument.
Makes code easier to follow by eliminating loads checks
how much channels are used and which argument to pass to
the template.
2014-01-02 15:24:46 +06:00
Sergey Sharybin
5d701c6d25 Re-bundle libmv from new upstream repository
No functional changes, just to make sure all the patches
are ported nicely and that update scripts works fine.
2014-01-01 22:32:48 +06:00
Sergey Sharybin
5933b2455c Update Ceres to the latest upstream
Summary:
This brings up much easier termination type usage,
which for us means we might use:

  ceres::Summary::IsSolutionUsable()

instead of doing manual funky enum values check.

Reviewers: keir

Differential Revision: https://developer.blender.org/D153
2014-01-01 22:32:47 +06:00
Sergej Reich
05eebf49d3 Bullet: Update to svn r2719
Fixes part of T37905, fixed constraint didn't work correctly.
2013-12-26 12:45:57 +01:00
Campbell Barton
a7ac6481ef CMake: report messages as status (else ccmake treats like an error) 2013-12-10 13:18:46 +11:00
Alexandr Kuznetsov
e2429d6492 Woo Hoo. First git commit.
Changes for VC2013

Now, I can build Blender with VC2013 with Cycles, Collada, OpenExr,OpenImageIO disabled. Also, you need VC2008 sp1 installed to make old libs compatible.
2013-11-29 15:13:12 -05:00
Sergey Sharybin
28a2d5e264 Code cleanup: spelling fixes and verbosity prints 2013-11-29 01:46:08 +06:00
Sergey Sharybin
b7bca8663a Made collections port compatible with MSVC2008
The issue was caused by the fact that in this version
of MSVC unordered_map class is defined in <unordered_map>
header file, but this file declares the class int std::tr1
namespace.

This confused existing assumption that if there's an
existing <unordered_map> file then class is declared
in std namespace.

Added an extra check to CMake which detects whether
it's std or std::tr1 which actually contains class
of unordered_map.

This might be changed/cleaned in the future, for
now committing to our repository to solve compilation
error on windows.

Details of the patch in upstream can be found there:

  https://ceres-solver-review.googlesource.com/#/c/4371/
2013-11-28 23:28:11 +06:00
Sergey Sharybin
de6c1c9287 Update Ceres to latest upstream version
- A richer Problem API.
- DynamicNumericDiffCostFunction.
- Faster ITERATIVE_SCHUR solver.
- Faster SCHUR_JACOBI preconditioner.
- Faster Jacobian evaluation.
- Faster visibility based preconditioning using single linkage clustering.

Also re-wrote rules for unordered collections detection,
should work on all platforms and compilers now :)
2013-11-28 19:46:23 +06:00
Sergey Sharybin
dc71cb5f6e Fix Carve compilation on FreeBSD
Based on the patch from Marcus von Appen, thanks!
2013-11-28 14:00:10 +06:00
Sergey Sharybin
a628ca9ebe Update Carve to upstream version be054bc7ed86 2013-11-28 14:00:10 +06:00
Sergey Sharybin
1c14ead46f Carve bundler script cleanup
- random.hpp was only removed from actual include
  directory, but not from patches/files.

- Files list generator didn't ignore config.h file
  which in fact is not needed.
2013-11-28 14:00:10 +06:00
Sergey Sharybin
1de23f6c0d Tweaks and improvements to fundamental/homography estimation
- A bit more reasonable name for the estimation option
  structure and estimation functions.

- Get rid of unclear function and parameter tolerance,
  it wasn't clear at all in which units they are.

  Now we've got expected_average_symmetric_distance as
  an early output check and as soon as average symmetric
  error goes below this threshold refining finishes.

  This distance is measured in the same units as input
  points are.

  It is arguable whether we need callback for this or not,
  but seems Ceres doesn't have some kind of absolute
  threshold for function value and function_tolerance
  behaves different from logic behind expected symmetric
  error.

- Added option to normalize correspondences before
  estimating the homography in order to increase estimation
  stability. See

    R. Hartley and A. Zisserman. Multiple View Geometry in Computer
    Vision. Cambridge University Press, second edition, 2003.

    https://www.cs.ubc.ca/grads/resources/thesis/May09/Dubrofsky_Elan.pdf
2013-11-20 15:30:28 +06:00
Campbell Barton
cf9edb2610 rangetree: support for building on freebsd-10 2013-11-16 18:31:13 +11:00
Jens Verwiebe
a3ec6edc05 OSX/scons: make MACOSX_SDK_CHECK a local var is sconstruct and remove from env, also fix a longstanding misuse of MACOSX_SDK_CHECK in ceres, use MACOSX_SDK instead 2013-11-08 13:44:10 +00:00
Sergej Reich
13caf5cc14 bullet: Remove patch applied upstream 2013-11-04 17:02:01 +00:00
Keir Mierle
427844c28d Eagerly attempt to refine a track before doing a brute search
Before the refinement phase of tracking, a brute force SAD search
is run across the search area. This works well but is slow;
especially if the guess for the track's location is accurate.

This patch runs a refinement phase before running a brute force
search, hoping that the guessed position (in x2, y2) is close to
the best answer. If it is, then no brute search is done. If it is
not, then a normal brute force search followed by refinement is
done.

In some cases this may produce worse tracks than before; the
regressions will need investigation. The predictive motion model
(to be implemented) will reduce the probability of that happening.
2013-10-29 01:06:50 +00:00
Keir Mierle
d10abe6d4d Fix bug where libmv tracking incorrectly succeeds on failure
Before this patch, if Ceres returned USER_SUCCESS indicating that
Ceres was only changing the tracked quad slightly between
iterations (indicating convergence), no final correlation check
was done. This leads to incorrectly returning that the tracking
was successful, when it actually failed.
2013-10-28 18:34:19 +00:00
Sergey Sharybin
9f32e83175 Weighted tracks
Added a weight slider to track which defines
how much particular track affects in a final
reconstruction. This weight is for sure
animateable.

Currently it affects on BA step only which in
most cases will work just fine.

The usecase of this slider is to have it set
to 1.0 most of the time where the track is
good, but blend it's weight down to 0 when
tracker looses the track. This will prevent
camera from jump.

Tutorial is to be done by Sebastian.
2013-10-26 13:22:38 +00:00
Sergej Reich
451b60f1a3 Fix building with scons
Can't actually test here so hope this is enough.
2013-10-25 03:56:17 +00:00
Sergej Reich
472a021aca bullet: Update to version 2.82 (bullet revision 2705)
Remove patch that has been applied upstream.

Fixes several bugs.
2013-10-25 03:43:20 +00:00
Sergey Sharybin
dc46febec8 Code cleanup: move function prototype to header file 2013-10-15 15:21:44 +00:00
Sergey Sharybin
eb69cb7de3 Get rid of Allow Fallback option
It was rather confusing from the user usage point
of view and didn't get so much improvement after
new bundle adjuster was added.

In the future we might want to switch resection
to PPnP algorithm, which could also might be a
nice alternative to fallback option.
2013-10-15 15:21:41 +00:00
Sergey Sharybin
36039be6b5 Libmv: make sure CmakeList.txt is re-created with all needed headers on re-bundle 2013-10-09 20:21:12 +00:00
Sergey Sharybin
b5491291e4 Libmv: move platform-specific defines into own file 2013-10-09 20:02:02 +00:00