2011-11-07 12:55:18 +00: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.
|
|
|
|
*
|
|
|
|
* The Original Code is Copyright (C) 2011 Blender Foundation.
|
|
|
|
* All rights reserved.
|
|
|
|
*
|
|
|
|
* Contributor(s): Blender Foundation,
|
|
|
|
* Sergey Sharybin
|
|
|
|
*
|
|
|
|
* ***** END GPL LICENSE BLOCK *****
|
|
|
|
*/
|
|
|
|
|
2012-02-17 18:59:41 +00:00
|
|
|
#ifndef __BKE_TRACKING_H__
|
|
|
|
#define __BKE_TRACKING_H__
|
2011-11-07 12:55:18 +00:00
|
|
|
|
2012-02-27 20:27:19 +00:00
|
|
|
/** \file BKE_tracking.h
|
2011-11-07 12:55:18 +00:00
|
|
|
* \ingroup bke
|
|
|
|
* \author Sergey Sharybin
|
|
|
|
*/
|
|
|
|
|
|
|
|
struct bGPDlayer;
|
|
|
|
struct ImBuf;
|
2011-12-05 18:57:17 +00:00
|
|
|
struct ListBase;
|
2011-11-28 13:49:42 +00:00
|
|
|
struct MovieReconstructContext;
|
2011-11-07 12:55:18 +00:00
|
|
|
struct MovieTrackingTrack;
|
|
|
|
struct MovieTrackingMarker;
|
|
|
|
struct MovieTracking;
|
|
|
|
struct MovieTrackingContext;
|
2011-12-05 18:57:17 +00:00
|
|
|
struct MovieTrackingObject;
|
2011-11-07 12:55:18 +00:00
|
|
|
struct MovieClipUser;
|
|
|
|
struct MovieDistortion;
|
|
|
|
struct Camera;
|
|
|
|
struct Object;
|
|
|
|
struct Scene;
|
|
|
|
|
2011-11-28 13:26:46 +00:00
|
|
|
void BKE_tracking_init_settings(struct MovieTracking *tracking);
|
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
|
|
|
void BKE_tracking_clamp_marker(struct MovieTrackingMarker *marker, int event);
|
2011-11-07 12:55:18 +00:00
|
|
|
void BKE_tracking_track_flag(struct MovieTrackingTrack *track, int area, int flag, int clear);
|
|
|
|
|
2011-12-05 18:57:17 +00:00
|
|
|
struct MovieTrackingTrack *BKE_tracking_add_track(struct MovieTracking *tracking, struct ListBase *tracksbase,
|
2012-03-25 23:19:21 +00:00
|
|
|
float x, float y, int framenr, int width, int height);
|
2012-01-09 20:18:28 +00:00
|
|
|
struct MovieTrackingMarker *BKE_tracking_insert_marker(struct MovieTrackingTrack *track,
|
2012-03-25 23:19:21 +00:00
|
|
|
struct MovieTrackingMarker *marker);
|
2011-11-07 12:55:18 +00:00
|
|
|
void BKE_tracking_delete_marker(struct MovieTrackingTrack *track, int framenr);
|
|
|
|
|
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
|
|
|
void BKE_tracking_marker_pattern_minmax(struct MovieTrackingMarker *marker, float min[2], float max[2]);
|
2011-11-07 12:55:18 +00:00
|
|
|
struct MovieTrackingMarker *BKE_tracking_get_marker(struct MovieTrackingTrack *track, int framenr);
|
|
|
|
struct MovieTrackingMarker *BKE_tracking_ensure_marker(struct MovieTrackingTrack *track, int framenr);
|
|
|
|
struct MovieTrackingMarker *BKE_tracking_exact_marker(struct MovieTrackingTrack *track, int framenr);
|
|
|
|
int BKE_tracking_has_marker(struct MovieTrackingTrack *track, int framenr);
|
2012-01-25 13:37:11 +00:00
|
|
|
int BKE_tracking_has_enabled_marker(struct MovieTrackingTrack *track, int framenr);
|
2011-11-07 12:55:18 +00:00
|
|
|
|
|
|
|
void BKE_tracking_free_track(struct MovieTrackingTrack *track);
|
|
|
|
|
|
|
|
void BKE_tracking_clear_path(struct MovieTrackingTrack *track, int ref_frame, int action);
|
|
|
|
|
|
|
|
void BKE_tracking_join_tracks(struct MovieTrackingTrack *dst_track, struct MovieTrackingTrack *src_track);
|
|
|
|
void BKE_tracking_free(struct MovieTracking *tracking);
|
|
|
|
|
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
|
|
|
struct ImBuf *BKE_tracking_sample_pattern_imbuf(int frame_width, int frame_height,
|
|
|
|
struct ImBuf *struct_ibuf, struct MovieTrackingMarker *marker,
|
|
|
|
int num_samples_x, int num_samples_y, float pos[2]);
|
2011-11-07 12:55:18 +00:00
|
|
|
struct ImBuf *BKE_tracking_get_pattern_imbuf(struct ImBuf *ibuf, struct MovieTrackingTrack *track,
|
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
|
|
|
struct MovieTrackingMarker *marker, int anchored, int disable_channels);
|
2011-11-07 12:55:18 +00:00
|
|
|
struct ImBuf *BKE_tracking_get_search_imbuf(struct ImBuf *ibuf, struct MovieTrackingTrack *track,
|
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
|
|
|
struct MovieTrackingMarker *marker, int anchored, int disable_channels);
|
|
|
|
struct ImBuf *BKE_tracking_track_mask_get(struct MovieTracking *tracking, struct MovieTrackingTrack *track,
|
|
|
|
struct MovieTrackingMarker *marker, int width, int height);
|
2011-11-07 12:55:18 +00:00
|
|
|
|
2011-12-05 18:57:17 +00:00
|
|
|
void BKE_track_unique_name(struct ListBase *tracksbase, struct MovieTrackingTrack *track);
|
2011-11-07 12:55:18 +00:00
|
|
|
|
2011-12-05 18:57:17 +00:00
|
|
|
struct MovieTrackingTrack *BKE_tracking_named_track(struct MovieTracking *tracking, struct MovieTrackingObject *object, const char *name);
|
2011-12-15 16:10:49 +00:00
|
|
|
struct MovieTrackingTrack *BKE_tracking_indexed_track(struct MovieTracking *tracking, int tracknr, struct ListBase **tracksbase_r);
|
2011-11-07 12:55:18 +00:00
|
|
|
|
|
|
|
void BKE_tracking_camera_shift(struct MovieTracking *tracking, int winx, int winy, float *shiftx, float *shifty);
|
|
|
|
void BKE_tracking_camera_to_blender(struct MovieTracking *tracking, struct Scene *scene, struct Camera *camera, int width, int height);
|
|
|
|
|
|
|
|
void BKE_get_tracking_mat(struct Scene *scene, struct Object *ob, float mat[4][4]);
|
2011-12-05 18:57:17 +00:00
|
|
|
void BKE_tracking_projection_matrix(struct MovieTracking *tracking, struct MovieTrackingObject *object,
|
2012-03-25 23:19:21 +00:00
|
|
|
int framenr, int winx, int winy, float mat[4][4]);
|
2011-12-05 18:57:17 +00:00
|
|
|
|
|
|
|
struct ListBase *BKE_tracking_get_tracks(struct MovieTracking *tracking);
|
|
|
|
struct MovieTrackingReconstruction *BKE_tracking_get_reconstruction(struct MovieTracking *tracking);
|
|
|
|
|
|
|
|
struct MovieTrackingTrack *BKE_tracking_active_track(struct MovieTracking *tracking);
|
|
|
|
struct MovieTrackingObject *BKE_tracking_active_object(struct MovieTracking *tracking);
|
|
|
|
struct MovieTrackingObject *BKE_tracking_get_camera_object(struct MovieTracking *tracking);
|
|
|
|
struct ListBase *BKE_tracking_object_tracks(struct MovieTracking *tracking, struct MovieTrackingObject *object);
|
|
|
|
struct MovieTrackingReconstruction *BKE_tracking_object_reconstruction(struct MovieTracking *tracking,
|
2012-03-25 23:19:21 +00:00
|
|
|
struct MovieTrackingObject *object);
|
2011-11-07 12:55:18 +00:00
|
|
|
|
2012-01-15 13:31:58 +00:00
|
|
|
void BKE_tracking_disable_imbuf_channels(struct ImBuf *ibuf, int disable_red, int disable_green, int disable_blue, int grayscale);
|
|
|
|
|
2012-01-09 20:18:48 +00:00
|
|
|
/* clipboard */
|
|
|
|
void BKE_tracking_free_clipboard(void);
|
|
|
|
void BKE_tracking_clipboard_copy_tracks(struct MovieTracking *tracking, struct MovieTrackingObject *object);
|
|
|
|
int BKE_tracking_clipboard_has_tracks(void);
|
|
|
|
void BKE_tracking_clipboard_paste_tracks(struct MovieTracking *tracking, struct MovieTrackingObject *object);
|
|
|
|
|
2011-11-07 12:55:18 +00:00
|
|
|
/* 2D tracking */
|
|
|
|
struct MovieTrackingContext *BKE_tracking_context_new(struct MovieClip *clip, struct MovieClipUser *user,
|
2011-12-30 18:15:44 +00:00
|
|
|
short backwards, short sequence);
|
2011-11-07 12:55:18 +00:00
|
|
|
void BKE_tracking_context_free(struct MovieTrackingContext *context);
|
|
|
|
void BKE_tracking_sync(struct MovieTrackingContext *context);
|
|
|
|
void BKE_tracking_sync_user(struct MovieClipUser *user, struct MovieTrackingContext *context);
|
|
|
|
int BKE_tracking_next(struct MovieTrackingContext *context);
|
|
|
|
|
|
|
|
/* Camera solving */
|
2011-12-05 18:57:17 +00:00
|
|
|
int BKE_tracking_can_reconstruct(struct MovieTracking *tracking, struct MovieTrackingObject *object,
|
2012-03-25 23:19:21 +00:00
|
|
|
char *error_msg, int error_size);
|
2011-11-28 13:49:42 +00:00
|
|
|
|
|
|
|
struct MovieReconstructContext* BKE_tracking_reconstruction_context_new(struct MovieTracking *tracking,
|
2011-12-05 18:57:17 +00:00
|
|
|
struct MovieTrackingObject *object, int keyframe1, int keyframe2, int width, int height);
|
2011-11-28 13:49:42 +00:00
|
|
|
void BKE_tracking_reconstruction_context_free(struct MovieReconstructContext *context);
|
2012-03-25 23:19:21 +00:00
|
|
|
void BKE_tracking_solve_reconstruction(struct MovieReconstructContext *context, short *stop, short *do_update,
|
|
|
|
float *progress, char *stats_message, int message_size);
|
2011-11-28 13:49:42 +00:00
|
|
|
int BKE_tracking_finish_reconstruction(struct MovieReconstructContext *context, struct MovieTracking *tracking);
|
2011-11-07 12:55:18 +00:00
|
|
|
|
2011-12-05 18:57:17 +00:00
|
|
|
struct MovieReconstructedCamera *BKE_tracking_get_reconstructed_camera(struct MovieTracking *tracking,
|
|
|
|
struct MovieTrackingObject *object, int framenr);
|
2012-03-25 23:19:21 +00:00
|
|
|
void BKE_tracking_get_interpolated_camera(struct MovieTracking *tracking, struct MovieTrackingObject *object,
|
|
|
|
int framenr, float mat[4][4]);
|
2011-11-07 12:55:18 +00:00
|
|
|
|
|
|
|
/* Feature detection */
|
2011-12-05 18:57:17 +00:00
|
|
|
void BKE_tracking_detect_fast(struct MovieTracking *tracking, struct ListBase *tracksbase, struct ImBuf *imbuf,
|
2012-03-25 23:19:21 +00:00
|
|
|
int framenr, int margin, int min_trackness, int min_distance, struct bGPDlayer *layer,
|
|
|
|
int place_outside_layer);
|
2011-11-07 12:55:18 +00:00
|
|
|
|
|
|
|
/* 2D stabilization */
|
|
|
|
void BKE_tracking_stabilization_data(struct MovieTracking *tracking, int framenr, int width, int height, float loc[2], float *scale, float *angle);
|
|
|
|
struct ImBuf *BKE_tracking_stabilize(struct MovieTracking *tracking, int framenr, struct ImBuf *ibuf, float loc[2], float *scale, float *angle);
|
2012-02-17 08:23:42 +00:00
|
|
|
void BKE_tracking_stabdata_to_mat4(int width, int height, float aspect, float loc[2], float scale, float angle, float mat[4][4]);
|
2011-11-07 12:55:18 +00:00
|
|
|
|
|
|
|
/* Distortion/Undistortion */
|
|
|
|
void BKE_tracking_apply_intrinsics(struct MovieTracking *tracking, float co[2], float nco[2]);
|
|
|
|
void BKE_tracking_invert_intrinsics(struct MovieTracking *tracking, float co[2], float nco[2]);
|
|
|
|
|
|
|
|
struct MovieDistortion *BKE_tracking_distortion_create(void);
|
|
|
|
struct MovieDistortion *BKE_tracking_distortion_copy(struct MovieDistortion *distortion);
|
|
|
|
struct ImBuf *BKE_tracking_distortion_exec(struct MovieDistortion *distortion, struct MovieTracking *tracking,
|
2012-03-25 23:19:21 +00:00
|
|
|
struct ImBuf *ibuf, int width, int height, float overscan, int undistort);
|
2011-11-07 12:55:18 +00:00
|
|
|
void BKE_tracking_distortion_destroy(struct MovieDistortion *distortion);
|
|
|
|
|
|
|
|
struct ImBuf *BKE_tracking_undistort(struct MovieTracking *tracking, struct ImBuf *ibuf, int width, int height, float overscan);
|
|
|
|
struct ImBuf *BKE_tracking_distort(struct MovieTracking *tracking, struct ImBuf *ibuf, int width, int height, float overscan);
|
|
|
|
|
2011-12-05 18:57:17 +00:00
|
|
|
/* Object tracking */
|
|
|
|
struct MovieTrackingObject *BKE_tracking_new_object(struct MovieTracking *tracking, const char *name);
|
|
|
|
void BKE_tracking_remove_object(struct MovieTracking *tracking, struct MovieTrackingObject *object);
|
|
|
|
void BKE_tracking_object_unique_name(struct MovieTracking *tracking, struct MovieTrackingObject *object);
|
|
|
|
struct MovieTrackingObject *BKE_tracking_named_object(struct MovieTracking *tracking, const char *name);
|
|
|
|
|
2011-11-07 12:55:18 +00:00
|
|
|
/* Select */
|
2011-12-05 18:57:17 +00:00
|
|
|
void BKE_tracking_select_track(struct ListBase *tracksbase, struct MovieTrackingTrack *track, int area, int extend);
|
2011-11-07 12:55:18 +00:00
|
|
|
void BKE_tracking_deselect_track(struct MovieTrackingTrack *track, int area);
|
|
|
|
|
2012-04-30 16:19:20 +00:00
|
|
|
/* Dopesheet */
|
2012-05-03 23:15:01 +00:00
|
|
|
void BKE_tracking_dopesheet_tag_update(struct MovieTracking *tracking);
|
|
|
|
void BKE_tracking_dopesheet_update(struct MovieTracking *tracking, int sort_method, int inverse);
|
2012-04-30 16:19:20 +00:00
|
|
|
|
2012-02-26 08:14:14 +00:00
|
|
|
#define TRACK_SELECTED(track) ((track)->flag&SELECT || (track)->pat_flag&SELECT || (track)->search_flag&SELECT)
|
2011-11-07 12:55:18 +00:00
|
|
|
|
2012-02-26 08:14:14 +00:00
|
|
|
#define TRACK_AREA_SELECTED(track, area) ((area)==TRACK_AREA_POINT ? (track)->flag&SELECT : \
|
|
|
|
((area)==TRACK_AREA_PAT ? (track)->pat_flag&SELECT : \
|
|
|
|
(track)->search_flag&SELECT))
|
|
|
|
|
|
|
|
#define TRACK_VIEW_SELECTED(sc, track) ((((track)->flag & TRACK_HIDDEN)==0) && \
|
|
|
|
( TRACK_AREA_SELECTED(track, TRACK_AREA_POINT) || \
|
|
|
|
(((sc)->flag & SC_SHOW_MARKER_PATTERN) && TRACK_AREA_SELECTED(track, TRACK_AREA_PAT)) || \
|
|
|
|
(((sc)->flag & SC_SHOW_MARKER_SEARCH) && TRACK_AREA_SELECTED(track, TRACK_AREA_SEARCH))))
|
|
|
|
|
2012-05-03 23:41:28 +00:00
|
|
|
#define MARKER_VISIBLE(sc, track, marker) (((marker)->flag & MARKER_DISABLED)==0 || ((sc)->flag & SC_HIDE_DISABLED)==0 || (sc->clip->tracking.act_track == track))
|
2011-11-07 12:55:18 +00:00
|
|
|
|
2012-01-15 13:31:58 +00:00
|
|
|
#define TRACK_CLEAR_UPTO 0
|
|
|
|
#define TRACK_CLEAR_REMAINED 1
|
|
|
|
#define TRACK_CLEAR_ALL 2
|
|
|
|
|
2011-11-07 12:55:18 +00:00
|
|
|
#define CLAMP_PAT_DIM 1
|
|
|
|
#define CLAMP_PAT_POS 2
|
|
|
|
#define CLAMP_SEARCH_DIM 3
|
|
|
|
#define CLAMP_SEARCH_POS 4
|
|
|
|
|
|
|
|
#define TRACK_AREA_NONE -1
|
|
|
|
#define TRACK_AREA_POINT 1
|
|
|
|
#define TRACK_AREA_PAT 2
|
|
|
|
#define TRACK_AREA_SEARCH 4
|
|
|
|
|
|
|
|
#define TRACK_AREA_ALL (TRACK_AREA_POINT|TRACK_AREA_PAT|TRACK_AREA_SEARCH)
|
|
|
|
|
2012-05-03 19:28:41 +00:00
|
|
|
#define TRACK_SORT_NONE -1
|
|
|
|
#define TRACK_SORT_NAME 0
|
|
|
|
#define TRACK_SORT_LONGEST 1
|
|
|
|
#define TRACK_SORT_TOTAL 2
|
2012-06-08 16:42:24 +00:00
|
|
|
#define TRACK_SORT_AVERAGE_ERROR 3
|
2012-05-03 19:28:41 +00:00
|
|
|
|
2011-11-07 12:55:18 +00:00
|
|
|
#endif
|