Commit Graph

64 Commits

Author SHA1 Message Date
Sergey Sharybin
48ead27366 Camera tracking: switch dopesheet information to lazy calculation
All operators which changes tracking data now just tags dopsheet as outdated,
actual re-calculaiton of happens only when this information is actually needed
(like on dopesheet draw).

This makes things a bit faster when there's no dopesheet visible in current
screen and also makes it much easier to update dopesheet using dependency
graph.

Also renamed dopesheet_sort_order to dopesheet_sort_method in rna and internal
stuff which makes much more sense and also correlated with naming in
file browser.
2012-05-03 23:15:01 +00:00
Sergey Sharybin
b1006fb949 Clip editor: sort order for dopesheet channels
Supported sorting by name, longest tracked segment and total tracked frames.

Internally tracks are stored in Tracking datablock, but sort order is
a clip editor space property and sorting happens on clip editor draw.
If there's no dopesheet opened with different sort orders it's not
a problem due to re-sorting wouldn't happen.

Also fixed draw issue of tracked segments introduced in previous commit.
2012-05-03 19:28:41 +00:00
Sergey Sharybin
6f3400ca52 Clip editor: cleanup of View menu - do not show operators which doesn't make sense in dopesheet/curve view 2012-05-02 17:33:48 +00:00
Sergey Sharybin
f111131ca6 Camera tracking: initial commit of dopesheet view for clip editor
- Displays dopesheet information for selected tracks, and currently does not
  support any kind of editing.
- Changed regions to use the whole main region for such views as curves and dopesheet.
  This allows to have own panels with tools/properties in this area.
- Active clip is getting synchronized between different clip editor editors in the
  same screen, so updating of curve/dopesheet views happens automatically when one
  changes current clip in one of this editors.
- Panels in toolbox and properties panels are now separated to rely on current view
  mode, but some operators and poll functions still need to be updated.
- Added new screen called "Movie Tracking" where layout is configured to
  display timeline, main clip window, curves and dopesheet.
2012-04-30 16:19:20 +00:00
Sergey Sharybin
c27c87dde4 Camera tracking: backport refactoring made in local branches with masking and dopesheet view into trunk
Mostly related on changes in poll functions for tracking operators and some changes
to how interface is initializing for different view types.
2012-04-29 12:32:26 +00:00
Sergey Sharybin
51a4188105 Camera tracking: support of tripod motion solving
Expose option into interface to use modal solver which currently
supports only tripod motion.

This solver requires two tracks at least to reconstruct motion.
Using more tracks aren't improving solution in general, just adds
instability into solution and slows down things a lot.

Refirement of camera intrinsics was disabled due to it's not only
refines camera intrinsics but also adjusts camera position which
isn't necessary here

To use this solver just activate "Tripod Motion" checkbox in
solver panel.

Merged from tomato: svn merge ^/branches/soc-2011-tomato -r45622:45624 -r46036:46037

P.S. Quite experimental yet, requires more checking and probably
tweaks to prevent camera jumps when tracks apperars/disappears
from the screen.
2012-04-28 14:54:45 +00:00
Sergey Sharybin
f9d9b4635d Camera tracking: support of tripod motion solving
Expose option into interface to use modal solver which currently
supports only tripod motion.

This solver requires two tracks at least to reconstruct motion.
Using more tracks aren't improving solution in general, just adds
instability into solution and slows down things a lot.

Refirement of camera intrinsics is supported by this solver.

To use this solver just activate "Tripod Motion" checkbox in
solver panel.
2012-04-14 12:02:47 +00:00
Sergey Sharybin
bfca79a657 Merging r44227 through r45619 from trunk into soc-2011-tomato 2012-04-14 10:46:47 +00:00
Sergey Sharybin
c579625265 Fix for reconstruction menu which still was using set_floor operator instead of set_plane 2012-04-07 15:20:20 +00:00
Sergey Sharybin
991ab5802b Cleanup: move tracking settings to be just after Track panel which makes it easier to
control things during tracking.
2012-03-30 10:37:20 +00:00
Campbell Barton
9db821a5db lattice & UV 'select all' menu items were missing action assignment. 2012-03-18 20:10:58 +00:00
Bastien Montagne
02abb636a3 UI messages: unification of select/deselect stuff.
Previously we had three versions, Select/Deselect, Select or Deselect, and (De)select, choosen the third (shortest) one for now.
2012-03-17 19:14:08 +00:00
Sergey Sharybin
91c2aa7b95 Camera tracking: wall scene orientation operator
Made Set Floor a bit more general and name it Set Plane which defines
orientation from 3 selected tracks and makes them belong to specified
plane (wall or floor).
2012-03-06 12:27:42 +00:00
Sergey Sharybin
ed3b7e2c23 Camera tracking: configurable filter type for 2d stabilization
--
svn merge -r44151:44152 ^/branches/soc-2011-tomato
2012-02-17 08:27:19 +00:00
Sergey Sharybin
62d09c9103 Tomato: configurable filter type for 2d stabilization 2012-02-16 15:03:37 +00:00
Sergey Sharybin
81048fed74 Merging r43871 through r43908 from trunk into soc-2011-tomato 2012-02-05 14:39:43 +00:00
Sergey Sharybin
04a079668c Movie Clip Editor: cleanup of display panels
- Split display options into two panels:
  * Display, which contains all general display options related on editor itself
  * Marker Display, which contains options which makes sense for markers themselves
   and not used so often.
