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.
|
|
|
|
*
|
|
|
|
* 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 19:59:41 +01:00
|
|
|
#ifndef __BKE_TRACKING_H__
|
|
|
|
#define __BKE_TRACKING_H__
|
2011-11-07 13:55:18 +01:00
|
|
|
|
2012-02-27 21:27:19 +01:00
|
|
|
/** \file BKE_tracking.h
|
2011-11-07 13:55:18 +01:00
|
|
|
* \ingroup bke
|
|
|
|
* \author Sergey Sharybin
|
|
|
|
*/
|
|
|
|
|
|
|
|
struct bGPDlayer;
|
|
|
|
struct ImBuf;
|
2011-12-05 19:57:17 +01:00
|
|
|
struct ListBase;
|
2011-11-28 14:49:42 +01:00
|
|
|
struct MovieReconstructContext;
|
2011-11-07 13:55:18 +01:00
|
|
|
struct MovieTrackingTrack;
|
|
|
|
struct MovieTrackingMarker;
|
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
|
|
|
struct MovieTrackingPlaneTrack;
|
|
|
|
struct MovieTrackingPlaneMarker;
|
2011-11-07 13:55:18 +01:00
|
|
|
struct MovieTracking;
|
2011-12-05 19:57:17 +01:00
|
|
|
struct MovieTrackingObject;
|
2011-11-07 13:55:18 +01:00
|
|
|
struct MovieClipUser;
|
|
|
|
struct MovieDistortion;
|
|
|
|
struct Camera;
|
|
|
|
struct Object;
|
|
|
|
struct Scene;
|
2013-02-18 11:12:44 +01:00
|
|
|
struct rcti;
|
2011-11-07 13:55:18 +01:00
|
|
|
|
2012-06-15 13:03:23 +02:00
|
|
|
/* **** Common functions **** */
|
2011-11-07 13:55:18 +01:00
|
|
|
|
2012-06-15 13:03:23 +02:00
|
|
|
void BKE_tracking_free(struct MovieTracking *tracking);
|
Refactor ID copying (and to some extent, ID freeing).
This will allow much finer controll over how we copy data-blocks, from
full copy in Main database, to "lighter" ones (out of Main, inside an
already allocated datablock, etc.).
This commit also transfers a llot of what was previously handled by
per-ID-type custom code to generic ID handling code in BKE_library.
Hopefully will avoid in future inconsistencies and missing bits we had
all over the codebase in the past.
It also adds missing copying handling for a few types, most notably
Scene (which where using a fully customized handling previously).
Note that the type of allocation used during copying (regular in Main,
allocated but outside of Main, or not allocated by ID handling code at
all) is stored in ID's, which allows to handle them correctly when
freeing. This needs to be taken care of with caution when doing 'weird'
unusual things with ID copying and/or allocation!
As a final note, while rather noisy, this commit will hopefully not
break too much existing branches, old 'API' has been kept for the main
part, as a wrapper around new code. Cleaning it up will happen later.
Design task : T51804
Phab Diff: D2714
2017-08-07 16:39:55 +02:00
|
|
|
void BKE_tracking_copy(struct MovieTracking *tracking_dst, const struct MovieTracking *tracking_src, const int flag);
|
2012-06-15 13:03:23 +02:00
|
|
|
|
|
|
|
void BKE_tracking_settings_init(struct MovieTracking *tracking);
|
|
|
|
|
|
|
|
struct ListBase *BKE_tracking_get_active_tracks(struct MovieTracking *tracking);
|
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
|
|
|
struct ListBase *BKE_tracking_get_active_plane_tracks(struct MovieTracking *tracking);
|
2012-06-15 13:03:23 +02:00
|
|
|
struct MovieTrackingReconstruction *BKE_tracking_get_active_reconstruction(struct MovieTracking *tracking);
|
|
|
|
|
|
|
|
/* matrices for constraints and drawing */
|
|
|
|
void BKE_tracking_get_camera_object_matrix(struct Scene *scene, struct Object *ob, float mat[4][4]);
|
|
|
|
void BKE_tracking_get_projection_matrix(struct MovieTracking *tracking, struct MovieTrackingObject *object,
|
|
|
|
int framenr, int winx, int winy, float mat[4][4]);
|
|
|
|
|
|
|
|
/* **** Clipboard **** */
|
|
|
|
void BKE_tracking_clipboard_free(void);
|
|
|
|
void BKE_tracking_clipboard_copy_tracks(struct MovieTracking *tracking, struct MovieTrackingObject *object);
|
2013-09-05 15:37:36 +02:00
|
|
|
bool BKE_tracking_clipboard_has_tracks(void);
|
2012-06-15 13:03:23 +02:00
|
|
|
void BKE_tracking_clipboard_paste_tracks(struct MovieTracking *tracking, struct MovieTrackingObject *object);
|
|
|
|
|
|
|
|
/* **** Track **** */
|
|
|
|
struct MovieTrackingTrack *BKE_tracking_track_add(struct MovieTracking *tracking, struct ListBase *tracksbase,
|
2012-03-26 01:19:21 +02:00
|
|
|
float x, float y, int framenr, int width, int height);
|
2013-12-30 12:03:59 +01:00
|
|
|
struct MovieTrackingTrack *BKE_tracking_track_duplicate(struct MovieTrackingTrack *track);
|
2012-06-15 13:03:23 +02:00
|
|
|
void BKE_tracking_track_unique_name(struct ListBase *tracksbase, struct MovieTrackingTrack *track);
|
|
|
|
void BKE_tracking_track_free(struct MovieTrackingTrack *track);
|
|
|
|
|
|
|
|
void BKE_tracking_track_flag_set(struct MovieTrackingTrack *track, int area, int flag);
|
|
|
|
void BKE_tracking_track_flag_clear(struct MovieTrackingTrack *track, int area, int flag);
|
|
|
|
|
2013-09-05 15:37:36 +02:00
|
|
|
bool BKE_tracking_track_has_marker_at_frame(struct MovieTrackingTrack *track, int framenr);
|
|
|
|
bool BKE_tracking_track_has_enabled_marker_at_frame(struct MovieTrackingTrack *track, int framenr);
|
2012-06-15 13:03:23 +02:00
|
|
|
|
|
|
|
void BKE_tracking_track_path_clear(struct MovieTrackingTrack *track, int ref_frame, int action);
|
2012-10-15 12:43:10 +02:00
|
|
|
void BKE_tracking_tracks_join(struct MovieTracking *tracking, struct MovieTrackingTrack *dst_track, struct MovieTrackingTrack *src_track);
|
2012-06-15 13:03:23 +02:00
|
|
|
|
|
|
|
struct MovieTrackingTrack *BKE_tracking_track_get_named(struct MovieTracking *tracking,
|
|
|
|
struct MovieTrackingObject *object,
|
|
|
|
const char *name);
|
|
|
|
struct MovieTrackingTrack *BKE_tracking_track_get_indexed(struct MovieTracking *tracking, int tracknr,
|
2015-05-07 23:25:39 +02:00
|
|
|
struct ListBase **r_tracksbase);
|
2012-06-15 13:03:23 +02:00
|
|
|
|
|
|
|
struct MovieTrackingTrack *BKE_tracking_track_get_active(struct MovieTracking *tracking);
|
|
|
|
|
|
|
|
float *BKE_tracking_track_get_mask(int frame_width, int frame_height, struct MovieTrackingTrack *track,
|
|
|
|
struct MovieTrackingMarker *marker);
|
|
|
|
|
2014-01-28 13:01:03 +01:00
|
|
|
float BKE_tracking_track_get_weight_for_marker(struct MovieClip *clip, struct MovieTrackingTrack *track, struct MovieTrackingMarker *marker);
|
|
|
|
|
2012-06-15 13:03:23 +02:00
|
|
|
/* selection */
|
2013-09-05 15:37:36 +02:00
|
|
|
void BKE_tracking_track_select(struct ListBase *tracksbase, struct MovieTrackingTrack *track, int area, bool extend);
|
2012-06-15 13:03:23 +02:00
|
|
|
void BKE_tracking_track_deselect(struct MovieTrackingTrack *track, int area);
|
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
|
|
|
void BKE_tracking_tracks_deselect_all(struct ListBase *tracksbase);
|
2012-06-15 13:03:23 +02:00
|
|
|
|
|
|
|
/* **** Marker **** */
|
|
|
|
struct MovieTrackingMarker *BKE_tracking_marker_insert(struct MovieTrackingTrack *track,
|
2012-03-26 01:19:21 +02:00
|
|
|
struct MovieTrackingMarker *marker);
|
2012-06-15 13:03:23 +02:00
|
|
|
void BKE_tracking_marker_delete(struct MovieTrackingTrack *track, int framenr);
|
|
|
|
|
|
|
|
void BKE_tracking_marker_clamp(struct MovieTrackingMarker *marker, int event);
|
|
|
|
|
|
|
|
struct MovieTrackingMarker *BKE_tracking_marker_get(struct MovieTrackingTrack *track, int framenr);
|
|
|
|
struct MovieTrackingMarker *BKE_tracking_marker_get_exact(struct MovieTrackingTrack *track, int framenr);
|
|
|
|
struct MovieTrackingMarker *BKE_tracking_marker_ensure(struct MovieTrackingTrack *track, int framenr);
|
2011-11-07 13:55:18 +01:00
|
|
|
|
2012-06-11 13:40:54 +02:00
|
|
|
void BKE_tracking_marker_pattern_minmax(const struct MovieTrackingMarker *marker, float min[2], float max[2]);
|
2011-11-07 13:55:18 +01:00
|
|
|
|
2012-07-27 12:12:58 +02:00
|
|
|
void BKE_tracking_marker_get_subframe_position(struct MovieTrackingTrack *track, float framenr, float pos[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
|
|
|
/* **** Plane Track **** */
|
|
|
|
struct MovieTrackingPlaneTrack *BKE_tracking_plane_track_add(struct MovieTracking *tracking, struct ListBase *plane_tracks_base,
|
|
|
|
struct ListBase *tracks, int framenr);
|
|
|
|
void BKE_tracking_plane_track_unique_name(struct ListBase *plane_tracks_base, struct MovieTrackingPlaneTrack *plane_track);
|
|
|
|
void BKE_tracking_plane_track_free(struct MovieTrackingPlaneTrack *plane_track);
|
|
|
|
|
|
|
|
bool BKE_tracking_plane_track_has_marker_at_frame(struct MovieTrackingPlaneTrack *plane_track, int framenr);
|
|
|
|
bool BKE_tracking_plane_track_has_enabled_marker_at_frame(struct MovieTrackingPlaneTrack *plane_track, int framenr);
|
|
|
|
|
|
|
|
struct MovieTrackingPlaneTrack *BKE_tracking_plane_track_get_named(struct MovieTracking *tracking,
|
|
|
|
struct MovieTrackingObject *object,
|
|
|
|
const char *name);
|
|
|
|
|
|
|
|
struct MovieTrackingPlaneTrack *BKE_tracking_plane_track_get_active(struct MovieTracking *tracking);
|
|
|
|
|
|
|
|
void BKE_tracking_plane_tracks_deselect_all(struct ListBase *plane_tracks_base);
|
|
|
|
|
2015-04-21 22:54:45 +02:00
|
|
|
bool BKE_tracking_plane_track_has_point_track(struct MovieTrackingPlaneTrack *plane_track,
|
|
|
|
struct MovieTrackingTrack *track);
|
|
|
|
bool BKE_tracking_plane_track_remove_point_track(struct MovieTrackingPlaneTrack *plane_track,
|
|
|
|
struct MovieTrackingTrack *track);
|
|
|
|
|
|
|
|
void BKE_tracking_plane_tracks_remove_point_track(struct MovieTracking *tracking,
|
|
|
|
struct MovieTrackingTrack *track);
|
|
|
|
|
2015-04-21 23:10:13 +02:00
|
|
|
void BKE_tracking_plane_track_replace_point_track(struct MovieTrackingPlaneTrack *plane_track,
|
|
|
|
struct MovieTrackingTrack *old_track,
|
|
|
|
struct MovieTrackingTrack *new_track);
|
|
|
|
void BKE_tracking_plane_tracks_replace_point_track(struct MovieTracking *tracking,
|
|
|
|
struct MovieTrackingTrack *old_track,
|
|
|
|
struct MovieTrackingTrack *new_track);
|
|
|
|
|
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
|
|
|
/* **** Plane Marker **** */
|
|
|
|
struct MovieTrackingPlaneMarker *BKE_tracking_plane_marker_insert(struct MovieTrackingPlaneTrack *plane_track,
|
|
|
|
struct MovieTrackingPlaneMarker *plane_marker);
|
|
|
|
void BKE_tracking_plane_marker_delete(struct MovieTrackingPlaneTrack *plane_track, int framenr);
|
|
|
|
|
|
|
|
struct MovieTrackingPlaneMarker *BKE_tracking_plane_marker_get(struct MovieTrackingPlaneTrack *plane_track, int framenr);
|
|
|
|
struct MovieTrackingPlaneMarker *BKE_tracking_plane_marker_get_exact(struct MovieTrackingPlaneTrack *plane_track, int framenr);
|
|
|
|
struct MovieTrackingPlaneMarker *BKE_tracking_plane_marker_ensure(struct MovieTrackingPlaneTrack *plane_track, int framenr);
|
2014-11-18 15:29:03 +01:00
|
|
|
void BKE_tracking_plane_marker_get_subframe_corners(struct MovieTrackingPlaneTrack *plane_track,
|
|
|
|
float framenr,
|
|
|
|
float corners[4][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
|
|
|
|
2012-06-15 13:03:23 +02:00
|
|
|
/* **** Object **** */
|
|
|
|
struct MovieTrackingObject *BKE_tracking_object_add(struct MovieTracking *tracking, const char *name);
|
2013-09-05 15:37:36 +02:00
|
|
|
bool BKE_tracking_object_delete(struct MovieTracking *tracking, struct MovieTrackingObject *object);
|
2011-11-07 13:55:18 +01:00
|
|
|
|
2012-06-15 13:03:23 +02:00
|
|
|
void BKE_tracking_object_unique_name(struct MovieTracking *tracking, struct MovieTrackingObject *object);
|
2011-11-07 13:55:18 +01:00
|
|
|
|
2012-06-15 13:03:23 +02:00
|
|
|
struct MovieTrackingObject *BKE_tracking_object_get_named(struct MovieTracking *tracking, const char *name);
|
2011-11-07 13:55:18 +01:00
|
|
|
|
2012-06-15 13:03:23 +02:00
|
|
|
struct MovieTrackingObject *BKE_tracking_object_get_active(struct MovieTracking *tracking);
|
|
|
|
struct MovieTrackingObject *BKE_tracking_object_get_camera(struct MovieTracking *tracking);
|
2011-11-07 13:55:18 +01:00
|
|
|
|
2012-06-15 13:03:23 +02:00
|
|
|
struct ListBase *BKE_tracking_object_get_tracks(struct MovieTracking *tracking, struct MovieTrackingObject *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
|
|
|
struct ListBase *BKE_tracking_object_get_plane_tracks(struct MovieTracking *tracking, struct MovieTrackingObject *object);
|
2012-06-15 13:03:23 +02:00
|
|
|
struct MovieTrackingReconstruction *BKE_tracking_object_get_reconstruction(struct MovieTracking *tracking,
|
|
|
|
struct MovieTrackingObject *object);
|
2011-11-07 13:55:18 +01:00
|
|
|
|
2012-06-15 13:03:23 +02:00
|
|
|
/* **** Camera **** */
|
|
|
|
void BKE_tracking_camera_shift_get(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);
|
2011-11-07 13:55:18 +01:00
|
|
|
|
2012-06-15 13:03:23 +02:00
|
|
|
struct MovieReconstructedCamera *BKE_tracking_camera_get_reconstructed(struct MovieTracking *tracking,
|
|
|
|
struct MovieTrackingObject *object,
|
|
|
|
int framenr);
|
|
|
|
void BKE_tracking_camera_get_reconstructed_interpolate(struct MovieTracking *tracking,
|
|
|
|
struct MovieTrackingObject *object,
|
2015-07-13 18:17:07 +02:00
|
|
|
float framenr, float mat[4][4]);
|
2011-11-07 13:55:18 +01:00
|
|
|
|
2012-06-15 13:03:23 +02:00
|
|
|
/* **** Distortion/Undistortion **** */
|
2014-02-20 14:41:05 +01:00
|
|
|
struct MovieDistortion *BKE_tracking_distortion_new(struct MovieTracking *tracking,
|
|
|
|
int calibration_width, int calibration_height);
|
2012-06-15 13:03:23 +02:00
|
|
|
void BKE_tracking_distortion_update(struct MovieDistortion *distortion, struct MovieTracking *tracking,
|
|
|
|
int calibration_width, int calibration_height);
|
2013-03-15 12:59:46 +01:00
|
|
|
void BKE_tracking_distortion_set_threads(struct MovieDistortion *distortion, int threads);
|
2012-06-15 13:03:23 +02:00
|
|
|
struct MovieDistortion *BKE_tracking_distortion_copy(struct MovieDistortion *distortion);
|
|
|
|
struct ImBuf *BKE_tracking_distortion_exec(struct MovieDistortion *distortion, struct MovieTracking *tracking,
|
2013-09-05 15:37:36 +02:00
|
|
|
struct ImBuf *ibuf, int width, int height, float overscan, bool undistort);
|
2016-01-26 11:42:55 +01:00
|
|
|
void BKE_tracking_distortion_distort_v2(struct MovieDistortion *distortion,
|
|
|
|
const float co[2],
|
|
|
|
float r_co[2]);
|
|
|
|
void BKE_tracking_distortion_undistort_v2(struct MovieDistortion *distortion,
|
|
|
|
const float co[2],
|
|
|
|
float r_co[2]);
|
2012-06-15 13:03:23 +02:00
|
|
|
void BKE_tracking_distortion_free(struct MovieDistortion *distortion);
|
2011-12-05 19:57:17 +01:00
|
|
|
|
2012-08-01 00:01:44 +02:00
|
|
|
void BKE_tracking_distort_v2(struct MovieTracking *tracking, const float co[2], float r_co[2]);
|
|
|
|
void BKE_tracking_undistort_v2(struct MovieTracking *tracking, const float co[2], float r_co[2]);
|
2011-12-05 19:57:17 +01:00
|
|
|
|
2012-06-15 13:03:23 +02:00
|
|
|
struct ImBuf *BKE_tracking_undistort_frame(struct MovieTracking *tracking, struct ImBuf *ibuf,
|
|
|
|
int calibration_width, int calibration_height, float overscan);
|
|
|
|
struct ImBuf *BKE_tracking_distort_frame(struct MovieTracking *tracking, struct ImBuf *ibuf,
|
|
|
|
int calibration_width, int calibration_height, float overscan);
|
2011-11-07 13:55:18 +01:00
|
|
|
|
2014-09-11 15:33:01 +02:00
|
|
|
void BKE_tracking_max_distortion_delta_across_bound(struct MovieTracking *tracking, struct rcti *rect,
|
|
|
|
bool undistort, float delta[2]);
|
2013-02-18 11:12:44 +01:00
|
|
|
|
2012-06-15 13:03:23 +02:00
|
|
|
/* **** Image sampling **** */
|
|
|
|
struct ImBuf *BKE_tracking_sample_pattern(int frame_width, int frame_height,
|
|
|
|
struct ImBuf *struct_ibuf, struct MovieTrackingTrack *track,
|
2013-09-05 15:37:36 +02:00
|
|
|
struct MovieTrackingMarker *marker, bool from_anchor, bool use_mask,
|
2012-06-15 13:03:23 +02:00
|
|
|
int num_samples_x, int num_samples_y, float pos[2]);
|
|
|
|
struct ImBuf *BKE_tracking_get_pattern_imbuf(struct ImBuf *ibuf, struct MovieTrackingTrack *track,
|
2013-09-05 15:37:36 +02:00
|
|
|
struct MovieTrackingMarker *marker, bool anchored, bool disable_channels);
|
2012-06-15 13:03:23 +02:00
|
|
|
struct ImBuf *BKE_tracking_get_search_imbuf(struct ImBuf *ibuf, struct MovieTrackingTrack *track,
|
2013-09-05 15:37:36 +02:00
|
|
|
struct MovieTrackingMarker *marker, bool anchored, bool disable_channels);
|
2012-01-15 14:31:58 +01:00
|
|
|
|
2013-09-05 15:37:36 +02:00
|
|
|
void BKE_tracking_disable_channels(struct ImBuf *ibuf, bool disable_red, bool disable_green,
|
|
|
|
bool disable_blue, bool grayscale);
|
2012-01-09 21:18:48 +01:00
|
|
|
|
2012-06-15 13:03:23 +02:00
|
|
|
/* **** 2D tracking **** */
|
2013-09-05 15:37:36 +02:00
|
|
|
void BKE_tracking_refine_marker(struct MovieClip *clip, struct MovieTrackingTrack *track, struct MovieTrackingMarker *marker, bool backwards);
|
2011-11-07 13:55:18 +01:00
|
|
|
|
2014-06-22 16:19:48 +02:00
|
|
|
/* *** 2D auto track *** */
|
|
|
|
|
|
|
|
struct AutoTrackContext *BKE_autotrack_context_new(struct MovieClip *clip, struct MovieClipUser *user,
|
|
|
|
const bool backwards, const bool sequence);
|
|
|
|
bool BKE_autotrack_context_step(struct AutoTrackContext *context);
|
|
|
|
void BKE_autotrack_context_sync(struct AutoTrackContext *context);
|
|
|
|
void BKE_autotrack_context_sync_user(struct AutoTrackContext *context, struct MovieClipUser *user);
|
|
|
|
void BKE_autotrack_context_finish(struct AutoTrackContext *context);
|
|
|
|
void BKE_autotrack_context_free(struct AutoTrackContext *context);
|
|
|
|
|
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
|
|
|
/* **** Plane tracking **** */
|
|
|
|
|
|
|
|
void BKE_tracking_track_plane_from_existing_motion(struct MovieTrackingPlaneTrack *plane_track, int start_frame);
|
2013-09-17 10:54:10 +02:00
|
|
|
void BKE_tracking_retrack_plane_from_existing_motion_at_segment(struct MovieTrackingPlaneTrack *plane_track, int start_frame);
|
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
|
|
|
void BKE_tracking_homography_between_two_quads(/*const*/ float reference_corners[4][2], /*const*/ float corners[4][2], float H[3][3]);
|
|
|
|
|
2012-06-15 13:03:23 +02:00
|
|
|
/* **** Camera solving **** */
|
2013-09-05 15:37:36 +02:00
|
|
|
bool BKE_tracking_reconstruction_check(struct MovieTracking *tracking, struct MovieTrackingObject *object,
|
|
|
|
char *error_msg, int error_size);
|
2011-11-28 14:49:42 +01:00
|
|
|
|
2013-10-26 15:22:38 +02:00
|
|
|
struct MovieReconstructContext *BKE_tracking_reconstruction_context_new(struct MovieClip *clip,
|
2012-06-15 13:03:23 +02:00
|
|
|
struct MovieTrackingObject *object,
|
|
|
|
int keyframe1, int keyframe2,
|
|
|
|
int width, int height);
|
2011-11-28 14:49:42 +01:00
|
|
|
void BKE_tracking_reconstruction_context_free(struct MovieReconstructContext *context);
|
2012-06-15 13:03:23 +02:00
|
|
|
void BKE_tracking_reconstruction_solve(struct MovieReconstructContext *context, short *stop, short *do_update,
|
2012-03-26 01:19:21 +02:00
|
|
|
float *progress, char *stats_message, int message_size);
|
2013-09-05 15:37:36 +02:00
|
|
|
bool BKE_tracking_reconstruction_finish(struct MovieReconstructContext *context, struct MovieTracking *tracking);
|
2011-11-07 13:55:18 +01:00
|
|
|
|
2013-05-13 15:37:05 +02:00
|
|
|
void BKE_tracking_reconstruction_scale(struct MovieTracking *tracking, float scale[3]);
|
|
|
|
|
2012-06-15 13:03:23 +02:00
|
|
|
/* **** Feature detection **** */
|
2011-12-05 19:57:17 +01:00
|
|
|
void BKE_tracking_detect_fast(struct MovieTracking *tracking, struct ListBase *tracksbase, struct ImBuf *imbuf,
|
2012-03-26 01:19:21 +02:00
|
|
|
int framenr, int margin, int min_trackness, int min_distance, struct bGPDlayer *layer,
|
2013-09-05 15:37:36 +02:00
|
|
|
bool place_outside_layer);
|
2011-11-07 13:55:18 +01:00
|
|
|
|
2013-10-08 15:53:59 +02:00
|
|
|
void BKE_tracking_detect_harris(struct MovieTracking *tracking, struct ListBase *tracksbase, struct ImBuf *ibuf,
|
|
|
|
int framenr, int margin, float threshold, int min_distance, struct bGPDlayer *layer,
|
|
|
|
bool place_outside_layer);
|
|
|
|
|
2012-06-15 13:03:23 +02:00
|
|
|
/* **** 2D stabilization **** */
|
Rework 2D stabilizator
See this page for motivation and description of concepts:
https://github.com/Ichthyostega/blender/wiki
See this video for UI explanation and demonstration of usage
http://vimeo.com/blenderHack/stabilizerdemo
This proposal attempts to improve usability of Blender's image stabilization
feature for real-world footage esp. with moving and panning camera. It builds
upon the feature tracking to get a measurement of 2D image movement.
- Use a weighted average of movement contributions (instead of a median).
- Allow for rotation compensation and zoom (image scale) compensation.
- Allow to pick a different set of tracks for translation and for
rotation/zoom.
- Treat translation / rotation / zoom contributions systematically in a
similar way.
- Improve handling of partial tracking data with gaps and varying
start / end points.
- Have a user definable anchor frame and interpolate / extrapolate data to
avoid jumping back to "neutral" position when no tracking data is available.
- Support for travelling and panning shots by including an //intended//
position/rotation/zoom ("target position"). The idea is for these parameters
to be //animated// by the user, in order to supply an smooth, intended
camera movement. This way, we can keep the image content roughly in frame
even when moving completely away from the initial view.
A known shortcoming is that the pivot point for rotation compensation is set to
the translation compensated image center. This can produce spurious rotation on
travelling shots, which needs to be compensated manually (by animating the
target rotation parameter). There are several possible ways to address that
problem, yet all of them are considered beyond the scope of this improvement
proposal for now.
Own modifications:
- Restrict line length, it's really handy for split-view editing
- In motion tracking we prefer fully human-readable comments, meaning we
don't use doxygen with it's weird markup and comments are supposed to
start with capital and end with a full stop,
- Add explicit comparison of pointer to NULL.
Reviewers: sergey
Subscribers: kusi, kdawg, forest-house, mardy, Samoth, plasmasolutions, willolis, sebastian_k, hype, enetheru, sunboy, jta, leon_cheung
Maniphest Tasks: T49036
Differential Revision: https://developer.blender.org/D583
2016-08-16 10:32:55 +02:00
|
|
|
void BKE_tracking_stabilization_data_get(struct MovieClip *clip, int framenr, int width, int height,
|
2013-06-12 14:34:10 +02:00
|
|
|
float translation[2], float *scale, float *angle);
|
Rework 2D stabilizator
See this page for motivation and description of concepts:
https://github.com/Ichthyostega/blender/wiki
See this video for UI explanation and demonstration of usage
http://vimeo.com/blenderHack/stabilizerdemo
This proposal attempts to improve usability of Blender's image stabilization
feature for real-world footage esp. with moving and panning camera. It builds
upon the feature tracking to get a measurement of 2D image movement.
- Use a weighted average of movement contributions (instead of a median).
- Allow for rotation compensation and zoom (image scale) compensation.
- Allow to pick a different set of tracks for translation and for
rotation/zoom.
- Treat translation / rotation / zoom contributions systematically in a
similar way.
- Improve handling of partial tracking data with gaps and varying
start / end points.
- Have a user definable anchor frame and interpolate / extrapolate data to
avoid jumping back to "neutral" position when no tracking data is available.
- Support for travelling and panning shots by including an //intended//
position/rotation/zoom ("target position"). The idea is for these parameters
to be //animated// by the user, in order to supply an smooth, intended
camera movement. This way, we can keep the image content roughly in frame
even when moving completely away from the initial view.
A known shortcoming is that the pivot point for rotation compensation is set to
the translation compensated image center. This can produce spurious rotation on
travelling shots, which needs to be compensated manually (by animating the
target rotation parameter). There are several possible ways to address that
problem, yet all of them are considered beyond the scope of this improvement
proposal for now.
Own modifications:
- Restrict line length, it's really handy for split-view editing
- In motion tracking we prefer fully human-readable comments, meaning we
don't use doxygen with it's weird markup and comments are supposed to
start with capital and end with a full stop,
- Add explicit comparison of pointer to NULL.
Reviewers: sergey
Subscribers: kusi, kdawg, forest-house, mardy, Samoth, plasmasolutions, willolis, sebastian_k, hype, enetheru, sunboy, jta, leon_cheung
Maniphest Tasks: T49036
Differential Revision: https://developer.blender.org/D583
2016-08-16 10:32:55 +02:00
|
|
|
struct ImBuf *BKE_tracking_stabilize_frame(struct MovieClip *clip, int framenr, struct ImBuf *ibuf,
|
2013-06-12 14:34:10 +02:00
|
|
|
float translation[2], float *scale, float *angle);
|
|
|
|
void BKE_tracking_stabilization_data_to_mat4(int width, int height, float aspect, float translation[2],
|
2012-06-15 13:03:23 +02:00
|
|
|
float scale, float angle, float mat[4][4]);
|
2011-11-07 13:55:18 +01:00
|
|
|
|
2012-04-30 18:19:20 +02:00
|
|
|
/* Dopesheet */
|
2012-05-04 01:15:01 +02:00
|
|
|
void BKE_tracking_dopesheet_tag_update(struct MovieTracking *tracking);
|
2012-06-12 19:10:24 +02:00
|
|
|
void BKE_tracking_dopesheet_update(struct MovieTracking *tracking);
|
2012-04-30 18:19:20 +02:00
|
|
|
|
2012-06-10 21:59:02 +02:00
|
|
|
#define TRACK_SELECTED(track) ((track)->flag & SELECT || (track)->pat_flag & SELECT || (track)->search_flag & SELECT)
|
2011-11-07 13:55:18 +01:00
|
|
|
|
2012-06-10 21:59:02 +02: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))
|
2012-02-26 09:14:14 +01:00
|
|
|
|
2012-06-10 21:59:02 +02:00
|
|
|
#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-02-26 09:14:14 +01:00
|
|
|
|
2014-03-06 15:07:14 +01:00
|
|
|
#define PLANE_TRACK_VIEW_SELECTED(plane_track) ((((plane_track)->flag & PLANE_TRACK_HIDDEN) == 0) && \
|
|
|
|
((plane_track)->flag & SELECT))
|
|
|
|
|
2012-06-10 21:59:02 +02: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 13:55:18 +01:00
|
|
|
|
2012-06-10 21:59:02 +02:00
|
|
|
#define TRACK_CLEAR_UPTO 0
|
|
|
|
#define TRACK_CLEAR_REMAINED 1
|
|
|
|
#define TRACK_CLEAR_ALL 2
|
2012-01-15 14:31:58 +01:00
|
|
|
|
2012-06-10 21:59:02 +02:00
|
|
|
#define CLAMP_PAT_DIM 1
|
|
|
|
#define CLAMP_PAT_POS 2
|
|
|
|
#define CLAMP_SEARCH_DIM 3
|
|
|
|
#define CLAMP_SEARCH_POS 4
|
2011-11-07 13:55:18 +01:00
|
|
|
|
2012-06-10 21:59:02 +02:00
|
|
|
#define TRACK_AREA_NONE -1
|
|
|
|
#define TRACK_AREA_POINT 1
|
|
|
|
#define TRACK_AREA_PAT 2
|
|
|
|
#define TRACK_AREA_SEARCH 4
|
2011-11-07 13:55:18 +01:00
|
|
|
|
2012-06-10 21:59:02 +02:00
|
|
|
#define TRACK_AREA_ALL (TRACK_AREA_POINT | TRACK_AREA_PAT | TRACK_AREA_SEARCH)
|
2011-11-07 13:55:18 +01:00
|
|
|
|
|
|
|
#endif
|