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;
|
|
|
|
struct MovieTrackingContext;
|
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);
|
|
|
|
|
|
|
|
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,
|
|
|
|
struct ListBase **tracksbase_r);
|
|
|
|
|
|
|
|
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);
|
|
|
|
|
|
|
|
/* 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);
|
|
|
|
|
|
|
|
/* **** 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);
|
|
|
|
|
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,
|
|
|
|
int framenr, float mat[4][4]);
|
2011-11-07 13:55:18 +01:00
|
|
|
|
2012-06-15 13:03:23 +02:00
|
|
|
/* **** Distortion/Undistortion **** */
|
|
|
|
struct MovieDistortion *BKE_tracking_distortion_new(void);
|
|
|
|
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);
|
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
|
|
|
|
2013-02-18 11:12:44 +01:00
|
|
|
void BKE_tracking_max_undistortion_delta_across_bound(struct MovieTracking *tracking, struct rcti *rect, float delta[2]);
|
|
|
|
|
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 **** */
|
2011-11-07 13:55:18 +01:00
|
|
|
struct MovieTrackingContext *BKE_tracking_context_new(struct MovieClip *clip, struct MovieClipUser *user,
|
2012-06-10 21:59:02 +02:00
|
|
|
short backwards, short sequence);
|
2011-11-07 13:55:18 +01:00
|
|
|
void BKE_tracking_context_free(struct MovieTrackingContext *context);
|
2012-06-15 13:03:23 +02:00
|
|
|
void BKE_tracking_context_sync(struct MovieTrackingContext *context);
|
|
|
|
void BKE_tracking_context_sync_user(const struct MovieTrackingContext *context, struct MovieClipUser *user);
|
2013-09-05 15:37:36 +02:00
|
|
|
bool BKE_tracking_context_step(struct MovieTrackingContext *context);
|
2013-09-10 14:46:18 +02:00
|
|
|
void BKE_tracking_context_finish(struct MovieTrackingContext *context);
|
|
|
|
|
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
|
|
|
|
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 **** */
|
|
|
|
void BKE_tracking_stabilization_data_get(struct MovieTracking *tracking, int framenr, int width, int height,
|
2013-06-12 14:34:10 +02:00
|
|
|
float translation[2], float *scale, float *angle);
|
2012-06-15 13:03:23 +02:00
|
|
|
struct ImBuf *BKE_tracking_stabilize_frame(struct MovieTracking *tracking, 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
|
|
|
|
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
|