- Remove Show GPencil option which doesn't actually make sense because strokes might
  be disabled from GPencil panel
- Removed Show Pyramid option and show pyramid for KLT tracker as default.
- Added hotkey to toggle Show Disabled (Alt-D)
- Added hotkey to toggle Show Pattern (Alt-S)

Changes in interface and hotkeys are done by Sebastian Koenig.
 Thanks for the patch!

Own changes in interface were related on Aspect Ratio. It doesn't make
much sense for tracking (camera pixel aspect is what you'll want to use,
but for masking it would make much more sense because when you just
want to create a mask for footage you don't actually have camera).
Just removing from interface seems not so nice for now.

Merged from soc-2011-tomato rev43872
2012-02-05 13:43:58 +00:00
Campbell Barton
637bc0ddea Code Cleanup: pep8 edits 2012-02-04 11:10:41 +00:00
Sergey Sharybin
c8f5dac11b Movie Clip Editor: implemented option to display frame using OpenGL textures
Initial idea was to perform bilinear filtering for displaying proxied frame
to make it looking a bit smoother. It was done but it was also discovered
that using such kind of texture buffers helps on some crappy videocards
when playing $k footage.

Currently check for NPOT support is disabled, so use this option with care.
2012-02-03 19:13:31 +00:00
Sergey Sharybin
c354a6a02c Movie Clip Editor: cleanup of display panels
- Split display options into two panels:
  * Display, which contains all general display options related on editor itself
  * Marker Display, which contains options which makes sense for markers themselves
    and not used so often.
- Remove Show GPencil option which doesn't actually make sense because strokes might
  be disabled from GPencil panel
- Removed Show Pyramid option and show pyramid for KLT tracker as default.
- Added hotkey to toggle Show Disabled (Alt-D)
- Added hotkey to toggle Show Pattern (Alt-S)

Changes in interface and hotkeys are done by Sebastian Koenig.
Thanks for the patch!

Own changes in interface were related on Aspect Ratio. It doesn't make
much sense for tracking (camera pixel aspect is what you'll want to use,
but for masking it would make much more sense because when you just
want to create a mask for footage you don't actually have camera).
Just removing from interface seems not so nice for now.
2012-02-03 19:13:08 +00:00
Sergey Sharybin
f193291b32 Movie Clip Editor: proxy sizes for original and undistortted footages are now controlling separately 2012-02-01 18:08:37 +00:00
Sergey Sharybin
bcbe9ca5fc Color channels used for tracking is now a part of default tracking settings and also a part of presets. 2012-01-26 15:33:16 +00:00
Sergey Sharybin
6eb3d5cb50 Movie clip editor: default tracking settings can be copied from active track now 2012-01-26 15:04:25 +00:00
Sergey Sharybin
db57cbac20 More curves view improvements for clip editor:
- Renamed graph_jump_to_current_frame to graph_center_current_frame
  which makes more sense.
- Curve view now can be locked to time cursor (Lock to Time Cursor in
  Display panel or L button in curve view). Not sure if offset from
  locked position will make much sense here.
- Added hotkey for solving -- Shift-S.
2012-01-26 11:49:38 +00:00
Sergey Sharybin
bce89860f5 Various fixes for camera tracking stuff
- Fixed tooltip displaying for track sequence forwards in clip editor
- Corrected detection of 8 tracks so it wouldn't count tracks disabled
  on keyframes.
- Scale track preview to actual track widget size instead of scaling the
  whole preview image with given zoom ratio, so no extra memory needed to
  store zoomed margin would be used.
- Track's statistics text will fit pattern position instead of search if
  marker is disabled on current frame.
- Fixed toggle selection operator if selected track is hidden due to
  "Hide Disabled" policy.
2012-01-25 13:37:11 +00:00
Campbell Barton
a7c1e339cf picky cleanup to use of bpy.types 2012-01-18 06:11:56 +00:00
Sergey Sharybin
21b5dea29b PEP8 complaint changes 2012-01-17 17:27:18 +00:00
Sergey Sharybin
f37d1b7b4e Color channels now can be disabled for the whole frame in clip editor 2012-01-15 13:31:58 +00:00
Campbell Barton
93cf1531d0 fix own bug [#29875] Due to operators now reusing there last-used settings, some UI options are more or less broken (esp. in shortcuts and menu entries)
also prefer *.select_all rather then *.select_inverse operators, since this is an option for select_all.
2012-01-14 06:30:27 +00:00
Sergey Sharybin
5bf5d5a844 Camera tracking: tracks copy/paste operator
This commit implements basic clipboard support for movie tracking data
int clip editor. Used own implementation of clipboard like it's done
for sequencer.
Ideally it needed to be switched to more general clipboard system, but
currently this system is designed for text data only and it need to
be re-designed itself. But this feature is quite useful since object
tracking is implemented, so it should be OK to live with such own
implementation for a while.
2012-01-09 20:18:48 +00:00
Sergey Sharybin
d919c30ac3 More whitespace cleanup in python scripts 2012-01-06 21:25:28 +00:00
Thomas Dinges
e95a05b29d 2.6 UI Files:
* Some code cleanup.
2012-01-05 16:04:25 +00:00
Campbell Barton
1d152c77a5 minor style edits to space_clip & unused var 2011-12-31 02:40:33 +00:00
Sergey Sharybin
1dc74acc12 Object tracking: configurable scale for object solution
Added slider to define scale of object solution which is used to define
"depth" of object relative to camera position. This slider effects on all
"users" of object solution such as bundles display, constrained objects and so.

Added new operator called "Set Solution Scale" to set real scale for object
solution based on real distance between two bundles reconstructed for this object.

New slider and operator can be found on "Object" panel in toolbox when in
reconstruction mode and active tracking object isn't a camera.
2011-12-19 15:12:33 +00:00
Sergey Sharybin
4fe2df3b8c Make distortion panel be a bit more obvious label 2011-12-06 18:39:16 +00:00
Sergey Sharybin
6ac2bb8b94 Merging r42442 through r42457 from trunk into soc-2011-tomato 2011-12-06 09:27:18 +00:00
Sergey Sharybin
3b1e077b39 Camera tracking: fixed typo in remove tracking preset button 2011-12-06 09:23:35 +00:00
Campbell Barton
04464c6cf9 more minor py edits 2011-12-05 23:05:16 +00:00
Sergey Sharybin
cbe9713b50 Object solver: minor tweaks
- Rename solving button to Object Motion if active tracking object isn't a camera
- Ignore refine flags when solving object
2011-12-05 19:31:21 +00:00
Sergey Sharybin
9355cc5c39 Object tracking; initial commit
This commit implements basis stuff needed for object tracking,
use case isn't perfect now, interface also should be cleaned a bit.

- Added list of objects to be tracked. Default there's only one object called
  "Camera" which is used for solving camera motion. Other objects can be added
  and each of them will have it;s own list of tracks. Only one object can be used
  for camera solving at this moment.
- Added new constraint called "Object Tracking" which makes oriented object be
  moving in the save way as solved object motion.
- Scene orientation tools can be used for orienting object to bundles.
- All tools which works with list of tracks or reconstruction data now
  gets that lists from active editing object.
- All objects and their tracking data are available via python api.
2011-12-05 18:57:17 +00:00
Keir Mierle
e98e8acf1a Add minimum correlation widget to tracker default settings panel. 2011-12-04 14:08:58 +00:00
Keir Mierle
f1454ec399 Turn grayscale preview on if any channel toggles are active for motion tracking. 2011-12-04 13:58:40 +00:00
Keir Mierle
4bd3a296bb 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).
2011-12-04 13:46:25 +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
Keir Mierle
d00bb6dd56 Add a toggle button to display motion tracker previews in grayscale. 2011-12-04 12:58:31 +00:00
Keir Mierle
8e01cfa045 Don't show the "Correlation" tracking preset when the hybrid tracker is selected. 2011-12-03 23:33:07 +00:00
Sergey Sharybin
f382dda12d Fixed wrong operator usage in clip editor's reconstruction menu 2011-11-29 17:26:48 +00:00
Thomas Dinges
f64189573d * Never, ever use "col2" or something like that as UI variable name. 2011-11-28 17:10:32 +00:00
Sergey Sharybin
0b5ba70244 Rename tracking settings presets to something which makes more sense. 2011-11-28 16:10:50 +00:00
Sergey Sharybin
a3623a046b Camera tracking: merging tracking presets stuff from tomato branch
This commit implements:

- Configurable settings for newly creating tracks
  Now it's possible to set tracking algorithm and it's settings for
  all newly creating tracks including manual tracks creation and
  tracks creation by "Detect Features" operator.
- Moves margin, frames limit and adjust frame inside per-track
  settings.
  Was request from Francois for this.
- Adjust Frames replaced with menu called Pattern Match where it's
  possible to choose between matching pattern from keyframe frame
  or from previously tracked frame.
  Didn't see somebody used adjust frames values differ from 0 and 1,
  and this menu should make things more clear here/
2011-11-28 13:26:46 +00:00