Commit Graph

500 Commits

Author SHA1 Message Date
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
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
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
Campbell Barton
e06eea4fba fix for scons with recent change to how BINRELOC is enabled via cmake.
also add WITH_PYTHON define to qtcreator project generator until we get a way to add them properly.
2011-02-25 14:45:45 +00:00
Nathan Letwory
5e41760a15 doxygen: add bullet to extern libs, some small changes in page names, and fixes around license blocks 2011-02-22 16:12:12 +00:00
Campbell Barton
9ef0eed4b6 build python module without binreloc, add dummy argv[0] to initialize bprogname. 2011-02-21 13:13:08 +00:00