2011-11-07 12:55:18 +00:00
|
|
|
/*
|
|
|
|
* 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.
|
|
|
|
*/
|
|
|
|
|
2019-02-18 08:08:12 +11:00
|
|
|
/** \file
|
|
|
|
* \ingroup RNA
|
2011-11-07 12:55:18 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
#include <stdlib.h>
|
|
|
|
#include <limits.h>
|
|
|
|
|
|
|
|
#include "MEM_guardedalloc.h"
|
|
|
|
|
|
|
|
#include "BKE_movieclip.h"
|
|
|
|
#include "BKE_tracking.h"
|
|
|
|
|
2012-11-02 09:41:26 +00:00
|
|
|
#include "RNA_access.h"
|
2011-11-07 12:55:18 +00:00
|
|
|
#include "RNA_define.h"
|
|
|
|
|
|
|
|
#include "rna_internal.h"
|
|
|
|
|
|
|
|
#include "DNA_movieclip_types.h"
|
2012-06-10 19:59:02 +00:00
|
|
|
#include "DNA_object_types.h" /* SELECT */
|
2011-11-07 12:55:18 +00:00
|
|
|
#include "DNA_scene_types.h"
|
|
|
|
|
|
|
|
#include "WM_types.h"
|
|
|
|
|
|
|
|
#ifdef RNA_RUNTIME
|
|
|
|
|
2019-01-26 20:41:52 +11:00
|
|
|
#include "BLI_math.h"
|
|
|
|
|
2017-12-19 13:39:37 +01:00
|
|
|
#include "DNA_anim_types.h"
|
|
|
|
|
|
|
|
#include "BKE_animsys.h"
|
2011-11-07 12:55:18 +00:00
|
|
|
#include "BKE_node.h"
|
|
|
|
|
2017-06-08 10:14:53 +02:00
|
|
|
#include "DEG_depsgraph.h"
|
|
|
|
|
2011-11-07 12:55:18 +00:00
|
|
|
#include "IMB_imbuf.h"
|
|
|
|
|
|
|
|
#include "WM_api.h"
|
|
|
|
|
2012-02-15 16:06:48 +00:00
|
|
|
static char *rna_tracking_path(PointerRNA *UNUSED(ptr))
|
|
|
|
{
|
2019-03-24 16:09:46 +11:00
|
|
|
return BLI_strdup("tracking");
|
2012-02-15 16:06:48 +00:00
|
|
|
}
|
|
|
|
|
2012-02-20 22:58:00 +00:00
|
|
|
static void rna_tracking_defaultSettings_patternUpdate(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr)
|
2011-11-28 13:26:46 +00:00
|
|
|
{
|
2012-06-10 19:59:02 +00:00
|
|
|
MovieClip *clip = (MovieClip *)ptr->id.data;
|
2012-03-05 23:30:41 +00:00
|
|
|
MovieTracking *tracking = &clip->tracking;
|
|
|
|
MovieTrackingSettings *settings = &tracking->settings;
|
2011-11-28 13:26:46 +00:00
|
|
|
|
2012-06-10 19:59:02 +00:00
|
|
|
if (settings->default_search_size < settings->default_pattern_size)
|
2012-03-05 23:30:41 +00:00
|
|
|
settings->default_search_size = settings->default_pattern_size;
|
2011-11-28 13:26:46 +00:00
|
|
|
}
|
|
|
|
|
2012-02-20 22:58:00 +00:00
|
|
|
static void rna_tracking_defaultSettings_searchUpdate(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr)
|
2011-11-28 13:26:46 +00:00
|
|
|
{
|
2012-06-10 19:59:02 +00:00
|
|
|
MovieClip *clip = (MovieClip *)ptr->id.data;
|
2012-03-05 23:30:41 +00:00
|
|
|
MovieTracking *tracking = &clip->tracking;
|
|
|
|
MovieTrackingSettings *settings = &tracking->settings;
|
2011-11-28 13:26:46 +00:00
|
|
|
|
2012-06-10 19:59:02 +00:00
|
|
|
if (settings->default_pattern_size > settings->default_search_size)
|
2012-03-05 23:30:41 +00:00
|
|
|
settings->default_pattern_size = settings->default_search_size;
|
2011-11-28 13:26:46 +00:00
|
|
|
}
|
|
|
|
|
2012-02-15 16:06:48 +00:00
|
|
|
static char *rna_trackingTrack_path(PointerRNA *ptr)
|
|
|
|
{
|
2015-11-04 20:01:33 +05:00
|
|
|
MovieClip *clip = (MovieClip *)ptr->id.data;
|
2013-04-23 20:10:22 +00:00
|
|
|
MovieTrackingTrack *track = (MovieTrackingTrack *)ptr->data;
|
2017-12-19 12:48:53 +01:00
|
|
|
/* Escaped object name, escaped track name, rest of the path. */
|
|
|
|
char rna_path[MAX_NAME * 4 + 64];
|
|
|
|
BKE_tracking_get_rna_path_for_track(&clip->tracking,
|
|
|
|
track,
|
|
|
|
rna_path, sizeof(rna_path));
|
|
|
|
return BLI_strdup(rna_path);
|
2012-02-15 16:06:48 +00:00
|
|
|
}
|
|
|
|
|
2012-01-09 20:18:57 +00:00
|
|
|
static void rna_trackingTracks_begin(CollectionPropertyIterator *iter, PointerRNA *ptr)
|
2011-11-07 12:55:18 +00:00
|
|
|
{
|
2012-06-10 19:59:02 +00:00
|
|
|
MovieClip *clip = (MovieClip *)ptr->id.data;
|
2011-12-05 18:57:17 +00:00
|
|
|
|
2011-11-07 12:55:18 +00:00
|
|
|
rna_iterator_listbase_begin(iter, &clip->tracking.tracks, NULL);
|
|
|
|
}
|
|
|
|
|
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 09:46:30 +00:00
|
|
|
static void rna_trackingPlaneTracks_begin(CollectionPropertyIterator *iter, PointerRNA *ptr)
|
|
|
|
{
|
|
|
|
MovieClip *clip = (MovieClip *)ptr->id.data;
|
|
|
|
|
|
|
|
rna_iterator_listbase_begin(iter, &clip->tracking.plane_tracks, NULL);
|
|
|
|
}
|
|
|
|
|
2012-01-09 20:18:57 +00:00
|
|
|
static void rna_trackingObjects_begin(CollectionPropertyIterator *iter, PointerRNA *ptr)
|
2011-11-07 12:55:18 +00:00
|
|
|
{
|
2012-06-10 19:59:02 +00:00
|
|
|
MovieClip *clip = (MovieClip *)ptr->id.data;
|
2011-11-07 12:55:18 +00:00
|
|
|
|
2011-12-05 18:57:17 +00:00
|
|
|
rna_iterator_listbase_begin(iter, &clip->tracking.objects, NULL);
|
|
|
|
}
|
2011-11-07 12:55:18 +00:00
|
|
|
|
2011-12-05 18:57:17 +00:00
|
|
|
static int rna_tracking_active_object_index_get(PointerRNA *ptr)
|
|
|
|
{
|
2012-06-10 19:59:02 +00:00
|
|
|
MovieClip *clip = (MovieClip *)ptr->id.data;
|
2011-12-05 18:57:17 +00:00
|
|
|
|
|
|
|
return clip->tracking.objectnr;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void rna_tracking_active_object_index_set(PointerRNA *ptr, int value)
|
|
|
|
{
|
2012-06-10 19:59:02 +00:00
|
|
|
MovieClip *clip = (MovieClip *)ptr->id.data;
|
2011-12-05 18:57:17 +00:00
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
clip->tracking.objectnr = value;
|
2013-03-06 18:01:24 +00:00
|
|
|
BKE_tracking_dopesheet_tag_update(&clip->tracking);
|
2011-12-05 18:57:17 +00:00
|
|
|
}
|
|
|
|
|
2013-09-20 06:35:28 +00:00
|
|
|
static void rna_tracking_active_object_index_range(PointerRNA *ptr, int *min, int *max,
|
|
|
|
int *UNUSED(softmin), int *UNUSED(softmax))
|
2011-12-05 18:57:17 +00:00
|
|
|
{
|
2012-06-10 19:59:02 +00:00
|
|
|
MovieClip *clip = (MovieClip *)ptr->id.data;
|
2011-12-05 18:57:17 +00:00
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
*min = 0;
|
2012-11-07 12:31:05 +00:00
|
|
|
*max = max_ii(0, clip->tracking.tot_object - 1);
|
2011-11-07 12:55:18 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static PointerRNA rna_tracking_active_track_get(PointerRNA *ptr)
|
|
|
|
{
|
2012-06-10 19:59:02 +00:00
|
|
|
MovieClip *clip = (MovieClip *)ptr->id.data;
|
2012-06-15 11:03:23 +00:00
|
|
|
MovieTrackingTrack *act_track = BKE_tracking_track_get_active(&clip->tracking);
|
2011-11-07 12:55:18 +00:00
|
|
|
|
2011-12-05 18:57:17 +00:00
|
|
|
return rna_pointer_inherit_refine(ptr, &RNA_MovieTrackingTrack, act_track);
|
2011-11-07 12:55:18 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static void rna_tracking_active_track_set(PointerRNA *ptr, PointerRNA value)
|
|
|
|
{
|
2012-06-10 19:59:02 +00:00
|
|
|
MovieClip *clip = (MovieClip *)ptr->id.data;
|
2012-03-05 23:30:41 +00:00
|
|
|
MovieTrackingTrack *track = (MovieTrackingTrack *)value.data;
|
2012-06-15 11:03:23 +00:00
|
|
|
ListBase *tracksbase = BKE_tracking_get_active_tracks(&clip->tracking);
|
2012-03-05 23:30:41 +00:00
|
|
|
int index = BLI_findindex(tracksbase, track);
|
2011-11-07 12:55:18 +00:00
|
|
|
|
2014-02-01 01:45:09 +11:00
|
|
|
if (index != -1)
|
2012-03-05 23:30:41 +00:00
|
|
|
clip->tracking.act_track = track;
|
2011-12-05 18:57:17 +00:00
|
|
|
else
|
2012-03-05 23:30:41 +00:00
|
|
|
clip->tracking.act_track = NULL;
|
2011-11-07 12:55:18 +00: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 09:46:30 +00:00
|
|
|
static PointerRNA rna_tracking_active_plane_track_get(PointerRNA *ptr)
|
|
|
|
{
|
|
|
|
MovieClip *clip = (MovieClip *)ptr->id.data;
|
|
|
|
MovieTrackingPlaneTrack *act_plane_track = BKE_tracking_plane_track_get_active(&clip->tracking);
|
|
|
|
|
|
|
|
return rna_pointer_inherit_refine(ptr, &RNA_MovieTrackingPlaneTrack, act_plane_track);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void rna_tracking_active_plane_track_set(PointerRNA *ptr, PointerRNA value)
|
|
|
|
{
|
|
|
|
MovieClip *clip = (MovieClip *)ptr->id.data;
|
|
|
|
MovieTrackingPlaneTrack *plane_track = (MovieTrackingPlaneTrack *) value.data;
|
|
|
|
ListBase *plane_tracks_base = BKE_tracking_get_active_plane_tracks(&clip->tracking);
|
|
|
|
int index = BLI_findindex(plane_tracks_base, plane_track);
|
|
|
|
|
2014-02-01 01:45:09 +11:00
|
|
|
if (index != -1)
|
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 09:46:30 +00:00
|
|
|
clip->tracking.act_plane_track = plane_track;
|
|
|
|
else
|
|
|
|
clip->tracking.act_plane_track = NULL;
|
|
|
|
}
|
|
|
|
|
2012-09-22 14:07:55 +00:00
|
|
|
static void rna_trackingTrack_name_set(PointerRNA *ptr, const char *value)
|
2011-11-07 12:55:18 +00:00
|
|
|
{
|
2012-03-05 23:30:41 +00:00
|
|
|
MovieClip *clip = (MovieClip *)ptr->id.data;
|
|
|
|
MovieTrackingTrack *track = (MovieTrackingTrack *)ptr->data;
|
2017-12-19 12:22:34 +01:00
|
|
|
ListBase *tracksbase =
|
|
|
|
BKE_tracking_find_tracks_list_for_track(&clip->tracking, track);
|
2017-12-19 13:39:37 +01:00
|
|
|
/* Store old name, for the animation fix later. */
|
|
|
|
char old_name[sizeof(track->name)];
|
|
|
|
BLI_strncpy(old_name, track->name, sizeof(track->name));
|
|
|
|
/* Update the name, */
|
2011-11-07 12:55:18 +00:00
|
|
|
BLI_strncpy(track->name, value, sizeof(track->name));
|
2012-06-15 11:03:23 +00:00
|
|
|
BKE_tracking_track_unique_name(tracksbase, track);
|
2017-12-19 13:39:37 +01:00
|
|
|
/* Fix animation paths. */
|
|
|
|
AnimData *adt = BKE_animdata_from_id(&clip->id);
|
|
|
|
if (adt != NULL) {
|
|
|
|
char rna_path[MAX_NAME * 2 + 64];
|
|
|
|
BKE_tracking_get_rna_path_prefix_for_track(&clip->tracking,
|
|
|
|
track,
|
|
|
|
rna_path, sizeof(rna_path));
|
|
|
|
BKE_animdata_fix_paths_rename(&clip->id, adt, NULL,
|
|
|
|
rna_path,
|
|
|
|
old_name, track->name,
|
|
|
|
0, 0, 1);
|
|
|
|
}
|
2011-11-07 12:55:18 +00:00
|
|
|
}
|
|
|
|
|
2018-07-05 22:25:34 +02:00
|
|
|
static bool rna_trackingTrack_select_get(PointerRNA *ptr)
|
2011-11-15 12:20:58 +00:00
|
|
|
{
|
2012-03-05 23:30:41 +00:00
|
|
|
MovieTrackingTrack *track = (MovieTrackingTrack *)ptr->data;
|
2011-11-15 12:20:58 +00:00
|
|
|
|
|
|
|
return TRACK_SELECTED(track);
|
|
|
|
}
|
|
|
|
|
2018-07-05 22:25:34 +02:00
|
|
|
static void rna_trackingTrack_select_set(PointerRNA *ptr, bool value)
|
2011-11-15 12:20:58 +00:00
|
|
|
{
|
2012-03-05 23:30:41 +00:00
|
|
|
MovieTrackingTrack *track = (MovieTrackingTrack *)ptr->data;
|
2011-11-15 12:20:58 +00:00
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
if (value) {
|
|
|
|
track->flag |= SELECT;
|
|
|
|
track->pat_flag |= SELECT;
|
|
|
|
track->search_flag |= SELECT;
|
2011-11-15 12:20:58 +00:00
|
|
|
}
|
|
|
|
else {
|
2012-03-05 23:30:41 +00:00
|
|
|
track->flag &= ~SELECT;
|
|
|
|
track->pat_flag &= ~SELECT;
|
|
|
|
track->search_flag &= ~SELECT;
|
2011-11-15 12:20:58 +00: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 09:46:30 +00:00
|
|
|
static void rna_trackingPlaneMarker_frame_set(PointerRNA *ptr, int value)
|
|
|
|
{
|
|
|
|
MovieClip *clip = (MovieClip *) ptr->id.data;
|
|
|
|
MovieTracking *tracking = &clip->tracking;
|
|
|
|
MovieTrackingPlaneMarker *plane_marker = (MovieTrackingPlaneMarker *) ptr->data;
|
2013-08-23 09:10:23 +00:00
|
|
|
MovieTrackingObject *tracking_object;
|
|
|
|
bool found = false;
|
|
|
|
MovieTrackingPlaneTrack *plane_track = NULL;
|
|
|
|
|
|
|
|
for (tracking_object = tracking->objects.first;
|
|
|
|
tracking_object;
|
|
|
|
tracking_object = tracking_object->next)
|
|
|
|
{
|
|
|
|
ListBase *tracksbase = BKE_tracking_object_get_plane_tracks(tracking, tracking_object);
|
|
|
|
|
|
|
|
for (plane_track = tracksbase->first;
|
2014-01-12 22:05:24 +11:00
|
|
|
plane_track;
|
|
|
|
plane_track = plane_track->next)
|
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 09:46:30 +00:00
|
|
|
{
|
2013-08-23 09:10:23 +00:00
|
|
|
if (plane_marker >= plane_track->markers && plane_marker < plane_track->markers + plane_track->markersnr) {
|
|
|
|
found = true;
|
|
|
|
break;
|
|
|
|
}
|
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 09:46:30 +00:00
|
|
|
}
|
|
|
|
|
2013-08-23 09:10:23 +00:00
|
|
|
if (found) {
|
|
|
|
break;
|
|
|
|
}
|
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 09:46:30 +00:00
|
|
|
}
|
|
|
|
|
2013-08-23 09:10:23 +00:00
|
|
|
if (found) {
|
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 09:46:30 +00:00
|
|
|
MovieTrackingPlaneMarker new_plane_marker = *plane_marker;
|
|
|
|
new_plane_marker.framenr = value;
|
|
|
|
|
|
|
|
BKE_tracking_plane_marker_delete(plane_track, plane_marker->framenr);
|
|
|
|
BKE_tracking_plane_marker_insert(plane_track, &new_plane_marker);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static char *rna_trackingPlaneTrack_path(PointerRNA *ptr)
|
|
|
|
{
|
2015-11-04 20:01:33 +05:00
|
|
|
MovieClip *clip = (MovieClip *)ptr->id.data;
|
Merge plane track feature from tomato branch
This commit includes all the changes made for plane tracker
in tomato branch.
Movie clip editor changes:
- Artist might create a plane track out of multiple point
tracks which belongs to the same track (minimum amount of
point tracks is 4, maximum is not actually limited).
When new plane track is added, it's getting "tracked"
across all point tracks, which makes it stick to the same
plane point tracks belong to.
- After plane track was added, it need to be manually adjusted
in a way it covers feature one might to mask/replace.
General transform tools (G, R, S) or sliding corners with
a mouse could be sued for this. Plane corner which
corresponds to left bottom image corner has got X/Y axis
on it (red is for X axis, green for Y).
- Re-adjusting plane corners makes plane to be "re-tracked"
for the frames sequence between current frame and next
and previous keyframes.
- Kayframes might be removed from the plane, using Shit-X
(Marker Delete) operator. However, currently manual
re-adjustment or "re-track" trigger is needed.
Compositor changes:
- Added new node called Plane Track Deform.
- User selects which plane track to use (for this he need
to select movie clip datablock, object and track names).
- Node gets an image input, which need to be warped into
the plane.
- Node outputs:
* Input image warped into the plane.
* Plane, rasterized to a mask.
Masking changes:
- Mask points might be parented to a plane track, which
makes this point deforming in a way as if it belongs
to the tracked plane.
Some video tutorials are available:
- Coder video: http://www.youtube.com/watch?v=vISEwqNHqe4
- Artist video: https://vimeo.com/71727578
This is mine and Keir's holiday code project :)
2013-08-16 09:46:30 +00:00
|
|
|
MovieTrackingPlaneTrack *plane_track = (MovieTrackingPlaneTrack *)ptr->data;
|
2017-12-19 12:48:53 +01:00
|
|
|
/* Escaped object name, escaped track name, rest of the path. */
|
|
|
|
char rna_path[MAX_NAME * 4 + 64];
|
|
|
|
BKE_tracking_get_rna_path_for_plane_track(&clip->tracking,
|
|
|
|
plane_track,
|
|
|
|
rna_path, sizeof(rna_path));
|
|
|
|
return BLI_strdup(rna_path);
|
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 09:46:30 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static void rna_trackingPlaneTrack_name_set(PointerRNA *ptr, const char *value)
|
|
|
|
{
|
|
|
|
MovieClip *clip = (MovieClip *)ptr->id.data;
|
|
|
|
MovieTrackingPlaneTrack *plane_track = (MovieTrackingPlaneTrack *)ptr->data;
|
2017-12-19 12:22:34 +01:00
|
|
|
ListBase *plane_tracks_base =
|
|
|
|
BKE_tracking_find_tracks_list_for_plane_track(&clip->tracking,
|
|
|
|
plane_track);
|
2017-12-19 13:39:37 +01:00
|
|
|
/* Store old name, for the animation fix later. */
|
|
|
|
char old_name[sizeof(plane_track->name)];
|
|
|
|
BLI_strncpy(old_name, plane_track->name, sizeof(plane_track->name));
|
|
|
|
/* Update the name, */
|
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 09:46:30 +00:00
|
|
|
BLI_strncpy(plane_track->name, value, sizeof(plane_track->name));
|
|
|
|
BKE_tracking_plane_track_unique_name(plane_tracks_base, plane_track);
|
2017-12-19 13:39:37 +01:00
|
|
|
/* Fix animation paths. */
|
|
|
|
AnimData *adt = BKE_animdata_from_id(&clip->id);
|
|
|
|
if (adt != NULL) {
|
|
|
|
char rna_path[MAX_NAME * 2 + 64];
|
|
|
|
BKE_tracking_get_rna_path_prefix_for_plane_track(&clip->tracking,
|
|
|
|
plane_track,
|
|
|
|
rna_path,
|
|
|
|
sizeof(rna_path));
|
|
|
|
BKE_animdata_fix_paths_rename(&clip->id, adt, NULL,
|
|
|
|
rna_path,
|
|
|
|
old_name, plane_track->name,
|
|
|
|
0, 0, 1);
|
|
|
|
}
|
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 09:46:30 +00:00
|
|
|
}
|
|
|
|
|
2012-02-15 16:06:48 +00:00
|
|
|
static char *rna_trackingCamera_path(PointerRNA *UNUSED(ptr))
|
|
|
|
{
|
2019-03-24 16:09:46 +11:00
|
|
|
return BLI_strdup("tracking.camera");
|
2012-02-15 16:06:48 +00:00
|
|
|
}
|
|
|
|
|
2011-11-07 12:55:18 +00:00
|
|
|
static float rna_trackingCamera_focal_mm_get(PointerRNA *ptr)
|
|
|
|
{
|
2012-06-10 19:59:02 +00:00
|
|
|
MovieClip *clip = (MovieClip *)ptr->id.data;
|
2012-03-05 23:30:41 +00:00
|
|
|
MovieTrackingCamera *camera = &clip->tracking.camera;
|
|
|
|
float val = camera->focal;
|
2011-11-07 12:55:18 +00:00
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
if (clip->lastsize[0])
|
2012-06-10 19:59:02 +00:00
|
|
|
val = val * camera->sensor_width / (float)clip->lastsize[0];
|
2011-11-07 12:55:18 +00:00
|
|
|
|
|
|
|
return val;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void rna_trackingCamera_focal_mm_set(PointerRNA *ptr, float value)
|
|
|
|
{
|
2012-06-10 19:59:02 +00:00
|
|
|
MovieClip *clip = (MovieClip *)ptr->id.data;
|
2012-03-05 23:30:41 +00:00
|
|
|
MovieTrackingCamera *camera = &clip->tracking.camera;
|
2011-11-07 12:55:18 +00:00
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
if (clip->lastsize[0])
|
2012-06-10 19:59:02 +00:00
|
|
|
value = clip->lastsize[0] * value / camera->sensor_width;
|
2011-11-07 12:55:18 +00:00
|
|
|
|
2012-05-03 21:35:04 +00:00
|
|
|
if (value >= 0.0001f)
|
2012-03-05 23:30:41 +00:00
|
|
|
camera->focal = value;
|
2011-11-07 12:55:18 +00:00
|
|
|
}
|
|
|
|
|
2012-02-15 16:06:48 +00:00
|
|
|
static char *rna_trackingStabilization_path(PointerRNA *UNUSED(ptr))
|
|
|
|
{
|
2019-03-24 16:09:46 +11:00
|
|
|
return BLI_strdup("tracking.stabilization");
|
2012-02-15 16:06:48 +00:00
|
|
|
}
|
|
|
|
|
2011-11-07 12:55:18 +00:00
|
|
|
static int rna_track_2d_stabilization(CollectionPropertyIterator *UNUSED(iter), void *data)
|
|
|
|
{
|
2012-06-10 19:59:02 +00:00
|
|
|
MovieTrackingTrack *track = (MovieTrackingTrack *)data;
|
2011-11-07 12:55:18 +00:00
|
|
|
|
2012-06-10 19:59:02 +00:00
|
|
|
if ((track->flag & TRACK_USE_2D_STAB) == 0)
|
2011-11-07 12:55:18 +00:00
|
|
|
return 1;
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
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
|
|
|
static int rna_track_2d_stabilization_rotation(CollectionPropertyIterator *UNUSED(iter), void *data)
|
|
|
|
{
|
|
|
|
MovieTrackingTrack *track = (MovieTrackingTrack *)data;
|
|
|
|
|
|
|
|
if ((track->flag & TRACK_USE_2D_STAB_ROT) == 0)
|
|
|
|
return 1;
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2011-11-07 12:55:18 +00:00
|
|
|
static void rna_tracking_stabTracks_begin(CollectionPropertyIterator *iter, PointerRNA *ptr)
|
|
|
|
{
|
2012-06-10 19:59:02 +00:00
|
|
|
MovieClip *clip = (MovieClip *)ptr->id.data;
|
2011-11-07 12:55:18 +00:00
|
|
|
rna_iterator_listbase_begin(iter, &clip->tracking.tracks, rna_track_2d_stabilization);
|
|
|
|
}
|
|
|
|
|
|
|
|
static int rna_tracking_stabTracks_active_index_get(PointerRNA *ptr)
|
|
|
|
{
|
2012-06-10 19:59:02 +00:00
|
|
|
MovieClip *clip = (MovieClip *)ptr->id.data;
|
2011-11-07 12:55:18 +00:00
|
|
|
return clip->tracking.stabilization.act_track;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void rna_tracking_stabTracks_active_index_set(PointerRNA *ptr, int value)
|
|
|
|
{
|
2012-06-10 19:59:02 +00:00
|
|
|
MovieClip *clip = (MovieClip *)ptr->id.data;
|
2012-03-05 23:30:41 +00:00
|
|
|
clip->tracking.stabilization.act_track = value;
|
2011-11-07 12:55:18 +00:00
|
|
|
}
|
|
|
|
|
2013-09-20 06:35:28 +00:00
|
|
|
static void rna_tracking_stabTracks_active_index_range(PointerRNA *ptr, int *min, int *max,
|
|
|
|
int *UNUSED(softmin), int *UNUSED(softmax))
|
2011-11-07 12:55:18 +00:00
|
|
|
{
|
2012-06-10 19:59:02 +00:00
|
|
|
MovieClip *clip = (MovieClip *)ptr->id.data;
|
2011-11-07 12:55:18 +00:00
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
*min = 0;
|
2012-11-07 12:31:05 +00:00
|
|
|
*max = max_ii(0, clip->tracking.stabilization.tot_track - 1);
|
2011-11-07 12:55:18 +00:00
|
|
|
}
|
|
|
|
|
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
|
|
|
static void rna_tracking_stabRotTracks_begin(CollectionPropertyIterator *iter, PointerRNA *ptr)
|
2014-02-20 19:41:05 +06:00
|
|
|
{
|
|
|
|
MovieClip *clip = (MovieClip *)ptr->id.data;
|
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
|
|
|
rna_iterator_listbase_begin(iter, &clip->tracking.tracks, rna_track_2d_stabilization_rotation);
|
|
|
|
}
|
2014-02-20 19:41:05 +06:00
|
|
|
|
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
|
|
|
static int rna_tracking_stabRotTracks_active_index_get(PointerRNA *ptr)
|
|
|
|
{
|
|
|
|
MovieClip *clip = (MovieClip *)ptr->id.data;
|
|
|
|
return clip->tracking.stabilization.act_rot_track;
|
2014-02-20 19:41:05 +06:00
|
|
|
}
|
|
|
|
|
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
|
|
|
static void rna_tracking_stabRotTracks_active_index_set(PointerRNA *ptr, int value)
|
2011-11-07 12:55:18 +00:00
|
|
|
{
|
2012-06-10 19:59:02 +00:00
|
|
|
MovieClip *clip = (MovieClip *)ptr->id.data;
|
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
|
|
|
clip->tracking.stabilization.act_rot_track = value;
|
|
|
|
}
|
2011-11-07 12:55:18 +00:00
|
|
|
|
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
|
|
|
static void rna_tracking_stabRotTracks_active_index_range(PointerRNA *ptr, int *min, int *max,
|
|
|
|
int *UNUSED(softmin), int *UNUSED(softmax))
|
|
|
|
{
|
|
|
|
MovieClip *clip = (MovieClip *)ptr->id.data;
|
|
|
|
|
|
|
|
*min = 0;
|
|
|
|
*max = max_ii(0, clip->tracking.stabilization.tot_rot_track - 1);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void rna_tracking_flushUpdate(Main *UNUSED(bmain), Scene *scene, PointerRNA *ptr)
|
|
|
|
{
|
|
|
|
MovieClip *clip = (MovieClip *)ptr->id.data;
|
2011-11-07 12:55:18 +00:00
|
|
|
|
|
|
|
nodeUpdateID(scene->nodetree, &clip->id);
|
|
|
|
|
2012-06-10 19:59:02 +00:00
|
|
|
WM_main_add_notifier(NC_SCENE | ND_NODES, NULL);
|
2014-07-24 21:00:35 +06:00
|
|
|
WM_main_add_notifier(NC_SCENE, NULL);
|
2017-06-08 10:14:53 +02:00
|
|
|
DEG_id_tag_update(&clip->id, 0);
|
2011-11-07 12:55:18 +00:00
|
|
|
}
|
|
|
|
|
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
|
|
|
static void rna_tracking_resetIntrinsics(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr)
|
|
|
|
{
|
|
|
|
MovieClip *clip = (MovieClip *)ptr->id.data;
|
|
|
|
MovieTracking *tracking = &clip->tracking;
|
|
|
|
|
|
|
|
if (tracking->camera.intrinsics) {
|
|
|
|
BKE_tracking_distortion_free(tracking->camera.intrinsics);
|
|
|
|
tracking->camera.intrinsics = NULL;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2011-12-05 18:57:17 +00:00
|
|
|
static void rna_trackingObject_tracks_begin(CollectionPropertyIterator *iter, PointerRNA *ptr)
|
|
|
|
{
|
2012-12-30 15:16:08 +00:00
|
|
|
MovieTrackingObject *object = (MovieTrackingObject *)ptr->data;
|
2011-12-05 18:57:17 +00:00
|
|
|
|
2012-06-10 19:59:02 +00:00
|
|
|
if (object->flag & TRACKING_OBJECT_CAMERA) {
|
|
|
|
MovieClip *clip = (MovieClip *)ptr->id.data;
|
2012-01-04 09:19:39 +00:00
|
|
|
|
|
|
|
rna_iterator_listbase_begin(iter, &clip->tracking.tracks, NULL);
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
rna_iterator_listbase_begin(iter, &object->tracks, NULL);
|
|
|
|
}
|
2011-12-05 18:57:17 +00: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 09:46:30 +00:00
|
|
|
static void rna_trackingObject_plane_tracks_begin(CollectionPropertyIterator *iter, PointerRNA *ptr)
|
|
|
|
{
|
|
|
|
MovieTrackingObject *object = (MovieTrackingObject *)ptr->data;
|
|
|
|
|
|
|
|
if (object->flag & TRACKING_OBJECT_CAMERA) {
|
|
|
|
MovieClip *clip = (MovieClip *)ptr->id.data;
|
|
|
|
|
|
|
|
rna_iterator_listbase_begin(iter, &clip->tracking.plane_tracks, NULL);
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
rna_iterator_listbase_begin(iter, &object->plane_tracks, NULL);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2012-06-08 18:16:20 +00:00
|
|
|
static PointerRNA rna_trackingObject_reconstruction_get(PointerRNA *ptr)
|
|
|
|
{
|
2012-12-30 15:16:08 +00:00
|
|
|
MovieTrackingObject *object = (MovieTrackingObject *)ptr->data;
|
2012-06-08 18:16:20 +00:00
|
|
|
|
|
|
|
if (object->flag & TRACKING_OBJECT_CAMERA) {
|
2012-06-10 19:59:02 +00:00
|
|
|
MovieClip *clip = (MovieClip *)ptr->id.data;
|
2012-06-08 18:16:20 +00:00
|
|
|
|
|
|
|
return rna_pointer_inherit_refine(ptr, &RNA_MovieTrackingReconstruction, &clip->tracking.reconstruction);
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
return rna_pointer_inherit_refine(ptr, &RNA_MovieTrackingReconstruction, &object->reconstruction);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2011-12-05 18:57:17 +00:00
|
|
|
static PointerRNA rna_tracking_active_object_get(PointerRNA *ptr)
|
|
|
|
{
|
2012-06-10 19:59:02 +00:00
|
|
|
MovieClip *clip = (MovieClip *)ptr->id.data;
|
2012-03-05 23:30:41 +00:00
|
|
|
MovieTrackingObject *object = BLI_findlink(&clip->tracking.objects, clip->tracking.objectnr);
|
2011-12-05 18:57:17 +00:00
|
|
|
|
|
|
|
return rna_pointer_inherit_refine(ptr, &RNA_MovieTrackingObject, object);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void rna_tracking_active_object_set(PointerRNA *ptr, PointerRNA value)
|
|
|
|
{
|
2012-06-10 19:59:02 +00:00
|
|
|
MovieClip *clip = (MovieClip *)ptr->id.data;
|
2012-03-05 23:30:41 +00:00
|
|
|
MovieTrackingObject *object = (MovieTrackingObject *)value.data;
|
|
|
|
int index = BLI_findindex(&clip->tracking.objects, object);
|
2011-12-05 18:57:17 +00:00
|
|
|
|
2014-02-01 01:45:09 +11:00
|
|
|
if (index != -1) clip->tracking.objectnr = index;
|
2012-03-05 23:30:41 +00:00
|
|
|
else clip->tracking.objectnr = 0;
|
2011-12-05 18:57:17 +00:00
|
|
|
}
|
|
|
|
|
2012-09-22 14:07:55 +00:00
|
|
|
static void rna_trackingObject_name_set(PointerRNA *ptr, const char *value)
|
2011-12-05 18:57:17 +00:00
|
|
|
{
|
2012-03-05 23:30:41 +00:00
|
|
|
MovieClip *clip = (MovieClip *)ptr->id.data;
|
|
|
|
MovieTrackingObject *object = (MovieTrackingObject *)ptr->data;
|
2011-12-05 18:57:17 +00:00
|
|
|
|
|
|
|
BLI_strncpy(object->name, value, sizeof(object->name));
|
|
|
|
|
|
|
|
BKE_tracking_object_unique_name(&clip->tracking, object);
|
|
|
|
}
|
|
|
|
|
2012-02-20 22:58:00 +00:00
|
|
|
static void rna_trackingObject_flushUpdate(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr)
|
2011-12-19 15:12:33 +00:00
|
|
|
{
|
2012-06-10 19:59:02 +00:00
|
|
|
MovieClip *clip = (MovieClip *)ptr->id.data;
|
2011-12-19 15:12:33 +00:00
|
|
|
|
2012-06-10 19:59:02 +00:00
|
|
|
WM_main_add_notifier(NC_OBJECT | ND_TRANSFORM, NULL);
|
2017-06-08 10:14:53 +02:00
|
|
|
DEG_id_tag_update(&clip->id, 0);
|
2011-12-19 15:12:33 +00:00
|
|
|
}
|
|
|
|
|
2012-01-09 20:18:57 +00:00
|
|
|
static void rna_trackingMarker_frame_set(PointerRNA *ptr, int value)
|
|
|
|
{
|
|
|
|
MovieClip *clip = (MovieClip *) ptr->id.data;
|
|
|
|
MovieTracking *tracking = &clip->tracking;
|
|
|
|
MovieTrackingMarker *marker = (MovieTrackingMarker *) ptr->data;
|
2013-08-23 09:10:23 +00:00
|
|
|
MovieTrackingObject *tracking_object;
|
|
|
|
bool found = false;
|
|
|
|
MovieTrackingTrack *track = NULL;
|
|
|
|
|
|
|
|
for (tracking_object = tracking->objects.first;
|
|
|
|
tracking_object;
|
|
|
|
tracking_object = tracking_object->next)
|
|
|
|
{
|
|
|
|
ListBase *tracksbase = BKE_tracking_object_get_tracks(tracking, tracking_object);
|
|
|
|
|
|
|
|
for (track = tracksbase->first;
|
2014-01-12 22:05:24 +11:00
|
|
|
track;
|
|
|
|
track = track->next)
|
2013-08-23 09:10:23 +00:00
|
|
|
{
|
|
|
|
if (marker >= track->markers && marker < track->markers + track->markersnr) {
|
|
|
|
found = true;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
2012-01-09 20:18:57 +00:00
|
|
|
|
2013-08-23 09:10:23 +00:00
|
|
|
if (found) {
|
2012-01-09 20:18:57 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2013-08-23 09:10:23 +00:00
|
|
|
if (found) {
|
2012-01-09 20:18:57 +00:00
|
|
|
MovieTrackingMarker new_marker = *marker;
|
|
|
|
new_marker.framenr = value;
|
|
|
|
|
2012-06-15 11:03:23 +00:00
|
|
|
BKE_tracking_marker_delete(track, marker->framenr);
|
|
|
|
BKE_tracking_marker_insert(track, &new_marker);
|
2012-01-09 20:18:57 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
Planar tracking support for motion tracking
===========================================
Major list of changes done in tomato branch:
- Add a planar tracking implementation to libmv
This adds a new planar tracking implementation to libmv. The
tracker is based on Ceres[1], the new nonlinear minimizer that
myself and Sameer released from Google as open source. Since
the motion model is more involved, the interface is
different than the RegionTracker interface used previously
in Blender.
The start of a C API in libmv-capi.{cpp,h} is also included.
- Migrate from pat_{min,max} for markers to 4 corners representation
Convert markers in the movie clip editor / 2D tracker from using
pat_min and pat_max notation to using the a more general, 4-corner
representation.
There is still considerable porting work to do; in particular
sliding from preview widget does not work correct for rotated
markers.
All other areas should be ported to new representation:
* Added support of sliding individual corners. LMB slide + Ctrl
would scale the whole pattern
* S would scale the whole marker, S-S would scale pattern only
* Added support of marker's rotation which is currently rotates
only patterns around their centers or all markers around median,
Rotation or other non-translation/scaling transformation of search
area doesn't make sense.
* Track Preview widget would display transformed pattern which
libmv actually operates with.
- "Efficient Second-order Minimization" for the planar tracker
This implements the "Efficient Second-order Minimization"
scheme, as supported by the existing translation tracker.
This increases the amount of per-iteration work, but
decreases the number of iterations required to converge and
also increases the size of the basin of attraction for the
optimization.
- Remove the use of the legacy RegionTracker API from Blender,
and replaces it with the new TrackRegion API. This also
adds several features to the planar tracker in libmv:
* Do a brute-force initialization of tracking similar to "Hybrid"
mode in the stable release, but using all floats. This is slower
but more accurate. It is still necessary to evaluate if the
performance loss is worth it. In particular, this change is
necessary to support high bit depth imagery.
* Add support for masks over the search window. This is a step
towards supporting user-defined tracker masks. The tracker masks
will make it easy for users to make a mask for e.g. a ball.
Not exposed into interface yet/
* Add Pearson product moment correlation coefficient checking (aka
"Correlation" in the UI. This causes tracking failure if the
tracked patch is not linearly related to the template.
* Add support for warping a few points in addition to the supplied
points. This is useful because the tracking code deliberately
does not expose the underlying warp representation. Instead,
warps are specified in an aparametric way via the correspondences.
- Replace the old style tracker configuration panel with the
new planar tracking panel. From a users perspective, this means:
* The old "tracking algorithm" picker is gone. There is only 1
algorithm now. We may revisit this later, but I would much
prefer to have only 1 algorithm. So far no optimization work
has been done so the speed is not there yet.
* There is now a dropdown to select the motion model. Choices:
* Translation
* Translation, rotation
* Translation, scale
* Translation, rotation, scale
* Affine
* Perspective
* The old "Hybrid" mode is gone; instead there is a toggle to
enable or disable translation-only tracker initialization. This
is the equivalent of the hyrbid mode before, but rewritten to work
with the new planar tracking modes.
* The pyramid levels setting is gone. At a future date, the planar
tracker will decide to use pyramids or not automatically. The
pyramid setting was ultimately a mistake; with the brute force
initialization it is unnecessary.
- Add light-normalized tracking
Added the ability to normalize patterns by their average value while
tracking, to make them invariant to global illumination changes.
Additional details could be found at wiki page [2]
[1] http://code.google.com/p/ceres-solver
[2] http://wiki.blender.org/index.php/Dev:Ref/Release_Notes/2.64/Motion_Tracker
2012-06-10 15:28:19 +00:00
|
|
|
static void rna_tracking_markerPattern_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr)
|
|
|
|
{
|
|
|
|
MovieTrackingMarker *marker = (MovieTrackingMarker *)ptr->data;
|
|
|
|
|
2012-06-15 11:03:23 +00:00
|
|
|
BKE_tracking_marker_clamp(marker, CLAMP_PAT_DIM);
|
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
|
|
|
}
|
|
|
|
|
|
|
|
static void rna_tracking_markerSearch_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr)
|
|
|
|
{
|
|
|
|
MovieTrackingMarker *marker = (MovieTrackingMarker *)ptr->data;
|
|
|
|
|
2012-06-15 11:03:23 +00:00
|
|
|
BKE_tracking_marker_clamp(marker, CLAMP_SEARCH_DIM);
|
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
|
|
|
}
|
|
|
|
|
2012-08-04 10:47:31 +00:00
|
|
|
static void rna_tracking_markerPattern_boundbox_get(PointerRNA *ptr, float *values)
|
|
|
|
{
|
|
|
|
MovieTrackingMarker *marker = (MovieTrackingMarker *)ptr->data;
|
|
|
|
float min[2], max[2];
|
|
|
|
|
|
|
|
BKE_tracking_marker_pattern_minmax(marker, min, max);
|
|
|
|
|
|
|
|
copy_v2_v2(values, min);
|
|
|
|
copy_v2_v2(values + 2, max);
|
|
|
|
}
|
|
|
|
|
2013-09-20 06:35:28 +00:00
|
|
|
static void rna_trackingDopesheet_tagUpdate(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr)
|
2012-06-12 17:10:24 +00:00
|
|
|
{
|
|
|
|
MovieClip *clip = (MovieClip *)ptr->id.data;
|
|
|
|
MovieTrackingDopesheet *dopesheet = &clip->tracking.dopesheet;
|
|
|
|
|
|
|
|
dopesheet->ok = 0;
|
|
|
|
}
|
|
|
|
|
2011-11-07 12:55:18 +00:00
|
|
|
/* API */
|
|
|
|
|
2013-08-19 18:37:00 +00:00
|
|
|
static MovieTrackingTrack *add_track_to_base(MovieClip *clip, MovieTracking *tracking, ListBase *tracksbase,
|
|
|
|
const char *name, int frame)
|
2011-12-05 18:57:17 +00:00
|
|
|
{
|
2013-01-07 11:28:27 +00:00
|
|
|
int width, height;
|
2012-03-05 23:30:41 +00:00
|
|
|
MovieClipUser user = {0};
|
2013-01-07 11:28:27 +00:00
|
|
|
MovieTrackingTrack *track;
|
2011-12-05 18:57:17 +00:00
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
user.framenr = 1;
|
2011-12-05 18:57:17 +00:00
|
|
|
|
|
|
|
BKE_movieclip_get_size(clip, &user, &width, &height);
|
|
|
|
|
2013-01-07 11:28:27 +00:00
|
|
|
track = BKE_tracking_track_add(tracking, tracksbase, 0, 0, frame, width, height);
|
|
|
|
|
|
|
|
if (name && name[0]) {
|
|
|
|
BLI_strncpy(track->name, name, sizeof(track->name));
|
|
|
|
BKE_tracking_track_unique_name(tracksbase, track);
|
|
|
|
}
|
|
|
|
|
|
|
|
return track;
|
2011-12-05 18:57:17 +00:00
|
|
|
}
|
|
|
|
|
2013-01-07 11:28:27 +00:00
|
|
|
static MovieTrackingTrack *rna_trackingTracks_new(ID *id, MovieTracking *tracking, const char *name, int frame)
|
2011-12-05 18:57:17 +00:00
|
|
|
{
|
2012-03-05 23:30:41 +00:00
|
|
|
MovieClip *clip = (MovieClip *) id;
|
2013-01-07 11:28:27 +00:00
|
|
|
MovieTrackingTrack *track;
|
2011-12-05 18:57:17 +00:00
|
|
|
|
2013-01-07 11:28:27 +00:00
|
|
|
track = add_track_to_base(clip, tracking, &tracking->tracks, name, frame);
|
2011-12-05 18:57:17 +00:00
|
|
|
|
2012-06-10 19:59:02 +00:00
|
|
|
WM_main_add_notifier(NC_MOVIECLIP | NA_EDITED, clip);
|
2013-01-07 11:28:27 +00:00
|
|
|
|
|
|
|
return track;
|
2011-12-05 18:57:17 +00:00
|
|
|
}
|
|
|
|
|
2013-11-04 18:58:22 +00:00
|
|
|
static MovieTrackingTrack *rna_trackingObject_tracks_new(ID *id, MovieTrackingObject *object, const char *name,
|
|
|
|
int frame)
|
2011-12-05 18:57:17 +00:00
|
|
|
{
|
2012-03-05 23:30:41 +00:00
|
|
|
MovieClip *clip = (MovieClip *) id;
|
|
|
|
ListBase *tracksbase = &object->tracks;
|
2013-01-07 11:28:27 +00:00
|
|
|
MovieTrackingTrack *track;
|
2011-12-05 18:57:17 +00:00
|
|
|
|
2012-06-10 19:59:02 +00:00
|
|
|
if (object->flag & TRACKING_OBJECT_CAMERA)
|
2012-03-05 23:30:41 +00:00
|
|
|
tracksbase = &clip->tracking.tracks;
|
2011-12-05 18:57:17 +00:00
|
|
|
|
2013-01-07 11:28:27 +00:00
|
|
|
track = add_track_to_base(clip, &clip->tracking, tracksbase, name, frame);
|
2011-12-05 18:57:17 +00:00
|
|
|
|
2012-06-10 19:59:02 +00:00
|
|
|
WM_main_add_notifier(NC_MOVIECLIP | NA_EDITED, NULL);
|
2013-01-07 11:28:27 +00:00
|
|
|
|
|
|
|
return track;
|
2011-12-05 18:57:17 +00:00
|
|
|
}
|
|
|
|
|
2012-01-09 20:18:57 +00:00
|
|
|
static MovieTrackingObject *rna_trackingObject_new(MovieTracking *tracking, const char *name)
|
2011-12-05 18:57:17 +00:00
|
|
|
{
|
2012-06-15 11:03:23 +00:00
|
|
|
MovieTrackingObject *object = BKE_tracking_object_add(tracking, name);
|
2011-12-05 18:57:17 +00:00
|
|
|
|
2012-06-10 19:59:02 +00:00
|
|
|
WM_main_add_notifier(NC_MOVIECLIP | NA_EDITED, NULL);
|
2011-12-05 18:57:17 +00:00
|
|
|
|
|
|
|
return object;
|
|
|
|
}
|
|
|
|
|
2012-11-02 09:41:26 +00:00
|
|
|
static void rna_trackingObject_remove(MovieTracking *tracking, ReportList *reports, PointerRNA *object_ptr)
|
2011-12-05 18:57:17 +00:00
|
|
|
{
|
2012-11-02 09:41:26 +00:00
|
|
|
MovieTrackingObject *object = object_ptr->data;
|
2014-04-01 11:34:00 +11:00
|
|
|
if (BKE_tracking_object_delete(tracking, object) == false) {
|
2012-11-07 14:56:53 +00:00
|
|
|
BKE_reportf(reports, RPT_ERROR, "MovieTracking '%s' cannot be removed", object->name);
|
2012-11-02 09:41:26 +00:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
RNA_POINTER_INVALIDATE(object_ptr);
|
2011-12-05 18:57:17 +00:00
|
|
|
|
2012-06-10 19:59:02 +00:00
|
|
|
WM_main_add_notifier(NC_MOVIECLIP | NA_EDITED, NULL);
|
2011-12-05 18:57:17 +00:00
|
|
|
}
|
|
|
|
|
2018-07-01 15:47:09 +02:00
|
|
|
static MovieTrackingMarker *rna_trackingMarkers_find_frame(MovieTrackingTrack *track, int framenr, bool exact)
|
2011-11-07 12:55:18 +00:00
|
|
|
{
|
2012-08-04 10:47:31 +00:00
|
|
|
if (exact)
|
|
|
|
return BKE_tracking_marker_get_exact(track, framenr);
|
|
|
|
else
|
|
|
|
return BKE_tracking_marker_get(track, framenr);
|
2012-01-09 20:18:28 +00:00
|
|
|
}
|
|
|
|
|
2012-06-10 19:59:02 +00:00
|
|
|
static MovieTrackingMarker *rna_trackingMarkers_insert_frame(MovieTrackingTrack *track, int framenr, float *co)
|
2012-01-09 20:18:28 +00:00
|
|
|
{
|
|
|
|
MovieTrackingMarker marker, *new_marker;
|
|
|
|
|
|
|
|
memset(&marker, 0, sizeof(marker));
|
|
|
|
marker.framenr = framenr;
|
|
|
|
copy_v2_v2(marker.pos, co);
|
|
|
|
|
2013-01-07 11:28:20 +00:00
|
|
|
/* a bit arbitrary, but better than creating markers with zero pattern
|
|
|
|
* which is forbidden actually
|
|
|
|
*/
|
|
|
|
copy_v2_v2(marker.pattern_corners[0], track->markers[0].pattern_corners[0]);
|
|
|
|
copy_v2_v2(marker.pattern_corners[1], track->markers[0].pattern_corners[1]);
|
|
|
|
copy_v2_v2(marker.pattern_corners[2], track->markers[0].pattern_corners[2]);
|
|
|
|
copy_v2_v2(marker.pattern_corners[3], track->markers[0].pattern_corners[3]);
|
|
|
|
|
2012-06-15 11:03:23 +00:00
|
|
|
new_marker = BKE_tracking_marker_insert(track, &marker);
|
2012-01-09 20:18:28 +00:00
|
|
|
|
2012-06-10 19:59:02 +00:00
|
|
|
WM_main_add_notifier(NC_MOVIECLIP | NA_EDITED, NULL);
|
2012-01-09 20:18:28 +00:00
|
|
|
|
|
|
|
return new_marker;
|
|
|
|
}
|
|
|
|
|
2012-09-22 14:07:55 +00:00
|
|
|
static void rna_trackingMarkers_delete_frame(MovieTrackingTrack *track, int framenr)
|
2012-01-09 20:18:28 +00:00
|
|
|
{
|
2012-03-05 23:30:41 +00:00
|
|
|
if (track->markersnr == 1)
|
2012-01-09 20:18:28 +00:00
|
|
|
return;
|
|
|
|
|
2012-06-15 11:03:23 +00:00
|
|
|
BKE_tracking_marker_delete(track, framenr);
|
2012-01-09 20:18:28 +00:00
|
|
|
|
2012-06-10 19:59:02 +00:00
|
|
|
WM_main_add_notifier(NC_MOVIECLIP | NA_EDITED, NULL);
|
2011-11-07 12:55:18 +00:00
|
|
|
}
|
|
|
|
|
2013-11-04 18:58:22 +00:00
|
|
|
static MovieTrackingPlaneMarker *rna_trackingPlaneMarkers_find_frame(MovieTrackingPlaneTrack *plane_track,
|
2018-07-01 15:47:09 +02:00
|
|
|
int framenr, bool exact)
|
2013-08-23 09:10:23 +00:00
|
|
|
{
|
|
|
|
if (exact)
|
|
|
|
return BKE_tracking_plane_marker_get_exact(plane_track, framenr);
|
|
|
|
else
|
|
|
|
return BKE_tracking_plane_marker_get(plane_track, framenr);
|
|
|
|
}
|
|
|
|
|
2013-11-04 18:58:22 +00:00
|
|
|
static MovieTrackingPlaneMarker *rna_trackingPlaneMarkers_insert_frame(MovieTrackingPlaneTrack *plane_track,
|
|
|
|
int framenr)
|
2013-08-23 09:10:23 +00:00
|
|
|
{
|
|
|
|
MovieTrackingPlaneMarker plane_marker, *new_plane_marker;
|
|
|
|
|
|
|
|
memset(&plane_marker, 0, sizeof(plane_marker));
|
|
|
|
plane_marker.framenr = framenr;
|
|
|
|
|
|
|
|
/* a bit arbitrary, but better than creating zero markers */
|
|
|
|
copy_v2_v2(plane_marker.corners[0], plane_track->markers[0].corners[0]);
|
|
|
|
copy_v2_v2(plane_marker.corners[1], plane_track->markers[0].corners[1]);
|
|
|
|
copy_v2_v2(plane_marker.corners[2], plane_track->markers[0].corners[2]);
|
|
|
|
copy_v2_v2(plane_marker.corners[3], plane_track->markers[0].corners[3]);
|
|
|
|
|
|
|
|
new_plane_marker = BKE_tracking_plane_marker_insert(plane_track, &plane_marker);
|
|
|
|
|
|
|
|
WM_main_add_notifier(NC_MOVIECLIP | NA_EDITED, NULL);
|
|
|
|
|
|
|
|
return new_plane_marker;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void rna_trackingPlaneMarkers_delete_frame(MovieTrackingPlaneTrack *plane_track, int framenr)
|
|
|
|
{
|
|
|
|
if (plane_track->markersnr == 1)
|
|
|
|
return;
|
|
|
|
|
|
|
|
BKE_tracking_plane_marker_delete(plane_track, framenr);
|
|
|
|
|
|
|
|
WM_main_add_notifier(NC_MOVIECLIP | NA_EDITED, NULL);
|
|
|
|
}
|
|
|
|
|
2014-02-26 19:40:04 +06:00
|
|
|
static MovieTrackingObject *find_object_for_reconstruction(MovieTracking *tracking,
|
|
|
|
MovieTrackingReconstruction *reconstruction)
|
|
|
|
{
|
|
|
|
MovieTrackingObject *object;
|
|
|
|
|
|
|
|
for (object = tracking->objects.first; object; object = object->next) {
|
|
|
|
if (object->flag & TRACKING_OBJECT_CAMERA) {
|
|
|
|
if (&tracking->reconstruction == reconstruction) {
|
|
|
|
return object;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else if (&object->reconstruction == reconstruction) {
|
|
|
|
return object;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static MovieReconstructedCamera *rna_trackingCameras_find_frame(ID *id, MovieTrackingReconstruction *reconstruction, int framenr)
|
|
|
|
{
|
|
|
|
MovieClip *clip = (MovieClip *) id;
|
|
|
|
MovieTracking *tracking = &clip->tracking;
|
|
|
|
MovieTrackingObject *object = find_object_for_reconstruction(tracking, reconstruction);
|
|
|
|
return BKE_tracking_camera_get_reconstructed(tracking, object, framenr);
|
|
|
|
}
|
|
|
|
|
2014-02-27 08:38:14 +11:00
|
|
|
static void rna_trackingCameras_matrix_from_frame(ID *id, MovieTrackingReconstruction *reconstruction, int framenr, float matrix[16])
|
2014-02-26 19:40:04 +06:00
|
|
|
{
|
|
|
|
float mat[4][4];
|
|
|
|
|
|
|
|
MovieClip *clip = (MovieClip *) id;
|
|
|
|
MovieTracking *tracking = &clip->tracking;
|
|
|
|
MovieTrackingObject *object = find_object_for_reconstruction(tracking, reconstruction);
|
|
|
|
BKE_tracking_camera_get_reconstructed_interpolate(tracking, object, framenr, mat);
|
|
|
|
|
|
|
|
memcpy(matrix, mat, sizeof(float) * 16);
|
|
|
|
}
|
|
|
|
|
2011-11-07 12:55:18 +00:00
|
|
|
#else
|
|
|
|
|
2017-10-18 15:07:26 +11:00
|
|
|
static const EnumPropertyItem tracker_motion_model[] = {
|
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
|
|
|
{TRACK_MOTION_MODEL_HOMOGRAPHY, "Perspective", 0, "Perspective",
|
2012-06-11 09:05:17 +00:00
|
|
|
"Search for markers that are perspectively deformed (homography) between frames"},
|
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
|
|
|
{TRACK_MOTION_MODEL_AFFINE, "Affine", 0, "Affine",
|
2012-06-11 09:05:17 +00:00
|
|
|
"Search for markers that are affine-deformed (t, r, k, and skew) between frames"},
|
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
|
|
|
{TRACK_MOTION_MODEL_TRANSLATION_ROTATION_SCALE, "LocRotScale", 0, "LocRotScale",
|
2012-06-11 09:05:17 +00:00
|
|
|
"Search for markers that are translated, rotated, and scaled between frames"},
|
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
|
|
|
{TRACK_MOTION_MODEL_TRANSLATION_SCALE, "LocScale", 0, "LocScale",
|
2012-06-11 09:05:17 +00:00
|
|
|
"Search for markers that are translated and scaled between frames"},
|
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
|
|
|
{TRACK_MOTION_MODEL_TRANSLATION_ROTATION, "LocRot", 0, "LocRot",
|
2012-06-11 09:05:17 +00:00
|
|
|
"Search for markers that are translated and rotated between frames"},
|
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
|
|
|
{TRACK_MOTION_MODEL_TRANSLATION, "Loc", 0, "Loc",
|
2012-06-11 09:05:17 +00:00
|
|
|
"Search for markers that are translated between frames"},
|
2019-02-03 14:01:45 +11:00
|
|
|
{0, NULL, 0, NULL, NULL},
|
2012-06-10 19:59:02 +00:00
|
|
|
};
|
2011-11-28 13:26:46 +00:00
|
|
|
|
2017-10-18 15:07:26 +11:00
|
|
|
static const EnumPropertyItem pattern_match_items[] = {
|
2011-11-28 13:26:46 +00:00
|
|
|
{TRACK_MATCH_KEYFRAME, "KEYFRAME", 0, "Keyframe", "Track pattern from keyframe to next frame"},
|
|
|
|
{TRACK_MATCH_PREVFRAME, "PREV_FRAME", 0, "Previous frame", "Track pattern from current frame to next frame"},
|
2019-02-03 14:01:45 +11:00
|
|
|
{0, NULL, 0, NULL, NULL},
|
2012-06-10 19:59:02 +00:00
|
|
|
};
|
2011-11-28 13:26:46 +00:00
|
|
|
|
2011-11-07 12:55:18 +00:00
|
|
|
static void rna_def_trackingSettings(BlenderRNA *brna)
|
|
|
|
{
|
|
|
|
StructRNA *srna;
|
|
|
|
PropertyRNA *prop;
|
|
|
|
|
2017-10-18 15:07:26 +11:00
|
|
|
static const EnumPropertyItem speed_items[] = {
|
2011-11-07 12:55:18 +00:00
|
|
|
{0, "FASTEST", 0, "Fastest", "Track as fast as it's possible"},
|
2012-06-10 19:59:02 +00:00
|
|
|
{TRACKING_SPEED_DOUBLE, "DOUBLE", 0, "Double", "Track with double speed"},
|
2011-11-07 12:55:18 +00:00
|
|
|
{TRACKING_SPEED_REALTIME, "REALTIME", 0, "Realtime", "Track with realtime speed"},
|
|
|
|
{TRACKING_SPEED_HALF, "HALF", 0, "Half", "Track with half of realtime speed"},
|
|
|
|
{TRACKING_SPEED_QUARTER, "QUARTER", 0, "Quarter", "Track with quarter of realtime speed"},
|
2019-02-03 14:01:45 +11:00
|
|
|
{0, NULL, 0, NULL, NULL},
|
2012-06-10 19:59:02 +00:00
|
|
|
};
|
2011-11-07 12:55:18 +00:00
|
|
|
|
2017-10-18 15:07:26 +11:00
|
|
|
static const EnumPropertyItem cleanup_items[] = {
|
2011-11-07 12:55:18 +00:00
|
|
|
{TRACKING_CLEAN_SELECT, "SELECT", 0, "Select", "Select unclean tracks"},
|
|
|
|
{TRACKING_CLEAN_DELETE_TRACK, "DELETE_TRACK", 0, "Delete Track", "Delete unclean tracks"},
|
|
|
|
{TRACKING_CLEAN_DELETE_SEGMENT, "DELETE_SEGMENTS", 0, "Delete Segments", "Delete unclean segments of tracks"},
|
2019-02-03 14:01:45 +11:00
|
|
|
{0, NULL, 0, NULL, NULL},
|
2011-11-07 12:55:18 +00:00
|
|
|
};
|
|
|
|
|
2017-10-18 15:07:26 +11:00
|
|
|
static const EnumPropertyItem refine_items[] = {
|
Assorted camera tracker improvements
- Add support for refining the camera's intrinsic parameters
during a solve. Currently, refining supports only the following
combinations of intrinsic parameters:
f
f, cx, cy
f, cx, cy, k1, k2
f, k1
f, k1, k2
This is not the same as autocalibration, since the user must
still make a reasonable initial guess about the focal length and
other parameters, whereas true autocalibration would eliminate
the need for the user specify intrinsic parameters at all.
However, the solver works well with only rough guesses for the
focal length, so perhaps full autocalibation is not that
important.
Adding support for the last two combinations, (f, k1) and (f,
k1, k2) required changes to the library libmv depends on for
bundle adjustment, SSBA. These changes should get ported
upstream not just to libmv but to SSBA as well.
- Improved the region of convergence for bundle adjustment by
increasing the number of Levenberg-Marquardt iterations from 50
to 500. This way, the solver is able to crawl out of the bad
local minima it gets stuck in when changing from, for example,
bundling k1 and k2 to just k1 and resetting k2 to 0.
- Add several new region tracker implementations. A region tracker
is a libmv concept, which refers to tracking a template image
pattern through frames. The impact to end users is that tracking
should "just work better". I am reserving a more detailed
writeup, and maybe a paper, for later.
- Other libmv tweaks, such as detecting that a tracker is headed
outside of the image bounds.
This includes several changes made directly to the libmv extern
code rather expecting to get those changes through normal libmv
channels, because I, the libmv BDFL, decided it was faster to work
on libmv directly in Blender, then later reverse-port the libmv
changes from Blender back into libmv trunk. The interesting part
is that I added a full Levenberg-Marquardt loop to the region
tracking code, which should lead to a more stable solutions. I
also added a hacky implementation of "Efficient Second-Order
Minimization" for tracking, which works nicely. A more detailed
quantitative evaluation will follow.
Original patch by Keir, cleaned a bit by myself.
2011-11-14 06:41:23 +00:00
|
|
|
{0, "NONE", 0, "Nothing", "Do not refine camera intrinsics"},
|
|
|
|
{REFINE_FOCAL_LENGTH, "FOCAL_LENGTH", 0, "Focal Length", "Refine focal length"},
|
2012-06-10 19:59:02 +00:00
|
|
|
{REFINE_FOCAL_LENGTH | REFINE_RADIAL_DISTORTION_K1, "FOCAL_LENGTH_RADIAL_K1", 0, "Focal length, K1",
|
|
|
|
"Refine focal length and radial distortion K1"},
|
|
|
|
{REFINE_FOCAL_LENGTH |
|
|
|
|
REFINE_RADIAL_DISTORTION_K1 |
|
2012-03-18 09:27:36 +00:00
|
|
|
REFINE_RADIAL_DISTORTION_K2, "FOCAL_LENGTH_RADIAL_K1_K2", 0, "Focal length, K1, K2",
|
2012-06-10 19:59:02 +00:00
|
|
|
"Refine focal length and radial distortion K1 and K2"},
|
|
|
|
{REFINE_FOCAL_LENGTH |
|
|
|
|
REFINE_PRINCIPAL_POINT |
|
|
|
|
REFINE_RADIAL_DISTORTION_K1 |
|
2012-03-18 09:27:36 +00:00
|
|
|
REFINE_RADIAL_DISTORTION_K2, "FOCAL_LENGTH_PRINCIPAL_POINT_RADIAL_K1_K2", 0,
|
2012-06-10 19:59:02 +00:00
|
|
|
"Focal Length, Optical Center, K1, K2",
|
|
|
|
"Refine focal length, optical center and radial distortion K1 and K2"},
|
|
|
|
{REFINE_FOCAL_LENGTH |
|
2012-03-18 09:27:36 +00:00
|
|
|
REFINE_PRINCIPAL_POINT, "FOCAL_LENGTH_PRINCIPAL_POINT", 0, "Focal Length, Optical Center",
|
2012-06-10 19:59:02 +00:00
|
|
|
"Refine focal length and optical center"},
|
2013-02-26 11:46:38 +00:00
|
|
|
{REFINE_RADIAL_DISTORTION_K1 |
|
|
|
|
REFINE_RADIAL_DISTORTION_K2, "RADIAL_K1_K2", 0, "K1, K2",
|
|
|
|
"Refine radial distortion K1 and K2"},
|
2019-02-03 14:01:45 +11:00
|
|
|
{0, NULL, 0, NULL, NULL},
|
Assorted camera tracker improvements
- Add support for refining the camera's intrinsic parameters
during a solve. Currently, refining supports only the following
combinations of intrinsic parameters:
f
f, cx, cy
f, cx, cy, k1, k2
f, k1
f, k1, k2
This is not the same as autocalibration, since the user must
still make a reasonable initial guess about the focal length and
other parameters, whereas true autocalibration would eliminate
the need for the user specify intrinsic parameters at all.
However, the solver works well with only rough guesses for the
focal length, so perhaps full autocalibation is not that
important.
Adding support for the last two combinations, (f, k1) and (f,
k1, k2) required changes to the library libmv depends on for
bundle adjustment, SSBA. These changes should get ported
upstream not just to libmv but to SSBA as well.
- Improved the region of convergence for bundle adjustment by
increasing the number of Levenberg-Marquardt iterations from 50
to 500. This way, the solver is able to crawl out of the bad
local minima it gets stuck in when changing from, for example,
bundling k1 and k2 to just k1 and resetting k2 to 0.
- Add several new region tracker implementations. A region tracker
is a libmv concept, which refers to tracking a template image
pattern through frames. The impact to end users is that tracking
should "just work better". I am reserving a more detailed
writeup, and maybe a paper, for later.
- Other libmv tweaks, such as detecting that a tracker is headed
outside of the image bounds.
This includes several changes made directly to the libmv extern
code rather expecting to get those changes through normal libmv
channels, because I, the libmv BDFL, decided it was faster to work
on libmv directly in Blender, then later reverse-port the libmv
changes from Blender back into libmv trunk. The interesting part
is that I added a full Levenberg-Marquardt loop to the region
tracking code, which should lead to a more stable solutions. I
also added a hacky implementation of "Efficient Second-Order
Minimization" for tracking, which works nicely. A more detailed
quantitative evaluation will follow.
Original patch by Keir, cleaned a bit by myself.
2011-11-14 06:41:23 +00:00
|
|
|
};
|
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
srna = RNA_def_struct(brna, "MovieTrackingSettings", NULL);
|
2011-11-07 12:55:18 +00:00
|
|
|
RNA_def_struct_ui_text(srna, "Movie tracking settings", "Match moving settings");
|
|
|
|
|
|
|
|
/* speed */
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "speed", PROP_ENUM, PROP_NONE);
|
2011-11-07 12:55:18 +00:00
|
|
|
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
|
|
|
|
RNA_def_property_enum_items(prop, speed_items);
|
2012-03-18 09:27:36 +00:00
|
|
|
RNA_def_property_ui_text(prop, "Speed",
|
|
|
|
"Limit speed of tracking to make visual feedback easier "
|
|
|
|
"(this does not affect the tracking quality)");
|
2011-11-07 12:55:18 +00:00
|
|
|
|
2013-05-30 09:03:49 +00:00
|
|
|
/* use keyframe selection */
|
|
|
|
prop = RNA_def_property(srna, "use_keyframe_selection", PROP_BOOLEAN, PROP_NONE);
|
|
|
|
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
|
|
|
|
RNA_def_property_boolean_sdna(prop, NULL, "reconstruction_flag", TRACKING_USE_KEYFRAME_SELECTION);
|
|
|
|
RNA_def_property_ui_text(prop, "Keyframe Selection",
|
|
|
|
"Automatically select keyframes when solving camera/object motion");
|
|
|
|
|
Assorted camera tracker improvements
- Add support for refining the camera's intrinsic parameters
during a solve. Currently, refining supports only the following
combinations of intrinsic parameters:
f
f, cx, cy
f, cx, cy, k1, k2
f, k1
f, k1, k2
This is not the same as autocalibration, since the user must
still make a reasonable initial guess about the focal length and
other parameters, whereas true autocalibration would eliminate
the need for the user specify intrinsic parameters at all.
However, the solver works well with only rough guesses for the
focal length, so perhaps full autocalibation is not that
important.
Adding support for the last two combinations, (f, k1) and (f,
k1, k2) required changes to the library libmv depends on for
bundle adjustment, SSBA. These changes should get ported
upstream not just to libmv but to SSBA as well.
- Improved the region of convergence for bundle adjustment by
increasing the number of Levenberg-Marquardt iterations from 50
to 500. This way, the solver is able to crawl out of the bad
local minima it gets stuck in when changing from, for example,
bundling k1 and k2 to just k1 and resetting k2 to 0.
- Add several new region tracker implementations. A region tracker
is a libmv concept, which refers to tracking a template image
pattern through frames. The impact to end users is that tracking
should "just work better". I am reserving a more detailed
writeup, and maybe a paper, for later.
- Other libmv tweaks, such as detecting that a tracker is headed
outside of the image bounds.
This includes several changes made directly to the libmv extern
code rather expecting to get those changes through normal libmv
channels, because I, the libmv BDFL, decided it was faster to work
on libmv directly in Blender, then later reverse-port the libmv
changes from Blender back into libmv trunk. The interesting part
is that I added a full Levenberg-Marquardt loop to the region
tracking code, which should lead to a more stable solutions. I
also added a hacky implementation of "Efficient Second-Order
Minimization" for tracking, which works nicely. A more detailed
quantitative evaluation will follow.
Original patch by Keir, cleaned a bit by myself.
2011-11-14 06:41:23 +00:00
|
|
|
/* intrinsics refinement during bundle adjustment */
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "refine_intrinsics", PROP_ENUM, PROP_NONE);
|
Assorted camera tracker improvements
- Add support for refining the camera's intrinsic parameters
during a solve. Currently, refining supports only the following
combinations of intrinsic parameters:
f
f, cx, cy
f, cx, cy, k1, k2
f, k1
f, k1, k2
This is not the same as autocalibration, since the user must
still make a reasonable initial guess about the focal length and
other parameters, whereas true autocalibration would eliminate
the need for the user specify intrinsic parameters at all.
However, the solver works well with only rough guesses for the
focal length, so perhaps full autocalibation is not that
important.
Adding support for the last two combinations, (f, k1) and (f,
k1, k2) required changes to the library libmv depends on for
bundle adjustment, SSBA. These changes should get ported
upstream not just to libmv but to SSBA as well.
- Improved the region of convergence for bundle adjustment by
increasing the number of Levenberg-Marquardt iterations from 50
to 500. This way, the solver is able to crawl out of the bad
local minima it gets stuck in when changing from, for example,
bundling k1 and k2 to just k1 and resetting k2 to 0.
- Add several new region tracker implementations. A region tracker
is a libmv concept, which refers to tracking a template image
pattern through frames. The impact to end users is that tracking
should "just work better". I am reserving a more detailed
writeup, and maybe a paper, for later.
- Other libmv tweaks, such as detecting that a tracker is headed
outside of the image bounds.
This includes several changes made directly to the libmv extern
code rather expecting to get those changes through normal libmv
channels, because I, the libmv BDFL, decided it was faster to work
on libmv directly in Blender, then later reverse-port the libmv
changes from Blender back into libmv trunk. The interesting part
is that I added a full Levenberg-Marquardt loop to the region
tracking code, which should lead to a more stable solutions. I
also added a hacky implementation of "Efficient Second-Order
Minimization" for tracking, which works nicely. A more detailed
quantitative evaluation will follow.
Original patch by Keir, cleaned a bit by myself.
2011-11-14 06:41:23 +00:00
|
|
|
RNA_def_property_enum_sdna(prop, NULL, "refine_camera_intrinsics");
|
|
|
|
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
|
|
|
|
RNA_def_property_enum_items(prop, refine_items);
|
|
|
|
RNA_def_property_ui_text(prop, "Refine", "Refine intrinsics during camera solving");
|
|
|
|
|
2011-11-07 12:55:18 +00:00
|
|
|
/* tool settings */
|
|
|
|
|
|
|
|
/* distance */
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "distance", PROP_FLOAT, PROP_NONE);
|
2011-11-07 12:55:18 +00:00
|
|
|
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
|
|
|
|
RNA_def_property_float_sdna(prop, NULL, "dist");
|
2012-02-14 17:03:06 +00:00
|
|
|
RNA_def_property_float_default(prop, 1.0f);
|
2011-11-07 12:55:18 +00:00
|
|
|
RNA_def_property_ui_text(prop, "Distance", "Distance between two bundles used for scene scaling");
|
|
|
|
|
|
|
|
/* frames count */
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "clean_frames", PROP_INT, PROP_NONE);
|
2011-11-07 12:55:18 +00:00
|
|
|
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
|
|
|
|
RNA_def_property_int_sdna(prop, NULL, "clean_frames");
|
|
|
|
RNA_def_property_range(prop, 0, INT_MAX);
|
2012-03-18 09:27:36 +00:00
|
|
|
RNA_def_property_ui_text(prop, "Tracked Frames",
|
|
|
|
"Effect on tracks which are tracked less than the specified amount of frames");
|
2011-11-07 12:55:18 +00:00
|
|
|
|
2012-03-08 04:12:11 +00:00
|
|
|
/* re-projection error */
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "clean_error", PROP_FLOAT, PROP_NONE);
|
2011-11-07 12:55:18 +00:00
|
|
|
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
|
|
|
|
RNA_def_property_float_sdna(prop, NULL, "clean_error");
|
|
|
|
RNA_def_property_range(prop, 0, FLT_MAX);
|
2012-03-08 04:12:11 +00:00
|
|
|
RNA_def_property_ui_text(prop, "Reprojection Error", "Effect on tracks which have a larger re-projection error");
|
2011-11-07 12:55:18 +00:00
|
|
|
|
|
|
|
/* cleanup action */
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "clean_action", PROP_ENUM, PROP_NONE);
|
2011-11-07 12:55:18 +00:00
|
|
|
RNA_def_property_enum_sdna(prop, NULL, "clean_action");
|
|
|
|
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
|
|
|
|
RNA_def_property_enum_items(prop, cleanup_items);
|
|
|
|
RNA_def_property_ui_text(prop, "Action", "Cleanup action to execute");
|
2011-11-28 13:26:46 +00:00
|
|
|
|
|
|
|
/* ** default tracker settings ** */
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "show_default_expanded", PROP_BOOLEAN, PROP_NONE);
|
2011-11-28 13:26:46 +00:00
|
|
|
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
|
|
|
|
RNA_def_property_boolean_sdna(prop, NULL, "flag", TRACKING_SETTINGS_SHOW_DEFAULT_EXPANDED);
|
2014-02-07 20:26:43 +06:00
|
|
|
RNA_def_property_ui_text(prop, "Show Expanded", "Show default options expanded in the user interface");
|
2018-11-22 15:31:19 +11:00
|
|
|
RNA_def_property_ui_icon(prop, ICON_DISCLOSURE_TRI_RIGHT, 1);
|
2014-02-07 20:26:43 +06:00
|
|
|
|
|
|
|
/* ** extra tracker settings ** */
|
|
|
|
prop = RNA_def_property(srna, "show_extra_expanded", PROP_BOOLEAN, PROP_NONE);
|
|
|
|
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
|
|
|
|
RNA_def_property_boolean_sdna(prop, NULL, "flag", TRACKING_SETTINGS_SHOW_EXTRA_EXPANDED);
|
|
|
|
RNA_def_property_ui_text(prop, "Show Expanded", "Show extra options expanded in the user interface");
|
2018-11-22 15:31:19 +11:00
|
|
|
RNA_def_property_ui_icon(prop, ICON_DISCLOSURE_TRI_RIGHT, 1);
|
2011-11-28 13:26:46 +00:00
|
|
|
|
2012-04-14 12:02:47 +00:00
|
|
|
/* solver settings */
|
|
|
|
prop = RNA_def_property(srna, "use_tripod_solver", PROP_BOOLEAN, PROP_NONE);
|
|
|
|
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
|
|
|
|
RNA_def_property_boolean_sdna(prop, NULL, "motion_flag", TRACKING_MOTION_TRIPOD);
|
2012-11-07 14:56:53 +00:00
|
|
|
RNA_def_property_ui_text(prop, "Tripod Motion",
|
|
|
|
"Use special solver to track a stable camera position, such as a tripod");
|
2012-04-14 12:02:47 +00:00
|
|
|
|
Planar tracking support for motion tracking
===========================================
Major list of changes done in tomato branch:
- Add a planar tracking implementation to libmv
This adds a new planar tracking implementation to libmv. The
tracker is based on Ceres[1], the new nonlinear minimizer that
myself and Sameer released from Google as open source. Since
the motion model is more involved, the interface is
different than the RegionTracker interface used previously
in Blender.
The start of a C API in libmv-capi.{cpp,h} is also included.
- Migrate from pat_{min,max} for markers to 4 corners representation
Convert markers in the movie clip editor / 2D tracker from using
pat_min and pat_max notation to using the a more general, 4-corner
representation.
There is still considerable porting work to do; in particular
sliding from preview widget does not work correct for rotated
markers.
All other areas should be ported to new representation:
* Added support of sliding individual corners. LMB slide + Ctrl
would scale the whole pattern
* S would scale the whole marker, S-S would scale pattern only
* Added support of marker's rotation which is currently rotates
only patterns around their centers or all markers around median,
Rotation or other non-translation/scaling transformation of search
area doesn't make sense.
* Track Preview widget would display transformed pattern which
libmv actually operates with.
- "Efficient Second-order Minimization" for the planar tracker
This implements the "Efficient Second-order Minimization"
scheme, as supported by the existing translation tracker.
This increases the amount of per-iteration work, but
decreases the number of iterations required to converge and
also increases the size of the basin of attraction for the
optimization.
- Remove the use of the legacy RegionTracker API from Blender,
and replaces it with the new TrackRegion API. This also
adds several features to the planar tracker in libmv:
* Do a brute-force initialization of tracking similar to "Hybrid"
mode in the stable release, but using all floats. This is slower
but more accurate. It is still necessary to evaluate if the
performance loss is worth it. In particular, this change is
necessary to support high bit depth imagery.
* Add support for masks over the search window. This is a step
towards supporting user-defined tracker masks. The tracker masks
will make it easy for users to make a mask for e.g. a ball.
Not exposed into interface yet/
* Add Pearson product moment correlation coefficient checking (aka
"Correlation" in the UI. This causes tracking failure if the
tracked patch is not linearly related to the template.
* Add support for warping a few points in addition to the supplied
points. This is useful because the tracking code deliberately
does not expose the underlying warp representation. Instead,
warps are specified in an aparametric way via the correspondences.
- Replace the old style tracker configuration panel with the
new planar tracking panel. From a users perspective, this means:
* The old "tracking algorithm" picker is gone. There is only 1
algorithm now. We may revisit this later, but I would much
prefer to have only 1 algorithm. So far no optimization work
has been done so the speed is not there yet.
* There is now a dropdown to select the motion model. Choices:
* Translation
* Translation, rotation
* Translation, scale
* Translation, rotation, scale
* Affine
* Perspective
* The old "Hybrid" mode is gone; instead there is a toggle to
enable or disable translation-only tracker initialization. This
is the equivalent of the hyrbid mode before, but rewritten to work
with the new planar tracking modes.
* The pyramid levels setting is gone. At a future date, the planar
tracker will decide to use pyramids or not automatically. The
pyramid setting was ultimately a mistake; with the brute force
initialization it is unnecessary.
- Add light-normalized tracking
Added the ability to normalize patterns by their average value while
tracking, to make them invariant to global illumination changes.
Additional details could be found at wiki page [2]
[1] http://code.google.com/p/ceres-solver
[2] http://wiki.blender.org/index.php/Dev:Ref/Release_Notes/2.64/Motion_Tracker
2012-06-10 15:28:19 +00:00
|
|
|
/* default_limit_frames */
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "default_frames_limit", PROP_INT, PROP_NONE);
|
2011-11-28 13:26:46 +00:00
|
|
|
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
|
|
|
|
RNA_def_property_int_sdna(prop, NULL, "default_frames_limit");
|
|
|
|
RNA_def_property_range(prop, 0, SHRT_MAX);
|
2011-11-29 14:49:47 +00:00
|
|
|
RNA_def_property_ui_text(prop, "Frames Limit", "Every tracking cycle, this number of frames are tracked");
|
2011-11-28 13:26:46 +00:00
|
|
|
|
Planar tracking support for motion tracking
===========================================
Major list of changes done in tomato branch:
- Add a planar tracking implementation to libmv
This adds a new planar tracking implementation to libmv. The
tracker is based on Ceres[1], the new nonlinear minimizer that
myself and Sameer released from Google as open source. Since
the motion model is more involved, the interface is
different than the RegionTracker interface used previously
in Blender.
The start of a C API in libmv-capi.{cpp,h} is also included.
- Migrate from pat_{min,max} for markers to 4 corners representation
Convert markers in the movie clip editor / 2D tracker from using
pat_min and pat_max notation to using the a more general, 4-corner
representation.
There is still considerable porting work to do; in particular
sliding from preview widget does not work correct for rotated
markers.
All other areas should be ported to new representation:
* Added support of sliding individual corners. LMB slide + Ctrl
would scale the whole pattern
* S would scale the whole marker, S-S would scale pattern only
* Added support of marker's rotation which is currently rotates
only patterns around their centers or all markers around median,
Rotation or other non-translation/scaling transformation of search
area doesn't make sense.
* Track Preview widget would display transformed pattern which
libmv actually operates with.
- "Efficient Second-order Minimization" for the planar tracker
This implements the "Efficient Second-order Minimization"
scheme, as supported by the existing translation tracker.
This increases the amount of per-iteration work, but
decreases the number of iterations required to converge and
also increases the size of the basin of attraction for the
optimization.
- Remove the use of the legacy RegionTracker API from Blender,
and replaces it with the new TrackRegion API. This also
adds several features to the planar tracker in libmv:
* Do a brute-force initialization of tracking similar to "Hybrid"
mode in the stable release, but using all floats. This is slower
but more accurate. It is still necessary to evaluate if the
performance loss is worth it. In particular, this change is
necessary to support high bit depth imagery.
* Add support for masks over the search window. This is a step
towards supporting user-defined tracker masks. The tracker masks
will make it easy for users to make a mask for e.g. a ball.
Not exposed into interface yet/
* Add Pearson product moment correlation coefficient checking (aka
"Correlation" in the UI. This causes tracking failure if the
tracked patch is not linearly related to the template.
* Add support for warping a few points in addition to the supplied
points. This is useful because the tracking code deliberately
does not expose the underlying warp representation. Instead,
warps are specified in an aparametric way via the correspondences.
- Replace the old style tracker configuration panel with the
new planar tracking panel. From a users perspective, this means:
* The old "tracking algorithm" picker is gone. There is only 1
algorithm now. We may revisit this later, but I would much
prefer to have only 1 algorithm. So far no optimization work
has been done so the speed is not there yet.
* There is now a dropdown to select the motion model. Choices:
* Translation
* Translation, rotation
* Translation, scale
* Translation, rotation, scale
* Affine
* Perspective
* The old "Hybrid" mode is gone; instead there is a toggle to
enable or disable translation-only tracker initialization. This
is the equivalent of the hyrbid mode before, but rewritten to work
with the new planar tracking modes.
* The pyramid levels setting is gone. At a future date, the planar
tracker will decide to use pyramids or not automatically. The
pyramid setting was ultimately a mistake; with the brute force
initialization it is unnecessary.
- Add light-normalized tracking
Added the ability to normalize patterns by their average value while
tracking, to make them invariant to global illumination changes.
Additional details could be found at wiki page [2]
[1] http://code.google.com/p/ceres-solver
[2] http://wiki.blender.org/index.php/Dev:Ref/Release_Notes/2.64/Motion_Tracker
2012-06-10 15:28:19 +00:00
|
|
|
/* default_pattern_match */
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "default_pattern_match", PROP_ENUM, PROP_NONE);
|
2011-11-28 13:26:46 +00:00
|
|
|
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
|
|
|
|
RNA_def_property_enum_sdna(prop, NULL, "default_pattern_match");
|
|
|
|
RNA_def_property_enum_items(prop, pattern_match_items);
|
2012-03-18 09:27:36 +00:00
|
|
|
RNA_def_property_ui_text(prop, "Pattern Match",
|
|
|
|
"Track pattern from given frame when tracking marker to next frame");
|
2011-11-28 13:26:46 +00:00
|
|
|
|
Planar tracking support for motion tracking
===========================================
Major list of changes done in tomato branch:
- Add a planar tracking implementation to libmv
This adds a new planar tracking implementation to libmv. The
tracker is based on Ceres[1], the new nonlinear minimizer that
myself and Sameer released from Google as open source. Since
the motion model is more involved, the interface is
different than the RegionTracker interface used previously
in Blender.
The start of a C API in libmv-capi.{cpp,h} is also included.
- Migrate from pat_{min,max} for markers to 4 corners representation
Convert markers in the movie clip editor / 2D tracker from using
pat_min and pat_max notation to using the a more general, 4-corner
representation.
There is still considerable porting work to do; in particular
sliding from preview widget does not work correct for rotated
markers.
All other areas should be ported to new representation:
* Added support of sliding individual corners. LMB slide + Ctrl
would scale the whole pattern
* S would scale the whole marker, S-S would scale pattern only
* Added support of marker's rotation which is currently rotates
only patterns around their centers or all markers around median,
Rotation or other non-translation/scaling transformation of search
area doesn't make sense.
* Track Preview widget would display transformed pattern which
libmv actually operates with.
- "Efficient Second-order Minimization" for the planar tracker
This implements the "Efficient Second-order Minimization"
scheme, as supported by the existing translation tracker.
This increases the amount of per-iteration work, but
decreases the number of iterations required to converge and
also increases the size of the basin of attraction for the
optimization.
- Remove the use of the legacy RegionTracker API from Blender,
and replaces it with the new TrackRegion API. This also
adds several features to the planar tracker in libmv:
* Do a brute-force initialization of tracking similar to "Hybrid"
mode in the stable release, but using all floats. This is slower
but more accurate. It is still necessary to evaluate if the
performance loss is worth it. In particular, this change is
necessary to support high bit depth imagery.
* Add support for masks over the search window. This is a step
towards supporting user-defined tracker masks. The tracker masks
will make it easy for users to make a mask for e.g. a ball.
Not exposed into interface yet/
* Add Pearson product moment correlation coefficient checking (aka
"Correlation" in the UI. This causes tracking failure if the
tracked patch is not linearly related to the template.
* Add support for warping a few points in addition to the supplied
points. This is useful because the tracking code deliberately
does not expose the underlying warp representation. Instead,
warps are specified in an aparametric way via the correspondences.
- Replace the old style tracker configuration panel with the
new planar tracking panel. From a users perspective, this means:
* The old "tracking algorithm" picker is gone. There is only 1
algorithm now. We may revisit this later, but I would much
prefer to have only 1 algorithm. So far no optimization work
has been done so the speed is not there yet.
* There is now a dropdown to select the motion model. Choices:
* Translation
* Translation, rotation
* Translation, scale
* Translation, rotation, scale
* Affine
* Perspective
* The old "Hybrid" mode is gone; instead there is a toggle to
enable or disable translation-only tracker initialization. This
is the equivalent of the hyrbid mode before, but rewritten to work
with the new planar tracking modes.
* The pyramid levels setting is gone. At a future date, the planar
tracker will decide to use pyramids or not automatically. The
pyramid setting was ultimately a mistake; with the brute force
initialization it is unnecessary.
- Add light-normalized tracking
Added the ability to normalize patterns by their average value while
tracking, to make them invariant to global illumination changes.
Additional details could be found at wiki page [2]
[1] http://code.google.com/p/ceres-solver
[2] http://wiki.blender.org/index.php/Dev:Ref/Release_Notes/2.64/Motion_Tracker
2012-06-10 15:28:19 +00:00
|
|
|
/* default_margin */
|
2013-12-16 17:53:15 +06:00
|
|
|
prop = RNA_def_property(srna, "default_margin", PROP_INT, PROP_PIXEL);
|
2011-11-28 13:26:46 +00:00
|
|
|
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
|
|
|
|
RNA_def_property_int_sdna(prop, NULL, "default_margin");
|
|
|
|
RNA_def_property_range(prop, 0, 300);
|
2012-07-03 17:20:21 +00:00
|
|
|
RNA_def_property_ui_text(prop, "Margin", "Default distance from image boundary at which marker stops tracking");
|
2011-11-28 13:26:46 +00:00
|
|
|
|
Planar tracking support for motion tracking
===========================================
Major list of changes done in tomato branch:
- Add a planar tracking implementation to libmv
This adds a new planar tracking implementation to libmv. The
tracker is based on Ceres[1], the new nonlinear minimizer that
myself and Sameer released from Google as open source. Since
the motion model is more involved, the interface is
different than the RegionTracker interface used previously
in Blender.
The start of a C API in libmv-capi.{cpp,h} is also included.
- Migrate from pat_{min,max} for markers to 4 corners representation
Convert markers in the movie clip editor / 2D tracker from using
pat_min and pat_max notation to using the a more general, 4-corner
representation.
There is still considerable porting work to do; in particular
sliding from preview widget does not work correct for rotated
markers.
All other areas should be ported to new representation:
* Added support of sliding individual corners. LMB slide + Ctrl
would scale the whole pattern
* S would scale the whole marker, S-S would scale pattern only
* Added support of marker's rotation which is currently rotates
only patterns around their centers or all markers around median,
Rotation or other non-translation/scaling transformation of search
area doesn't make sense.
* Track Preview widget would display transformed pattern which
libmv actually operates with.
- "Efficient Second-order Minimization" for the planar tracker
This implements the "Efficient Second-order Minimization"
scheme, as supported by the existing translation tracker.
This increases the amount of per-iteration work, but
decreases the number of iterations required to converge and
also increases the size of the basin of attraction for the
optimization.
- Remove the use of the legacy RegionTracker API from Blender,
and replaces it with the new TrackRegion API. This also
adds several features to the planar tracker in libmv:
* Do a brute-force initialization of tracking similar to "Hybrid"
mode in the stable release, but using all floats. This is slower
but more accurate. It is still necessary to evaluate if the
performance loss is worth it. In particular, this change is
necessary to support high bit depth imagery.
* Add support for masks over the search window. This is a step
towards supporting user-defined tracker masks. The tracker masks
will make it easy for users to make a mask for e.g. a ball.
Not exposed into interface yet/
* Add Pearson product moment correlation coefficient checking (aka
"Correlation" in the UI. This causes tracking failure if the
tracked patch is not linearly related to the template.
* Add support for warping a few points in addition to the supplied
points. This is useful because the tracking code deliberately
does not expose the underlying warp representation. Instead,
warps are specified in an aparametric way via the correspondences.
- Replace the old style tracker configuration panel with the
new planar tracking panel. From a users perspective, this means:
* The old "tracking algorithm" picker is gone. There is only 1
algorithm now. We may revisit this later, but I would much
prefer to have only 1 algorithm. So far no optimization work
has been done so the speed is not there yet.
* There is now a dropdown to select the motion model. Choices:
* Translation
* Translation, rotation
* Translation, scale
* Translation, rotation, scale
* Affine
* Perspective
* The old "Hybrid" mode is gone; instead there is a toggle to
enable or disable translation-only tracker initialization. This
is the equivalent of the hyrbid mode before, but rewritten to work
with the new planar tracking modes.
* The pyramid levels setting is gone. At a future date, the planar
tracker will decide to use pyramids or not automatically. The
pyramid setting was ultimately a mistake; with the brute force
initialization it is unnecessary.
- Add light-normalized tracking
Added the ability to normalize patterns by their average value while
tracking, to make them invariant to global illumination changes.
Additional details could be found at wiki page [2]
[1] http://code.google.com/p/ceres-solver
[2] http://wiki.blender.org/index.php/Dev:Ref/Release_Notes/2.64/Motion_Tracker
2012-06-10 15:28:19 +00:00
|
|
|
/* default_tracking_motion_model */
|
|
|
|
prop = RNA_def_property(srna, "default_motion_model", PROP_ENUM, PROP_NONE);
|
2011-11-28 13:26:46 +00:00
|
|
|
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
|
|
|
|
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
|
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
|
|
|
RNA_def_property_enum_items(prop, tracker_motion_model);
|
|
|
|
RNA_def_property_ui_text(prop, "Motion model", "Default motion model to use for tracking");
|
2011-11-28 13:26:46 +00:00
|
|
|
|
2012-06-12 11:13:53 +00:00
|
|
|
/* default_use_brute */
|
2012-08-04 10:47:31 +00:00
|
|
|
prop = RNA_def_property(srna, "use_default_brute", PROP_BOOLEAN, PROP_NONE);
|
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
|
|
|
RNA_def_property_boolean_sdna(prop, NULL, "default_algorithm_flag", TRACK_ALGORITHM_FLAG_USE_BRUTE);
|
|
|
|
RNA_def_property_ui_text(prop, "Prepass", "Use a brute-force translation-only initialization when tracking");
|
2012-06-10 19:59:02 +00:00
|
|
|
RNA_def_property_update(prop, NC_MOVIECLIP | ND_DISPLAY, NULL);
|
2011-11-28 13:26:46 +00:00
|
|
|
|
2012-06-12 11:13:53 +00:00
|
|
|
/* default_use_brute */
|
2012-08-04 10:47:31 +00:00
|
|
|
prop = RNA_def_property(srna, "use_default_mask", PROP_BOOLEAN, PROP_NONE);
|
2012-06-12 11:13:53 +00:00
|
|
|
RNA_def_property_boolean_sdna(prop, NULL, "default_algorithm_flag", TRACK_ALGORITHM_FLAG_USE_MASK);
|
2012-11-07 14:56:53 +00:00
|
|
|
RNA_def_property_ui_text(prop, "Use Mask",
|
2015-10-24 02:44:43 +11:00
|
|
|
"Use a grease pencil data-block as a mask to use only specified areas of pattern "
|
2012-11-07 14:56:53 +00:00
|
|
|
"when tracking");
|
2012-06-12 11:13:53 +00:00
|
|
|
RNA_def_property_update(prop, NC_MOVIECLIP | ND_DISPLAY, NULL);
|
|
|
|
|
|
|
|
/* default_use_normalization */
|
2012-08-04 10:47:31 +00:00
|
|
|
prop = RNA_def_property(srna, "use_default_normalization", PROP_BOOLEAN, PROP_NONE);
|
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
|
|
|
RNA_def_property_boolean_sdna(prop, NULL, "default_algorithm_flag", TRACK_ALGORITHM_FLAG_USE_NORMALIZATION);
|
2012-06-11 09:05:17 +00:00
|
|
|
RNA_def_property_ui_text(prop, "Normalize", "Normalize light intensities while tracking (slower)");
|
2012-06-10 19:59:02 +00:00
|
|
|
RNA_def_property_update(prop, NC_MOVIECLIP | ND_DISPLAY, NULL);
|
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
|
|
|
|
|
|
|
/* default minmal correlation */
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "default_correlation_min", PROP_FLOAT, PROP_NONE);
|
2011-11-28 13:26:46 +00:00
|
|
|
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
|
|
|
|
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
|
|
|
|
RNA_def_property_float_sdna(prop, NULL, "default_minimum_correlation");
|
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
|
|
|
RNA_def_property_range(prop, 0.0f, 1.0f);
|
|
|
|
RNA_def_property_ui_range(prop, 0.0f, 1.0f, 0.05, 3);
|
2012-03-18 09:27:36 +00:00
|
|
|
RNA_def_property_ui_text(prop, "Correlation",
|
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
|
|
|
"Default minimum value of correlation between matched pattern and reference "
|
|
|
|
"that is still treated as successful tracking");
|
2011-11-28 13:26:46 +00:00
|
|
|
|
|
|
|
/* default pattern size */
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "default_pattern_size", PROP_INT, PROP_NONE);
|
2011-11-28 13:26:46 +00:00
|
|
|
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
|
|
|
|
RNA_def_property_int_sdna(prop, NULL, "default_pattern_size");
|
|
|
|
RNA_def_property_range(prop, 5, 1000);
|
|
|
|
RNA_def_property_update(prop, 0, "rna_tracking_defaultSettings_patternUpdate");
|
2011-11-29 14:49:47 +00:00
|
|
|
RNA_def_property_ui_text(prop, "Pattern Size", "Size of pattern area for newly created tracks");
|
2011-11-28 13:26:46 +00:00
|
|
|
|
|
|
|
/* default search size */
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "default_search_size", PROP_INT, PROP_NONE);
|
2011-11-28 13:26:46 +00:00
|
|
|
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
|
|
|
|
RNA_def_property_int_sdna(prop, NULL, "default_search_size");
|
|
|
|
RNA_def_property_range(prop, 5, 1000);
|
|
|
|
RNA_def_property_update(prop, 0, "rna_tracking_defaultSettings_searchUpdate");
|
2011-11-29 14:49:47 +00:00
|
|
|
RNA_def_property_ui_text(prop, "Search Size", "Size of search area for newly created tracks");
|
2011-12-19 15:12:33 +00:00
|
|
|
|
Planar tracking support for motion tracking
===========================================
Major list of changes done in tomato branch:
- Add a planar tracking implementation to libmv
This adds a new planar tracking implementation to libmv. The
tracker is based on Ceres[1], the new nonlinear minimizer that
myself and Sameer released from Google as open source. Since
the motion model is more involved, the interface is
different than the RegionTracker interface used previously
in Blender.
The start of a C API in libmv-capi.{cpp,h} is also included.
- Migrate from pat_{min,max} for markers to 4 corners representation
Convert markers in the movie clip editor / 2D tracker from using
pat_min and pat_max notation to using the a more general, 4-corner
representation.
There is still considerable porting work to do; in particular
sliding from preview widget does not work correct for rotated
markers.
All other areas should be ported to new representation:
* Added support of sliding individual corners. LMB slide + Ctrl
would scale the whole pattern
* S would scale the whole marker, S-S would scale pattern only
* Added support of marker's rotation which is currently rotates
only patterns around their centers or all markers around median,
Rotation or other non-translation/scaling transformation of search
area doesn't make sense.
* Track Preview widget would display transformed pattern which
libmv actually operates with.
- "Efficient Second-order Minimization" for the planar tracker
This implements the "Efficient Second-order Minimization"
scheme, as supported by the existing translation tracker.
This increases the amount of per-iteration work, but
decreases the number of iterations required to converge and
also increases the size of the basin of attraction for the
optimization.
- Remove the use of the legacy RegionTracker API from Blender,
and replaces it with the new TrackRegion API. This also
adds several features to the planar tracker in libmv:
* Do a brute-force initialization of tracking similar to "Hybrid"
mode in the stable release, but using all floats. This is slower
but more accurate. It is still necessary to evaluate if the
performance loss is worth it. In particular, this change is
necessary to support high bit depth imagery.
* Add support for masks over the search window. This is a step
towards supporting user-defined tracker masks. The tracker masks
will make it easy for users to make a mask for e.g. a ball.
Not exposed into interface yet/
* Add Pearson product moment correlation coefficient checking (aka
"Correlation" in the UI. This causes tracking failure if the
tracked patch is not linearly related to the template.
* Add support for warping a few points in addition to the supplied
points. This is useful because the tracking code deliberately
does not expose the underlying warp representation. Instead,
warps are specified in an aparametric way via the correspondences.
- Replace the old style tracker configuration panel with the
new planar tracking panel. From a users perspective, this means:
* The old "tracking algorithm" picker is gone. There is only 1
algorithm now. We may revisit this later, but I would much
prefer to have only 1 algorithm. So far no optimization work
has been done so the speed is not there yet.
* There is now a dropdown to select the motion model. Choices:
* Translation
* Translation, rotation
* Translation, scale
* Translation, rotation, scale
* Affine
* Perspective
* The old "Hybrid" mode is gone; instead there is a toggle to
enable or disable translation-only tracker initialization. This
is the equivalent of the hyrbid mode before, but rewritten to work
with the new planar tracking modes.
* The pyramid levels setting is gone. At a future date, the planar
tracker will decide to use pyramids or not automatically. The
pyramid setting was ultimately a mistake; with the brute force
initialization it is unnecessary.
- Add light-normalized tracking
Added the ability to normalize patterns by their average value while
tracking, to make them invariant to global illumination changes.
Additional details could be found at wiki page [2]
[1] http://code.google.com/p/ceres-solver
[2] http://wiki.blender.org/index.php/Dev:Ref/Release_Notes/2.64/Motion_Tracker
2012-06-10 15:28:19 +00:00
|
|
|
/* default use_red_channel */
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "use_default_red_channel", PROP_BOOLEAN, PROP_NONE);
|
2012-01-26 15:33:16 +00:00
|
|
|
RNA_def_property_boolean_negative_sdna(prop, NULL, "default_flag", TRACK_DISABLE_RED);
|
|
|
|
RNA_def_property_ui_text(prop, "Use Red Channel", "Use red channel from footage for tracking");
|
2012-06-10 19:59:02 +00:00
|
|
|
RNA_def_property_update(prop, NC_MOVIECLIP | ND_DISPLAY, NULL);
|
2012-01-26 15:33:16 +00:00
|
|
|
|
Planar tracking support for motion tracking
===========================================
Major list of changes done in tomato branch:
- Add a planar tracking implementation to libmv
This adds a new planar tracking implementation to libmv. The
tracker is based on Ceres[1], the new nonlinear minimizer that
myself and Sameer released from Google as open source. Since
the motion model is more involved, the interface is
different than the RegionTracker interface used previously
in Blender.
The start of a C API in libmv-capi.{cpp,h} is also included.
- Migrate from pat_{min,max} for markers to 4 corners representation
Convert markers in the movie clip editor / 2D tracker from using
pat_min and pat_max notation to using the a more general, 4-corner
representation.
There is still considerable porting work to do; in particular
sliding from preview widget does not work correct for rotated
markers.
All other areas should be ported to new representation:
* Added support of sliding individual corners. LMB slide + Ctrl
would scale the whole pattern
* S would scale the whole marker, S-S would scale pattern only
* Added support of marker's rotation which is currently rotates
only patterns around their centers or all markers around median,
Rotation or other non-translation/scaling transformation of search
area doesn't make sense.
* Track Preview widget would display transformed pattern which
libmv actually operates with.
- "Efficient Second-order Minimization" for the planar tracker
This implements the "Efficient Second-order Minimization"
scheme, as supported by the existing translation tracker.
This increases the amount of per-iteration work, but
decreases the number of iterations required to converge and
also increases the size of the basin of attraction for the
optimization.
- Remove the use of the legacy RegionTracker API from Blender,
and replaces it with the new TrackRegion API. This also
adds several features to the planar tracker in libmv:
* Do a brute-force initialization of tracking similar to "Hybrid"
mode in the stable release, but using all floats. This is slower
but more accurate. It is still necessary to evaluate if the
performance loss is worth it. In particular, this change is
necessary to support high bit depth imagery.
* Add support for masks over the search window. This is a step
towards supporting user-defined tracker masks. The tracker masks
will make it easy for users to make a mask for e.g. a ball.
Not exposed into interface yet/
* Add Pearson product moment correlation coefficient checking (aka
"Correlation" in the UI. This causes tracking failure if the
tracked patch is not linearly related to the template.
* Add support for warping a few points in addition to the supplied
points. This is useful because the tracking code deliberately
does not expose the underlying warp representation. Instead,
warps are specified in an aparametric way via the correspondences.
- Replace the old style tracker configuration panel with the
new planar tracking panel. From a users perspective, this means:
* The old "tracking algorithm" picker is gone. There is only 1
algorithm now. We may revisit this later, but I would much
prefer to have only 1 algorithm. So far no optimization work
has been done so the speed is not there yet.
* There is now a dropdown to select the motion model. Choices:
* Translation
* Translation, rotation
* Translation, scale
* Translation, rotation, scale
* Affine
* Perspective
* The old "Hybrid" mode is gone; instead there is a toggle to
enable or disable translation-only tracker initialization. This
is the equivalent of the hyrbid mode before, but rewritten to work
with the new planar tracking modes.
* The pyramid levels setting is gone. At a future date, the planar
tracker will decide to use pyramids or not automatically. The
pyramid setting was ultimately a mistake; with the brute force
initialization it is unnecessary.
- Add light-normalized tracking
Added the ability to normalize patterns by their average value while
tracking, to make them invariant to global illumination changes.
Additional details could be found at wiki page [2]
[1] http://code.google.com/p/ceres-solver
[2] http://wiki.blender.org/index.php/Dev:Ref/Release_Notes/2.64/Motion_Tracker
2012-06-10 15:28:19 +00:00
|
|
|
/* default_use_green_channel */
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "use_default_green_channel", PROP_BOOLEAN, PROP_NONE);
|
2012-01-26 15:33:16 +00:00
|
|
|
RNA_def_property_boolean_negative_sdna(prop, NULL, "default_flag", TRACK_DISABLE_GREEN);
|
|
|
|
RNA_def_property_ui_text(prop, "Use Green Channel", "Use green channel from footage for tracking");
|
2012-06-10 19:59:02 +00:00
|
|
|
RNA_def_property_update(prop, NC_MOVIECLIP | ND_DISPLAY, NULL);
|
2012-01-26 15:33:16 +00:00
|
|
|
|
Planar tracking support for motion tracking
===========================================
Major list of changes done in tomato branch:
- Add a planar tracking implementation to libmv
This adds a new planar tracking implementation to libmv. The
tracker is based on Ceres[1], the new nonlinear minimizer that
myself and Sameer released from Google as open source. Since
the motion model is more involved, the interface is
different than the RegionTracker interface used previously
in Blender.
The start of a C API in libmv-capi.{cpp,h} is also included.
- Migrate from pat_{min,max} for markers to 4 corners representation
Convert markers in the movie clip editor / 2D tracker from using
pat_min and pat_max notation to using the a more general, 4-corner
representation.
There is still considerable porting work to do; in particular
sliding from preview widget does not work correct for rotated
markers.
All other areas should be ported to new representation:
* Added support of sliding individual corners. LMB slide + Ctrl
would scale the whole pattern
* S would scale the whole marker, S-S would scale pattern only
* Added support of marker's rotation which is currently rotates
only patterns around their centers or all markers around median,
Rotation or other non-translation/scaling transformation of search
area doesn't make sense.
* Track Preview widget would display transformed pattern which
libmv actually operates with.
- "Efficient Second-order Minimization" for the planar tracker
This implements the "Efficient Second-order Minimization"
scheme, as supported by the existing translation tracker.
This increases the amount of per-iteration work, but
decreases the number of iterations required to converge and
also increases the size of the basin of attraction for the
optimization.
- Remove the use of the legacy RegionTracker API from Blender,
and replaces it with the new TrackRegion API. This also
adds several features to the planar tracker in libmv:
* Do a brute-force initialization of tracking similar to "Hybrid"
mode in the stable release, but using all floats. This is slower
but more accurate. It is still necessary to evaluate if the
performance loss is worth it. In particular, this change is
necessary to support high bit depth imagery.
* Add support for masks over the search window. This is a step
towards supporting user-defined tracker masks. The tracker masks
will make it easy for users to make a mask for e.g. a ball.
Not exposed into interface yet/
* Add Pearson product moment correlation coefficient checking (aka
"Correlation" in the UI. This causes tracking failure if the
tracked patch is not linearly related to the template.
* Add support for warping a few points in addition to the supplied
points. This is useful because the tracking code deliberately
does not expose the underlying warp representation. Instead,
warps are specified in an aparametric way via the correspondences.
- Replace the old style tracker configuration panel with the
new planar tracking panel. From a users perspective, this means:
* The old "tracking algorithm" picker is gone. There is only 1
algorithm now. We may revisit this later, but I would much
prefer to have only 1 algorithm. So far no optimization work
has been done so the speed is not there yet.
* There is now a dropdown to select the motion model. Choices:
* Translation
* Translation, rotation
* Translation, scale
* Translation, rotation, scale
* Affine
* Perspective
* The old "Hybrid" mode is gone; instead there is a toggle to
enable or disable translation-only tracker initialization. This
is the equivalent of the hyrbid mode before, but rewritten to work
with the new planar tracking modes.
* The pyramid levels setting is gone. At a future date, the planar
tracker will decide to use pyramids or not automatically. The
pyramid setting was ultimately a mistake; with the brute force
initialization it is unnecessary.
- Add light-normalized tracking
Added the ability to normalize patterns by their average value while
tracking, to make them invariant to global illumination changes.
Additional details could be found at wiki page [2]
[1] http://code.google.com/p/ceres-solver
[2] http://wiki.blender.org/index.php/Dev:Ref/Release_Notes/2.64/Motion_Tracker
2012-06-10 15:28:19 +00:00
|
|
|
/* default_use_blue_channel */
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "use_default_blue_channel", PROP_BOOLEAN, PROP_NONE);
|
2012-01-26 15:33:16 +00:00
|
|
|
RNA_def_property_boolean_negative_sdna(prop, NULL, "default_flag", TRACK_DISABLE_BLUE);
|
|
|
|
RNA_def_property_ui_text(prop, "Use Blue Channel", "Use blue channel from footage for tracking");
|
2012-06-10 19:59:02 +00:00
|
|
|
RNA_def_property_update(prop, NC_MOVIECLIP | ND_DISPLAY, NULL);
|
2012-01-26 15:33:16 +00:00
|
|
|
|
2014-02-19 18:42:32 +06:00
|
|
|
prop = RNA_def_property(srna, "default_weight", PROP_FLOAT, PROP_FACTOR);
|
|
|
|
RNA_def_property_range(prop, 0.0f, 1.0f);
|
|
|
|
RNA_def_property_ui_text(prop, "Weight", "Influence of newly created track on a final solution");
|
|
|
|
|
2012-01-26 15:33:16 +00:00
|
|
|
/* ** object tracking ** */
|
|
|
|
|
2011-12-19 15:12:33 +00:00
|
|
|
/* object distance */
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "object_distance", PROP_FLOAT, PROP_NONE);
|
2011-12-19 15:12:33 +00:00
|
|
|
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
|
|
|
|
RNA_def_property_float_sdna(prop, NULL, "object_distance");
|
|
|
|
RNA_def_property_ui_text(prop, "Distance", "Distance between two bundles used for object scaling");
|
|
|
|
RNA_def_property_range(prop, 0.001, 10000);
|
2012-02-14 17:03:06 +00:00
|
|
|
RNA_def_property_float_default(prop, 1.0f);
|
2011-12-19 15:12:33 +00:00
|
|
|
RNA_def_property_ui_range(prop, 0.001, 10000.0, 1, 3);
|
2011-11-07 12:55:18 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static void rna_def_trackingCamera(BlenderRNA *brna)
|
|
|
|
{
|
|
|
|
StructRNA *srna;
|
|
|
|
PropertyRNA *prop;
|
|
|
|
|
2017-10-18 15:07:26 +11:00
|
|
|
static const EnumPropertyItem distortion_model_items[] = {
|
2014-02-20 19:41:05 +06:00
|
|
|
{TRACKING_DISTORTION_MODEL_POLYNOMIAL, "POLYNOMIAL", 0, "Polynomial", "Radial distortion model which fits common cameras"},
|
|
|
|
{TRACKING_DISTORTION_MODEL_DIVISION, "DIVISION", 0, "Divisions", "Division distortion model which "
|
|
|
|
"better represents wide-angle cameras"},
|
2019-02-03 14:01:45 +11:00
|
|
|
{0, NULL, 0, NULL, NULL},
|
2014-02-20 19:41:05 +06:00
|
|
|
};
|
|
|
|
|
2017-10-18 15:07:26 +11:00
|
|
|
static const EnumPropertyItem camera_units_items[] = {
|
2011-11-07 12:55:18 +00:00
|
|
|
{CAMERA_UNITS_PX, "PIXELS", 0, "px", "Use pixels for units of focal length"},
|
|
|
|
{CAMERA_UNITS_MM, "MILLIMETERS", 0, "mm", "Use millimeters for units of focal length"},
|
2019-02-03 14:01:45 +11:00
|
|
|
{0, NULL, 0, NULL, NULL},
|
2012-06-10 19:59:02 +00:00
|
|
|
};
|
2011-11-07 12:55:18 +00:00
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
srna = RNA_def_struct(brna, "MovieTrackingCamera", NULL);
|
2012-02-15 16:06:48 +00:00
|
|
|
RNA_def_struct_path_func(srna, "rna_trackingCamera_path");
|
2011-11-07 12:55:18 +00:00
|
|
|
RNA_def_struct_ui_text(srna, "Movie tracking camera data", "Match-moving camera data for tracking");
|
|
|
|
|
2014-02-20 19:41:05 +06:00
|
|
|
/* Distortion model */
|
|
|
|
prop = RNA_def_property(srna, "distortion_model", PROP_ENUM, PROP_NONE);
|
|
|
|
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
|
|
|
|
RNA_def_property_enum_items(prop, distortion_model_items);
|
|
|
|
RNA_def_property_ui_text(prop, "Distortion Model", "Distortion model used for camera lenses");
|
|
|
|
RNA_def_property_update(prop, NC_MOVIECLIP | NA_EDITED, "rna_tracking_resetIntrinsics");
|
|
|
|
|
2011-11-07 12:55:18 +00:00
|
|
|
/* Sensor */
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "sensor_width", PROP_FLOAT, PROP_NONE);
|
2011-11-07 12:55:18 +00:00
|
|
|
RNA_def_property_float_sdna(prop, NULL, "sensor_width");
|
2012-02-15 16:06:48 +00:00
|
|
|
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
|
2011-11-07 12:55:18 +00:00
|
|
|
RNA_def_property_range(prop, 0.0f, 500.0f);
|
|
|
|
RNA_def_property_ui_text(prop, "Sensor", "Width of CCD sensor in millimeters");
|
2012-06-10 19:59:02 +00:00
|
|
|
RNA_def_property_update(prop, NC_MOVIECLIP | NA_EDITED, NULL);
|
2011-11-07 12:55:18 +00:00
|
|
|
|
|
|
|
/* Focal Length */
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "focal_length", PROP_FLOAT, PROP_NONE);
|
2011-11-07 12:55:18 +00:00
|
|
|
RNA_def_property_float_sdna(prop, NULL, "focal");
|
2012-02-15 16:06:48 +00:00
|
|
|
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
|
2013-11-25 05:26:25 +01:00
|
|
|
RNA_def_property_range(prop, 0.0001f, FLT_MAX);
|
|
|
|
RNA_def_property_ui_range(prop, 0.0001f, 5000.0f, 1, 2);
|
2011-11-07 12:55:18 +00:00
|
|
|
RNA_def_property_float_funcs(prop, "rna_trackingCamera_focal_mm_get", "rna_trackingCamera_focal_mm_set", NULL);
|
|
|
|
RNA_def_property_ui_text(prop, "Focal Length", "Camera's focal length");
|
2012-06-10 19:59:02 +00:00
|
|
|
RNA_def_property_update(prop, NC_MOVIECLIP | NA_EDITED, NULL);
|
2011-11-07 12:55:18 +00:00
|
|
|
|
|
|
|
/* Focal Length in pixels */
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "focal_length_pixels", PROP_FLOAT, PROP_NONE);
|
2011-11-07 12:55:18 +00:00
|
|
|
RNA_def_property_float_sdna(prop, NULL, "focal");
|
2012-02-15 16:06:48 +00:00
|
|
|
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
|
2013-11-25 05:26:25 +01:00
|
|
|
RNA_def_property_range(prop, 0.0f, FLT_MAX);
|
|
|
|
RNA_def_property_ui_range(prop, 0.0f, 5000.f, 1, 2);
|
2011-11-07 12:55:18 +00:00
|
|
|
RNA_def_property_ui_text(prop, "Focal Length", "Camera's focal length");
|
2012-06-10 19:59:02 +00:00
|
|
|
RNA_def_property_update(prop, NC_MOVIECLIP | NA_EDITED, NULL);
|
2011-11-07 12:55:18 +00:00
|
|
|
|
|
|
|
/* Units */
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "units", PROP_ENUM, PROP_NONE);
|
2011-11-07 12:55:18 +00:00
|
|
|
RNA_def_property_enum_sdna(prop, NULL, "units");
|
|
|
|
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
|
2012-02-15 16:06:48 +00:00
|
|
|
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
|
2011-11-07 12:55:18 +00:00
|
|
|
RNA_def_property_enum_items(prop, camera_units_items);
|
|
|
|
RNA_def_property_ui_text(prop, "Units", "Units used for camera focal length");
|
|
|
|
|
|
|
|
/* Principal Point */
|
2013-12-16 17:53:15 +06:00
|
|
|
prop = RNA_def_property(srna, "principal", PROP_FLOAT, PROP_PIXEL);
|
2011-11-07 12:55:18 +00:00
|
|
|
RNA_def_property_array(prop, 2);
|
|
|
|
RNA_def_property_float_sdna(prop, NULL, "principal");
|
2012-02-15 16:06:48 +00:00
|
|
|
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
|
2011-11-07 12:55:18 +00:00
|
|
|
RNA_def_property_ui_text(prop, "Principal Point", "Optical center of lens");
|
2012-06-10 19:59:02 +00:00
|
|
|
RNA_def_property_update(prop, NC_MOVIECLIP | NA_EDITED, NULL);
|
2011-11-07 12:55:18 +00:00
|
|
|
|
|
|
|
/* Radial distortion parameters */
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "k1", PROP_FLOAT, PROP_NONE);
|
2011-11-07 12:55:18 +00:00
|
|
|
RNA_def_property_float_sdna(prop, NULL, "k1");
|
2012-02-15 16:06:48 +00:00
|
|
|
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
|
2012-06-17 09:58:26 +00:00
|
|
|
RNA_def_property_ui_range(prop, -10, 10, 0.1, 3);
|
2011-11-07 12:55:18 +00:00
|
|
|
RNA_def_property_ui_text(prop, "K1", "First coefficient of third order polynomial radial distortion");
|
2012-06-10 19:59:02 +00:00
|
|
|
RNA_def_property_update(prop, NC_MOVIECLIP | NA_EDITED, "rna_tracking_flushUpdate");
|
2011-11-07 12:55:18 +00:00
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "k2", PROP_FLOAT, PROP_NONE);
|
2011-11-07 12:55:18 +00:00
|
|
|
RNA_def_property_float_sdna(prop, NULL, "k2");
|
2012-02-15 16:06:48 +00:00
|
|
|
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
|
2012-06-17 09:58:26 +00:00
|
|
|
RNA_def_property_ui_range(prop, -10, 10, 0.1, 3);
|
2011-11-07 12:55:18 +00:00
|
|
|
RNA_def_property_ui_text(prop, "K2", "Second coefficient of third order polynomial radial distortion");
|
2012-06-10 19:59:02 +00:00
|
|
|
RNA_def_property_update(prop, NC_MOVIECLIP | NA_EDITED, "rna_tracking_flushUpdate");
|
2011-11-07 12:55:18 +00:00
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "k3", PROP_FLOAT, PROP_NONE);
|
2011-11-07 12:55:18 +00:00
|
|
|
RNA_def_property_float_sdna(prop, NULL, "k3");
|
2012-02-15 16:06:48 +00:00
|
|
|
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
|
2012-06-17 09:58:26 +00:00
|
|
|
RNA_def_property_ui_range(prop, -10, 10, 0.1, 3);
|
2011-11-07 12:55:18 +00:00
|
|
|
RNA_def_property_ui_text(prop, "K3", "Third coefficient of third order polynomial radial distortion");
|
2012-06-10 19:59:02 +00:00
|
|
|
RNA_def_property_update(prop, NC_MOVIECLIP | NA_EDITED, "rna_tracking_flushUpdate");
|
2011-11-07 12:55:18 +00:00
|
|
|
|
2014-02-20 19:41:05 +06:00
|
|
|
/* Division distortion parameters */
|
|
|
|
prop = RNA_def_property(srna, "division_k1", PROP_FLOAT, PROP_NONE);
|
|
|
|
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
|
|
|
|
RNA_def_property_ui_range(prop, -10, 10, 0.1, 3);
|
|
|
|
RNA_def_property_ui_text(prop, "K1", "First coefficient of second order division distortion");
|
|
|
|
RNA_def_property_update(prop, NC_MOVIECLIP | NA_EDITED, "rna_tracking_flushUpdate");
|
|
|
|
|
|
|
|
prop = RNA_def_property(srna, "division_k2", PROP_FLOAT, PROP_NONE);
|
|
|
|
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
|
|
|
|
RNA_def_property_ui_range(prop, -10, 10, 0.1, 3);
|
|
|
|
RNA_def_property_ui_text(prop, "K2", "First coefficient of second order division distortion");
|
|
|
|
RNA_def_property_update(prop, NC_MOVIECLIP | NA_EDITED, "rna_tracking_flushUpdate");
|
|
|
|
|
2011-11-07 12:55:18 +00:00
|
|
|
/* pixel aspect */
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "pixel_aspect", PROP_FLOAT, PROP_XYZ);
|
2011-11-07 12:55:18 +00:00
|
|
|
RNA_def_property_float_sdna(prop, NULL, "pixel_aspect");
|
2012-02-15 16:06:48 +00:00
|
|
|
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
|
2013-11-25 05:26:25 +01:00
|
|
|
RNA_def_property_range(prop, 0.1f, FLT_MAX);
|
2011-11-07 12:55:18 +00:00
|
|
|
RNA_def_property_ui_range(prop, 0.1f, 5000.0f, 1, 2);
|
2012-02-16 13:14:49 +00:00
|
|
|
RNA_def_property_float_default(prop, 1.0f);
|
2011-11-15 12:20:58 +00:00
|
|
|
RNA_def_property_ui_text(prop, "Pixel Aspect Ratio", "Pixel aspect ratio");
|
2012-06-10 19:59:02 +00:00
|
|
|
RNA_def_property_update(prop, NC_MOVIECLIP | ND_DISPLAY, "rna_tracking_flushUpdate");
|
2011-11-07 12:55:18 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static void rna_def_trackingMarker(BlenderRNA *brna)
|
|
|
|
{
|
|
|
|
StructRNA *srna;
|
|
|
|
PropertyRNA *prop;
|
|
|
|
|
2012-08-04 10:47:31 +00:00
|
|
|
static int boundbox_dimsize[] = {2, 2};
|
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
srna = RNA_def_struct(brna, "MovieTrackingMarker", NULL);
|
2011-11-07 12:55:18 +00:00
|
|
|
RNA_def_struct_ui_text(srna, "Movie tracking marker data", "Match-moving marker data for tracking");
|
|
|
|
|
|
|
|
/* position */
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "co", PROP_FLOAT, PROP_TRANSLATION);
|
2011-11-07 12:55:18 +00:00
|
|
|
RNA_def_property_array(prop, 2);
|
2012-04-10 08:33:30 +00:00
|
|
|
RNA_def_property_ui_range(prop, -FLT_MAX, FLT_MAX, 1, RNA_TRANSLATION_PREC_DEFAULT);
|
2011-11-07 12:55:18 +00:00
|
|
|
RNA_def_property_float_sdna(prop, NULL, "pos");
|
|
|
|
RNA_def_property_ui_text(prop, "Position", "Marker position at frame in normalized coordinates");
|
2012-06-10 19:59:02 +00:00
|
|
|
RNA_def_property_update(prop, NC_MOVIECLIP | NA_EDITED, NULL);
|
2011-11-07 12:55:18 +00:00
|
|
|
|
|
|
|
/* frame */
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "frame", PROP_INT, PROP_NONE);
|
2011-11-07 12:55:18 +00:00
|
|
|
RNA_def_property_int_sdna(prop, NULL, "framenr");
|
|
|
|
RNA_def_property_ui_text(prop, "Frame", "Frame number marker is keyframed on");
|
2012-01-09 20:18:36 +00:00
|
|
|
RNA_def_property_int_funcs(prop, NULL, "rna_trackingMarker_frame_set", NULL);
|
2013-09-11 21:27:14 +00:00
|
|
|
RNA_def_property_update(prop, NC_MOVIECLIP | NA_EDITED, NULL);
|
2011-11-07 12:55:18 +00:00
|
|
|
|
|
|
|
/* enable */
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "mute", PROP_BOOLEAN, PROP_NONE);
|
2011-11-19 02:48:09 +00:00
|
|
|
RNA_def_property_boolean_sdna(prop, NULL, "flag", MARKER_DISABLED);
|
|
|
|
RNA_def_property_ui_text(prop, "Mode", "Is marker muted for current frame");
|
2012-06-10 19:59:02 +00:00
|
|
|
RNA_def_property_update(prop, NC_MOVIECLIP | NA_EDITED, NULL);
|
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
|
|
|
|
|
|
|
/* pattern */
|
|
|
|
prop = RNA_def_property(srna, "pattern_corners", PROP_FLOAT, PROP_MATRIX);
|
|
|
|
RNA_def_property_float_sdna(prop, NULL, "pattern_corners");
|
|
|
|
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
|
|
|
|
RNA_def_property_multi_array(prop, 2, rna_matrix_dimsize_4x2);
|
|
|
|
RNA_def_property_ui_range(prop, -FLT_MAX, FLT_MAX, 1, RNA_TRANSLATION_PREC_DEFAULT);
|
|
|
|
RNA_def_property_ui_text(prop, "Pattern Corners",
|
2012-06-11 09:05:17 +00:00
|
|
|
"Array of coordinates which represents pattern's corners in "
|
|
|
|
"normalized coordinates relative to marker position");
|
2012-06-10 19:59:02 +00:00
|
|
|
RNA_def_property_update(prop, NC_MOVIECLIP | NA_EDITED, "rna_tracking_markerPattern_update");
|
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
|
|
|
|
2012-08-04 10:47:31 +00:00
|
|
|
prop = RNA_def_property(srna, "pattern_bound_box", PROP_FLOAT, PROP_NONE);
|
|
|
|
RNA_def_property_multi_array(prop, 2, boundbox_dimsize);
|
|
|
|
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
|
|
|
|
RNA_def_property_float_funcs(prop, "rna_tracking_markerPattern_boundbox_get", NULL, NULL);
|
|
|
|
RNA_def_property_ui_text(prop, "Pattern Bounding Box", "Pattern area bounding box in normalized coordinates");
|
|
|
|
|
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
|
|
|
/* search */
|
|
|
|
prop = RNA_def_property(srna, "search_min", PROP_FLOAT, PROP_TRANSLATION);
|
|
|
|
RNA_def_property_array(prop, 2);
|
|
|
|
RNA_def_property_ui_range(prop, -FLT_MAX, FLT_MAX, 1, RNA_TRANSLATION_PREC_DEFAULT);
|
|
|
|
RNA_def_property_float_sdna(prop, NULL, "search_min");
|
|
|
|
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
|
|
|
|
RNA_def_property_ui_text(prop, "Search Min",
|
2012-06-10 19:59:02 +00:00
|
|
|
"Left-bottom corner of search area in normalized coordinates relative "
|
|
|
|
"to marker position");
|
|
|
|
RNA_def_property_update(prop, NC_MOVIECLIP | NA_EDITED, "rna_tracking_markerSearch_update");
|
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
|
|
|
|
|
|
|
prop = RNA_def_property(srna, "search_max", PROP_FLOAT, PROP_TRANSLATION);
|
|
|
|
RNA_def_property_array(prop, 2);
|
|
|
|
RNA_def_property_ui_range(prop, -FLT_MAX, FLT_MAX, 1, RNA_TRANSLATION_PREC_DEFAULT);
|
|
|
|
RNA_def_property_float_sdna(prop, NULL, "search_max");
|
|
|
|
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
|
|
|
|
RNA_def_property_ui_text(prop, "Search Max",
|
2012-06-10 19:59:02 +00:00
|
|
|
"Right-bottom corner of search area in normalized coordinates relative "
|
|
|
|
"to marker position");
|
|
|
|
RNA_def_property_update(prop, NC_MOVIECLIP | NA_EDITED, "rna_tracking_markerSearch_update");
|
2013-11-01 04:06:01 +00:00
|
|
|
|
|
|
|
/* is marker keyframed */
|
2013-11-03 09:33:17 +00:00
|
|
|
prop = RNA_def_property(srna, "is_keyed", PROP_BOOLEAN, PROP_NONE);
|
2013-11-01 04:06:01 +00:00
|
|
|
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
|
|
|
|
RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", MARKER_TRACKED);
|
2013-11-04 18:58:22 +00:00
|
|
|
RNA_def_property_ui_text(prop, "Keyframed", "Whether the position of the marker is keyframed or tracked");
|
2011-11-07 12:55:18 +00:00
|
|
|
}
|
|
|
|
|
2012-01-09 20:18:28 +00:00
|
|
|
static void rna_def_trackingMarkers(BlenderRNA *brna, PropertyRNA *cprop)
|
2011-11-07 12:55:18 +00:00
|
|
|
{
|
|
|
|
StructRNA *srna;
|
|
|
|
FunctionRNA *func;
|
|
|
|
PropertyRNA *parm;
|
|
|
|
|
2012-01-09 20:18:28 +00:00
|
|
|
RNA_def_property_srna(cprop, "MovieTrackingMarkers");
|
2012-03-05 23:30:41 +00:00
|
|
|
srna = RNA_def_struct(brna, "MovieTrackingMarkers", NULL);
|
2012-01-09 20:18:28 +00:00
|
|
|
RNA_def_struct_sdna(srna, "MovieTrackingTrack");
|
|
|
|
RNA_def_struct_ui_text(srna, "Movie Tracking Markers", "Collection of markers for movie tracking track");
|
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
func = RNA_def_function(srna, "find_frame", "rna_trackingMarkers_find_frame");
|
2012-01-09 20:18:28 +00:00
|
|
|
RNA_def_function_ui_description(func, "Get marker for specified frame");
|
2012-03-05 23:30:41 +00:00
|
|
|
parm = RNA_def_int(func, "frame", 1, MINFRAME, MAXFRAME, "Frame",
|
2012-03-18 09:27:36 +00:00
|
|
|
"Frame number to find marker for", MINFRAME, MAXFRAME);
|
Refactor RNA property: split flags in property flags, parameter flags, and internal flags.
This gives us 9 flags available again for properties (we had none anymore),
and also makes things slightly cleaner.
To simplify (and make more clear the differences between mere properties
and function parameters), also added RNA_def_parameter_flags function (and
its clear counterpart), to be used instead of RNA_def_property_flag for
function parameters.
This patch is also a big cleanup (some RNA function definitions were
still using 'prop' PropertyRNA pointer, etc.).
And yes, am aware this will be annoying for all branches, but we really need
to get new flags available for properties (will need at least one for override, etc.).
Reviewers: sergey, Severin
Subscribers: dfelinto, brecht
Differential Revision: https://developer.blender.org/D2400
2016-12-12 15:23:55 +01:00
|
|
|
RNA_def_parameter_flags(parm, 0, PARM_REQUIRED);
|
2014-04-01 11:34:00 +11:00
|
|
|
RNA_def_boolean(func, "exact", true, "Exact",
|
2012-11-01 09:54:00 +00:00
|
|
|
"Get marker at exact frame number rather than get estimated marker");
|
2012-03-05 23:30:41 +00:00
|
|
|
parm = RNA_def_pointer(func, "marker", "MovieTrackingMarker", "", "Marker for specified frame");
|
2012-01-09 20:18:28 +00:00
|
|
|
RNA_def_function_return(func, parm);
|
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
func = RNA_def_function(srna, "insert_frame", "rna_trackingMarkers_insert_frame");
|
2013-08-23 09:10:23 +00:00
|
|
|
RNA_def_function_ui_description(func, "Insert a new marker at the specified frame");
|
2012-03-05 23:30:41 +00:00
|
|
|
parm = RNA_def_int(func, "frame", 1, MINFRAME, MAXFRAME, "Frame",
|
2012-03-18 09:27:36 +00:00
|
|
|
"Frame number to insert marker to", MINFRAME, MAXFRAME);
|
Refactor RNA property: split flags in property flags, parameter flags, and internal flags.
This gives us 9 flags available again for properties (we had none anymore),
and also makes things slightly cleaner.
To simplify (and make more clear the differences between mere properties
and function parameters), also added RNA_def_parameter_flags function (and
its clear counterpart), to be used instead of RNA_def_property_flag for
function parameters.
This patch is also a big cleanup (some RNA function definitions were
still using 'prop' PropertyRNA pointer, etc.).
And yes, am aware this will be annoying for all branches, but we really need
to get new flags available for properties (will need at least one for override, etc.).
Reviewers: sergey, Severin
Subscribers: dfelinto, brecht
Differential Revision: https://developer.blender.org/D2400
2016-12-12 15:23:55 +01:00
|
|
|
RNA_def_parameter_flags(parm, 0, PARM_REQUIRED);
|
2013-09-11 21:27:14 +00:00
|
|
|
RNA_def_float_vector(func, "co", 2, NULL, -1.0, 1.0, "Coordinate",
|
2012-03-18 09:27:36 +00:00
|
|
|
"Place new marker at the given frame using specified in normalized space coordinates",
|
|
|
|
-1.0, 1.0);
|
Refactor RNA property: split flags in property flags, parameter flags, and internal flags.
This gives us 9 flags available again for properties (we had none anymore),
and also makes things slightly cleaner.
To simplify (and make more clear the differences between mere properties
and function parameters), also added RNA_def_parameter_flags function (and
its clear counterpart), to be used instead of RNA_def_property_flag for
function parameters.
This patch is also a big cleanup (some RNA function definitions were
still using 'prop' PropertyRNA pointer, etc.).
And yes, am aware this will be annoying for all branches, but we really need
to get new flags available for properties (will need at least one for override, etc.).
Reviewers: sergey, Severin
Subscribers: dfelinto, brecht
Differential Revision: https://developer.blender.org/D2400
2016-12-12 15:23:55 +01:00
|
|
|
RNA_def_parameter_flags(parm, 0, PARM_REQUIRED);
|
2012-03-05 23:30:41 +00:00
|
|
|
parm = RNA_def_pointer(func, "marker", "MovieTrackingMarker", "", "Newly created marker");
|
2012-01-09 20:18:28 +00:00
|
|
|
RNA_def_function_return(func, parm);
|
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
func = RNA_def_function(srna, "delete_frame", "rna_trackingMarkers_delete_frame");
|
2012-01-09 20:18:28 +00:00
|
|
|
RNA_def_function_ui_description(func, "Delete marker at specified frame");
|
2012-03-05 23:30:41 +00:00
|
|
|
parm = RNA_def_int(func, "frame", 1, MINFRAME, MAXFRAME, "Frame",
|
2012-03-18 09:27:36 +00:00
|
|
|
"Frame number to delete marker from", MINFRAME, MAXFRAME);
|
Refactor RNA property: split flags in property flags, parameter flags, and internal flags.
This gives us 9 flags available again for properties (we had none anymore),
and also makes things slightly cleaner.
To simplify (and make more clear the differences between mere properties
and function parameters), also added RNA_def_parameter_flags function (and
its clear counterpart), to be used instead of RNA_def_property_flag for
function parameters.
This patch is also a big cleanup (some RNA function definitions were
still using 'prop' PropertyRNA pointer, etc.).
And yes, am aware this will be annoying for all branches, but we really need
to get new flags available for properties (will need at least one for override, etc.).
Reviewers: sergey, Severin
Subscribers: dfelinto, brecht
Differential Revision: https://developer.blender.org/D2400
2016-12-12 15:23:55 +01:00
|
|
|
RNA_def_parameter_flags(parm, 0, PARM_REQUIRED);
|
2012-01-09 20:18:28 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static void rna_def_trackingTrack(BlenderRNA *brna)
|
|
|
|
{
|
|
|
|
StructRNA *srna;
|
|
|
|
PropertyRNA *prop;
|
|
|
|
|
2011-11-07 12:55:18 +00:00
|
|
|
rna_def_trackingMarker(brna);
|
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
srna = RNA_def_struct(brna, "MovieTrackingTrack", NULL);
|
2012-02-15 16:06:48 +00:00
|
|
|
RNA_def_struct_path_func(srna, "rna_trackingTrack_path");
|
2011-11-07 12:55:18 +00:00
|
|
|
RNA_def_struct_ui_text(srna, "Movie tracking track data", "Match-moving track data for tracking");
|
|
|
|
RNA_def_struct_ui_icon(srna, ICON_ANIM_DATA);
|
|
|
|
|
|
|
|
/* name */
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "name", PROP_STRING, PROP_NONE);
|
2011-11-07 12:55:18 +00:00
|
|
|
RNA_def_property_ui_text(prop, "Name", "Unique name of track");
|
|
|
|
RNA_def_property_string_funcs(prop, NULL, NULL, "rna_trackingTrack_name_set");
|
2012-06-10 19:59:02 +00:00
|
|
|
RNA_def_property_string_maxlength(prop, MAX_ID_NAME - 2);
|
|
|
|
RNA_def_property_update(prop, NC_MOVIECLIP | NA_EDITED, NULL);
|
2011-11-07 12:55:18 +00:00
|
|
|
RNA_def_struct_name_property(srna, prop);
|
|
|
|
|
2011-11-28 13:26:46 +00:00
|
|
|
/* limit frames */
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "frames_limit", PROP_INT, PROP_NONE);
|
2011-11-28 13:26:46 +00:00
|
|
|
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
|
|
|
|
RNA_def_property_int_sdna(prop, NULL, "frames_limit");
|
2012-02-15 16:06:48 +00:00
|
|
|
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
|
2011-11-28 13:26:46 +00:00
|
|
|
RNA_def_property_range(prop, 0, SHRT_MAX);
|
2011-11-29 14:49:47 +00:00
|
|
|
RNA_def_property_ui_text(prop, "Frames Limit", "Every tracking cycle, this number of frames are tracked");
|
2011-11-28 13:26:46 +00:00
|
|
|
|
|
|
|
/* pattern match */
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "pattern_match", PROP_ENUM, PROP_NONE);
|
2011-11-28 13:26:46 +00:00
|
|
|
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
|
|
|
|
RNA_def_property_enum_sdna(prop, NULL, "pattern_match");
|
2012-02-15 16:06:48 +00:00
|
|
|
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
|
2011-11-28 13:26:46 +00:00
|
|
|
RNA_def_property_enum_items(prop, pattern_match_items);
|
2012-03-18 09:27:36 +00:00
|
|
|
RNA_def_property_ui_text(prop, "Pattern Match",
|
|
|
|
"Track pattern from given frame when tracking marker to next frame");
|
2011-11-28 13:26:46 +00:00
|
|
|
|
|
|
|
/* margin */
|
2013-12-16 17:53:15 +06:00
|
|
|
prop = RNA_def_property(srna, "margin", PROP_INT, PROP_PIXEL);
|
2011-11-28 13:26:46 +00:00
|
|
|
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
|
|
|
|
RNA_def_property_int_sdna(prop, NULL, "margin");
|
2012-02-15 16:06:48 +00:00
|
|
|
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
|
2011-11-28 13:26:46 +00:00
|
|
|
RNA_def_property_range(prop, 0, 300);
|
2012-07-03 17:20:21 +00:00
|
|
|
RNA_def_property_ui_text(prop, "Margin", "Distance from image boundary at which marker stops tracking");
|
2011-11-28 13:26:46 +00:00
|
|
|
|
Planar tracking support for motion tracking
===========================================
Major list of changes done in tomato branch:
- Add a planar tracking implementation to libmv
This adds a new planar tracking implementation to libmv. The
tracker is based on Ceres[1], the new nonlinear minimizer that
myself and Sameer released from Google as open source. Since
the motion model is more involved, the interface is
different than the RegionTracker interface used previously
in Blender.
The start of a C API in libmv-capi.{cpp,h} is also included.
- Migrate from pat_{min,max} for markers to 4 corners representation
Convert markers in the movie clip editor / 2D tracker from using
pat_min and pat_max notation to using the a more general, 4-corner
representation.
There is still considerable porting work to do; in particular
sliding from preview widget does not work correct for rotated
markers.
All other areas should be ported to new representation:
* Added support of sliding individual corners. LMB slide + Ctrl
would scale the whole pattern
* S would scale the whole marker, S-S would scale pattern only
* Added support of marker's rotation which is currently rotates
only patterns around their centers or all markers around median,
Rotation or other non-translation/scaling transformation of search
area doesn't make sense.
* Track Preview widget would display transformed pattern which
libmv actually operates with.
- "Efficient Second-order Minimization" for the planar tracker
This implements the "Efficient Second-order Minimization"
scheme, as supported by the existing translation tracker.
This increases the amount of per-iteration work, but
decreases the number of iterations required to converge and
also increases the size of the basin of attraction for the
optimization.
- Remove the use of the legacy RegionTracker API from Blender,
and replaces it with the new TrackRegion API. This also
adds several features to the planar tracker in libmv:
* Do a brute-force initialization of tracking similar to "Hybrid"
mode in the stable release, but using all floats. This is slower
but more accurate. It is still necessary to evaluate if the
performance loss is worth it. In particular, this change is
necessary to support high bit depth imagery.
* Add support for masks over the search window. This is a step
towards supporting user-defined tracker masks. The tracker masks
will make it easy for users to make a mask for e.g. a ball.
Not exposed into interface yet/
* Add Pearson product moment correlation coefficient checking (aka
"Correlation" in the UI. This causes tracking failure if the
tracked patch is not linearly related to the template.
* Add support for warping a few points in addition to the supplied
points. This is useful because the tracking code deliberately
does not expose the underlying warp representation. Instead,
warps are specified in an aparametric way via the correspondences.
- Replace the old style tracker configuration panel with the
new planar tracking panel. From a users perspective, this means:
* The old "tracking algorithm" picker is gone. There is only 1
algorithm now. We may revisit this later, but I would much
prefer to have only 1 algorithm. So far no optimization work
has been done so the speed is not there yet.
* There is now a dropdown to select the motion model. Choices:
* Translation
* Translation, rotation
* Translation, scale
* Translation, rotation, scale
* Affine
* Perspective
* The old "Hybrid" mode is gone; instead there is a toggle to
enable or disable translation-only tracker initialization. This
is the equivalent of the hyrbid mode before, but rewritten to work
with the new planar tracking modes.
* The pyramid levels setting is gone. At a future date, the planar
tracker will decide to use pyramids or not automatically. The
pyramid setting was ultimately a mistake; with the brute force
initialization it is unnecessary.
- Add light-normalized tracking
Added the ability to normalize patterns by their average value while
tracking, to make them invariant to global illumination changes.
Additional details could be found at wiki page [2]
[1] http://code.google.com/p/ceres-solver
[2] http://wiki.blender.org/index.php/Dev:Ref/Release_Notes/2.64/Motion_Tracker
2012-06-10 15:28:19 +00:00
|
|
|
/* tracking motion model */
|
|
|
|
prop = RNA_def_property(srna, "motion_model", PROP_ENUM, PROP_NONE);
|
2011-11-07 12:55:18 +00:00
|
|
|
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
|
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
|
|
|
RNA_def_property_enum_items(prop, tracker_motion_model);
|
2012-02-15 16:06:48 +00:00
|
|
|
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
|
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
|
|
|
RNA_def_property_ui_text(prop, "Motion model", "Default motion model to use for tracking");
|
2011-11-07 12:55:18 +00:00
|
|
|
|
Planar tracking support for motion tracking
===========================================
Major list of changes done in tomato branch:
- Add a planar tracking implementation to libmv
This adds a new planar tracking implementation to libmv. The
tracker is based on Ceres[1], the new nonlinear minimizer that
myself and Sameer released from Google as open source. Since
the motion model is more involved, the interface is
different than the RegionTracker interface used previously
in Blender.
The start of a C API in libmv-capi.{cpp,h} is also included.
- Migrate from pat_{min,max} for markers to 4 corners representation
Convert markers in the movie clip editor / 2D tracker from using
pat_min and pat_max notation to using the a more general, 4-corner
representation.
There is still considerable porting work to do; in particular
sliding from preview widget does not work correct for rotated
markers.
All other areas should be ported to new representation:
* Added support of sliding individual corners. LMB slide + Ctrl
would scale the whole pattern
* S would scale the whole marker, S-S would scale pattern only
* Added support of marker's rotation which is currently rotates
only patterns around their centers or all markers around median,
Rotation or other non-translation/scaling transformation of search
area doesn't make sense.
* Track Preview widget would display transformed pattern which
libmv actually operates with.
- "Efficient Second-order Minimization" for the planar tracker
This implements the "Efficient Second-order Minimization"
scheme, as supported by the existing translation tracker.
This increases the amount of per-iteration work, but
decreases the number of iterations required to converge and
also increases the size of the basin of attraction for the
optimization.
- Remove the use of the legacy RegionTracker API from Blender,
and replaces it with the new TrackRegion API. This also
adds several features to the planar tracker in libmv:
* Do a brute-force initialization of tracking similar to "Hybrid"
mode in the stable release, but using all floats. This is slower
but more accurate. It is still necessary to evaluate if the
performance loss is worth it. In particular, this change is
necessary to support high bit depth imagery.
* Add support for masks over the search window. This is a step
towards supporting user-defined tracker masks. The tracker masks
will make it easy for users to make a mask for e.g. a ball.
Not exposed into interface yet/
* Add Pearson product moment correlation coefficient checking (aka
"Correlation" in the UI. This causes tracking failure if the
tracked patch is not linearly related to the template.
* Add support for warping a few points in addition to the supplied
points. This is useful because the tracking code deliberately
does not expose the underlying warp representation. Instead,
warps are specified in an aparametric way via the correspondences.
- Replace the old style tracker configuration panel with the
new planar tracking panel. From a users perspective, this means:
* The old "tracking algorithm" picker is gone. There is only 1
algorithm now. We may revisit this later, but I would much
prefer to have only 1 algorithm. So far no optimization work
has been done so the speed is not there yet.
* There is now a dropdown to select the motion model. Choices:
* Translation
* Translation, rotation
* Translation, scale
* Translation, rotation, scale
* Affine
* Perspective
* The old "Hybrid" mode is gone; instead there is a toggle to
enable or disable translation-only tracker initialization. This
is the equivalent of the hyrbid mode before, but rewritten to work
with the new planar tracking modes.
* The pyramid levels setting is gone. At a future date, the planar
tracker will decide to use pyramids or not automatically. The
pyramid setting was ultimately a mistake; with the brute force
initialization it is unnecessary.
- Add light-normalized tracking
Added the ability to normalize patterns by their average value while
tracking, to make them invariant to global illumination changes.
Additional details could be found at wiki page [2]
[1] http://code.google.com/p/ceres-solver
[2] http://wiki.blender.org/index.php/Dev:Ref/Release_Notes/2.64/Motion_Tracker
2012-06-10 15:28:19 +00:00
|
|
|
/* minimum correlation */
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "correlation_min", PROP_FLOAT, PROP_NONE);
|
2011-11-07 12:55:18 +00:00
|
|
|
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
|
|
|
|
RNA_def_property_float_sdna(prop, NULL, "minimum_correlation");
|
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
|
|
|
RNA_def_property_range(prop, 0.0f, 1.0f);
|
|
|
|
RNA_def_property_ui_range(prop, 0.0f, 1.0f, 0.05, 3);
|
2012-03-18 09:27:36 +00:00
|
|
|
RNA_def_property_ui_text(prop, "Correlation",
|
|
|
|
"Minimal value of correlation between matched pattern and reference "
|
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
|
|
|
"that is still treated as successful tracking");
|
|
|
|
|
|
|
|
/* use_brute */
|
|
|
|
prop = RNA_def_property(srna, "use_brute", PROP_BOOLEAN, PROP_NONE);
|
|
|
|
RNA_def_property_boolean_sdna(prop, NULL, "algorithm_flag", TRACK_ALGORITHM_FLAG_USE_BRUTE);
|
|
|
|
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
|
|
|
|
RNA_def_property_ui_text(prop, "Prepass", "Use a brute-force translation only pre-track before refinement");
|
2012-06-10 19:59:02 +00:00
|
|
|
RNA_def_property_update(prop, NC_MOVIECLIP | ND_DISPLAY, NULL);
|
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
|
|
|
|
|
|
|
/* use_brute */
|
2012-06-12 11:13:53 +00:00
|
|
|
prop = RNA_def_property(srna, "use_mask", PROP_BOOLEAN, PROP_NONE);
|
|
|
|
RNA_def_property_boolean_sdna(prop, NULL, "algorithm_flag", TRACK_ALGORITHM_FLAG_USE_MASK);
|
2012-11-07 14:56:53 +00:00
|
|
|
RNA_def_property_ui_text(prop, "Use Mask",
|
2015-10-24 02:44:43 +11:00
|
|
|
"Use a grease pencil data-block as a mask to use only specified areas of pattern "
|
2012-11-07 14:56:53 +00:00
|
|
|
"when tracking");
|
2012-06-12 11:13:53 +00:00
|
|
|
RNA_def_property_update(prop, NC_MOVIECLIP | ND_DISPLAY, NULL);
|
|
|
|
|
|
|
|
/* use_normalization */
|
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
|
|
|
prop = RNA_def_property(srna, "use_normalization", PROP_BOOLEAN, PROP_NONE);
|
|
|
|
RNA_def_property_boolean_sdna(prop, NULL, "algorithm_flag", TRACK_ALGORITHM_FLAG_USE_NORMALIZATION);
|
|
|
|
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
|
|
|
|
RNA_def_property_ui_text(prop, "Normalize", "Normalize light intensities while tracking. Slower");
|
2012-06-10 19:59:02 +00:00
|
|
|
RNA_def_property_update(prop, NC_MOVIECLIP | ND_DISPLAY, NULL);
|
2011-11-07 12:55:18 +00:00
|
|
|
|
|
|
|
/* markers */
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "markers", PROP_COLLECTION, PROP_NONE);
|
2011-11-07 12:55:18 +00:00
|
|
|
RNA_def_property_struct_type(prop, "MovieTrackingMarker");
|
|
|
|
RNA_def_property_collection_sdna(prop, NULL, "markers", "markersnr");
|
|
|
|
RNA_def_property_ui_text(prop, "Markers", "Collection of markers in track");
|
2012-01-09 20:18:28 +00:00
|
|
|
rna_def_trackingMarkers(brna, prop);
|
2011-11-07 12:55:18 +00:00
|
|
|
|
|
|
|
/* ** channels ** */
|
|
|
|
|
|
|
|
/* use_red_channel */
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "use_red_channel", PROP_BOOLEAN, PROP_NONE);
|
2011-11-07 12:55:18 +00:00
|
|
|
RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", TRACK_DISABLE_RED);
|
2012-02-15 16:06:48 +00:00
|
|
|
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
|
2011-11-07 12:55:18 +00:00
|
|
|
RNA_def_property_ui_text(prop, "Use Red Channel", "Use red channel from footage for tracking");
|
2012-06-10 19:59:02 +00:00
|
|
|
RNA_def_property_update(prop, NC_MOVIECLIP | ND_DISPLAY, NULL);
|
2011-11-07 12:55:18 +00:00
|
|
|
|
|
|
|
/* use_green_channel */
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "use_green_channel", PROP_BOOLEAN, PROP_NONE);
|
2011-11-07 12:55:18 +00:00
|
|
|
RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", TRACK_DISABLE_GREEN);
|
2012-02-15 16:06:48 +00:00
|
|
|
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
|
2011-11-07 12:55:18 +00:00
|
|
|
RNA_def_property_ui_text(prop, "Use Green Channel", "Use green channel from footage for tracking");
|
2012-06-10 19:59:02 +00:00
|
|
|
RNA_def_property_update(prop, NC_MOVIECLIP | ND_DISPLAY, NULL);
|
2011-11-07 12:55:18 +00:00
|
|
|
|
|
|
|
/* use_blue_channel */
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "use_blue_channel", PROP_BOOLEAN, PROP_NONE);
|
2011-11-07 12:55:18 +00:00
|
|
|
RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", TRACK_DISABLE_BLUE);
|
2012-02-15 16:06:48 +00:00
|
|
|
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
|
2011-11-07 12:55:18 +00:00
|
|
|
RNA_def_property_ui_text(prop, "Use Blue Channel", "Use blue channel from footage for tracking");
|
2012-06-10 19:59:02 +00:00
|
|
|
RNA_def_property_update(prop, NC_MOVIECLIP | ND_DISPLAY, NULL);
|
2011-11-07 12:55:18 +00:00
|
|
|
|
2011-12-04 12:58:31 +00:00
|
|
|
/* preview_grayscale */
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "use_grayscale_preview", PROP_BOOLEAN, PROP_NONE);
|
2011-12-04 12:58:31 +00:00
|
|
|
RNA_def_property_boolean_sdna(prop, NULL, "flag", TRACK_PREVIEW_GRAYSCALE);
|
2012-02-15 16:06:48 +00:00
|
|
|
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
|
2011-12-04 12:58:31 +00:00
|
|
|
RNA_def_property_ui_text(prop, "Grayscale", "Display what the tracking algorithm sees in the preview");
|
2012-06-10 19:59:02 +00:00
|
|
|
RNA_def_property_update(prop, NC_MOVIECLIP | ND_DISPLAY, NULL);
|
2011-12-04 12:58:31 +00:00
|
|
|
|
2012-06-12 11:13:53 +00:00
|
|
|
/* preview_alpha */
|
|
|
|
prop = RNA_def_property(srna, "use_alpha_preview", PROP_BOOLEAN, PROP_NONE);
|
|
|
|
RNA_def_property_boolean_sdna(prop, NULL, "flag", TRACK_PREVIEW_ALPHA);
|
|
|
|
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
|
|
|
|
RNA_def_property_ui_text(prop, "Alpha", "Apply track's mask on displaying preview");
|
|
|
|
RNA_def_property_update(prop, NC_MOVIECLIP | ND_DISPLAY, NULL);
|
|
|
|
|
2011-11-07 12:55:18 +00:00
|
|
|
/* has bundle */
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "has_bundle", PROP_BOOLEAN, PROP_NONE);
|
2011-11-07 12:55:18 +00:00
|
|
|
RNA_def_property_boolean_sdna(prop, NULL, "flag", TRACK_HAS_BUNDLE);
|
|
|
|
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
|
|
|
|
RNA_def_property_ui_text(prop, "Has Bundle", "True if track has a valid bundle");
|
|
|
|
|
|
|
|
/* bundle position */
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "bundle", PROP_FLOAT, PROP_TRANSLATION);
|
2011-11-07 12:55:18 +00:00
|
|
|
RNA_def_property_array(prop, 3);
|
|
|
|
RNA_def_property_float_sdna(prop, NULL, "bundle_pos");
|
|
|
|
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
|
|
|
|
RNA_def_property_ui_text(prop, "Bundle", "Position of bundle reconstructed from this track");
|
2012-04-10 08:33:30 +00:00
|
|
|
RNA_def_property_ui_range(prop, -FLT_MAX, FLT_MAX, 1, RNA_TRANSLATION_PREC_DEFAULT);
|
2011-11-07 12:55:18 +00:00
|
|
|
|
|
|
|
/* hide */
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "hide", PROP_BOOLEAN, PROP_NONE);
|
2011-11-07 12:55:18 +00:00
|
|
|
RNA_def_property_boolean_sdna(prop, NULL, "flag", TRACK_HIDDEN);
|
2012-02-15 16:06:48 +00:00
|
|
|
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
|
2011-11-07 12:55:18 +00:00
|
|
|
RNA_def_property_ui_text(prop, "Hide", "Track is hidden");
|
2012-06-10 19:59:02 +00:00
|
|
|
RNA_def_property_update(prop, NC_MOVIECLIP | ND_DISPLAY, NULL);
|
2011-11-07 12:55:18 +00:00
|
|
|
|
2011-11-15 12:20:58 +00:00
|
|
|
/* select */
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "select", PROP_BOOLEAN, PROP_NONE);
|
2011-11-15 12:20:58 +00:00
|
|
|
RNA_def_property_boolean_funcs(prop, "rna_trackingTrack_select_get", "rna_trackingTrack_select_set");
|
|
|
|
RNA_def_property_ui_text(prop, "Select", "Track is selected");
|
2012-06-10 19:59:02 +00:00
|
|
|
RNA_def_property_update(prop, NC_MOVIECLIP | ND_DISPLAY, NULL);
|
2011-11-15 12:20:58 +00:00
|
|
|
|
|
|
|
/* select_anchor */
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "select_anchor", PROP_BOOLEAN, PROP_NONE);
|
2011-11-15 12:20:58 +00:00
|
|
|
RNA_def_property_boolean_sdna(prop, NULL, "flag", SELECT);
|
|
|
|
RNA_def_property_ui_text(prop, "Select Anchor", "Track's anchor point is selected");
|
2012-06-10 19:59:02 +00:00
|
|
|
RNA_def_property_update(prop, NC_MOVIECLIP | ND_DISPLAY, NULL);
|
2011-11-15 12:20:58 +00:00
|
|
|
|
|
|
|
/* select_pattern */
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "select_pattern", PROP_BOOLEAN, PROP_NONE);
|
2011-11-15 12:20:58 +00:00
|
|
|
RNA_def_property_boolean_sdna(prop, NULL, "pat_flag", SELECT);
|
|
|
|
RNA_def_property_ui_text(prop, "Select Pattern", "Track's pattern area is selected");
|
2012-06-10 19:59:02 +00:00
|
|
|
RNA_def_property_update(prop, NC_MOVIECLIP | ND_DISPLAY, NULL);
|
2011-11-15 12:20:58 +00:00
|
|
|
|
|
|
|
/* select_search */
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "select_search", PROP_BOOLEAN, PROP_NONE);
|
2011-11-15 12:20:58 +00:00
|
|
|
RNA_def_property_boolean_sdna(prop, NULL, "search_flag", SELECT);
|
|
|
|
RNA_def_property_ui_text(prop, "Select Search", "Track's search area is selected");
|
2012-06-10 19:59:02 +00:00
|
|
|
RNA_def_property_update(prop, NC_MOVIECLIP | ND_DISPLAY, NULL);
|
2011-11-15 12:20:58 +00:00
|
|
|
|
2011-11-07 12:55:18 +00:00
|
|
|
/* locked */
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "lock", PROP_BOOLEAN, PROP_NONE);
|
2011-11-07 12:55:18 +00:00
|
|
|
RNA_def_property_boolean_sdna(prop, NULL, "flag", TRACK_LOCKED);
|
2012-02-15 16:06:48 +00:00
|
|
|
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
|
2011-11-07 12:55:18 +00:00
|
|
|
RNA_def_property_ui_text(prop, "Lock", "Track is locked and all changes to it are disabled");
|
2012-06-10 19:59:02 +00:00
|
|
|
RNA_def_property_update(prop, NC_MOVIECLIP | ND_DISPLAY, NULL);
|
2011-11-07 12:55:18 +00:00
|
|
|
|
|
|
|
/* custom color */
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "use_custom_color", PROP_BOOLEAN, PROP_NONE);
|
2011-11-07 12:55:18 +00:00
|
|
|
RNA_def_property_boolean_sdna(prop, NULL, "flag", TRACK_CUSTOMCOLOR);
|
2012-02-15 16:06:48 +00:00
|
|
|
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
|
2011-11-07 12:55:18 +00:00
|
|
|
RNA_def_property_ui_text(prop, "Custom Color", "Use custom color instead of theme-defined");
|
2012-06-10 19:59:02 +00:00
|
|
|
RNA_def_property_update(prop, NC_MOVIECLIP | ND_DISPLAY, NULL);
|
2011-11-07 12:55:18 +00:00
|
|
|
|
|
|
|
/* color */
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "color", PROP_FLOAT, PROP_COLOR);
|
2011-11-07 12:55:18 +00:00
|
|
|
RNA_def_property_array(prop, 3);
|
|
|
|
RNA_def_property_range(prop, 0.0f, 1.0f);
|
2012-03-18 09:27:36 +00:00
|
|
|
RNA_def_property_ui_text(prop, "Color",
|
2012-04-14 15:44:31 +00:00
|
|
|
"Color of the track in the Movie Clip Editor and the 3D viewport after a solve");
|
2012-06-10 19:59:02 +00:00
|
|
|
RNA_def_property_update(prop, NC_MOVIECLIP | ND_DISPLAY, NULL);
|
2011-11-07 12:55:18 +00:00
|
|
|
|
|
|
|
/* average error */
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "average_error", PROP_FLOAT, PROP_NONE);
|
2011-11-07 12:55:18 +00:00
|
|
|
RNA_def_property_float_sdna(prop, NULL, "error");
|
|
|
|
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
|
|
|
|
RNA_def_property_ui_text(prop, "Average Error", "Average error of re-projection");
|
2012-06-10 15:26:50 +00:00
|
|
|
|
|
|
|
/* grease pencil */
|
|
|
|
prop = RNA_def_property(srna, "grease_pencil", PROP_POINTER, PROP_NONE);
|
|
|
|
RNA_def_property_pointer_sdna(prop, NULL, "gpd");
|
|
|
|
RNA_def_property_struct_type(prop, "GreasePencil");
|
2018-07-31 10:22:19 +02:00
|
|
|
RNA_def_property_pointer_funcs(prop, NULL, NULL, NULL, "rna_GPencil_datablocks_annotations_poll");
|
Grease Pencil - Storyboarding Features (merge from GPencil_EditStrokes branch)
This merge-commit brings in a number of new features and workflow/UI improvements for
working with Grease Pencil. While these were originally targetted at improving
the workflow for creating 3D storyboards in Blender using the Grease Pencil,
many of these changes should also prove useful in other workflows too.
The main highlights here are:
1) It is now possible to edit Grease Pencil strokes
- Use D Tab, or toggle the "Enable Editing" toggles in the Toolbar/Properties regions
to enter "Stroke Edit Mode". In this mode, many common editing tools will
operate on Grease Pencil stroke points instead.
- Tools implemented include Select, Select All/Border/Circle/Linked/More/Less,
Grab, Rotate, Scale, Bend, Shear, To Sphere, Mirror, Duplicate, Delete.
- Proportional Editing works when using the transform tools
2) Grease Pencil stroke settings can now be animated
NOTE: Currently drivers don't work, but if time allows, this may still be
added before the release.
3) Strokes can be drawn with "filled" interiors, using a separate set of
colour/opacity settings to the ones used for the lines themselves.
This makes use of OpenGL filled polys, which has the limitation of only
being able to fill convex shapes. Some artifacts may be visible on concave
shapes (e.g. pacman's mouth will be overdrawn)
4) "Volumetric Strokes" - An alternative drawing technique for stroke drawing
has been added which draws strokes as a series of screen-aligned discs.
While this was originally a partial experimental technique at getting better
quality 3D lines, the effects possible using this technique were interesting
enough to warrant making this a dedicated feature. Best results when partial
opacity and large stroke widths are used.
5) Improved Onion Skinning Support
- Different colours can be selected for the before/after ghosts. To do so,
enable the "colour wheel" toggle beside the Onion Skinning toggle, and set
the colours accordingly.
- Different numbers of ghosts can be shown before/after the current frame
6) Grease Pencil datablocks are now attached to the scene by default instead of
the active object.
- For a long time, the object-attachment has proved to be quite problematic
for users to keep track of. Now that this is done at scene level, it is
easier for most users to use.
- An exception for old files (and for any addons which may benefit from object
attachment instead), is that if the active object has a Grease Pencil datablock,
that will be used instead.
- It is not currently possible to choose object-attachment from the UI, but
it is simple to do this from the console instead, by doing:
context.active_object.grease_pencil = bpy.data.grease_pencil["blah"]
7) Various UI Cleanups
- The layers UI has been cleaned up to use a list instead of the nested-panels
design. Apart from saving space, this is also much nicer to look at now.
- The UI code is now all defined in Python. To support this, it has been necessary
to add some new context properties to make it easier to access these settings.
e.g. "gpencil_data" for the datablock
"active_gpencil_layer" and "active_gpencil_frame" for active data,
"editable_gpencil_strokes" for the strokes that can be edited
- The "stroke placement/alignment" settings (previously "Drawing Settings" at the
bottom of the Grease Pencil panel in the Properties Region) is now located in
the toolbar. These were more toolsettings than properties for how GPencil got drawn.
- "Use Sketching Sessions" has been renamed "Continuous Drawing", as per a
suggestion for an earlier discussion on developer.blender.org
- By default, the painting operator will wait for a mouse button to be pressed
before it starts creating the stroke. This is to make it easier to include
this operator in various toolbars/menus/etc. To get it immediately starting
(as when you hold down DKEy to draw), set "wait_for_input" to False.
- GPencil Layers can be rearranged in the "Grease Pencil" mode of the Action Editor
- Toolbar panels have been added to all the other editors which support these.
8) Pie menus for quick-access to tools
A set of experimental pie menus has been included for quick access to many
tools and settings. It is not necessary to use these to get things done,
but they have been designed to help make certain common tasks easier.
- Ctrl-D = The main pie menu. Reveals tools in a context sensitive and
spatially stable manner.
- D Q = "Quick Settings" pie. This allows quick access to the active
layer's settings. Notably, colours, thickness, and turning
onion skinning on/off.
2014-12-01 01:52:06 +13:00
|
|
|
RNA_def_property_flag(prop, PROP_EDITABLE | PROP_ID_REFCOUNT);
|
2012-06-10 15:26:50 +00:00
|
|
|
RNA_def_property_ui_text(prop, "Grease Pencil", "Grease pencil data for this track");
|
|
|
|
RNA_def_property_update(prop, NC_MOVIECLIP | ND_DISPLAY, NULL);
|
2013-10-26 13:22:38 +00:00
|
|
|
|
|
|
|
/* weight */
|
|
|
|
prop = RNA_def_property(srna, "weight", PROP_FLOAT, PROP_FACTOR);
|
|
|
|
RNA_def_property_float_sdna(prop, NULL, "weight");
|
|
|
|
RNA_def_property_range(prop, 0.0f, 1.0f);
|
2013-11-04 18:58:22 +00:00
|
|
|
RNA_def_property_ui_text(prop, "Weight", "Influence of this track on a final solution");
|
2013-11-20 15:55:23 +06:00
|
|
|
|
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
|
|
|
/* weight_stab */
|
|
|
|
prop = RNA_def_property(srna, "weight_stab", PROP_FLOAT, PROP_FACTOR);
|
|
|
|
RNA_def_property_float_sdna(prop, NULL, "weight_stab");
|
|
|
|
RNA_def_property_range(prop, 0.0f, 1.0f);
|
|
|
|
RNA_def_property_ui_text(prop, "Stab Weight", "Influence of this track on 2D stabilization");
|
|
|
|
|
2013-11-20 15:55:23 +06:00
|
|
|
/* offset */
|
|
|
|
prop = RNA_def_property(srna, "offset", PROP_FLOAT, PROP_TRANSLATION);
|
|
|
|
RNA_def_property_array(prop, 2);
|
|
|
|
RNA_def_property_ui_range(prop, -FLT_MAX, FLT_MAX, 1, RNA_TRANSLATION_PREC_DEFAULT);
|
|
|
|
RNA_def_property_float_sdna(prop, NULL, "offset");
|
|
|
|
RNA_def_property_ui_text(prop, "Offset", "Offset of track from the parenting point");
|
|
|
|
RNA_def_property_update(prop, NC_MOVIECLIP | NA_EDITED, NULL);
|
2011-11-07 12:55:18 +00: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 09:46:30 +00:00
|
|
|
static void rna_def_trackingPlaneMarker(BlenderRNA *brna)
|
|
|
|
{
|
|
|
|
StructRNA *srna;
|
|
|
|
PropertyRNA *prop;
|
|
|
|
|
|
|
|
srna = RNA_def_struct(brna, "MovieTrackingPlaneMarker", NULL);
|
|
|
|
RNA_def_struct_ui_text(srna, "Movie Tracking Plane Marker Data", "Match-moving plane marker data for tracking");
|
|
|
|
|
|
|
|
/* frame */
|
|
|
|
prop = RNA_def_property(srna, "frame", PROP_INT, PROP_NONE);
|
|
|
|
RNA_def_property_int_sdna(prop, NULL, "framenr");
|
|
|
|
RNA_def_property_ui_text(prop, "Frame", "Frame number marker is keyframed on");
|
|
|
|
RNA_def_property_int_funcs(prop, NULL, "rna_trackingPlaneMarker_frame_set", NULL);
|
2013-09-11 21:27:14 +00:00
|
|
|
RNA_def_property_update(prop, NC_MOVIECLIP | NA_EDITED, NULL);
|
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 09:46:30 +00:00
|
|
|
|
|
|
|
/* Corners */
|
|
|
|
prop = RNA_def_property(srna, "corners", PROP_FLOAT, PROP_MATRIX);
|
|
|
|
RNA_def_property_float_sdna(prop, NULL, "corners");
|
|
|
|
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
|
|
|
|
RNA_def_property_multi_array(prop, 2, rna_matrix_dimsize_4x2);
|
|
|
|
RNA_def_property_ui_range(prop, -FLT_MAX, FLT_MAX, 1, RNA_TRANSLATION_PREC_DEFAULT);
|
|
|
|
RNA_def_property_ui_text(prop, "Corners",
|
2013-08-19 18:37:00 +00:00
|
|
|
"Array of coordinates which represents UI rectangle corners in "
|
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 09:46:30 +00:00
|
|
|
"frame normalized coordinates");
|
|
|
|
RNA_def_property_update(prop, NC_MOVIECLIP | NA_EDITED, NULL);
|
|
|
|
|
|
|
|
/* enable */
|
|
|
|
prop = RNA_def_property(srna, "mute", PROP_BOOLEAN, PROP_NONE);
|
|
|
|
RNA_def_property_boolean_sdna(prop, NULL, "flag", PLANE_MARKER_DISABLED);
|
|
|
|
RNA_def_property_ui_text(prop, "Mode", "Is marker muted for current frame");
|
|
|
|
RNA_def_property_update(prop, NC_MOVIECLIP | NA_EDITED, NULL);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void rna_def_trackingPlaneMarkers(BlenderRNA *brna, PropertyRNA *cprop)
|
|
|
|
{
|
|
|
|
StructRNA *srna;
|
2013-08-23 09:10:23 +00:00
|
|
|
FunctionRNA *func;
|
|
|
|
PropertyRNA *parm;
|
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 09:46:30 +00:00
|
|
|
|
|
|
|
RNA_def_property_srna(cprop, "MovieTrackingPlaneMarkers");
|
|
|
|
srna = RNA_def_struct(brna, "MovieTrackingPlaneMarkers", NULL);
|
|
|
|
RNA_def_struct_sdna(srna, "MovieTrackingPlaneTrack");
|
2013-08-19 18:37:00 +00:00
|
|
|
RNA_def_struct_ui_text(srna, "Movie Tracking Plane Markers",
|
|
|
|
"Collection of markers for movie tracking plane track");
|
2013-08-23 09:10:23 +00:00
|
|
|
|
|
|
|
func = RNA_def_function(srna, "find_frame", "rna_trackingPlaneMarkers_find_frame");
|
|
|
|
RNA_def_function_ui_description(func, "Get plane marker for specified frame");
|
|
|
|
parm = RNA_def_int(func, "frame", 1, MINFRAME, MAXFRAME, "Frame",
|
|
|
|
"Frame number to find marker for", MINFRAME, MAXFRAME);
|
Refactor RNA property: split flags in property flags, parameter flags, and internal flags.
This gives us 9 flags available again for properties (we had none anymore),
and also makes things slightly cleaner.
To simplify (and make more clear the differences between mere properties
and function parameters), also added RNA_def_parameter_flags function (and
its clear counterpart), to be used instead of RNA_def_property_flag for
function parameters.
This patch is also a big cleanup (some RNA function definitions were
still using 'prop' PropertyRNA pointer, etc.).
And yes, am aware this will be annoying for all branches, but we really need
to get new flags available for properties (will need at least one for override, etc.).
Reviewers: sergey, Severin
Subscribers: dfelinto, brecht
Differential Revision: https://developer.blender.org/D2400
2016-12-12 15:23:55 +01:00
|
|
|
RNA_def_parameter_flags(parm, 0, PARM_REQUIRED);
|
2014-04-01 11:34:00 +11:00
|
|
|
RNA_def_boolean(func, "exact", true, "Exact",
|
2013-08-23 09:10:23 +00:00
|
|
|
"Get plane marker at exact frame number rather than get estimated marker");
|
|
|
|
parm = RNA_def_pointer(func, "plane_marker", "MovieTrackingPlaneMarker", "", "Plane marker for specified frame");
|
|
|
|
RNA_def_function_return(func, parm);
|
|
|
|
|
|
|
|
func = RNA_def_function(srna, "insert_frame", "rna_trackingPlaneMarkers_insert_frame");
|
|
|
|
RNA_def_function_ui_description(func, "Insert a new plane marker at the specified frame");
|
|
|
|
parm = RNA_def_int(func, "frame", 1, MINFRAME, MAXFRAME, "Frame",
|
|
|
|
"Frame number to insert marker to", MINFRAME, MAXFRAME);
|
Refactor RNA property: split flags in property flags, parameter flags, and internal flags.
This gives us 9 flags available again for properties (we had none anymore),
and also makes things slightly cleaner.
To simplify (and make more clear the differences between mere properties
and function parameters), also added RNA_def_parameter_flags function (and
its clear counterpart), to be used instead of RNA_def_property_flag for
function parameters.
This patch is also a big cleanup (some RNA function definitions were
still using 'prop' PropertyRNA pointer, etc.).
And yes, am aware this will be annoying for all branches, but we really need
to get new flags available for properties (will need at least one for override, etc.).
Reviewers: sergey, Severin
Subscribers: dfelinto, brecht
Differential Revision: https://developer.blender.org/D2400
2016-12-12 15:23:55 +01:00
|
|
|
RNA_def_parameter_flags(parm, 0, PARM_REQUIRED);
|
2013-08-23 09:10:23 +00:00
|
|
|
parm = RNA_def_pointer(func, "plane_marker", "MovieTrackingPlaneMarker", "", "Newly created plane marker");
|
|
|
|
RNA_def_function_return(func, parm);
|
|
|
|
|
|
|
|
func = RNA_def_function(srna, "delete_frame", "rna_trackingPlaneMarkers_delete_frame");
|
|
|
|
RNA_def_function_ui_description(func, "Delete plane marker at specified frame");
|
|
|
|
parm = RNA_def_int(func, "frame", 1, MINFRAME, MAXFRAME, "Frame",
|
|
|
|
"Frame number to delete plane marker from", MINFRAME, MAXFRAME);
|
Refactor RNA property: split flags in property flags, parameter flags, and internal flags.
This gives us 9 flags available again for properties (we had none anymore),
and also makes things slightly cleaner.
To simplify (and make more clear the differences between mere properties
and function parameters), also added RNA_def_parameter_flags function (and
its clear counterpart), to be used instead of RNA_def_property_flag for
function parameters.
This patch is also a big cleanup (some RNA function definitions were
still using 'prop' PropertyRNA pointer, etc.).
And yes, am aware this will be annoying for all branches, but we really need
to get new flags available for properties (will need at least one for override, etc.).
Reviewers: sergey, Severin
Subscribers: dfelinto, brecht
Differential Revision: https://developer.blender.org/D2400
2016-12-12 15:23:55 +01:00
|
|
|
RNA_def_parameter_flags(parm, 0, PARM_REQUIRED);
|
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 09:46:30 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static void rna_def_trackingPlaneTrack(BlenderRNA *brna)
|
|
|
|
{
|
|
|
|
StructRNA *srna;
|
|
|
|
PropertyRNA *prop;
|
|
|
|
|
|
|
|
rna_def_trackingPlaneMarker(brna);
|
|
|
|
|
|
|
|
srna = RNA_def_struct(brna, "MovieTrackingPlaneTrack", NULL);
|
|
|
|
RNA_def_struct_path_func(srna, "rna_trackingPlaneTrack_path");
|
|
|
|
RNA_def_struct_ui_text(srna, "Movie tracking plane track data", "Match-moving plane track data for tracking");
|
|
|
|
RNA_def_struct_ui_icon(srna, ICON_ANIM_DATA);
|
|
|
|
|
|
|
|
/* name */
|
|
|
|
prop = RNA_def_property(srna, "name", PROP_STRING, PROP_NONE);
|
|
|
|
RNA_def_property_ui_text(prop, "Name", "Unique name of track");
|
|
|
|
RNA_def_property_string_funcs(prop, NULL, NULL, "rna_trackingPlaneTrack_name_set");
|
|
|
|
RNA_def_property_string_maxlength(prop, MAX_ID_NAME - 2);
|
|
|
|
RNA_def_property_update(prop, NC_MOVIECLIP | NA_EDITED, NULL);
|
|
|
|
RNA_def_struct_name_property(srna, prop);
|
|
|
|
|
|
|
|
/* markers */
|
|
|
|
prop = RNA_def_property(srna, "markers", PROP_COLLECTION, PROP_NONE);
|
|
|
|
RNA_def_property_struct_type(prop, "MovieTrackingPlaneMarker");
|
|
|
|
RNA_def_property_collection_sdna(prop, NULL, "markers", "markersnr");
|
|
|
|
RNA_def_property_ui_text(prop, "Markers", "Collection of markers in track");
|
|
|
|
rna_def_trackingPlaneMarkers(brna, prop);
|
|
|
|
|
|
|
|
/* select */
|
|
|
|
prop = RNA_def_property(srna, "select", PROP_BOOLEAN, PROP_NONE);
|
|
|
|
RNA_def_property_boolean_sdna(prop, NULL, "flag", SELECT);
|
|
|
|
RNA_def_property_ui_text(prop, "Select", "Plane track is selected");
|
|
|
|
RNA_def_property_update(prop, NC_MOVIECLIP | ND_DISPLAY, NULL);
|
2013-09-10 12:46:18 +00:00
|
|
|
|
|
|
|
/* auto keyframing */
|
|
|
|
prop = RNA_def_property(srna, "use_auto_keying", PROP_BOOLEAN, PROP_NONE);
|
|
|
|
RNA_def_property_boolean_sdna(prop, NULL, "flag", PLANE_TRACK_AUTOKEY);
|
2017-12-19 12:59:52 +01:00
|
|
|
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
|
2013-09-10 12:46:18 +00:00
|
|
|
RNA_def_property_ui_text(prop, "Auto Keyframe", "Automatic keyframe insertion when moving plane corners");
|
|
|
|
RNA_def_property_ui_icon(prop, ICON_REC, 0);
|
2013-11-29 23:26:57 +06:00
|
|
|
|
|
|
|
/* image */
|
|
|
|
prop = RNA_def_property(srna, "image", PROP_POINTER, PROP_NONE);
|
|
|
|
RNA_def_property_struct_type(prop, "Image");
|
|
|
|
RNA_def_property_flag(prop, PROP_EDITABLE);
|
|
|
|
RNA_def_property_ui_text(prop, "Image", "Image displayed in the track during editing in clip editor");
|
|
|
|
RNA_def_property_update(prop, NC_MOVIECLIP | ND_DISPLAY, NULL);
|
|
|
|
|
|
|
|
/* image opacity */
|
2013-12-12 13:51:04 +06:00
|
|
|
prop = RNA_def_property(srna, "image_opacity", PROP_FLOAT, PROP_FACTOR);
|
2013-11-29 23:26:57 +06:00
|
|
|
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
|
|
|
|
RNA_def_property_range(prop, 0.0, 1.0);
|
|
|
|
RNA_def_property_ui_text(prop, "Image Opacity", "Opacity of the image");
|
|
|
|
RNA_def_property_update(prop, NC_MOVIECLIP | ND_DISPLAY, NULL);
|
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 09:46:30 +00:00
|
|
|
}
|
|
|
|
|
2011-11-07 12:55:18 +00:00
|
|
|
static void rna_def_trackingStabilization(BlenderRNA *brna)
|
|
|
|
{
|
|
|
|
StructRNA *srna;
|
|
|
|
PropertyRNA *prop;
|
|
|
|
|
2017-10-18 15:07:26 +11:00
|
|
|
static const EnumPropertyItem filter_items[] = {
|
2016-08-17 12:53:03 +02:00
|
|
|
{TRACKING_FILTER_NEAREST, "NEAREST", 0, "Nearest", "No interpolation, use nearest neighbor pixel"},
|
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
|
|
|
{TRACKING_FILTER_BILINEAR, "BILINEAR", 0, "Bilinear", "Simple interpolation between adjacent pixels"},
|
|
|
|
{TRACKING_FILTER_BICUBIC, "BICUBIC", 0, "Bicubic", "High quality pixel interpolation"},
|
2019-02-03 14:01:45 +11:00
|
|
|
{0, NULL, 0, NULL, NULL},
|
2012-06-10 19:59:02 +00:00
|
|
|
};
|
2012-02-16 15:03:37 +00:00
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
srna = RNA_def_struct(brna, "MovieTrackingStabilization", NULL);
|
2012-02-15 16:06:48 +00:00
|
|
|
RNA_def_struct_path_func(srna, "rna_trackingStabilization_path");
|
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
|
|
|
RNA_def_struct_ui_text(srna, "Movie tracking stabilization data", "2D stabilization based on tracking markers");
|
2011-11-07 12:55:18 +00:00
|
|
|
|
|
|
|
/* 2d stabilization */
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "use_2d_stabilization", PROP_BOOLEAN, PROP_NONE);
|
2011-11-07 12:55:18 +00:00
|
|
|
RNA_def_property_boolean_sdna(prop, NULL, "flag", TRACKING_2D_STABILIZATION);
|
2012-02-15 16:06:48 +00:00
|
|
|
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
|
2011-11-07 12:55:18 +00:00
|
|
|
RNA_def_property_ui_text(prop, "Use 2D stabilization", "Use 2D stabilization for footage");
|
2012-06-10 19:59:02 +00:00
|
|
|
RNA_def_property_update(prop, NC_MOVIECLIP | ND_DISPLAY, "rna_tracking_flushUpdate");
|
2011-11-07 12:55:18 +00:00
|
|
|
|
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
|
|
|
/* use_stabilize_rotation */
|
|
|
|
prop = RNA_def_property(srna, "use_stabilize_rotation", PROP_BOOLEAN, PROP_NONE);
|
|
|
|
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
|
|
|
|
RNA_def_property_boolean_sdna(prop, NULL, "flag", TRACKING_STABILIZE_ROTATION);
|
|
|
|
RNA_def_property_ui_text(prop, "Stabilize Rotation", "Stabilize detected rotation around center of frame");
|
|
|
|
RNA_def_property_update(prop, NC_MOVIECLIP | ND_DISPLAY, "rna_tracking_flushUpdate");
|
|
|
|
|
|
|
|
/* use_stabilize_scale */
|
|
|
|
prop = RNA_def_property(srna, "use_stabilize_scale", PROP_BOOLEAN, PROP_NONE);
|
|
|
|
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
|
|
|
|
RNA_def_property_boolean_sdna(prop, NULL, "flag", TRACKING_STABILIZE_SCALE);
|
|
|
|
RNA_def_property_ui_text(prop, "Stabilize Scale", "Compensate any scale changes relative to center of rotation");
|
|
|
|
RNA_def_property_update(prop, NC_MOVIECLIP | ND_DISPLAY, "rna_tracking_flushUpdate");
|
|
|
|
|
2011-11-07 12:55:18 +00:00
|
|
|
/* tracks */
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "tracks", PROP_COLLECTION, PROP_NONE);
|
2012-03-18 09:27:36 +00:00
|
|
|
RNA_def_property_collection_funcs(prop, "rna_tracking_stabTracks_begin", "rna_iterator_listbase_next",
|
|
|
|
"rna_iterator_listbase_end", "rna_iterator_listbase_get",
|
|
|
|
NULL, NULL, NULL, NULL);
|
2011-11-07 12:55:18 +00:00
|
|
|
RNA_def_property_struct_type(prop, "MovieTrackingTrack");
|
2016-08-17 12:53:03 +02:00
|
|
|
RNA_def_property_ui_text(prop, "Translation Tracks",
|
|
|
|
"Collection of tracks used for 2D stabilization (translation)");
|
2012-06-10 19:59:02 +00:00
|
|
|
RNA_def_property_update(prop, NC_MOVIECLIP | ND_DISPLAY, "rna_tracking_flushUpdate");
|
2011-11-07 12:55:18 +00:00
|
|
|
|
|
|
|
/* active track index */
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "active_track_index", PROP_INT, PROP_NONE);
|
2011-11-07 12:55:18 +00:00
|
|
|
RNA_def_property_int_sdna(prop, NULL, "act_track");
|
2012-02-15 16:06:48 +00:00
|
|
|
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
|
2012-03-18 09:27:36 +00:00
|
|
|
RNA_def_property_int_funcs(prop, "rna_tracking_stabTracks_active_index_get",
|
|
|
|
"rna_tracking_stabTracks_active_index_set",
|
|
|
|
"rna_tracking_stabTracks_active_index_range");
|
2016-08-17 12:53:03 +02:00
|
|
|
RNA_def_property_ui_text(prop, "Active Track Index",
|
|
|
|
"Index of active track in translation stabilization tracks list");
|
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
|
|
|
|
|
|
|
/* tracks used for rotation stabilization */
|
|
|
|
prop = RNA_def_property(srna, "rotation_tracks", PROP_COLLECTION, PROP_NONE);
|
|
|
|
RNA_def_property_collection_funcs(prop, "rna_tracking_stabRotTracks_begin", "rna_iterator_listbase_next",
|
|
|
|
"rna_iterator_listbase_end", "rna_iterator_listbase_get",
|
|
|
|
NULL, NULL, NULL, NULL);
|
|
|
|
RNA_def_property_struct_type(prop, "MovieTrackingTrack");
|
|
|
|
RNA_def_property_ui_text(prop, "Rotation Tracks", "Collection of tracks used for 2D stabilization (translation)");
|
|
|
|
RNA_def_property_update(prop, NC_MOVIECLIP | ND_DISPLAY, "rna_tracking_flushUpdate");
|
|
|
|
|
|
|
|
/* active rotation track index */
|
|
|
|
prop = RNA_def_property(srna, "active_rotation_track_index", PROP_INT, PROP_NONE);
|
|
|
|
RNA_def_property_int_sdna(prop, NULL, "act_rot_track");
|
|
|
|
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
|
|
|
|
RNA_def_property_int_funcs(prop, "rna_tracking_stabRotTracks_active_index_get",
|
|
|
|
"rna_tracking_stabRotTracks_active_index_set",
|
|
|
|
"rna_tracking_stabRotTracks_active_index_range");
|
2016-08-17 12:53:03 +02:00
|
|
|
RNA_def_property_ui_text(prop, "Active Rotation Track Index",
|
|
|
|
"Index of active track in rotation stabilization tracks list");
|
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
|
|
|
|
|
|
|
/* anchor frame */
|
|
|
|
prop = RNA_def_property(srna, "anchor_frame", PROP_INT, PROP_NONE);
|
|
|
|
RNA_def_property_int_sdna(prop, NULL, "anchor_frame");
|
|
|
|
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
|
|
|
|
RNA_def_property_range(prop, MINFRAME, MAXFRAME);
|
2016-08-17 12:53:03 +02:00
|
|
|
RNA_def_property_ui_text(prop, "Anchor Frame",
|
|
|
|
"Reference point to anchor stabilization "
|
|
|
|
"(other frames will be adjusted relative to this frame's position)");
|
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
|
|
|
RNA_def_property_update(prop, NC_MOVIECLIP | ND_DISPLAY, "rna_tracking_flushUpdate");
|
|
|
|
|
|
|
|
/* target position */
|
2016-08-17 10:36:38 +02:00
|
|
|
prop = RNA_def_property(srna, "target_position", PROP_FLOAT, PROP_TRANSLATION);
|
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
|
|
|
RNA_def_property_array(prop, 2);
|
|
|
|
RNA_def_property_ui_range(prop, -FLT_MAX, FLT_MAX, 1, 3); /* increment in steps of 0.01 and show 3 digit after point */
|
|
|
|
RNA_def_property_float_sdna(prop, NULL, "target_pos");
|
2016-08-17 12:53:03 +02:00
|
|
|
RNA_def_property_ui_text(prop, "Expected Position",
|
|
|
|
"Known relative offset of original shot, will be subtracted "
|
|
|
|
"(e.g. for panning shot, can be animated)");
|
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
|
|
|
RNA_def_property_update(prop, NC_MOVIECLIP | ND_DISPLAY, NULL);
|
|
|
|
|
|
|
|
/* target rotation */
|
2016-08-17 10:36:38 +02:00
|
|
|
prop = RNA_def_property(srna, "target_rotation", PROP_FLOAT, PROP_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
|
|
|
RNA_def_property_float_sdna(prop, NULL, "target_rot");
|
|
|
|
RNA_def_property_range(prop, -FLT_MAX, FLT_MAX);
|
2016-08-22 17:22:06 +02:00
|
|
|
RNA_def_property_ui_range(prop, -FLT_MAX, FLT_MAX, 10.0f, 3);
|
2016-08-17 12:53:03 +02:00
|
|
|
RNA_def_property_ui_text(prop, "Expected Rotation",
|
|
|
|
"Rotation present on original shot, will be compensated (e.g. for deliberate tilting)");
|
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
|
|
|
RNA_def_property_update(prop, NC_MOVIECLIP | ND_DISPLAY, NULL);
|
|
|
|
|
|
|
|
/* target scale */
|
2016-08-19 14:33:49 +02:00
|
|
|
prop = RNA_def_property(srna, "target_scale", PROP_FLOAT, PROP_FACTOR);
|
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
|
|
|
RNA_def_property_float_sdna(prop, NULL, "scale");
|
2016-08-22 17:22:06 +02:00
|
|
|
RNA_def_property_range(prop, FLT_EPSILON, FLT_MAX);
|
|
|
|
RNA_def_property_ui_range(prop, 0.01f, 10.0f, 0.001f, 3); /* increment in steps of 0.001. Show 3 digit after point */
|
|
|
|
RNA_def_property_ui_text(prop, "Expected Scale",
|
2016-08-17 12:53:03 +02:00
|
|
|
"Explicitly scale resulting frame to compensate zoom of original shot");
|
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
|
|
|
RNA_def_property_update(prop, NC_MOVIECLIP | ND_DISPLAY, "rna_tracking_flushUpdate");
|
2011-11-07 12:55:18 +00:00
|
|
|
|
|
|
|
/* autoscale */
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "use_autoscale", PROP_BOOLEAN, PROP_NONE);
|
2011-11-07 12:55:18 +00:00
|
|
|
RNA_def_property_boolean_sdna(prop, NULL, "flag", TRACKING_AUTOSCALE);
|
2012-02-15 16:06:48 +00:00
|
|
|
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
|
2012-03-18 09:27:36 +00:00
|
|
|
RNA_def_property_ui_text(prop, "Autoscale",
|
2012-07-04 15:52:07 +00:00
|
|
|
"Automatically scale footage to cover unfilled areas when stabilizing");
|
2012-06-10 19:59:02 +00:00
|
|
|
RNA_def_property_update(prop, NC_MOVIECLIP | ND_DISPLAY, "rna_tracking_flushUpdate");
|
2011-11-07 12:55:18 +00:00
|
|
|
|
|
|
|
/* max scale */
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "scale_max", PROP_FLOAT, PROP_FACTOR);
|
2011-11-07 12:55:18 +00:00
|
|
|
RNA_def_property_float_sdna(prop, NULL, "maxscale");
|
|
|
|
RNA_def_property_range(prop, 0.0f, 10.0f);
|
2011-11-29 14:49:47 +00:00
|
|
|
RNA_def_property_ui_text(prop, "Maximal Scale", "Limit the amount of automatic scaling");
|
2012-06-10 19:59:02 +00:00
|
|
|
RNA_def_property_update(prop, NC_MOVIECLIP | ND_DISPLAY, "rna_tracking_flushUpdate");
|
2011-11-07 12:55:18 +00:00
|
|
|
|
|
|
|
/* influence_location */
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "influence_location", PROP_FLOAT, PROP_FACTOR);
|
2011-11-07 12:55:18 +00:00
|
|
|
RNA_def_property_float_sdna(prop, NULL, "locinf");
|
|
|
|
RNA_def_property_range(prop, 0.0f, 1.0f);
|
|
|
|
RNA_def_property_ui_text(prop, "Location Influence", "Influence of stabilization algorithm on footage location");
|
2012-06-10 19:59:02 +00:00
|
|
|
RNA_def_property_update(prop, NC_MOVIECLIP | ND_DISPLAY, "rna_tracking_flushUpdate");
|
2011-11-07 12:55:18 +00:00
|
|
|
|
|
|
|
/* influence_scale */
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "influence_scale", PROP_FLOAT, PROP_FACTOR);
|
2011-11-07 12:55:18 +00:00
|
|
|
RNA_def_property_float_sdna(prop, NULL, "scaleinf");
|
|
|
|
RNA_def_property_range(prop, 0.0f, 1.0f);
|
|
|
|
RNA_def_property_ui_text(prop, "Scale Influence", "Influence of stabilization algorithm on footage scale");
|
2012-06-10 19:59:02 +00:00
|
|
|
RNA_def_property_update(prop, NC_MOVIECLIP | ND_DISPLAY, "rna_tracking_flushUpdate");
|
2011-11-07 12:55:18 +00:00
|
|
|
|
|
|
|
/* influence_rotation */
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "influence_rotation", PROP_FLOAT, PROP_FACTOR);
|
2011-11-07 12:55:18 +00:00
|
|
|
RNA_def_property_float_sdna(prop, NULL, "rotinf");
|
|
|
|
RNA_def_property_range(prop, 0.0f, 1.0f);
|
|
|
|
RNA_def_property_ui_text(prop, "Rotation Influence", "Influence of stabilization algorithm on footage rotation");
|
2012-06-10 19:59:02 +00:00
|
|
|
RNA_def_property_update(prop, NC_MOVIECLIP | ND_DISPLAY, "rna_tracking_flushUpdate");
|
2012-02-16 15:03:37 +00:00
|
|
|
|
|
|
|
/* filter */
|
|
|
|
prop = RNA_def_property(srna, "filter_type", PROP_ENUM, PROP_NONE);
|
|
|
|
RNA_def_property_enum_sdna(prop, NULL, "filter");
|
|
|
|
RNA_def_property_enum_items(prop, filter_items);
|
2016-08-17 12:53:03 +02:00
|
|
|
RNA_def_property_ui_text(prop, "Interpolate",
|
|
|
|
"Interpolation to use for sub-pixel shifts and rotations due to stabilization");
|
2012-06-10 19:59:02 +00:00
|
|
|
RNA_def_property_update(prop, NC_MOVIECLIP | ND_DISPLAY, "rna_tracking_flushUpdate");
|
2016-08-16 14:25:55 +02:00
|
|
|
|
|
|
|
/* UI display : show participating tracks */
|
|
|
|
prop = RNA_def_property(srna, "show_tracks_expanded", PROP_BOOLEAN, PROP_NONE);
|
|
|
|
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
|
|
|
|
RNA_def_property_boolean_sdna(prop, NULL, "flag", TRACKING_SHOW_STAB_TRACKS);
|
|
|
|
RNA_def_property_ui_text(prop, "Show Tracks", "Show UI list of tracks participating in stabilization");
|
2018-11-22 15:31:19 +11:00
|
|
|
RNA_def_property_ui_icon(prop, ICON_DISCLOSURE_TRI_RIGHT, 1);
|
2011-11-07 12:55:18 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static void rna_def_reconstructedCamera(BlenderRNA *brna)
|
|
|
|
{
|
|
|
|
StructRNA *srna;
|
|
|
|
PropertyRNA *prop;
|
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
srna = RNA_def_struct(brna, "MovieReconstructedCamera", NULL);
|
2012-03-18 09:27:36 +00:00
|
|
|
RNA_def_struct_ui_text(srna, "Movie tracking reconstructed camera data",
|
|
|
|
"Match-moving reconstructed camera data from tracker");
|
2011-11-07 12:55:18 +00:00
|
|
|
|
|
|
|
/* frame */
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "frame", PROP_INT, PROP_NONE);
|
2011-11-07 12:55:18 +00:00
|
|
|
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
|
|
|
|
RNA_def_property_int_sdna(prop, NULL, "framenr");
|
|
|
|
RNA_def_property_ui_text(prop, "Frame", "Frame number marker is keyframed on");
|
|
|
|
|
|
|
|
/* matrix */
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "matrix", PROP_FLOAT, PROP_MATRIX);
|
2011-11-07 12:55:18 +00:00
|
|
|
RNA_def_property_float_sdna(prop, NULL, "mat");
|
|
|
|
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
|
|
|
|
RNA_def_property_multi_array(prop, 2, rna_matrix_dimsize_4x4);
|
|
|
|
RNA_def_property_ui_text(prop, "Matrix", "Worldspace transformation matrix");
|
|
|
|
|
|
|
|
/* average_error */
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "average_error", PROP_FLOAT, PROP_NONE);
|
2011-11-07 12:55:18 +00:00
|
|
|
RNA_def_property_float_sdna(prop, NULL, "error");
|
|
|
|
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
|
2012-07-04 15:52:07 +00:00
|
|
|
RNA_def_property_ui_text(prop, "Average Error", "Average error of reconstruction");
|
2011-11-07 12:55:18 +00:00
|
|
|
}
|
|
|
|
|
2014-02-26 19:40:04 +06:00
|
|
|
static void rna_def_trackingReconstructedCameras(BlenderRNA *brna)
|
|
|
|
{
|
|
|
|
StructRNA *srna;
|
|
|
|
FunctionRNA *func;
|
|
|
|
PropertyRNA *parm;
|
|
|
|
|
|
|
|
srna = RNA_def_struct(brna, "MovieTrackingReconstructedCameras", NULL);
|
|
|
|
RNA_def_struct_sdna(srna, "MovieTrackingReconstruction");
|
|
|
|
RNA_def_struct_ui_text(srna, "Reconstructed Cameras", "Collection of solved cameras");
|
|
|
|
|
|
|
|
func = RNA_def_function(srna, "find_frame", "rna_trackingCameras_find_frame");
|
|
|
|
RNA_def_function_flag(func, FUNC_USE_SELF_ID);
|
|
|
|
RNA_def_function_ui_description(func, "Find a reconstructed camera for a give frame number");
|
|
|
|
RNA_def_int(func, "frame", 1, MINFRAME, MAXFRAME, "Frame", "Frame number to find camera for", MINFRAME, MAXFRAME);
|
|
|
|
parm = RNA_def_pointer(func, "camera", "MovieReconstructedCamera", "", "Camera for a given frame");
|
|
|
|
RNA_def_function_return(func, parm);
|
|
|
|
|
2014-02-27 08:38:14 +11:00
|
|
|
func = RNA_def_function(srna, "matrix_from_frame", "rna_trackingCameras_matrix_from_frame");
|
2014-02-26 19:40:04 +06:00
|
|
|
RNA_def_function_flag(func, FUNC_USE_SELF_ID);
|
|
|
|
RNA_def_function_ui_description(func, "Return interpolated camera matrix for a given frame");
|
|
|
|
RNA_def_int(func, "frame", 1, MINFRAME, MAXFRAME, "Frame", "Frame number to find camera for", MINFRAME, MAXFRAME);
|
2016-05-11 21:36:42 +10:00
|
|
|
parm = RNA_def_float_matrix(func, "matrix", 4, 4, NULL, -FLT_MAX, FLT_MAX, "Matrix",
|
|
|
|
"Interpolated camera matrix for a given frame", -FLT_MAX, FLT_MAX);
|
Refactor RNA property: split flags in property flags, parameter flags, and internal flags.
This gives us 9 flags available again for properties (we had none anymore),
and also makes things slightly cleaner.
To simplify (and make more clear the differences between mere properties
and function parameters), also added RNA_def_parameter_flags function (and
its clear counterpart), to be used instead of RNA_def_property_flag for
function parameters.
This patch is also a big cleanup (some RNA function definitions were
still using 'prop' PropertyRNA pointer, etc.).
And yes, am aware this will be annoying for all branches, but we really need
to get new flags available for properties (will need at least one for override, etc.).
Reviewers: sergey, Severin
Subscribers: dfelinto, brecht
Differential Revision: https://developer.blender.org/D2400
2016-12-12 15:23:55 +01:00
|
|
|
RNA_def_parameter_flags(parm, PROP_THICK_WRAP, 0); /* needed for string return value */
|
2014-02-26 19:40:04 +06:00
|
|
|
RNA_def_function_output(func, parm);
|
|
|
|
}
|
|
|
|
|
2011-11-07 12:55:18 +00:00
|
|
|
static void rna_def_trackingReconstruction(BlenderRNA *brna)
|
|
|
|
{
|
|
|
|
StructRNA *srna;
|
|
|
|
PropertyRNA *prop;
|
|
|
|
|
|
|
|
rna_def_reconstructedCamera(brna);
|
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
srna = RNA_def_struct(brna, "MovieTrackingReconstruction", NULL);
|
2012-03-18 09:27:36 +00:00
|
|
|
RNA_def_struct_ui_text(srna, "Movie tracking reconstruction data",
|
|
|
|
"Match-moving reconstruction data from tracker");
|
2011-11-07 12:55:18 +00:00
|
|
|
|
|
|
|
/* is_valid */
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "is_valid", PROP_BOOLEAN, PROP_NONE);
|
2011-11-07 12:55:18 +00:00
|
|
|
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
|
|
|
|
RNA_def_property_boolean_sdna(prop, NULL, "flag", TRACKING_RECONSTRUCTED);
|
|
|
|
RNA_def_property_ui_text(prop, "Reconstructed", "Is tracking data contains valid reconstruction information");
|
|
|
|
|
|
|
|
/* average_error */
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "average_error", PROP_FLOAT, PROP_NONE);
|
2011-11-07 12:55:18 +00:00
|
|
|
RNA_def_property_float_sdna(prop, NULL, "error");
|
|
|
|
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
|
2012-07-04 15:52:07 +00:00
|
|
|
RNA_def_property_ui_text(prop, "Average Error", "Average error of reconstruction");
|
2011-11-07 12:55:18 +00:00
|
|
|
|
|
|
|
/* cameras */
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "cameras", PROP_COLLECTION, PROP_NONE);
|
2011-11-07 12:55:18 +00:00
|
|
|
RNA_def_property_struct_type(prop, "MovieReconstructedCamera");
|
|
|
|
RNA_def_property_collection_sdna(prop, NULL, "cameras", "camnr");
|
|
|
|
RNA_def_property_ui_text(prop, "Cameras", "Collection of solved cameras");
|
2014-02-26 19:40:04 +06:00
|
|
|
RNA_def_property_srna(prop, "MovieTrackingReconstructedCameras");
|
|
|
|
|
2011-11-07 12:55:18 +00:00
|
|
|
}
|
|
|
|
|
2011-12-05 18:57:17 +00:00
|
|
|
static void rna_def_trackingTracks(BlenderRNA *brna)
|
2011-11-07 12:55:18 +00:00
|
|
|
{
|
|
|
|
StructRNA *srna;
|
|
|
|
FunctionRNA *func;
|
|
|
|
PropertyRNA *prop;
|
2013-01-07 11:28:27 +00:00
|
|
|
PropertyRNA *parm;
|
2011-11-07 12:55:18 +00:00
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
srna = RNA_def_struct(brna, "MovieTrackingTracks", NULL);
|
2011-11-07 12:55:18 +00:00
|
|
|
RNA_def_struct_sdna(srna, "MovieTracking");
|
|
|
|
RNA_def_struct_ui_text(srna, "Movie Tracks", "Collection of movie tracking tracks");
|
|
|
|
|
2013-01-07 11:28:27 +00:00
|
|
|
func = RNA_def_function(srna, "new", "rna_trackingTracks_new");
|
2011-12-05 18:57:17 +00:00
|
|
|
RNA_def_function_flag(func, FUNC_USE_SELF_ID);
|
2013-01-07 11:28:27 +00:00
|
|
|
RNA_def_function_ui_description(func, "Create new motion track in this movie clip");
|
2014-01-16 21:43:22 +11:00
|
|
|
RNA_def_string(func, "name", NULL, 0, "", "Name of new track");
|
2013-01-07 11:28:27 +00:00
|
|
|
RNA_def_int(func, "frame", 1, MINFRAME, MAXFRAME, "Frame", "Frame number to add track on", MINFRAME, MAXFRAME);
|
|
|
|
parm = RNA_def_pointer(func, "track", "MovieTrackingTrack", "", "Newly created track");
|
|
|
|
RNA_def_function_return(func, parm);
|
2011-11-07 12:55:18 +00:00
|
|
|
|
|
|
|
/* active track */
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "active", PROP_POINTER, PROP_NONE);
|
2011-11-07 12:55:18 +00:00
|
|
|
RNA_def_property_struct_type(prop, "MovieTrackingTrack");
|
|
|
|
RNA_def_property_pointer_funcs(prop, "rna_tracking_active_track_get", "rna_tracking_active_track_set", NULL, NULL);
|
2012-06-10 19:59:02 +00:00
|
|
|
RNA_def_property_flag(prop, PROP_EDITABLE | PROP_NEVER_UNLINK);
|
2011-11-07 12:55:18 +00:00
|
|
|
RNA_def_property_ui_text(prop, "Active Track", "Active track in this tracking data 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 09:46:30 +00:00
|
|
|
static void rna_def_trackingPlaneTracks(BlenderRNA *brna)
|
|
|
|
{
|
|
|
|
StructRNA *srna;
|
|
|
|
PropertyRNA *prop;
|
|
|
|
|
|
|
|
srna = RNA_def_struct(brna, "MovieTrackingPlaneTracks", NULL);
|
|
|
|
RNA_def_struct_sdna(srna, "MovieTracking");
|
|
|
|
RNA_def_struct_ui_text(srna, "Movie Plane Tracks", "Collection of movie tracking plane tracks");
|
|
|
|
|
2013-08-23 09:10:23 +00:00
|
|
|
/* TODO(sergey): Add API to create new plane tracks */
|
|
|
|
|
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 09:46:30 +00:00
|
|
|
/* active plane track */
|
|
|
|
prop = RNA_def_property(srna, "active", PROP_POINTER, PROP_NONE);
|
|
|
|
RNA_def_property_struct_type(prop, "MovieTrackingPlaneTrack");
|
2013-08-19 18:37:00 +00:00
|
|
|
RNA_def_property_pointer_funcs(prop, "rna_tracking_active_plane_track_get", "rna_tracking_active_plane_track_set",
|
|
|
|
NULL, NULL);
|
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 09:46:30 +00:00
|
|
|
RNA_def_property_flag(prop, PROP_EDITABLE | PROP_NEVER_UNLINK);
|
|
|
|
RNA_def_property_ui_text(prop, "Active Plane Track", "Active plane track in this tracking data object");
|
|
|
|
}
|
|
|
|
|
2011-12-05 18:57:17 +00:00
|
|
|
static void rna_def_trackingObjectTracks(BlenderRNA *brna)
|
|
|
|
{
|
|
|
|
StructRNA *srna;
|
|
|
|
FunctionRNA *func;
|
|
|
|
PropertyRNA *prop;
|
2013-01-07 11:28:27 +00:00
|
|
|
PropertyRNA *parm;
|
2011-12-05 18:57:17 +00:00
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
srna = RNA_def_struct(brna, "MovieTrackingObjectTracks", NULL);
|
2011-12-05 18:57:17 +00:00
|
|
|
RNA_def_struct_sdna(srna, "MovieTrackingObject");
|
|
|
|
RNA_def_struct_ui_text(srna, "Movie Tracks", "Collection of movie tracking tracks");
|
|
|
|
|
2013-01-07 11:28:27 +00:00
|
|
|
func = RNA_def_function(srna, "new", "rna_trackingObject_tracks_new");
|
2011-12-05 18:57:17 +00:00
|
|
|
RNA_def_function_flag(func, FUNC_USE_SELF_ID);
|
2013-01-07 11:28:27 +00:00
|
|
|
RNA_def_function_ui_description(func, "create new motion track in this movie clip");
|
2014-01-16 21:43:22 +11:00
|
|
|
RNA_def_string(func, "name", NULL, 0, "", "Name of new track");
|
2011-12-05 18:57:17 +00:00
|
|
|
RNA_def_int(func, "frame", 1, MINFRAME, MAXFRAME, "Frame", "Frame number to add tracks on", MINFRAME, MAXFRAME);
|
2013-01-07 11:28:27 +00:00
|
|
|
parm = RNA_def_pointer(func, "track", "MovieTrackingTrack", "", "Newly created track");
|
|
|
|
RNA_def_function_return(func, parm);
|
2011-12-05 18:57:17 +00:00
|
|
|
|
|
|
|
/* active track */
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "active", PROP_POINTER, PROP_NONE);
|
2011-12-05 18:57:17 +00:00
|
|
|
RNA_def_property_struct_type(prop, "MovieTrackingTrack");
|
|
|
|
RNA_def_property_pointer_funcs(prop, "rna_tracking_active_track_get", "rna_tracking_active_track_set", NULL, NULL);
|
2012-06-10 19:59:02 +00:00
|
|
|
RNA_def_property_flag(prop, PROP_EDITABLE | PROP_NEVER_UNLINK);
|
2011-12-05 18:57:17 +00:00
|
|
|
RNA_def_property_ui_text(prop, "Active Track", "Active track in this tracking data 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 09:46:30 +00:00
|
|
|
static void rna_def_trackingObjectPlaneTracks(BlenderRNA *brna)
|
|
|
|
{
|
|
|
|
StructRNA *srna;
|
|
|
|
PropertyRNA *prop;
|
|
|
|
|
|
|
|
srna = RNA_def_struct(brna, "MovieTrackingObjectPlaneTracks", NULL);
|
|
|
|
RNA_def_struct_sdna(srna, "MovieTrackingObject");
|
|
|
|
RNA_def_struct_ui_text(srna, "Plane Tracks", "Collection of tracking plane tracks");
|
|
|
|
|
|
|
|
/* active track */
|
|
|
|
prop = RNA_def_property(srna, "active", PROP_POINTER, PROP_NONE);
|
|
|
|
RNA_def_property_struct_type(prop, "MovieTrackingTrack");
|
2013-08-19 18:37:00 +00:00
|
|
|
RNA_def_property_pointer_funcs(prop, "rna_tracking_active_plane_track_get", "rna_tracking_active_plane_track_set",
|
|
|
|
NULL, NULL);
|
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 09:46:30 +00:00
|
|
|
RNA_def_property_flag(prop, PROP_EDITABLE | PROP_NEVER_UNLINK);
|
|
|
|
RNA_def_property_ui_text(prop, "Active Track", "Active track in this tracking data object");
|
|
|
|
}
|
|
|
|
|
2011-12-05 18:57:17 +00:00
|
|
|
static void rna_def_trackingObject(BlenderRNA *brna)
|
|
|
|
{
|
|
|
|
StructRNA *srna;
|
|
|
|
PropertyRNA *prop;
|
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
srna = RNA_def_struct(brna, "MovieTrackingObject", NULL);
|
2011-12-05 18:57:17 +00:00
|
|
|
RNA_def_struct_ui_text(srna, "Movie tracking object data", "Match-moving object tracking and reconstruction data");
|
|
|
|
|
|
|
|
/* name */
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "name", PROP_STRING, PROP_NONE);
|
2011-12-05 18:57:17 +00:00
|
|
|
RNA_def_property_ui_text(prop, "Name", "Unique name of object");
|
|
|
|
RNA_def_property_string_funcs(prop, NULL, NULL, "rna_trackingObject_name_set");
|
2012-06-10 19:59:02 +00:00
|
|
|
RNA_def_property_string_maxlength(prop, MAX_ID_NAME - 2);
|
|
|
|
RNA_def_property_update(prop, NC_MOVIECLIP | NA_EDITED, NULL);
|
2011-12-05 18:57:17 +00:00
|
|
|
RNA_def_struct_name_property(srna, prop);
|
|
|
|
|
|
|
|
/* is_camera */
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "is_camera", PROP_BOOLEAN, PROP_NONE);
|
2011-12-05 18:57:17 +00:00
|
|
|
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
|
|
|
|
RNA_def_property_boolean_sdna(prop, NULL, "flag", TRACKING_OBJECT_CAMERA);
|
|
|
|
RNA_def_property_ui_text(prop, "Camera", "Object is used for camera tracking");
|
2012-06-10 19:59:02 +00:00
|
|
|
RNA_def_property_update(prop, NC_MOVIECLIP | ND_DISPLAY, NULL);
|
2011-12-05 18:57:17 +00:00
|
|
|
|
|
|
|
/* tracks */
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "tracks", PROP_COLLECTION, PROP_NONE);
|
2012-03-18 09:27:36 +00:00
|
|
|
RNA_def_property_collection_funcs(prop, "rna_trackingObject_tracks_begin", "rna_iterator_listbase_next",
|
|
|
|
"rna_iterator_listbase_end", "rna_iterator_listbase_get",
|
|
|
|
NULL, NULL, NULL, NULL);
|
2011-12-05 18:57:17 +00:00
|
|
|
RNA_def_property_struct_type(prop, "MovieTrackingTrack");
|
|
|
|
RNA_def_property_ui_text(prop, "Tracks", "Collection of tracks in this tracking data object");
|
|
|
|
RNA_def_property_srna(prop, "MovieTrackingObjectTracks");
|
|
|
|
|
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 09:46:30 +00:00
|
|
|
/* plane tracks */
|
|
|
|
prop = RNA_def_property(srna, "plane_tracks", PROP_COLLECTION, PROP_NONE);
|
|
|
|
RNA_def_property_collection_funcs(prop, "rna_trackingObject_plane_tracks_begin", "rna_iterator_listbase_next",
|
|
|
|
"rna_iterator_listbase_end", "rna_iterator_listbase_get",
|
|
|
|
NULL, NULL, NULL, NULL);
|
|
|
|
RNA_def_property_struct_type(prop, "MovieTrackingPlaneTrack");
|
|
|
|
RNA_def_property_ui_text(prop, "Plane Tracks", "Collection of plane tracks in this tracking data object");
|
|
|
|
RNA_def_property_srna(prop, "MovieTrackingObjectPlaneTracks");
|
|
|
|
|
2011-12-05 18:57:17 +00:00
|
|
|
/* reconstruction */
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "reconstruction", PROP_POINTER, PROP_NONE);
|
2011-12-05 18:57:17 +00:00
|
|
|
RNA_def_property_struct_type(prop, "MovieTrackingReconstruction");
|
2012-06-08 18:16:20 +00:00
|
|
|
RNA_def_property_pointer_funcs(prop, "rna_trackingObject_reconstruction_get", NULL, NULL, NULL);
|
2011-12-19 15:12:33 +00:00
|
|
|
|
|
|
|
/* scale */
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "scale", PROP_FLOAT, PROP_NONE);
|
2011-12-19 15:12:33 +00:00
|
|
|
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
|
|
|
|
RNA_def_property_float_sdna(prop, NULL, "scale");
|
|
|
|
RNA_def_property_range(prop, 0.0001f, 10000.0f);
|
|
|
|
RNA_def_property_ui_range(prop, 0.0001f, 10000.0, 1, 4);
|
2012-02-14 17:03:06 +00:00
|
|
|
RNA_def_property_float_default(prop, 1.0f);
|
2011-12-19 15:12:33 +00:00
|
|
|
RNA_def_property_ui_text(prop, "Scale", "Scale of object solution in camera space");
|
2012-06-10 19:59:02 +00:00
|
|
|
RNA_def_property_update(prop, NC_MOVIECLIP | NA_EDITED, "rna_trackingObject_flushUpdate");
|
2012-10-09 10:33:18 +00:00
|
|
|
|
|
|
|
/* keyframe_a */
|
|
|
|
prop = RNA_def_property(srna, "keyframe_a", PROP_INT, PROP_NONE);
|
|
|
|
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
|
|
|
|
RNA_def_property_int_sdna(prop, NULL, "keyframe1");
|
|
|
|
RNA_def_property_ui_text(prop, "Keyframe A", "First keyframe used for reconstruction initialization");
|
|
|
|
|
|
|
|
/* keyframe_b */
|
|
|
|
prop = RNA_def_property(srna, "keyframe_b", PROP_INT, PROP_NONE);
|
|
|
|
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
|
|
|
|
RNA_def_property_int_sdna(prop, NULL, "keyframe2");
|
|
|
|
RNA_def_property_ui_text(prop, "Keyframe B", "Second keyframe used for reconstruction initialization");
|
2011-12-05 18:57:17 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static void rna_def_trackingObjects(BlenderRNA *brna, PropertyRNA *cprop)
|
|
|
|
{
|
|
|
|
StructRNA *srna;
|
|
|
|
PropertyRNA *prop;
|
|
|
|
|
|
|
|
FunctionRNA *func;
|
|
|
|
PropertyRNA *parm;
|
|
|
|
|
|
|
|
RNA_def_property_srna(cprop, "MovieTrackingObjects");
|
2012-03-05 23:30:41 +00:00
|
|
|
srna = RNA_def_struct(brna, "MovieTrackingObjects", NULL);
|
2011-12-05 18:57:17 +00:00
|
|
|
RNA_def_struct_sdna(srna, "MovieTracking");
|
2016-08-26 16:14:56 +02:00
|
|
|
RNA_def_struct_ui_text(srna, "Movie Objects", "Collection of movie tracking objects");
|
2011-12-05 18:57:17 +00:00
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
func = RNA_def_function(srna, "new", "rna_trackingObject_new");
|
2011-12-05 18:57:17 +00:00
|
|
|
RNA_def_function_ui_description(func, "Add tracking object to this movie clip");
|
2014-01-16 21:43:22 +11:00
|
|
|
parm = RNA_def_string(func, "name", NULL, 0, "", "Name of new object");
|
Refactor RNA property: split flags in property flags, parameter flags, and internal flags.
This gives us 9 flags available again for properties (we had none anymore),
and also makes things slightly cleaner.
To simplify (and make more clear the differences between mere properties
and function parameters), also added RNA_def_parameter_flags function (and
its clear counterpart), to be used instead of RNA_def_property_flag for
function parameters.
This patch is also a big cleanup (some RNA function definitions were
still using 'prop' PropertyRNA pointer, etc.).
And yes, am aware this will be annoying for all branches, but we really need
to get new flags available for properties (will need at least one for override, etc.).
Reviewers: sergey, Severin
Subscribers: dfelinto, brecht
Differential Revision: https://developer.blender.org/D2400
2016-12-12 15:23:55 +01:00
|
|
|
RNA_def_parameter_flags(parm, 0, PARM_REQUIRED);
|
2012-03-05 23:30:41 +00:00
|
|
|
parm = RNA_def_pointer(func, "object", "MovieTrackingObject", "", "New motion tracking object");
|
2011-12-05 18:57:17 +00:00
|
|
|
RNA_def_function_return(func, parm);
|
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
func = RNA_def_function(srna, "remove", "rna_trackingObject_remove");
|
2012-11-02 09:41:26 +00:00
|
|
|
RNA_def_function_flag(func, FUNC_USE_REPORTS);
|
2011-12-05 18:57:17 +00:00
|
|
|
RNA_def_function_ui_description(func, "Remove tracking object from this movie clip");
|
2012-11-02 09:41:26 +00:00
|
|
|
parm = RNA_def_pointer(func, "object", "MovieTrackingObject", "", "Motion tracking object to be removed");
|
Refactor RNA property: split flags in property flags, parameter flags, and internal flags.
This gives us 9 flags available again for properties (we had none anymore),
and also makes things slightly cleaner.
To simplify (and make more clear the differences between mere properties
and function parameters), also added RNA_def_parameter_flags function (and
its clear counterpart), to be used instead of RNA_def_property_flag for
function parameters.
This patch is also a big cleanup (some RNA function definitions were
still using 'prop' PropertyRNA pointer, etc.).
And yes, am aware this will be annoying for all branches, but we really need
to get new flags available for properties (will need at least one for override, etc.).
Reviewers: sergey, Severin
Subscribers: dfelinto, brecht
Differential Revision: https://developer.blender.org/D2400
2016-12-12 15:23:55 +01:00
|
|
|
RNA_def_parameter_flags(parm, PROP_NEVER_NULL, PARM_REQUIRED | PARM_RNAPTR);
|
|
|
|
RNA_def_parameter_clear_flags(parm, PROP_THICK_WRAP, 0);
|
2011-12-05 18:57:17 +00:00
|
|
|
|
|
|
|
/* active object */
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "active", PROP_POINTER, PROP_NONE);
|
2011-12-05 18:57:17 +00:00
|
|
|
RNA_def_property_struct_type(prop, "MovieTrackingObject");
|
2012-03-18 09:27:36 +00:00
|
|
|
RNA_def_property_pointer_funcs(prop, "rna_tracking_active_object_get",
|
|
|
|
"rna_tracking_active_object_set", NULL, NULL);
|
2012-06-10 19:59:02 +00:00
|
|
|
RNA_def_property_flag(prop, PROP_EDITABLE | PROP_NEVER_UNLINK);
|
2011-12-05 18:57:17 +00:00
|
|
|
RNA_def_property_ui_text(prop, "Active Object", "Active object in this tracking data object");
|
|
|
|
}
|
|
|
|
|
2012-06-12 17:10:24 +00:00
|
|
|
static void rna_def_trackingDopesheet(BlenderRNA *brna)
|
|
|
|
{
|
|
|
|
StructRNA *srna;
|
|
|
|
PropertyRNA *prop;
|
|
|
|
|
2017-10-18 15:07:26 +11:00
|
|
|
static const EnumPropertyItem sort_items[] = {
|
2012-06-12 17:10:24 +00:00
|
|
|
{TRACKING_DOPE_SORT_NAME, "NAME", 0, "Name", "Sort channels by their names"},
|
|
|
|
{TRACKING_DOPE_SORT_LONGEST, "LONGEST", 0, "Longest", "Sort channels by longest tracked segment"},
|
|
|
|
{TRACKING_DOPE_SORT_TOTAL, "TOTAL", 0, "Total", "Sort channels by overall amount of tracked segments"},
|
2012-11-07 14:56:53 +00:00
|
|
|
{TRACKING_DOPE_SORT_AVERAGE_ERROR, "AVERAGE_ERROR", 0, "Average Error",
|
|
|
|
"Sort channels by average reprojection error of tracks after solve"},
|
2019-02-03 14:01:45 +11:00
|
|
|
{0, NULL, 0, NULL, NULL},
|
2012-06-12 17:10:24 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
srna = RNA_def_struct(brna, "MovieTrackingDopesheet", NULL);
|
|
|
|
RNA_def_struct_ui_text(srna, "Movie Tracking Dopesheet", "Match-moving dopesheet data");
|
|
|
|
|
|
|
|
/* dopesheet sort */
|
|
|
|
prop = RNA_def_property(srna, "sort_method", PROP_ENUM, PROP_NONE);
|
|
|
|
RNA_def_property_enum_sdna(prop, NULL, "sort_method");
|
|
|
|
RNA_def_property_enum_items(prop, sort_items);
|
|
|
|
RNA_def_property_ui_text(prop, "Dopesheet Sort Field", "Method to be used to sort channels in dopesheet view");
|
|
|
|
RNA_def_property_update(prop, NC_MOVIECLIP | NA_EDITED, "rna_trackingDopesheet_tagUpdate");
|
|
|
|
|
|
|
|
/* invert_dopesheet_sort */
|
|
|
|
prop = RNA_def_property(srna, "use_invert_sort", PROP_BOOLEAN, PROP_NONE);
|
|
|
|
RNA_def_property_boolean_sdna(prop, NULL, "flag", TRACKING_DOPE_SORT_INVERSE);
|
|
|
|
RNA_def_property_ui_text(prop, "Invert Dopesheet Sort", "Invert sort order of dopesheet channels");
|
|
|
|
RNA_def_property_update(prop, NC_MOVIECLIP | NA_EDITED, "rna_trackingDopesheet_tagUpdate");
|
2012-06-12 17:10:47 +00:00
|
|
|
|
|
|
|
/* show_only_selected */
|
|
|
|
prop = RNA_def_property(srna, "show_only_selected", PROP_BOOLEAN, PROP_NONE);
|
|
|
|
RNA_def_property_boolean_sdna(prop, NULL, "flag", TRACKING_DOPE_SELECTED_ONLY);
|
|
|
|
RNA_def_property_ui_text(prop, "Only Selected", "Only include channels relating to selected objects and data");
|
|
|
|
RNA_def_property_ui_icon(prop, ICON_RESTRICT_SELECT_OFF, 0);
|
2012-06-12 17:11:16 +00:00
|
|
|
RNA_def_property_update(prop, NC_MOVIECLIP | NA_EDITED, "rna_trackingDopesheet_tagUpdate");
|
2012-06-12 17:10:47 +00:00
|
|
|
|
|
|
|
/* show_hidden */
|
|
|
|
prop = RNA_def_property(srna, "show_hidden", PROP_BOOLEAN, PROP_NONE);
|
|
|
|
RNA_def_property_boolean_sdna(prop, NULL, "flag", TRACKING_DOPE_SHOW_HIDDEN);
|
|
|
|
RNA_def_property_ui_text(prop, "Display Hidden", "Include channels from objects/bone that aren't visible");
|
|
|
|
RNA_def_property_ui_icon(prop, ICON_GHOST_ENABLED, 0);
|
2012-06-12 17:11:16 +00:00
|
|
|
RNA_def_property_update(prop, NC_MOVIECLIP | NA_EDITED, "rna_trackingDopesheet_tagUpdate");
|
2012-06-12 17:10:24 +00:00
|
|
|
}
|
|
|
|
|
2011-11-07 12:55:18 +00:00
|
|
|
static void rna_def_tracking(BlenderRNA *brna)
|
|
|
|
{
|
|
|
|
StructRNA *srna;
|
|
|
|
PropertyRNA *prop;
|
|
|
|
|
|
|
|
rna_def_trackingSettings(brna);
|
|
|
|
rna_def_trackingCamera(brna);
|
|
|
|
rna_def_trackingTrack(brna);
|
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 09:46:30 +00:00
|
|
|
rna_def_trackingPlaneTrack(brna);
|
2011-12-05 18:57:17 +00:00
|
|
|
rna_def_trackingTracks(brna);
|
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 09:46:30 +00:00
|
|
|
rna_def_trackingPlaneTracks(brna);
|
2011-12-05 18:57:17 +00:00
|
|
|
rna_def_trackingObjectTracks(brna);
|
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 09:46:30 +00:00
|
|
|
rna_def_trackingObjectPlaneTracks(brna);
|
2011-11-07 12:55:18 +00:00
|
|
|
rna_def_trackingStabilization(brna);
|
2014-02-26 19:40:04 +06:00
|
|
|
rna_def_trackingReconstructedCameras(brna);
|
2011-11-07 12:55:18 +00:00
|
|
|
rna_def_trackingReconstruction(brna);
|
2011-12-05 18:57:17 +00:00
|
|
|
rna_def_trackingObject(brna);
|
2012-06-12 17:10:24 +00:00
|
|
|
rna_def_trackingDopesheet(brna);
|
2011-11-07 12:55:18 +00:00
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
srna = RNA_def_struct(brna, "MovieTracking", NULL);
|
2012-02-15 16:06:48 +00:00
|
|
|
RNA_def_struct_path_func(srna, "rna_tracking_path");
|
2011-11-07 12:55:18 +00:00
|
|
|
RNA_def_struct_ui_text(srna, "Movie tracking data", "Match-moving data for tracking");
|
|
|
|
|
|
|
|
/* settings */
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "settings", PROP_POINTER, PROP_NONE);
|
2011-11-07 12:55:18 +00:00
|
|
|
RNA_def_property_struct_type(prop, "MovieTrackingSettings");
|
|
|
|
|
|
|
|
/* camera properties */
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "camera", PROP_POINTER, PROP_NONE);
|
2011-11-07 12:55:18 +00:00
|
|
|
RNA_def_property_struct_type(prop, "MovieTrackingCamera");
|
|
|
|
|
|
|
|
/* tracks */
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "tracks", PROP_COLLECTION, PROP_NONE);
|
2012-03-18 09:27:36 +00:00
|
|
|
RNA_def_property_collection_funcs(prop, "rna_trackingTracks_begin", "rna_iterator_listbase_next",
|
|
|
|
"rna_iterator_listbase_end", "rna_iterator_listbase_get",
|
|
|
|
NULL, NULL, NULL, NULL);
|
2011-11-07 12:55:18 +00:00
|
|
|
RNA_def_property_struct_type(prop, "MovieTrackingTrack");
|
|
|
|
RNA_def_property_ui_text(prop, "Tracks", "Collection of tracks in this tracking data object");
|
2011-12-05 18:57:17 +00:00
|
|
|
RNA_def_property_srna(prop, "MovieTrackingTracks");
|
2011-11-07 12:55:18 +00: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 09:46:30 +00:00
|
|
|
/* tracks */
|
|
|
|
prop = RNA_def_property(srna, "plane_tracks", PROP_COLLECTION, PROP_NONE);
|
|
|
|
RNA_def_property_collection_funcs(prop, "rna_trackingPlaneTracks_begin", "rna_iterator_listbase_next",
|
|
|
|
"rna_iterator_listbase_end", "rna_iterator_listbase_get",
|
|
|
|
NULL, NULL, NULL, NULL);
|
|
|
|
RNA_def_property_struct_type(prop, "MovieTrackingPlaneTrack");
|
|
|
|
RNA_def_property_ui_text(prop, "Plane Tracks", "Collection of plane tracks in this tracking data object");
|
|
|
|
RNA_def_property_srna(prop, "MovieTrackingPlaneTracks");
|
|
|
|
|
2011-11-07 12:55:18 +00:00
|
|
|
/* stabilization */
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "stabilization", PROP_POINTER, PROP_NONE);
|
2011-11-07 12:55:18 +00:00
|
|
|
RNA_def_property_struct_type(prop, "MovieTrackingStabilization");
|
|
|
|
|
|
|
|
/* reconstruction */
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "reconstruction", PROP_POINTER, PROP_NONE);
|
2011-11-07 12:55:18 +00:00
|
|
|
RNA_def_property_struct_type(prop, "MovieTrackingReconstruction");
|
2011-12-05 18:57:17 +00:00
|
|
|
|
|
|
|
/* objects */
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "objects", PROP_COLLECTION, PROP_NONE);
|
2012-03-18 09:27:36 +00:00
|
|
|
RNA_def_property_collection_funcs(prop, "rna_trackingObjects_begin", "rna_iterator_listbase_next",
|
|
|
|
"rna_iterator_listbase_end", "rna_iterator_listbase_get",
|
|
|
|
NULL, NULL, NULL, NULL);
|
2011-12-05 18:57:17 +00:00
|
|
|
RNA_def_property_struct_type(prop, "MovieTrackingObject");
|
|
|
|
RNA_def_property_ui_text(prop, "Objects", "Collection of objects in this tracking data object");
|
|
|
|
rna_def_trackingObjects(brna, prop);
|
|
|
|
|
|
|
|
/* active object index */
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "active_object_index", PROP_INT, PROP_NONE);
|
2011-12-05 18:57:17 +00:00
|
|
|
RNA_def_property_int_sdna(prop, NULL, "objectnr");
|
2012-02-15 16:06:48 +00:00
|
|
|
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
|
2012-03-18 09:27:36 +00:00
|
|
|
RNA_def_property_int_funcs(prop, "rna_tracking_active_object_index_get", "rna_tracking_active_object_index_set",
|
|
|
|
"rna_tracking_active_object_index_range");
|
2011-12-05 18:57:17 +00:00
|
|
|
RNA_def_property_ui_text(prop, "Active Object Index", "Index of active object");
|
2012-06-10 19:59:02 +00:00
|
|
|
RNA_def_property_update(prop, NC_MOVIECLIP | ND_DISPLAY, NULL);
|
2012-06-12 17:10:24 +00:00
|
|
|
|
|
|
|
/* dopesheet */
|
|
|
|
prop = RNA_def_property(srna, "dopesheet", PROP_POINTER, PROP_NONE);
|
|
|
|
RNA_def_property_struct_type(prop, "MovieTrackingDopesheet");
|
2011-11-07 12:55:18 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void RNA_def_tracking(BlenderRNA *brna)
|
|
|
|
{
|
|
|
|
rna_def_tracking(brna);
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|