Commit Graph

116 Commits

Author SHA1 Message Date
0966a3b191 Fixed issues updating texture buffer used for clip editor frame display
when specific circumstances are met.

Mainly issue was caused by checking ImBuf pointers, which used to fail
when some post-processing flags are changed. This was caused by the
fact that freeing old ImBuf and allocating new one could lead to new
ImBuf have the same pointer as previous one, which confuses cache.
2012-07-09 10:26:01 +00:00
7b3a5ead8c Fix crash sliding disabled marker from preview widget.
Reported by brothermechanic, thanks!
2012-06-24 14:16:40 +00:00
470ad6fc0e Do not check result of BKE_tracking_marker_get -- it shall always
return valid marker. If not -- let blender crash, because that means
something went really bad and silencing this isn't good idea.

Also made mask parenting to tracking data aware of clip's start frame.
2012-06-20 10:54:56 +00:00
c4e386c772 DO not reset clip's focal length when changing path to footage 2012-06-18 18:22:49 +00:00
0723d75abd Now updating of resolution should happen nice when clip's filepath is changing 2012-06-17 16:40:16 +00:00
8da0a03774 2D stabilization didn't work since clip start frame commit 2012-06-15 11:15:48 +00:00
f0c724219d Internal refactoring of tracking module, should be no functional changes
- Re-arrange functions in headers and implementation file to make them
  more grouped by entity they're operating with. Also order of functions
  in implementation file should match order of functions in header for
  easier navigation.

- Rename some functions to match conventions of naming public functions.
- Some code de-duplication, still some room for improvements tho.
- Split main 2D tracking functions into smaller steps to make it more clear.

Accidentally OpenMP was disabled in some of previous commits, re-enable it.
2012-06-15 11:03:23 +00:00
46c95d37c6 Default value for frame offset should be 0 2012-06-12 21:29:15 +00:00
5dc0b35a01 Added frame offset slider to clip datablocks
In contrast to start_frame (which affects on where footage actually
starts to play and also affects on all data associated with a clip
such as motion tracking, reconstruction and so on) this slider only
affects on a way how frame number is mapping to a filename, without
touching any kind of tracking data.

The formula is:
  file_name = clip_file_name + frame_offset - (start_frame - 1)
2012-06-12 21:25:23 +00:00
552887251f Masking support for motion tracks
Added option to use Grease Pencil datablock as a mask for pattern
when doing motion tracking. Option could be found in Tracking Settings
panel.

All strokes would be rasterized separately from each other and every
stroke is treating as a closed spline.

Also added option to apply a mask on track preview which is situated
just after B/B/W channel button under track preview.
2012-06-12 11:13:53 +00:00
25bb441301 Planar tracking support for motion tracking
===========================================

Major list of changes done in tomato branch:

- Add a planar tracking implementation to libmv
  This adds a new planar tracking implementation to libmv. The
  tracker is based on Ceres[1], the new nonlinear minimizer that
  myself and Sameer released from Google as open source. Since
  the motion model is more involved, the interface is
  different than the RegionTracker interface used previously
  in Blender.

  The start of a C API in libmv-capi.{cpp,h} is also included.

- Migrate from pat_{min,max} for markers to 4 corners representation

  Convert markers in the movie clip editor / 2D tracker from using
  pat_min and pat_max notation to using the a more general, 4-corner
  representation.

  There is still considerable porting work to do; in particular
  sliding from preview widget does not work correct for rotated
  markers.

  All other areas should be ported to new representation:

  * Added support of sliding individual corners. LMB slide + Ctrl
    would scale the whole pattern
  * S would scale the whole marker, S-S would scale pattern only
  * Added support of marker's rotation which is currently rotates
    only patterns around their centers or all markers around median,

    Rotation or other non-translation/scaling transformation of search
    area doesn't make sense.

  * Track Preview widget would display transformed pattern which
    libmv actually operates with.

- "Efficient Second-order Minimization" for the planar tracker

  This implements the "Efficient Second-order Minimization"
  scheme, as supported by the existing translation tracker.
  This increases the amount of per-iteration work, but
  decreases the number of iterations required to converge and
  also increases the size of the basin of attraction for the
  optimization.

