This commit bundles new libmv version from own branch
which brings fix for wrong parameter block used for
modal solver parameterization.
Fixes#34985: Crash with Motion tracker (Tripod Motion)
- Get rid of rotation matrix parameterization,
use angle-axis instead.
Also Joined rotation and translation into a
single parameter block.
This made minimization go significantly faster,
like 1.3x times in average.
- Fix first camera when bundling. This is to
address orientation ambiguity.
Reconstruction result could still vary in
size, but that's another issue to be addressed
later.
Additional change:
Split EuclideanBundleCommonIntrinsics into
smaller functions, so it's now a bit easier
to follow.
This made preview working but that broke internals
of tracking.
Namely, BlurredImageAndDerivativesChannels is giving
much more blurred image because it was assuming pixel
center is an integer position.
Guess other parts of libmv used to suffer because of
this issue.
Now pixel centering happens in blender side, and
libmv assumes integer position is a pixel center.
Thins brings up some speed improvements:
SPARSE_SCHUR is approx 1.3-1.5x times faster
ITERATIVE_SCHUR is approx 1.2x times faster
For blender this means camera solution go a bit
faster now. Would not have affect on tracking
speed.
- pass string size to BLI_timestr() to avoid possible buffer overrun.
- quiet warning for mingw.
- include guards for windows utf conversion funcs.
- fix for mistage in edge-angle-selection check.
- some style cleanup.
This commit implements multi-threaded calculation of frames
when building proxies. Both scaling and undistortion steps
are now threaded.
Frames and proxy resolution are still handled one-by-one,
saving files after every single step. So if HDD is not so
fast, this commit could have not so much benefit.
Internal changes:
- Added IMB_scaleImBuf_threaded which scales given image
buffer in multiple threads and uses bilinear filtering.
- libmv's camera intrinsics now have SetThreads() method
which is used to specify how many OpenMP threads to use
for buffer distortion/undistortion.
And yeah, this code is using OpenMP for threading.
- Reshuffled a bit libmv-capi calls and added function
BKE_tracking_distortion_set_threads to specify number
of threads used by intrinscis.
This patch allows Blender to display i18n monospace font in the text
editor and the Python interactive console. Wide characters that occupy
multiple columns such as CJK characters can be displayed correctly.
Furthermore, wrapping, selection, suggestion, cursor drawing, and
syntax highlighting should work.
Also fixes a bug [#34543]: In Text Editor false color in comment on cyrillic
To estimate how many columns each character occupies, this patch uses
wcwidth.c written by Markus Kuhn and distributed under MIT-style license:
http://www.cl.cam.ac.uk/~mgk25/ucs/wcwidth.c
wcwidth.c is stored in extern/wcwidth and used as a static library.
This patch adds new API to blenfont, blenlib and blenkernel:
BLF_get_unifont_mono()
BLF_free_unifont_mono()
BLF_draw_mono()
BLI_wcwidth()
BLI_wcswidth()
BLI_str_utf8_char_width()
BLI_str_utf8_char_width_safe()
txt_utf8_offset_to_column()
txt_utf8_column_to_offset()
Apply patches in patches directory, remove patches that were applied
upstream.
If you made changes without adding a patch, please check.
Fixes [#32233] exporting bullet format results in corrupt files.
There're some features planned which would
require rigid registration, but this code
would need to be re-done anyway to use new
minimizer and solving some issues with ICP
algorithm there.
Several major things are done in this commit:
- First of all, logic of modal solver was changed.
We do not rely on only minimizer to take care of
guessing rotation for frame, but we're using
analytical rotation computation for point clouds
to obtain initial rotation.
Then this rotation is being refined using Ceres
minimizer and now instead of minimizing average
distance between points of point of two clouds,
minimization of reprojection error of point
cloud onto frame happens.
This gives quite a bit of precision improvement.
- Second bigger improvement here is using bundle
adjustment for a result of first step when we're
only estimating rotation between neighbor images
and reprojecting markers.
This averages error across the image sequence
avoiding error accumulation. Also, this will
tweak bundles themselves a bit for better match.
- And last bigger improvement here is support of
camera intrinsics refirenment.
This allowed to significantly improve solution
for real-life footage and results after such
refining are much more usable than it were before.
Thanks to Keir for the help and code review.
This information is useful, but in cases when you, say,
working on a bundler it's annoying to scroll all the
information up.
Now behavior would be:
- running `./blender --debug-libmv` will print all the
debug messages
- running `./blender --debug-libmv --verbose 0` will
print only debug messages from solvers, recosntruction
and so, but will bypass final reprojection bunch of
messages
- running `./blender --debug-lib,v --verbose 1` will
include final reprojection messages.
This shall not lead to any functional changes, just
avoids radial distortion code duplicated in camera
intrinsics and bundling code.
For fancier bundle adjustment supprting different
distortion models this is not actually enough and
would need to make some bigger changes, but this
changes makes code a bit easier to maintain already.
Also made it theraded linear solver, seems it makes
sense for iterative schur with inner iterations
enabled.
Use OpenMO's max therads called from bundler code
to detect how many threads to use. Could be changed
in a way that number of threads is passing in options
from blender side in the future.
Also removed redundant V3D definition from compiler's
flags.
This commits adds extra refirenment entry in the menu which is
"K1, K2" and which will apparently refine only this distortion
coefficients.
This would be useful in cases when you know for sure focal length
(which could be obtained from lens, EXIF and so) but not sure
about how good you manual calibration is.
Be careful tho, there're no internal constraints on this
coefficients so distortion model could just screw up into insane
values.
Would not expect any significant changes in solver behavior, but
it could be more accurate in some cases.
Switching projective intersection to ceres is marked as a TODO
for now.
With new bundle adjustment based on Ceres we don't need
SSBA library anymore. This also means we don't need ldl
library and libmv is no longer depends on colamd as well.
Patch originally written by me, then finished by Sergey. Big
thanks to Sergey for troopering through and fixing the many issues
with my original (not compilable) patch.
The Ceres implementation uses 2 parameter blocks for each camera
(1 for rotation and 1 for translation), 1 parameter block for
common intrinsics (focal length etc) and 1 parameter block for
each track (e.g. bundle or 3D point).
We turn on some fancy optimizer options to get better performance,
in particular:
options.preconditioner_type = ceres::SCHUR_JACOBI;
options.linear_solver_type = ceres::ITERATIVE_SCHUR;
options.use_inner_iterations = true;
options.use_nonmonotonic_steps = true;
options.max_num_iterations = 100;
Special thanks to Sameer Agarwal of Ceres fame for splitting out
the SCHUR_JACOBI preconditioner so that it didn't depend on
CHOLMOD. Previously we could not use that preconditioner in
Blender because CHOLMOD is too large of a dependency for Blender.
BundleIntrinsicsLogMessage:
- Moved bunch of if(foo) LG << "bar" into this function, to make
EuclideanBundleCommonIntrinsics a little bit easier to follow.
EuclideanBundle:
- Fix RMSE logging.
structure instead of passing all the parameters to every function.
Makes it much easier to tweak distortion model.
---
svn merge -r52854:52855 ^/branches/soc-2011-tomato
- Moved keyframes and refirement flags into reconstruction options structure
- Moved distortion coefficients and other camera intrinsics into own structure
- Cleaned up reconstruction functions in libmv c-api
---
svn merge -r52853:52854 ^/branches/soc-2011-tomato
This is helpful because it brings CHOLMOB-free ITERATIVE_SCHUR and
SCHUR_JACOBI which is really nice for new upcoming bundle adjustment.
If also includes all the local fixes we made locally.
There're lots of other improvements/fixed which are not currently
would be so much visible in Blender, but which opens doors for some
great improvements in future.
This updates minilzo from version 2.03 to version 2.06 which
is like 3 years newer.
The main reason of this update is that older minilzo had some
strange valgrind warnings. Likely they're harmless, but it was
still annoying to troubleshot bakes with valgrind.
SSBA seemed to be working OK last time i've checked it
with MSVC and optimization enabled.
Also, we'll likely replace it with own BA soon, which
works fine with MSVC anyway.
find ldl symbols because order of libraries seems to be critical
for gcc linker.
A bit stupid, but that's how linker works..
Both CMake and SCons shall work fine on linux now.
Root of the issue goes to SSBA library which didn't work
properly when using optimization in MSVC. It was worked
around by disabling optimization for libmv, which is in
fact shame and shouldn't have been done.
It seems after some changes optimization does not affect
on SSBA code, but enabling optimization could be risky so
close to release.
For now solved by splitting SSBA to separate CMake/SCons
library, disabling optimization only for this particular
library and enabling optimization for rest of libmv.
Tested on all files which used to fail with optimization
enabled in SSBA and all of them works the same as before.
Tracking speed is significantly higher now.
After release we'll enable optimization for SSBA as well,
so there'll be no crappy build setup. Later we'll replace
old SSBA library with new BA code based on Ceres.
Bundle script would be broken for until then, so better
not to use it.
libmv still requires optimization switched off because
of some incompatibility of SSBA and MSVC optimizer which
makes bundle adjustment work just wrong.
This shall not be an issue for Ceres and no need to
disable optimization for extern_ceres
Note: this doesn't work yet for everything with latest stable bullet (2.81), need to look into why and likely apply some patches upstream.
However I managed to link blender by disabling some features, likely it can be made to work without too much trouble.
RangeTree is a simple C++ tree set for storing non-overlapping scalar
ranges. Original source from:
https://github.com/nicholasbishop/RangeTree
Also update the build systems to include RangeTree.
This commit is an attempt to improve collisions between moving Bullet rigid bodies using (concave) triangle mesh bounds.
Instead of using Gimpact, this we create a btCompoundShape with child shape tetrahedra derived from the surface triangles.
For each triangle, we add a fourth vertex using the centroid, shifting inwards using the triangle normal.
If the centroid hits an internal triangle, we stop. The default depth could be exposed as 'advanced' setting in the user interface.
This solution will be a slower than the original/gimpact solution, but a bit more reliable.
In the future, it is better to add HACD, convex decomposition to Blender, for moving concave meshes.
See http://kmamou.blogspot.com and the Bullet SDK's Demos/ConvexDecompositionDemo.