2011-11-07 13:55:18 +01:00
|
|
|
/*
|
|
|
|
* ***** BEGIN GPL LICENSE BLOCK *****
|
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU General Public License
|
|
|
|
* as published by the Free Software Foundation; either version 2
|
|
|
|
* of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program; if not, write to the Free Software Foundation,
|
|
|
|
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
|
|
|
*
|
2012-03-04 21:23:50 +01:00
|
|
|
* The Original Code is Copyright (C) 2011 Blender Foundation.
|
2011-11-07 13:55:18 +01:00
|
|
|
* All rights reserved.
|
|
|
|
*
|
|
|
|
* The Original Code is: all of this file.
|
|
|
|
*
|
|
|
|
* Contributor(s): Blender Foundation,
|
|
|
|
* Sergey Sharybin
|
|
|
|
*
|
|
|
|
* ***** END GPL LICENSE BLOCK *****
|
|
|
|
*/
|
|
|
|
|
|
|
|
/** \file DNA_tracking_types.h
|
|
|
|
* \ingroup DNA
|
|
|
|
* \since may-2011
|
|
|
|
* \author Sergey Sharybin
|
2013-03-02 08:27:19 +01:00
|
|
|
*
|
|
|
|
* Structs used for camera tracking and the movie-clip editor.
|
2011-11-07 13:55:18 +01:00
|
|
|
*/
|
|
|
|
|
2012-02-17 19:59:41 +01:00
|
|
|
#ifndef __DNA_TRACKING_TYPES_H__
|
|
|
|
#define __DNA_TRACKING_TYPES_H__
|
2011-12-30 08:25:49 +01:00
|
|
|
|
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 17:28:19 +02:00
|
|
|
#include "DNA_defs.h"
|
2011-11-07 13:55:18 +01:00
|
|
|
#include "DNA_listBase.h"
|
|
|
|
|
|
|
|
/* match-moving data */
|
|
|
|
|
2012-06-10 17:26:50 +02:00
|
|
|
struct bGPdata;
|
2011-11-07 13:55:18 +01:00
|
|
|
struct ImBuf;
|
2013-11-29 18:26:57 +01:00
|
|
|
struct Image;
|
2011-11-07 13:55:18 +01:00
|
|
|
struct MovieReconstructedCamera;
|
|
|
|
struct MovieTrackingCamera;
|
|
|
|
struct MovieTrackingBundle;
|
|
|
|
struct MovieTrackingMarker;
|
|
|
|
struct MovieTrackingTrack;
|
|
|
|
struct MovieTracking;
|
|
|
|
|
|
|
|
typedef struct MovieReconstructedCamera {
|
|
|
|
int framenr;
|
|
|
|
float error;
|
|
|
|
float mat[4][4];
|
|
|
|
} MovieReconstructedCamera;
|
|
|
|
|
|
|
|
typedef struct MovieTrackingCamera {
|
2012-06-10 21:59:02 +02:00
|
|
|
void *intrinsics; /* intrinsics handle */
|
2011-11-07 13:55:18 +01:00
|
|
|
|
2014-02-20 14:41:05 +01:00
|
|
|
short distortion_model;
|
|
|
|
short pad;
|
|
|
|
|
2012-06-10 21:59:02 +02:00
|
|
|
float sensor_width; /* width of CCD sensor */
|
|
|
|
float pixel_aspect; /* pixel aspect ratio */
|
|
|
|
float focal; /* focal length */
|
|
|
|
short units; /* units of focal length user is working with */
|
2011-11-07 13:55:18 +01:00
|
|
|
short pad1;
|
2012-06-10 21:59:02 +02:00
|
|
|
float principal[2]; /* principal point */
|
2014-02-20 14:41:05 +01:00
|
|
|
|
|
|
|
/* Polynomial distortion */
|
|
|
|
float k1, k2, k3; /* polynomial radial distortion */
|
|
|
|
|
|
|
|
/* Division distortion model coefficients */
|
|
|
|
float division_k1, division_k2;
|
2011-11-07 13:55:18 +01:00
|
|
|
} MovieTrackingCamera;
|
|
|
|
|
|
|
|
typedef struct MovieTrackingMarker {
|
2012-06-10 21:59:02 +02:00
|
|
|
float pos[2]; /* 2d position of marker on frame (in unified 0..1 space) */
|
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 17:28:19 +02:00
|
|
|
|
|
|
|
/* corners of pattern in the following order:
|
|
|
|
*
|
|
|
|
* Y
|
|
|
|
* ^
|
|
|
|
* | (3) --- (2)
|
|
|
|
* | | |
|
|
|
|
* | | |
|
|
|
|
* | | |
|
|
|
|
* | (0) --- (1)
|
|
|
|
* +-------------> X
|
|
|
|
*
|
|
|
|
* the coordinates are stored relative to pos.
|
|
|
|
*/
|
|
|
|
float pattern_corners[4][2];
|
|
|
|
|
|
|
|
/* positions of left-bottom and right-top corners of search area (in unified 0..1 units,
|
|
|
|
* relative to marker->pos
|
|
|
|
*/
|
|
|
|
float search_min[2], search_max[2];
|
|
|
|
|
2012-06-10 21:59:02 +02:00
|
|
|
int framenr; /* number of frame marker is associated with */
|
|
|
|
int flag; /* Marker's flag (alive, ...) */
|
2011-11-07 13:55:18 +01:00
|
|
|
} MovieTrackingMarker;
|
|
|
|
|
|
|
|
typedef struct MovieTrackingTrack {
|
|
|
|
struct MovieTrackingTrack *next, *prev;
|
|
|
|
|
2012-06-10 21:59:02 +02:00
|
|
|
char name[64]; /* MAX_NAME */
|
2011-11-07 13:55:18 +01:00
|
|
|
|
|
|
|
/* ** setings ** */
|
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 17:28:19 +02:00
|
|
|
|
|
|
|
/* positions of left-bottom and right-top corners of pattern (in unified 0..1 units,
|
|
|
|
* relative to marker->pos)
|
|
|
|
* moved to marker's corners since planar tracking implementation
|
|
|
|
*/
|
|
|
|
float pat_min[2] DNA_DEPRECATED, pat_max[2] DNA_DEPRECATED;
|
|
|
|
|
|
|
|
/* positions of left-bottom and right-top corners of search area (in unified 0..1 units,
|
|
|
|
* relative to marker->pos
|
|
|
|
* moved to marker since affine tracking implementation
|
|
|
|
*/
|
|
|
|
float search_min[2] DNA_DEPRECATED, search_max[2] DNA_DEPRECATED;
|
|
|
|
|
2012-06-10 21:59:02 +02:00
|
|
|
float offset[2]; /* offset to "parenting" point */
|
2011-11-07 13:55:18 +01:00
|
|
|
|
|
|
|
/* ** track ** */
|
2012-06-10 21:59:02 +02:00
|
|
|
int markersnr; /* count of markers in track */
|
|
|
|
int last_marker; /* most recently used marker */
|
|
|
|
MovieTrackingMarker *markers; /* markers in track */
|
2011-11-07 13:55:18 +01:00
|
|
|
|
|
|
|
/* ** reconstruction data ** */
|
2012-06-10 21:59:02 +02:00
|
|
|
float bundle_pos[3]; /* reconstructed position */
|
|
|
|
float error; /* average track reprojection error */
|
2011-11-07 13:55:18 +01:00
|
|
|
|
|
|
|
/* ** UI editing ** */
|
2012-06-10 21:59:02 +02:00
|
|
|
int flag, pat_flag, search_flag; /* flags (selection, ...) */
|
|
|
|
float color[3]; /* custom color for track */
|
2011-11-07 13:55:18 +01:00
|
|
|
|
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 17:28:19 +02:00
|
|
|
/* ** control how tracking happens */
|
2012-06-10 21:59:02 +02:00
|
|
|
short frames_limit; /* number of frames to be tarcked during single tracking session (if TRACKING_FRAMES_LIMIT is set) */
|
|
|
|
short margin; /* margin from frame boundaries */
|
|
|
|
short pattern_match; /* re-adjust every N frames */
|
2011-11-07 13:55:18 +01:00
|
|
|
|
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 17:28:19 +02:00
|
|
|
/* tracking parameters */
|
|
|
|
short motion_model; /* model of the motion for this track */
|
|
|
|
int algorithm_flag; /* flags for the tracking algorithm (use brute, use esm, use pyramid, etc */
|
2012-06-10 21:59:02 +02:00
|
|
|
float minimum_correlation; /* minimal correlation which is still treated as successful tracking */
|
2012-06-10 17:26:50 +02:00
|
|
|
|
2012-06-10 21:59:02 +02:00
|
|
|
struct bGPdata *gpd; /* grease-pencil data */
|
2013-10-26 15:22:38 +02:00
|
|
|
|
|
|
|
/* Weight of this track.
|
|
|
|
*
|
|
|
|
* Weight defines how much the track affects on the final reconstruction,
|
|
|
|
* usually gets animated in a way so when track has just appeared it's
|
|
|
|
* weight is zero and then it gets faded up.
|
|
|
|
*
|
|
|
|
* Used to prevent jumps of the camera when tracks are appearing or
|
|
|
|
* disappearing.
|
|
|
|
*/
|
|
|
|
float weight, pad;
|
2011-11-07 13:55:18 +01:00
|
|
|
} MovieTrackingTrack;
|
|
|
|
|
Merge plane track feature from tomato branch
This commit includes all the changes made for plane tracker
in tomato branch.
Movie clip editor changes:
- Artist might create a plane track out of multiple point
tracks which belongs to the same track (minimum amount of
point tracks is 4, maximum is not actually limited).
When new plane track is added, it's getting "tracked"
across all point tracks, which makes it stick to the same
plane point tracks belong to.
- After plane track was added, it need to be manually adjusted
in a way it covers feature one might to mask/replace.
General transform tools (G, R, S) or sliding corners with
a mouse could be sued for this. Plane corner which
corresponds to left bottom image corner has got X/Y axis
on it (red is for X axis, green for Y).
- Re-adjusting plane corners makes plane to be "re-tracked"
for the frames sequence between current frame and next
and previous keyframes.
- Kayframes might be removed from the plane, using Shit-X
(Marker Delete) operator. However, currently manual
re-adjustment or "re-track" trigger is needed.
Compositor changes:
- Added new node called Plane Track Deform.
- User selects which plane track to use (for this he need
to select movie clip datablock, object and track names).
- Node gets an image input, which need to be warped into
the plane.
- Node outputs:
* Input image warped into the plane.
* Plane, rasterized to a mask.
Masking changes:
- Mask points might be parented to a plane track, which
makes this point deforming in a way as if it belongs
to the tracked plane.
Some video tutorials are available:
- Coder video: http://www.youtube.com/watch?v=vISEwqNHqe4
- Artist video: https://vimeo.com/71727578
This is mine and Keir's holiday code project :)
2013-08-16 11:46:30 +02:00
|
|
|
typedef struct MovieTrackingPlaneMarker {
|
|
|
|
/* Corners of the plane in the following order:
|
|
|
|
*
|
|
|
|
* Y
|
|
|
|
* ^
|
|
|
|
* | (3) --- (2)
|
|
|
|
* | | |
|
|
|
|
* | | |
|
|
|
|
* | | |
|
|
|
|
* | (0) --- (1)
|
|
|
|
* +-------------> X
|
|
|
|
*
|
|
|
|
* The coordinates are stored in frame normalized coordinates.
|
|
|
|
*/
|
|
|
|
float corners[4][2];
|
|
|
|
|
|
|
|
int framenr; /* Number of frame plane marker is associated with */
|
|
|
|
int flag; /* Marker's flag (alive, ...) */
|
|
|
|
} MovieTrackingPlaneMarker;
|
|
|
|
|
|
|
|
typedef struct MovieTrackingPlaneTrack {
|
|
|
|
struct MovieTrackingPlaneTrack *next, *prev;
|
|
|
|
|
|
|
|
char name[64]; /* MAX_NAME */
|
|
|
|
|
|
|
|
MovieTrackingTrack **point_tracks; /* Array of point tracks used to define this plane.
|
2013-09-14 14:04:10 +02:00
|
|
|
* Each element is a pointer to MovieTrackingTrack. */
|
Merge plane track feature from tomato branch
This commit includes all the changes made for plane tracker
in tomato branch.
Movie clip editor changes:
- Artist might create a plane track out of multiple point
tracks which belongs to the same track (minimum amount of
point tracks is 4, maximum is not actually limited).
When new plane track is added, it's getting "tracked"
across all point tracks, which makes it stick to the same
plane point tracks belong to.
- After plane track was added, it need to be manually adjusted
in a way it covers feature one might to mask/replace.
General transform tools (G, R, S) or sliding corners with
a mouse could be sued for this. Plane corner which
corresponds to left bottom image corner has got X/Y axis
on it (red is for X axis, green for Y).
- Re-adjusting plane corners makes plane to be "re-tracked"
for the frames sequence between current frame and next
and previous keyframes.
- Kayframes might be removed from the plane, using Shit-X
(Marker Delete) operator. However, currently manual
re-adjustment or "re-track" trigger is needed.
Compositor changes:
- Added new node called Plane Track Deform.
- User selects which plane track to use (for this he need
to select movie clip datablock, object and track names).
- Node gets an image input, which need to be warped into
the plane.
- Node outputs:
* Input image warped into the plane.
* Plane, rasterized to a mask.
Masking changes:
- Mask points might be parented to a plane track, which
makes this point deforming in a way as if it belongs
to the tracked plane.
Some video tutorials are available:
- Coder video: http://www.youtube.com/watch?v=vISEwqNHqe4
- Artist video: https://vimeo.com/71727578
This is mine and Keir's holiday code project :)
2013-08-16 11:46:30 +02:00
|
|
|
int point_tracksnr, pad; /* Number of tracks in point_tracks array. */
|
|
|
|
|
|
|
|
MovieTrackingPlaneMarker *markers; /* Markers in the plane track */
|
|
|
|
int markersnr; /* Count of markers in track (size of markers array) */
|
|
|
|
|
|
|
|
int flag; /* flags (selection, ...) */
|
|
|
|
|
2013-11-29 18:26:57 +01:00
|
|
|
struct Image *image; /* Image displaying during editing */
|
|
|
|
float image_opacity; /* Opacity of the image */
|
|
|
|
|
Merge plane track feature from tomato branch
This commit includes all the changes made for plane tracker
in tomato branch.
Movie clip editor changes:
- Artist might create a plane track out of multiple point
tracks which belongs to the same track (minimum amount of
point tracks is 4, maximum is not actually limited).
When new plane track is added, it's getting "tracked"
across all point tracks, which makes it stick to the same
plane point tracks belong to.
- After plane track was added, it need to be manually adjusted
in a way it covers feature one might to mask/replace.
General transform tools (G, R, S) or sliding corners with
a mouse could be sued for this. Plane corner which
corresponds to left bottom image corner has got X/Y axis
on it (red is for X axis, green for Y).
- Re-adjusting plane corners makes plane to be "re-tracked"
for the frames sequence between current frame and next
and previous keyframes.
- Kayframes might be removed from the plane, using Shit-X
(Marker Delete) operator. However, currently manual
re-adjustment or "re-track" trigger is needed.
Compositor changes:
- Added new node called Plane Track Deform.
- User selects which plane track to use (for this he need
to select movie clip datablock, object and track names).
- Node gets an image input, which need to be warped into
the plane.
- Node outputs:
* Input image warped into the plane.
* Plane, rasterized to a mask.
Masking changes:
- Mask points might be parented to a plane track, which
makes this point deforming in a way as if it belongs
to the tracked plane.
Some video tutorials are available:
- Coder video: http://www.youtube.com/watch?v=vISEwqNHqe4
- Artist video: https://vimeo.com/71727578
This is mine and Keir's holiday code project :)
2013-08-16 11:46:30 +02:00
|
|
|
/* Runtime data */
|
2013-11-29 18:26:57 +01:00
|
|
|
int last_marker; /* Most recently used marker */
|
Merge plane track feature from tomato branch
This commit includes all the changes made for plane tracker
in tomato branch.
Movie clip editor changes:
- Artist might create a plane track out of multiple point
tracks which belongs to the same track (minimum amount of
point tracks is 4, maximum is not actually limited).
When new plane track is added, it's getting "tracked"
across all point tracks, which makes it stick to the same
plane point tracks belong to.
- After plane track was added, it need to be manually adjusted
in a way it covers feature one might to mask/replace.
General transform tools (G, R, S) or sliding corners with
a mouse could be sued for this. Plane corner which
corresponds to left bottom image corner has got X/Y axis
on it (red is for X axis, green for Y).
- Re-adjusting plane corners makes plane to be "re-tracked"
for the frames sequence between current frame and next
and previous keyframes.
- Kayframes might be removed from the plane, using Shit-X
(Marker Delete) operator. However, currently manual
re-adjustment or "re-track" trigger is needed.
Compositor changes:
- Added new node called Plane Track Deform.
- User selects which plane track to use (for this he need
to select movie clip datablock, object and track names).
- Node gets an image input, which need to be warped into
the plane.
- Node outputs:
* Input image warped into the plane.
* Plane, rasterized to a mask.
Masking changes:
- Mask points might be parented to a plane track, which
makes this point deforming in a way as if it belongs
to the tracked plane.
Some video tutorials are available:
- Coder video: http://www.youtube.com/watch?v=vISEwqNHqe4
- Artist video: https://vimeo.com/71727578
This is mine and Keir's holiday code project :)
2013-08-16 11:46:30 +02:00
|
|
|
} MovieTrackingPlaneTrack;
|
|
|
|
|
2011-11-07 13:55:18 +01:00
|
|
|
typedef struct MovieTrackingSettings {
|
2011-11-28 14:26:46 +01:00
|
|
|
int flag;
|
|
|
|
|
|
|
|
/* ** default tracker settings */
|
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 17:28:19 +02:00
|
|
|
short default_motion_model; /* model of the motion for this track */
|
|
|
|
short default_algorithm_flag; /* flags for the tracking algorithm (use brute, use esm, use pyramid, etc */
|
|
|
|
float default_minimum_correlation; /* minimal correlation which is still treated as successful tracking */
|
|
|
|
short default_pattern_size; /* size of pattern area for new tracks */
|
|
|
|
short default_search_size; /* size of search area for new tracks */
|
|
|
|
short default_frames_limit; /* number of frames to be tarcked during single tracking session (if TRACKING_FRAMES_LIMIT is set) */
|
|
|
|
short default_margin; /* margin from frame boundaries */
|
|
|
|
short default_pattern_match; /* re-adjust every N frames */
|
|
|
|
short default_flag; /* default flags like color channels used by default */
|
2014-02-19 13:42:32 +01:00
|
|
|
float default_weight; /* default weight of the track */
|
2012-01-26 16:33:16 +01:00
|
|
|
|
2012-06-10 21:59:02 +02:00
|
|
|
short motion_flag; /* flags describes motion type */
|
2011-11-28 14:26:46 +01:00
|
|
|
|
2011-11-07 13:55:18 +01:00
|
|
|
/* ** common tracker settings ** */
|
2012-06-10 21:59:02 +02:00
|
|
|
short speed; /* speed of tracking */
|
2011-11-07 13:55:18 +01:00
|
|
|
|
|
|
|
/* ** reconstruction settings ** */
|
2012-10-09 12:33:18 +02:00
|
|
|
int keyframe1 DNA_DEPRECATED,
|
2012-11-12 08:33:01 +01:00
|
|
|
keyframe2 DNA_DEPRECATED; /* two keyframes for reconstruction initialization
|
2012-10-09 12:33:18 +02:00
|
|
|
* were moved to per-tracking object settings
|
|
|
|
*/
|
2011-11-07 13:55:18 +01:00
|
|
|
|
2014-02-19 13:42:32 +01:00
|
|
|
int reconstruction_flag;
|
2012-11-05 09:04:27 +01:00
|
|
|
|
2012-04-14 14:02:47 +02:00
|
|
|
/* which camera intrinsics to refine. uses on the REFINE_* flags */
|
|
|
|
short refine_camera_intrinsics, pad2;
|
Assorted camera tracker improvements
- Add support for refining the camera's intrinsic parameters
during a solve. Currently, refining supports only the following
combinations of intrinsic parameters:
f
f, cx, cy
f, cx, cy, k1, k2
f, k1
f, k1, k2
This is not the same as autocalibration, since the user must
still make a reasonable initial guess about the focal length and
other parameters, whereas true autocalibration would eliminate
the need for the user specify intrinsic parameters at all.
However, the solver works well with only rough guesses for the
focal length, so perhaps full autocalibation is not that
important.
Adding support for the last two combinations, (f, k1) and (f,
k1, k2) required changes to the library libmv depends on for
bundle adjustment, SSBA. These changes should get ported
upstream not just to libmv but to SSBA as well.
- Improved the region of convergence for bundle adjustment by
increasing the number of Levenberg-Marquardt iterations from 50
to 500. This way, the solver is able to crawl out of the bad
local minima it gets stuck in when changing from, for example,
bundling k1 and k2 to just k1 and resetting k2 to 0.
- Add several new region tracker implementations. A region tracker
is a libmv concept, which refers to tracking a template image
pattern through frames. The impact to end users is that tracking
should "just work better". I am reserving a more detailed
writeup, and maybe a paper, for later.
- Other libmv tweaks, such as detecting that a tracker is headed
outside of the image bounds.
This includes several changes made directly to the libmv extern
code rather expecting to get those changes through normal libmv
channels, because I, the libmv BDFL, decided it was faster to work
on libmv directly in Blender, then later reverse-port the libmv
changes from Blender back into libmv trunk. The interesting part
is that I added a full Levenberg-Marquardt loop to the region
tracking code, which should lead to a more stable solutions. I
also added a hacky implementation of "Efficient Second-Order
Minimization" for tracking, which works nicely. A more detailed
quantitative evaluation will follow.
Original patch by Keir, cleaned a bit by myself.
2011-11-14 07:41:23 +01:00
|
|
|
|
2011-11-07 13:55:18 +01:00
|
|
|
/* ** tool settings ** */
|
|
|
|
|
|
|
|
/* set scale */
|
2012-06-10 21:59:02 +02:00
|
|
|
float dist; /* distance between two bundles used for scene scaling */
|
2011-11-07 13:55:18 +01:00
|
|
|
|
|
|
|
/* cleanup */
|
|
|
|
int clean_frames, clean_action;
|
2011-12-19 16:12:33 +01:00
|
|
|
float clean_error;
|
|
|
|
|
|
|
|
/* set object scale */
|
2012-06-10 21:59:02 +02:00
|
|
|
float object_distance; /* distance between two bundles used for object scaling */
|
2012-01-26 16:33:16 +01:00
|
|
|
|
|
|
|
int pad3;
|
2011-11-07 13:55:18 +01:00
|
|
|
} MovieTrackingSettings;
|
|
|
|
|
|
|
|
typedef struct MovieTrackingStabilization {
|
|
|
|
int flag;
|
2012-06-10 21:59:02 +02:00
|
|
|
int tot_track, act_track; /* total number and index of active track in list */
|
2011-11-07 13:55:18 +01:00
|
|
|
|
|
|
|
/* 2d stabilization */
|
2012-06-10 21:59:02 +02:00
|
|
|
float maxscale; /* max auto-scale factor */
|
|
|
|
MovieTrackingTrack *rot_track; /* track used to stabilize rotation */
|
2011-11-07 13:55:18 +01:00
|
|
|
|
2012-06-10 21:59:02 +02:00
|
|
|
float locinf, scaleinf, rotinf; /* influence on location, scale and rotation */
|
2011-11-07 13:55:18 +01:00
|
|
|
|
2012-06-10 21:59:02 +02:00
|
|
|
int filter; /* filter used for pixel interpolation */
|
2012-02-16 16:03:37 +01:00
|
|
|
|
2011-11-07 13:55:18 +01:00
|
|
|
/* some pre-computing run-time variables */
|
2012-06-10 21:59:02 +02:00
|
|
|
int ok; /* are precomputed values and scaled buf relevant? */
|
|
|
|
float scale; /* autoscale factor */
|
2011-11-07 13:55:18 +01:00
|
|
|
} MovieTrackingStabilization;
|
|
|
|
|
|
|
|
typedef struct MovieTrackingReconstruction {
|
|
|
|
int flag;
|
|
|
|
|
2012-06-10 21:59:02 +02:00
|
|
|
float error; /* average error of reconstruction */
|
2011-11-07 13:55:18 +01:00
|
|
|
|
2012-06-10 21:59:02 +02:00
|
|
|
int last_camera; /* most recently used camera */
|
|
|
|
int camnr; /* number of reconstructed cameras */
|
|
|
|
struct MovieReconstructedCamera *cameras; /* reconstructed cameras */
|
2011-11-07 13:55:18 +01:00
|
|
|
} MovieTrackingReconstruction;
|
|
|
|
|
2011-12-05 19:57:17 +01:00
|
|
|
typedef struct MovieTrackingObject {
|
|
|
|
struct MovieTrackingObject *next, *prev;
|
|
|
|
|
2012-06-10 21:59:02 +02:00
|
|
|
char name[64]; /* Name of tracking object, MAX_NAME */
|
2011-12-19 16:12:33 +01:00
|
|
|
int flag;
|
2012-06-10 21:59:02 +02:00
|
|
|
float scale; /* scale of object solution in amera space */
|
2011-12-19 16:12:33 +01:00
|
|
|
|
2012-06-10 21:59:02 +02:00
|
|
|
ListBase tracks; /* list of tracks use to tracking this object */
|
Merge plane track feature from tomato branch
This commit includes all the changes made for plane tracker
in tomato branch.
Movie clip editor changes:
- Artist might create a plane track out of multiple point
tracks which belongs to the same track (minimum amount of
point tracks is 4, maximum is not actually limited).
When new plane track is added, it's getting "tracked"
across all point tracks, which makes it stick to the same
plane point tracks belong to.
- After plane track was added, it need to be manually adjusted
in a way it covers feature one might to mask/replace.
General transform tools (G, R, S) or sliding corners with
a mouse could be sued for this. Plane corner which
corresponds to left bottom image corner has got X/Y axis
on it (red is for X axis, green for Y).
- Re-adjusting plane corners makes plane to be "re-tracked"
for the frames sequence between current frame and next
and previous keyframes.
- Kayframes might be removed from the plane, using Shit-X
(Marker Delete) operator. However, currently manual
re-adjustment or "re-track" trigger is needed.
Compositor changes:
- Added new node called Plane Track Deform.
- User selects which plane track to use (for this he need
to select movie clip datablock, object and track names).
- Node gets an image input, which need to be warped into
the plane.
- Node outputs:
* Input image warped into the plane.
* Plane, rasterized to a mask.
Masking changes:
- Mask points might be parented to a plane track, which
makes this point deforming in a way as if it belongs
to the tracked plane.
Some video tutorials are available:
- Coder video: http://www.youtube.com/watch?v=vISEwqNHqe4
- Artist video: https://vimeo.com/71727578
This is mine and Keir's holiday code project :)
2013-08-16 11:46:30 +02:00
|
|
|
ListBase plane_tracks; /* list of plane tracks used by this object */
|
2012-06-10 21:59:02 +02:00
|
|
|
MovieTrackingReconstruction reconstruction; /* reconstruction data for this object */
|
2012-10-09 12:33:18 +02:00
|
|
|
|
2012-11-05 09:04:27 +01:00
|
|
|
/* reconstruction options */
|
2012-11-12 08:33:01 +01:00
|
|
|
int keyframe1, keyframe2; /* two keyframes for reconstruction initialization */
|
2011-12-05 19:57:17 +01:00
|
|
|
} MovieTrackingObject;
|
|
|
|
|
2011-11-28 14:49:42 +01:00
|
|
|
typedef struct MovieTrackingStats {
|
|
|
|
char message[256];
|
|
|
|
} MovieTrackingStats;
|
|
|
|
|
2012-04-30 18:19:20 +02:00
|
|
|
typedef struct MovieTrackingDopesheetChannel {
|
|
|
|
struct MovieTrackingDopesheetChannel *next, *prev;
|
2012-05-03 19:52:34 +02:00
|
|
|
|
2012-06-10 21:59:02 +02:00
|
|
|
MovieTrackingTrack *track; /* motion track for which channel is created */
|
2012-05-03 19:52:34 +02:00
|
|
|
int pad;
|
|
|
|
|
2012-06-12 19:11:00 +02:00
|
|
|
char name[64]; /* name of channel */
|
|
|
|
|
2012-06-10 21:59:02 +02:00
|
|
|
int tot_segment; /* total number of segments */
|
|
|
|
int *segments; /* tracked segments */
|
|
|
|
int max_segment, total_frames; /* longest segment length and total number of tracked frames */
|
2012-04-30 18:19:20 +02:00
|
|
|
} MovieTrackingDopesheetChannel;
|
|
|
|
|
2013-02-22 11:13:15 +01:00
|
|
|
typedef struct MovieTrackingDopesheetCoverageSegment {
|
|
|
|
struct MovieTrackingDopesheetCoverageSegment *next, *prev;
|
|
|
|
|
|
|
|
int coverage;
|
|
|
|
int start_frame;
|
|
|
|
int end_frame;
|
|
|
|
|
|
|
|
int pad;
|
|
|
|
} MovieTrackingDopesheetCoverageSegment;
|
|
|
|
|
2012-04-30 18:19:20 +02:00
|
|
|
typedef struct MovieTrackingDopesheet {
|
2012-06-12 19:10:24 +02:00
|
|
|
int ok; /* flag if dopesheet information is still relevant */
|
2012-05-04 01:15:01 +02:00
|
|
|
|
2012-06-12 19:10:24 +02:00
|
|
|
short sort_method; /* method to be used to sort tracks */
|
|
|
|
short flag; /* dopesheet building flag such as inverted order of sort */
|
|
|
|
|
2013-02-22 11:13:15 +01:00
|
|
|
/* ** runtime stuff ** */
|
|
|
|
|
|
|
|
/* summary */
|
|
|
|
ListBase coverage_segments;
|
|
|
|
|
|
|
|
/* detailed */
|
2012-04-30 18:19:20 +02:00
|
|
|
ListBase channels;
|
2012-05-03 21:28:41 +02:00
|
|
|
int tot_channel;
|
|
|
|
|
2012-06-12 19:10:24 +02:00
|
|
|
int pad;
|
2012-04-30 18:19:20 +02:00
|
|
|
} MovieTrackingDopesheet;
|
|
|
|
|
2011-11-07 13:55:18 +01:00
|
|
|
typedef struct MovieTracking {
|
2012-06-10 21:59:02 +02:00
|
|
|
MovieTrackingSettings settings; /* different tracking-related settings */
|
|
|
|
MovieTrackingCamera camera; /* camera intrinsics */
|
|
|
|
ListBase tracks; /* list of tracks used for camera object */
|
Merge plane track feature from tomato branch
This commit includes all the changes made for plane tracker
in tomato branch.
Movie clip editor changes:
- Artist might create a plane track out of multiple point
tracks which belongs to the same track (minimum amount of
point tracks is 4, maximum is not actually limited).
When new plane track is added, it's getting "tracked"
across all point tracks, which makes it stick to the same
plane point tracks belong to.
- After plane track was added, it need to be manually adjusted
in a way it covers feature one might to mask/replace.
General transform tools (G, R, S) or sliding corners with
a mouse could be sued for this. Plane corner which
corresponds to left bottom image corner has got X/Y axis
on it (red is for X axis, green for Y).
- Re-adjusting plane corners makes plane to be "re-tracked"
for the frames sequence between current frame and next
and previous keyframes.
- Kayframes might be removed from the plane, using Shit-X
(Marker Delete) operator. However, currently manual
re-adjustment or "re-track" trigger is needed.
Compositor changes:
- Added new node called Plane Track Deform.
- User selects which plane track to use (for this he need
to select movie clip datablock, object and track names).
- Node gets an image input, which need to be warped into
the plane.
- Node outputs:
* Input image warped into the plane.
* Plane, rasterized to a mask.
Masking changes:
- Mask points might be parented to a plane track, which
makes this point deforming in a way as if it belongs
to the tracked plane.
Some video tutorials are available:
- Coder video: http://www.youtube.com/watch?v=vISEwqNHqe4
- Artist video: https://vimeo.com/71727578
This is mine and Keir's holiday code project :)
2013-08-16 11:46:30 +02:00
|
|
|
ListBase plane_tracks; /* list of plane tracks used by camera object */
|
2012-06-10 21:59:02 +02:00
|
|
|
MovieTrackingReconstruction reconstruction; /* reconstruction data for camera object */
|
|
|
|
MovieTrackingStabilization stabilization; /* stabilization data */
|
Merge plane track feature from tomato branch
This commit includes all the changes made for plane tracker
in tomato branch.
Movie clip editor changes:
- Artist might create a plane track out of multiple point
tracks which belongs to the same track (minimum amount of
point tracks is 4, maximum is not actually limited).
When new plane track is added, it's getting "tracked"
across all point tracks, which makes it stick to the same
plane point tracks belong to.
- After plane track was added, it need to be manually adjusted
in a way it covers feature one might to mask/replace.
General transform tools (G, R, S) or sliding corners with
a mouse could be sued for this. Plane corner which
corresponds to left bottom image corner has got X/Y axis
on it (red is for X axis, green for Y).
- Re-adjusting plane corners makes plane to be "re-tracked"
for the frames sequence between current frame and next
and previous keyframes.
- Kayframes might be removed from the plane, using Shit-X
(Marker Delete) operator. However, currently manual
re-adjustment or "re-track" trigger is needed.
Compositor changes:
- Added new node called Plane Track Deform.
- User selects which plane track to use (for this he need
to select movie clip datablock, object and track names).
- Node gets an image input, which need to be warped into
the plane.
- Node outputs:
* Input image warped into the plane.
* Plane, rasterized to a mask.
Masking changes:
- Mask points might be parented to a plane track, which
makes this point deforming in a way as if it belongs
to the tracked plane.
Some video tutorials are available:
- Coder video: http://www.youtube.com/watch?v=vISEwqNHqe4
- Artist video: https://vimeo.com/71727578
This is mine and Keir's holiday code project :)
2013-08-16 11:46:30 +02:00
|
|
|
MovieTrackingTrack *act_track; /* active track */
|
|
|
|
MovieTrackingPlaneTrack *act_plane_track; /* active plane track */
|
2011-11-28 14:49:42 +01:00
|
|
|
|
2011-12-05 19:57:17 +01:00
|
|
|
ListBase objects;
|
2012-06-10 21:59:02 +02:00
|
|
|
int objectnr, tot_object; /* index of active object and total number of objects */
|
2011-12-05 19:57:17 +01:00
|
|
|
|
2012-06-10 21:59:02 +02:00
|
|
|
MovieTrackingStats *stats; /* statistics displaying in clip editor */
|
2012-04-30 18:19:20 +02:00
|
|
|
|
2012-06-10 21:59:02 +02:00
|
|
|
MovieTrackingDopesheet dopesheet; /* dopesheet data */
|
2011-11-07 13:55:18 +01:00
|
|
|
} MovieTracking;
|
|
|
|
|
2014-02-20 14:41:05 +01:00
|
|
|
/* MovieTrackingCamera->distortion_model */
|
|
|
|
enum {
|
|
|
|
TRACKING_DISTORTION_MODEL_POLYNOMIAL = 0,
|
|
|
|
TRACKING_DISTORTION_MODEL_DIVISION = 1
|
|
|
|
};
|
|
|
|
|
2011-11-07 13:55:18 +01:00
|
|
|
/* MovieTrackingCamera->units */
|
|
|
|
enum {
|
|
|
|
CAMERA_UNITS_PX = 0,
|
2012-06-15 16:11:05 +02:00
|
|
|
CAMERA_UNITS_MM = 1
|
2011-11-07 13:55:18 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
/* MovieTrackingMarker->flag */
|
2012-11-05 10:40:00 +01:00
|
|
|
enum {
|
|
|
|
MARKER_DISABLED = (1 << 0),
|
|
|
|
MARKER_TRACKED = (1 << 1),
|
|
|
|
MARKER_GRAPH_SEL_X = (1 << 2),
|
|
|
|
MARKER_GRAPH_SEL_Y = (1 << 3),
|
|
|
|
MARKER_GRAPH_SEL = (MARKER_GRAPH_SEL_X | MARKER_GRAPH_SEL_Y)
|
|
|
|
};
|
2011-11-07 13:55:18 +01:00
|
|
|
|
|
|
|
/* MovieTrackingTrack->flag */
|
2012-11-05 10:40:00 +01:00
|
|
|
enum {
|
|
|
|
TRACK_HAS_BUNDLE = (1 << 1),
|
|
|
|
TRACK_DISABLE_RED = (1 << 2),
|
|
|
|
TRACK_DISABLE_GREEN = (1 << 3),
|
|
|
|
TRACK_DISABLE_BLUE = (1 << 4),
|
|
|
|
TRACK_HIDDEN = (1 << 5),
|
|
|
|
TRACK_LOCKED = (1 << 6),
|
|
|
|
TRACK_CUSTOMCOLOR = (1 << 7),
|
|
|
|
TRACK_USE_2D_STAB = (1 << 8),
|
|
|
|
TRACK_PREVIEW_GRAYSCALE = (1 << 9),
|
|
|
|
TRACK_DOPE_SEL = (1 << 10),
|
|
|
|
TRACK_PREVIEW_ALPHA = (1 << 11)
|
|
|
|
};
|
2011-11-07 13:55:18 +01:00
|
|
|
|
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 17:28:19 +02:00
|
|
|
/* MovieTrackingTrack->motion_model */
|
2012-11-05 10:40:00 +01:00
|
|
|
enum {
|
|
|
|
TRACK_MOTION_MODEL_TRANSLATION = 0,
|
|
|
|
TRACK_MOTION_MODEL_TRANSLATION_ROTATION = 1,
|
|
|
|
TRACK_MOTION_MODEL_TRANSLATION_SCALE = 2,
|
|
|
|
TRACK_MOTION_MODEL_TRANSLATION_ROTATION_SCALE = 3,
|
|
|
|
TRACK_MOTION_MODEL_AFFINE = 4,
|
|
|
|
TRACK_MOTION_MODEL_HOMOGRAPHY = 5
|
|
|
|
};
|
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 17:28:19 +02:00
|
|
|
|
|
|
|
/* MovieTrackingTrack->algorithm_flag */
|
2012-11-05 10:40:00 +01:00
|
|
|
enum {
|
|
|
|
TRACK_ALGORITHM_FLAG_USE_BRUTE = (1 << 0),
|
|
|
|
TRACK_ALGORITHM_FLAG_USE_NORMALIZATION = (1 << 2),
|
|
|
|
TRACK_ALGORITHM_FLAG_USE_MASK = (1 << 3)
|
|
|
|
};
|
2011-11-07 13:55:18 +01:00
|
|
|
|
2011-11-28 14:26:46 +01:00
|
|
|
/* MovieTrackingTrack->adjframes */
|
2012-11-05 10:40:00 +01:00
|
|
|
enum {
|
|
|
|
TRACK_MATCH_KEYFRAME = 0,
|
|
|
|
TRACK_MATCH_PREVFRAME = 1
|
|
|
|
};
|
2011-11-28 14:26:46 +01:00
|
|
|
|
|
|
|
/* MovieTrackingSettings->flag */
|
2012-11-05 10:40:00 +01:00
|
|
|
enum {
|
2014-02-07 15:26:43 +01:00
|
|
|
TRACKING_SETTINGS_SHOW_DEFAULT_EXPANDED = (1 << 0),
|
|
|
|
TRACKING_SETTINGS_SHOW_EXTRA_EXPANDED = (1 << 1)
|
2012-11-05 10:40:00 +01:00
|
|
|
};
|
2011-11-28 14:26:46 +01:00
|
|
|
|
2012-04-14 14:02:47 +02:00
|
|
|
/* MovieTrackingSettings->motion_flag */
|
2012-11-05 10:40:00 +01:00
|
|
|
enum {
|
|
|
|
TRACKING_MOTION_TRIPOD = (1 << 0),
|
2012-04-14 14:02:47 +02:00
|
|
|
|
2012-11-05 10:40:00 +01:00
|
|
|
TRACKING_MOTION_MODAL = (TRACKING_MOTION_TRIPOD)
|
|
|
|
};
|
2012-04-14 14:02:47 +02:00
|
|
|
|
2011-11-07 13:55:18 +01:00
|
|
|
/* MovieTrackingSettings->speed */
|
2012-11-05 10:40:00 +01:00
|
|
|
enum {
|
|
|
|
TRACKING_SPEED_FASTEST = 0,
|
|
|
|
TRACKING_SPEED_REALTIME = 1,
|
|
|
|
TRACKING_SPEED_HALF = 2,
|
|
|
|
TRACKING_SPEED_QUARTER = 4,
|
|
|
|
TRACKING_SPEED_DOUBLE = 5
|
|
|
|
};
|
2011-11-07 13:55:18 +01:00
|
|
|
|
2013-05-30 11:03:49 +02:00
|
|
|
/* MovieTrackingSettings->reconstruction_flag */
|
2012-11-05 10:40:00 +01:00
|
|
|
enum {
|
2013-10-15 17:21:41 +02:00
|
|
|
/* TRACKING_USE_FALLBACK_RECONSTRUCTION = (1 << 0), */ /* DEPRECATED */
|
2013-05-30 11:03:49 +02:00
|
|
|
TRACKING_USE_KEYFRAME_SELECTION = (1 << 1)
|
2012-11-05 10:40:00 +01:00
|
|
|
};
|
2012-11-05 09:04:27 +01:00
|
|
|
|
Assorted camera tracker improvements
- Add support for refining the camera's intrinsic parameters
during a solve. Currently, refining supports only the following
combinations of intrinsic parameters:
f
f, cx, cy
f, cx, cy, k1, k2
f, k1
f, k1, k2
This is not the same as autocalibration, since the user must
still make a reasonable initial guess about the focal length and
other parameters, whereas true autocalibration would eliminate
the need for the user specify intrinsic parameters at all.
However, the solver works well with only rough guesses for the
focal length, so perhaps full autocalibation is not that
important.
Adding support for the last two combinations, (f, k1) and (f,
k1, k2) required changes to the library libmv depends on for
bundle adjustment, SSBA. These changes should get ported
upstream not just to libmv but to SSBA as well.
- Improved the region of convergence for bundle adjustment by
increasing the number of Levenberg-Marquardt iterations from 50
to 500. This way, the solver is able to crawl out of the bad
local minima it gets stuck in when changing from, for example,
bundling k1 and k2 to just k1 and resetting k2 to 0.
- Add several new region tracker implementations. A region tracker
is a libmv concept, which refers to tracking a template image
pattern through frames. The impact to end users is that tracking
should "just work better". I am reserving a more detailed
writeup, and maybe a paper, for later.
- Other libmv tweaks, such as detecting that a tracker is headed
outside of the image bounds.
This includes several changes made directly to the libmv extern
code rather expecting to get those changes through normal libmv
channels, because I, the libmv BDFL, decided it was faster to work
on libmv directly in Blender, then later reverse-port the libmv
changes from Blender back into libmv trunk. The interesting part
is that I added a full Levenberg-Marquardt loop to the region
tracking code, which should lead to a more stable solutions. I
also added a hacky implementation of "Efficient Second-Order
Minimization" for tracking, which works nicely. A more detailed
quantitative evaluation will follow.
Original patch by Keir, cleaned a bit by myself.
2011-11-14 07:41:23 +01:00
|
|
|
/* MovieTrackingSettings->refine_camera_intrinsics */
|
2012-11-05 10:40:00 +01:00
|
|
|
enum {
|
|
|
|
REFINE_FOCAL_LENGTH = (1 << 0),
|
|
|
|
REFINE_PRINCIPAL_POINT = (1 << 1),
|
|
|
|
REFINE_RADIAL_DISTORTION_K1 = (1 << 2),
|
|
|
|
REFINE_RADIAL_DISTORTION_K2 = (1 << 4)
|
|
|
|
};
|
Assorted camera tracker improvements
- Add support for refining the camera's intrinsic parameters
during a solve. Currently, refining supports only the following
combinations of intrinsic parameters:
f
f, cx, cy
f, cx, cy, k1, k2
f, k1
f, k1, k2
This is not the same as autocalibration, since the user must
still make a reasonable initial guess about the focal length and
other parameters, whereas true autocalibration would eliminate
the need for the user specify intrinsic parameters at all.
However, the solver works well with only rough guesses for the
focal length, so perhaps full autocalibation is not that
important.
Adding support for the last two combinations, (f, k1) and (f,
k1, k2) required changes to the library libmv depends on for
bundle adjustment, SSBA. These changes should get ported
upstream not just to libmv but to SSBA as well.
- Improved the region of convergence for bundle adjustment by
increasing the number of Levenberg-Marquardt iterations from 50
to 500. This way, the solver is able to crawl out of the bad
local minima it gets stuck in when changing from, for example,
bundling k1 and k2 to just k1 and resetting k2 to 0.
- Add several new region tracker implementations. A region tracker
is a libmv concept, which refers to tracking a template image
pattern through frames. The impact to end users is that tracking
should "just work better". I am reserving a more detailed
writeup, and maybe a paper, for later.
- Other libmv tweaks, such as detecting that a tracker is headed
outside of the image bounds.
This includes several changes made directly to the libmv extern
code rather expecting to get those changes through normal libmv
channels, because I, the libmv BDFL, decided it was faster to work
on libmv directly in Blender, then later reverse-port the libmv
changes from Blender back into libmv trunk. The interesting part
is that I added a full Levenberg-Marquardt loop to the region
tracking code, which should lead to a more stable solutions. I
also added a hacky implementation of "Efficient Second-Order
Minimization" for tracking, which works nicely. A more detailed
quantitative evaluation will follow.
Original patch by Keir, cleaned a bit by myself.
2011-11-14 07:41:23 +01:00
|
|
|
|
2011-11-07 13:55:18 +01:00
|
|
|
/* MovieTrackingStrabilization->flag */
|
2012-11-05 10:40:00 +01:00
|
|
|
enum {
|
|
|
|
TRACKING_2D_STABILIZATION = (1 << 0),
|
|
|
|
TRACKING_AUTOSCALE = (1 << 1),
|
|
|
|
TRACKING_STABILIZE_ROTATION = (1 << 2)
|
|
|
|
};
|
2011-11-07 13:55:18 +01:00
|
|
|
|
2012-02-16 16:03:37 +01:00
|
|
|
/* MovieTrackingStrabilization->filter */
|
2012-11-05 10:40:00 +01:00
|
|
|
enum {
|
2012-12-11 15:19:41 +01:00
|
|
|
TRACKING_FILTER_NEAREST = 0,
|
2012-11-05 10:40:00 +01:00
|
|
|
TRACKING_FILTER_BILINEAR = 1,
|
|
|
|
TRACKING_FILTER_BICUBIC = 2
|
|
|
|
};
|
2012-02-16 16:03:37 +01:00
|
|
|
|
2011-11-07 13:55:18 +01:00
|
|
|
/* MovieTrackingReconstruction->flag */
|
2012-11-05 10:40:00 +01:00
|
|
|
enum {
|
|
|
|
TRACKING_RECONSTRUCTED = (1 << 0)
|
|
|
|
};
|
2011-11-07 13:55:18 +01:00
|
|
|
|
2011-12-05 19:57:17 +01:00
|
|
|
/* MovieTrackingObject->flag */
|
2012-11-05 10:40:00 +01:00
|
|
|
enum {
|
|
|
|
TRACKING_OBJECT_CAMERA = (1 << 0)
|
|
|
|
};
|
2011-12-05 19:57:17 +01:00
|
|
|
|
2012-11-05 10:40:00 +01:00
|
|
|
enum {
|
|
|
|
TRACKING_CLEAN_SELECT = 0,
|
|
|
|
TRACKING_CLEAN_DELETE_TRACK = 1,
|
|
|
|
TRACKING_CLEAN_DELETE_SEGMENT = 2
|
|
|
|
};
|
2011-11-07 13:55:18 +01:00
|
|
|
|
2012-06-12 19:10:24 +02:00
|
|
|
/* MovieTrackingDopesheet->sort_method */
|
2012-11-05 10:40:00 +01:00
|
|
|
enum {
|
|
|
|
TRACKING_DOPE_SORT_NAME = 0,
|
|
|
|
TRACKING_DOPE_SORT_LONGEST = 1,
|
|
|
|
TRACKING_DOPE_SORT_TOTAL = 2,
|
|
|
|
TRACKING_DOPE_SORT_AVERAGE_ERROR = 3
|
|
|
|
};
|
2012-06-12 19:10:24 +02:00
|
|
|
|
|
|
|
/* MovieTrackingDopesheet->flag */
|
2012-11-05 10:40:00 +01:00
|
|
|
enum {
|
|
|
|
TRACKING_DOPE_SORT_INVERSE = (1 << 0),
|
|
|
|
TRACKING_DOPE_SELECTED_ONLY = (1 << 1),
|
|
|
|
TRACKING_DOPE_SHOW_HIDDEN = (1 << 2)
|
|
|
|
};
|
2012-06-12 19:10:24 +02:00
|
|
|
|
2013-02-22 11:13:15 +01:00
|
|
|
/* MovieTrackingDopesheetCoverageSegment->trackness */
|
|
|
|
enum {
|
|
|
|
TRACKING_COVERAGE_BAD = 0,
|
|
|
|
TRACKING_COVERAGE_ACCEPTABLE = 1,
|
|
|
|
TRACKING_COVERAGE_OK = 2
|
|
|
|
};
|
|
|
|
|
Merge plane track feature from tomato branch
This commit includes all the changes made for plane tracker
in tomato branch.
Movie clip editor changes:
- Artist might create a plane track out of multiple point
tracks which belongs to the same track (minimum amount of
point tracks is 4, maximum is not actually limited).
When new plane track is added, it's getting "tracked"
across all point tracks, which makes it stick to the same
plane point tracks belong to.
- After plane track was added, it need to be manually adjusted
in a way it covers feature one might to mask/replace.
General transform tools (G, R, S) or sliding corners with
a mouse could be sued for this. Plane corner which
corresponds to left bottom image corner has got X/Y axis
on it (red is for X axis, green for Y).
- Re-adjusting plane corners makes plane to be "re-tracked"
for the frames sequence between current frame and next
and previous keyframes.
- Kayframes might be removed from the plane, using Shit-X
(Marker Delete) operator. However, currently manual
re-adjustment or "re-track" trigger is needed.
Compositor changes:
- Added new node called Plane Track Deform.
- User selects which plane track to use (for this he need
to select movie clip datablock, object and track names).
- Node gets an image input, which need to be warped into
the plane.
- Node outputs:
* Input image warped into the plane.
* Plane, rasterized to a mask.
Masking changes:
- Mask points might be parented to a plane track, which
makes this point deforming in a way as if it belongs
to the tracked plane.
Some video tutorials are available:
- Coder video: http://www.youtube.com/watch?v=vISEwqNHqe4
- Artist video: https://vimeo.com/71727578
This is mine and Keir's holiday code project :)
2013-08-16 11:46:30 +02:00
|
|
|
/* MovieTrackingPlaneMarker->flag */
|
|
|
|
enum {
|
|
|
|
PLANE_MARKER_DISABLED = (1 << 0),
|
|
|
|
PLANE_MARKER_TRACKED = (1 << 1),
|
|
|
|
};
|
|
|
|
|
|
|
|
/* MovieTrackingPlaneTrack->flag */
|
|
|
|
enum {
|
2013-09-10 14:46:18 +02:00
|
|
|
PLANE_TRACK_HIDDEN = (1 << 1),
|
|
|
|
PLANE_TRACK_LOCKED = (1 << 2),
|
|
|
|
PLANE_TRACK_AUTOKEY = (1 << 3),
|
Merge plane track feature from tomato branch
This commit includes all the changes made for plane tracker
in tomato branch.
Movie clip editor changes:
- Artist might create a plane track out of multiple point
tracks which belongs to the same track (minimum amount of
point tracks is 4, maximum is not actually limited).
When new plane track is added, it's getting "tracked"
across all point tracks, which makes it stick to the same
plane point tracks belong to.
- After plane track was added, it need to be manually adjusted
in a way it covers feature one might to mask/replace.
General transform tools (G, R, S) or sliding corners with
a mouse could be sued for this. Plane corner which
corresponds to left bottom image corner has got X/Y axis
on it (red is for X axis, green for Y).
- Re-adjusting plane corners makes plane to be "re-tracked"
for the frames sequence between current frame and next
and previous keyframes.
- Kayframes might be removed from the plane, using Shit-X
(Marker Delete) operator. However, currently manual
re-adjustment or "re-track" trigger is needed.
Compositor changes:
- Added new node called Plane Track Deform.
- User selects which plane track to use (for this he need
to select movie clip datablock, object and track names).
- Node gets an image input, which need to be warped into
the plane.
- Node outputs:
* Input image warped into the plane.
* Plane, rasterized to a mask.
Masking changes:
- Mask points might be parented to a plane track, which
makes this point deforming in a way as if it belongs
to the tracked plane.
Some video tutorials are available:
- Coder video: http://www.youtube.com/watch?v=vISEwqNHqe4
- Artist video: https://vimeo.com/71727578
This is mine and Keir's holiday code project :)
2013-08-16 11:46:30 +02:00
|
|
|
};
|
|
|
|
|
2013-03-02 08:27:19 +01:00
|
|
|
#endif /* __DNA_TRACKING_TYPES_H__ */
|