- Remove the use of the legacy RegionTracker API from Blender,
  and replaces it with the new TrackRegion API. This also
  adds several features to the planar tracker in libmv:

  * Do a brute-force initialization of tracking similar to "Hybrid"
    mode in the stable release, but using all floats. This is slower
    but more accurate. It is still necessary to evaluate if the
    performance loss is worth it. In particular, this change is
    necessary to support high bit depth imagery.

  * Add support for masks over the search window. This is a step
    towards supporting user-defined tracker masks. The tracker masks
    will make it easy for users to make a mask for e.g. a ball.

    Not exposed into interface yet/

  * Add Pearson product moment correlation coefficient checking (aka
    "Correlation" in the UI. This causes tracking failure if the
    tracked patch is not linearly related to the template.

  * Add support for warping a few points in addition to the supplied
    points. This is useful because the tracking code deliberately
    does not expose the underlying warp representation. Instead,
    warps are specified in an aparametric way via the correspondences.

- Replace the old style tracker configuration panel with the
  new planar tracking panel. From a users perspective, this means:

  * The old "tracking algorithm" picker is gone. There is only 1
    algorithm now. We may revisit this later, but I would much
    prefer to have only 1 algorithm. So far no optimization work
    has been done so the speed is not there yet.

  * There is now a dropdown to select the motion model. Choices:

        * Translation
        * Translation, rotation
        * Translation, scale
        * Translation, rotation, scale
        * Affine
        * Perspective

  * The old "Hybrid" mode is gone; instead there is a toggle to
    enable or disable translation-only tracker initialization. This
    is the equivalent of the hyrbid mode before, but rewritten to work
    with the new planar tracking modes.

  * The pyramid levels setting is gone. At a future date, the planar
    tracker will decide to use pyramids or not automatically. The
    pyramid setting was ultimately a mistake; with the brute force
    initialization it is unnecessary.

- Add light-normalized tracking

  Added the ability to normalize patterns by their average value while
  tracking, to make them invariant to global illumination changes.

Additional details could be found at wiki page [2]

  [1] http://code.google.com/p/ceres-solver
  [2] http://wiki.blender.org/index.php/Dev:Ref/Release_Notes/2.64/Motion_Tracker
2012-06-10 15:28:19 +00:00
916524d650 Fixed issue with non-updating frame in clip editor when toggling undistorted render while frame is grayscaled.
Also corrected some typos in movieclip.
2012-06-08 17:16:32 +00:00
8a500eea9a Avoid imbuf loading when getting movie clip size
This prevents high memory usage by non-proxied frames when doing mask parenting.

Description from code:

  Originally was needed to support image sequences with different image dimensions,
  which might be useful for such things as reconstruction of unordered image sequence,
  or painting/rotoscoping of non-equal-sized images, but this ended up in unneeded
  cache lookups and even unwanted non-proxied files loading when doing mask parenting,
  so let's disable this for now and assume image sequence consists of images with equal sizes
2012-06-07 16:15:24 +00:00
f43a733f59 Changed semantic of recently added start_frame
Now it's indicates at which scene frame number movie clip starts playing back.
This this setting is still belongs to clip datavlock and used by all users of
clip such as movie compositor nodes, constraints and so.

After long discussion and thoughts about this it was decided that this would
match image's current behavior (which initially seen a bit crappy), but that's
actually allows:

- Keep semantics of start frame in image and clip datablocks in sync
- Allows to support features like support of loading image sequences
  with crappy numbers in suffix which doesn't fit long int.
- Allows to eliminate extra boolean checkbox to control such kind of offset.

Hopefully from pipeline POV it wouldn't hurt because idea of having this things
implemented in original way was  working only if sequence before processing
started naming form 001.
2012-06-06 18:58:30 +00:00
0d61876ed0 Configurable start frame for movie clip datablocks as alternative to automatic start frame number
Number of start frame in opened image sequence used to be distinguished automatically
in a way that file name used on open would be displayed at scene frame #1.

But sometimes it's useful to have it manually configurable (like in cases when you're
processing image sequence and replacing clip's filepath to postprocessed image sequence
and want new clip to show at the same frame range as it was rendered from).

Added Custom Start Frame flag to movie clip (could be accessed from Footage panel in
clip editor) and Start Frame which means number of frame from sequence which would
be displayed at scene frame #1.

For example if you've got clip pointing to file render_00100.png and Start Frame of 100
this file would be displayed at scene frame #1, if Start Frame is 1 then this image
would be displayed at scene frame #100,
2012-06-05 18:38:09 +00:00
1cee8d1f1d Movie clip: remove workaround for #27997
it's not actually helps, but only confuses system when using openexr movie clips.
2012-05-23 16:19:04 +00:00
af3e348430 code cleanup: use TRUE/FALSE rather then 1/0 for better readability, also replace do prefix with do_ for bool vars. 2012-05-19 13:28:19 +00:00
f4705b38f9 Camera tracking: fixes for tracking of float images
- Fixed suddenly disappearing preview image from track widget
- Also suddenly stopping tracking should be fixed now

Both issues were caused by mixing working with floats and bytes and
in some cases it was wrong or missed checks done for this.
2012-05-09 08:33:11 +00:00
c79892c5cd Style cleanup of own modules using style checker from Campbell. 2012-05-07 08:53:59 +00:00
c93d7a193a style cleanup: BKE_*.c files which deal with library functions 2012-05-06 15:15:33 +00:00
a731e13043 code cleanup: function naming, use BKE_*type* prefix. 2012-05-05 14:03:12 +00:00
e3535e884a Style cleanup: spaces around operators 2012-05-03 23:47:39 +00:00
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
e701f9b670 style cleanup: whitespace / commas 2012-04-29 15:47:02 +00:00
f88cfd9168 Code and style cleanup in own modules in BKE and also mball module
- Make sure functions are named in way BKE_<object>_<action> (same way as RNA callbacks)
- Make functions which are used by mball.c only static and remove their prototypes
  from public header file.

Further cleanup is coming.
2012-04-28 16:49:00 +00:00
a434572654 Camera tracking: if there's no image for current frame display default grid
and allow to interact with tracks for operators which doesn't require image.

Merged from tomato branch: svn merge ^/branches/soc-2011-tomato -r45624:45625
2012-04-28 10:09:58 +00:00
b340f930ec style cleanup: changes to brace placement / newlines - for/while/if/switch 2012-04-28 06:31:57 +00:00
c1e475e527 code cleanup:
- remove unused vars
- no need to hard code version number for collada.
- cleanup some typos in comments.
- movieclip_calc_length was passing arg which should be unsigned to BLI_stringdec()
2012-04-08 07:34:09 +00:00
7018345bee Fixed deadlock on loading file without number group into movie clip editor 2012-04-07 16:37:55 +00:00
adbe628a1b Fix crash of Refresh Sequencer when some Movie / MovieClip strips doesn't have animation opened 2012-03-26 15:57:00 +00:00
69c9451c3e - MovieClip strips now have got valid color for older saved files
- Update Strip Length will now properly update lenght of movie clip
  strips created from movies before lenght was added there.
2012-03-26 13:36:22 +00:00
dbfe971c06 Fix for crash when adding image sequence movie clip into a sequencer 2012-03-26 13:30:53 +00:00
3fab018da4 Fix for object solver possible pointing to a freed memory when removing
movie clip data block from python/
2012-03-26 09:36:19 +00:00
1ce2c73816 Code style cleaup for motion-tracking modules.
Should be no functional changes.
2012-03-25 23:19:21 +00:00
69e6894b15 style cleanup: follow style guide for formatting of if/for/while loops, and else if's 2012-03-24 06:18:31 +00:00
d8623da305 == Sequencer ==
This adds movieclip input support to the sequencer, thereby making
undistorted and stabilized footage available without a seperate render step.

Also: removes some old cruft code from the sequencer:

* new_tstripdata wasn't used anymore
* StripElems were allocated for SCENE strips on full length, wasting memory
  Added a comment, that hopefully makes things a little bit clearer:
  StripElems are *only* usefull for MOVIE + IMAGE strips for all other strip
  types one can set this pointer to NULL. (If that should cause otherwise
  problems, then the code that doesn't check for NULL is to blame!)
2012-03-21 18:02:29 +00:00
f11a6d3a84 Adds support for utf paths on Windows.
Not all file formats/calls are supported yet. It will be expended.

Please from now on use BLI_fopen, BLI_* for file manipulations.
For non-windows systems BLI_fopen just calls fopen.
For Windows, the utf-8 string is translated to utf-16 string in order to call UTF version of the function.
2012-03-20 02:17:37 +00:00
95670e03a0 style cleanup / comment formatting for bli/bke/bmesh 2012-03-03 20:19:11 +00:00
6ca7d82932 code cleanup: white space, spelling & ';;' end of lines. 2012-02-25 16:04:03 +00:00
62d09c9103 Tomato: configurable filter type for 2d stabilization 2012-02-16 15:03:37 +00:00
14a92fc3a2 Tomato: run aspect correction before stabilizing shot. 2012-02-16 15:03:18 +00:00
da69173269 Tomato: fix for missing cache invalidation when disabling/enabling channels for stabilized shot 2012-02-16 07:45:01 +00:00
bd249c3bff Camera tracking: animation datablock for MovieClip
Added AnimData block to MovieClip datablock which allows to animate different
properties in clip. Currently supports animation of stabilization influence only.
2012-02-15 16:06:48 +00:00
2f90477272 Camera tracking: regression fixed after recent frame postprocessing refactor
No-proxied frames using for 2D tracking used to be putting to cache which lead
to extra memory usage which shouldn't happen.
2012-02-01 19:06:21 +00:00
a98a75346c quiet warnings and possible NULL checking crash fix for indentation functions. 2012-01-20 23:03:41 +00:00
f37d1b7b4e Color channels now can be disabled for the whole frame in clip editor 2012-01-15 13:31:58 +00:00
5e8940bcf1 Refactoring and code deduplicate in movie cache 2012-01-15 13:31:25 +00:00
0e4e608b71 Camera tracking: fixes for preview widget
- Clamping of image on boundaries now happens nicely
- Looks like to prevent dark edges on image boundary when doing
  bicubic interpolation, margin should be 3px. Maybe somebody can verify this?
2012-01-09 20:19:07 +00:00
a4604c457d Camera tracking: more accurate track preview widget
- Added 1px extra margin to deal with bicubic interpolation nicely
- Code should be a bit more clear now
2012-01-04 15:25:43 +00:00
c2ae77e5bd Merging r42896 through r42944 from trunk into soc-2911-tomato 2011-12-28 18:31:32 +00:00