This repository has been archived on 2023-10-09. You can view files and clone it, but cannot push or open issues or pull requests.
Files
blender-archive/source/blender/blenkernel/BKE_tracking.h

131 lines
6.9 KiB
C++
Raw Normal View History

Camera tracking integration =========================== - Initial implementaiton of new ID named MovieClip. Currently it has plactically the same functionality as images, but this functionality would be widen in nearest future. - Initial implementation of SpaceClip. This space is supposed to be used for acting with MovieClips (opening, playbacking, math-moving interaction and so on). Currently you could open image sequence/movie file here, pan/zoom, use a playback here. I've added cache visualizer to this space, but it's currently more a developer's feature to see how cache system works, but it could be adopted for further artists' usage (something like cache visuzlizer for simulations). - Added new theme area for Space Clip. No special colors were defined here yet. - Implementation of basic cache system for movies. This cache system is very familiar with sequence cache system, but it supposed to be more portable: at least cache keys aren't limited with sequence-based data and current seqcache could became an interface between sequencer and moviecache without much logic (only logic related on keys handling would be necessary here). Implemented basic limitors (ab\mount of cached imbuf's), so it'll be a bit more difficult to go out of memory when playing long animations in Image Editor (this cache system could be used for images too, in the future). - Very basic tools implementation -- only sceletion added, no real tool implemented (only camera focal length added to the UI which hasn't got real affect on anything). Assorted notes: - Not sure about best behaviour for Unlink clip button: should it be imageeditor-like (with de-referencing only) or text-editor like (with removing datablock from file). - Also not sure if tools/properties should be splitted into different areas or it'll be better to have tools and settings for this tool/item/etc in the same area (tools at the top, properties are under them). Code for properties area is '#if 0'-ed. - Sound isn't supported during playback in movie clip.
2011-05-30 04:18:02 +00:00
/*
* ***** BEGIN GPL LICENSE BLOCK *****
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*
Camera tracking integraiton =========================== - Corrected copyrights in my new files header. - Added debug option to dump as PNG image content of search areas tracking between which was failed. - Removed internal tracking settings like pyramid level and tolerance. Weren't useful neither for me nor for artists. - Fixed bug in BKE_tracking_get_marker which could lead to failure of getting marker for current frame when there's marker for requested frame. - Fixed bug with disappearing markers after tracking for cases when marker was added at frame different from tracking start frame and tracking start frame is equal to tracking end frame. - Stop tracking when no markers could be tracked. - Changed marker selection rules: * If marker isn't selected, all it's areas are getting selected with mouse. * If marker is selected and selection type doesn't have "extend" mode (SHIFT isn't holded down) the nearest to mouse cursor area would be selected. All the reast areas would loose selection. - Limit number of frames which would be used in "Track Markers" operator. So now you could easily track along 10/20/etc frames. - Change scene current frame after "Track Markers" operator. - Implemented speed limitors. Now tracking could happen: * As fast as possible * With reatime speed (scene FPS) * With half of realtime speed * With quarter of realtime speed. - Got rid of orig_user in MovieTrackingContext and user in TrackMarkersJob. This prevents crashes when user joins some space to SpaceClip from which tracking was started. - Made keyframes on path bigger and do not draw keyframes for non-selected markers. TODO: need to get rid of storing main, scene and screen in TrackMarkersJob. This is needed to set scene's current frame after tracking (such behavior is comfortable for artists) but this could lead to crash if scene is getting removed when tracking job is running. Render animation operator also stores scene and main, so such solution could be fine for first time before we've got something smarter.
2011-06-22 14:54:53 +00:00
* The Original Code is Copyright (C) 2011 Blender Foundation.
Camera tracking integration =========================== - Initial implementaiton of new ID named MovieClip. Currently it has plactically the same functionality as images, but this functionality would be widen in nearest future. - Initial implementation of SpaceClip. This space is supposed to be used for acting with MovieClips (opening, playbacking, math-moving interaction and so on). Currently you could open image sequence/movie file here, pan/zoom, use a playback here. I've added cache visualizer to this space, but it's currently more a developer's feature to see how cache system works, but it could be adopted for further artists' usage (something like cache visuzlizer for simulations). - Added new theme area for Space Clip. No special colors were defined here yet. - Implementation of basic cache system for movies. This cache system is very familiar with sequence cache system, but it supposed to be more portable: at least cache keys aren't limited with sequence-based data and current seqcache could became an interface between sequencer and moviecache without much logic (only logic related on keys handling would be necessary here). Implemented basic limitors (ab\mount of cached imbuf's), so it'll be a bit more difficult to go out of memory when playing long animations in Image Editor (this cache system could be used for images too, in the future). - Very basic tools implementation -- only sceletion added, no real tool implemented (only camera focal length added to the UI which hasn't got real affect on anything). Assorted notes: - Not sure about best behaviour for Unlink clip button: should it be imageeditor-like (with de-referencing only) or text-editor like (with removing datablock from file). - Also not sure if tools/properties should be splitted into different areas or it'll be better to have tools and settings for this tool/item/etc in the same area (tools at the top, properties are under them). Code for properties area is '#if 0'-ed. - Sound isn't supported during playback in movie clip.
2011-05-30 04:18:02 +00:00
* All rights reserved.
*
* Contributor(s): Blender Foundation,
* Sergey Sharybin
*
* ***** END GPL LICENSE BLOCK *****
*/
Camera tracking integration =========================== Implemented basic structures and operators for markers manipulaiton. Markers contains: - Position of marker at frame in unified 0..1 coordinates - Relative positions of left-bottom and right-top corners of pattern area - Relative positions of left-bottom and right-top corners of search area - Selection flags New operators: - Create new maerker. It's a modal operator which creates markers at mouse position when LMB is clicking. - Delete selected markers. - Select marker using RMB. Some parts of marker (point, patter, search) could be deselected. - Select markers using rectangular selection. - Select markers using circle selection. - Marker translation (G-key). - Marker scaling (S-key). UI changes: - Added mode to space clip. Currently supported modes are: * View mode * Tracking mode This was intended to separate different categories of tools, so interface shouldn't be overheaded with plenty of tools which aren't actually using in the same time. - Created new panel when actiev tool is 'MARKER' and there's active marker where positions could be adjusted in pixel space. Internal changes: - Splitted DNA/RNA movieclip files to make separation of tracking data and movie data more clear. This could be useful in the future when we'll want to support multiplie moies for single camera tracking (to make tracking more accurate). - Added new file in blenkernel, where all tracking-related function would be stored. Not very much function here at this moment, but in the future all stuff related on converting DNA to external tracking data would be stored here.
2011-06-03 15:39:53 +00:00
#ifndef BKE_TRACKING_H
#define BKE_TRACKING_H
Camera tracking integration =========================== - Initial implementaiton of new ID named MovieClip. Currently it has plactically the same functionality as images, but this functionality would be widen in nearest future. - Initial implementation of SpaceClip. This space is supposed to be used for acting with MovieClips (opening, playbacking, math-moving interaction and so on). Currently you could open image sequence/movie file here, pan/zoom, use a playback here. I've added cache visualizer to this space, but it's currently more a developer's feature to see how cache system works, but it could be adopted for further artists' usage (something like cache visuzlizer for simulations). - Added new theme area for Space Clip. No special colors were defined here yet. - Implementation of basic cache system for movies. This cache system is very familiar with sequence cache system, but it supposed to be more portable: at least cache keys aren't limited with sequence-based data and current seqcache could became an interface between sequencer and moviecache without much logic (only logic related on keys handling would be necessary here). Implemented basic limitors (ab\mount of cached imbuf's), so it'll be a bit more difficult to go out of memory when playing long animations in Image Editor (this cache system could be used for images too, in the future). - Very basic tools implementation -- only sceletion added, no real tool implemented (only camera focal length added to the UI which hasn't got real affect on anything). Assorted notes: - Not sure about best behaviour for Unlink clip button: should it be imageeditor-like (with de-referencing only) or text-editor like (with removing datablock from file). - Also not sure if tools/properties should be splitted into different areas or it'll be better to have tools and settings for this tool/item/etc in the same area (tools at the top, properties are under them). Code for properties area is '#if 0'-ed. - Sound isn't supported during playback in movie clip.
2011-05-30 04:18:02 +00:00
Camera tracking integration =========================== Implemented basic structures and operators for markers manipulaiton. Markers contains: - Position of marker at frame in unified 0..1 coordinates - Relative positions of left-bottom and right-top corners of pattern area - Relative positions of left-bottom and right-top corners of search area - Selection flags New operators: - Create new maerker. It's a modal operator which creates markers at mouse position when LMB is clicking. - Delete selected markers. - Select marker using RMB. Some parts of marker (point, patter, search) could be deselected. - Select markers using rectangular selection. - Select markers using circle selection. - Marker translation (G-key). - Marker scaling (S-key). UI changes: - Added mode to space clip. Currently supported modes are: * View mode * Tracking mode This was intended to separate different categories of tools, so interface shouldn't be overheaded with plenty of tools which aren't actually using in the same time. - Created new panel when actiev tool is 'MARKER' and there's active marker where positions could be adjusted in pixel space. Internal changes: - Splitted DNA/RNA movieclip files to make separation of tracking data and movie data more clear. This could be useful in the future when we'll want to support multiplie moies for single camera tracking (to make tracking more accurate). - Added new file in blenkernel, where all tracking-related function would be stored. Not very much function here at this moment, but in the future all stuff related on converting DNA to external tracking data would be stored here.
2011-06-03 15:39:53 +00:00
/** \file BKE_trackingp.h
* \ingroup bke
* \author Sergey Sharybin
*/
Camera tracking integration =========================== - Initial implementaiton of new ID named MovieClip. Currently it has plactically the same functionality as images, but this functionality would be widen in nearest future. - Initial implementation of SpaceClip. This space is supposed to be used for acting with MovieClips (opening, playbacking, math-moving interaction and so on). Currently you could open image sequence/movie file here, pan/zoom, use a playback here. I've added cache visualizer to this space, but it's currently more a developer's feature to see how cache system works, but it could be adopted for further artists' usage (something like cache visuzlizer for simulations). - Added new theme area for Space Clip. No special colors were defined here yet. - Implementation of basic cache system for movies. This cache system is very familiar with sequence cache system, but it supposed to be more portable: at least cache keys aren't limited with sequence-based data and current seqcache could became an interface between sequencer and moviecache without much logic (only logic related on keys handling would be necessary here). Implemented basic limitors (ab\mount of cached imbuf's), so it'll be a bit more difficult to go out of memory when playing long animations in Image Editor (this cache system could be used for images too, in the future). - Very basic tools implementation -- only sceletion added, no real tool implemented (only camera focal length added to the UI which hasn't got real affect on anything). Assorted notes: - Not sure about best behaviour for Unlink clip button: should it be imageeditor-like (with de-referencing only) or text-editor like (with removing datablock from file). - Also not sure if tools/properties should be splitted into different areas or it'll be better to have tools and settings for this tool/item/etc in the same area (tools at the top, properties are under them). Code for properties area is '#if 0'-ed. - Sound isn't supported during playback in movie clip.
2011-05-30 04:18:02 +00:00
struct bGPDlayer;
Camera tracking integration =========================== - itasc adopted for Eigen3 library. It compiles well, but need deeper testing for regressions. - Removed Eigen2 library. - Added settings to tracker which could be changed from UI. - Pattern area is now affects on tracker. Currently libmv supports square patterns which are centered to marker's position. Maximal pattern dimensions is sending to libmv as pattern size. Would be changed when libmv would support non-centered and non-square patterns. - Fixed bug with syncing pattern's flags when tracking. - Current frame in cache line became a bit more visible. It's useful for me to when debugging. - Changed behaviour of "Add Marekr" operator: not it's non-modal and places marker on mouse position at click. - Added macro "Add Marekr and Move" which is used to place markers from toolbar button. - Added some utility functions to get image buffer under search and pattern area which also returns relative position of marker center for this images. Generated images are more "correct" from coords rounding POV, but re-calculation of marker position back to frame coords is more complicated and not implemented yet, so old not very accurate logic is still used. - Added preview widget with content of pattern area. NOTE: files saved in previous versions of this branch could easily crash on tracking. Use "Reset To Settings" button from Tracking Settings before tracking selected markers for such files. TODO: - Implement adjusting marker position from marker's preview widget. - We've got an idea of sliding marker after click before releasing mouse button.
2011-06-14 16:22:06 +00:00
struct ImBuf;
struct MovieTrackingTrack;
Camera tracking integration =========================== Implemented basic structures and operators for markers manipulaiton. Markers contains: - Position of marker at frame in unified 0..1 coordinates - Relative positions of left-bottom and right-top corners of pattern area - Relative positions of left-bottom and right-top corners of search area - Selection flags New operators: - Create new maerker. It's a modal operator which creates markers at mouse position when LMB is clicking. - Delete selected markers. - Select marker using RMB. Some parts of marker (point, patter, search) could be deselected. - Select markers using rectangular selection. - Select markers using circle selection. - Marker translation (G-key). - Marker scaling (S-key). UI changes: - Added mode to space clip. Currently supported modes are: * View mode * Tracking mode This was intended to separate different categories of tools, so interface shouldn't be overheaded with plenty of tools which aren't actually using in the same time. - Created new panel when actiev tool is 'MARKER' and there's active marker where positions could be adjusted in pixel space. Internal changes: - Splitted DNA/RNA movieclip files to make separation of tracking data and movie data more clear. This could be useful in the future when we'll want to support multiplie moies for single camera tracking (to make tracking more accurate). - Added new file in blenkernel, where all tracking-related function would be stored. Not very much function here at this moment, but in the future all stuff related on converting DNA to external tracking data would be stored here.
2011-06-03 15:39:53 +00:00
struct MovieTrackingMarker;
struct MovieTracking;
struct MovieTrackingContext;
struct MovieClipUser;
struct MovieDistortion;
struct Scene;
struct Object;
Camera tracking integration =========================== - Initial implementaiton of new ID named MovieClip. Currently it has plactically the same functionality as images, but this functionality would be widen in nearest future. - Initial implementation of SpaceClip. This space is supposed to be used for acting with MovieClips (opening, playbacking, math-moving interaction and so on). Currently you could open image sequence/movie file here, pan/zoom, use a playback here. I've added cache visualizer to this space, but it's currently more a developer's feature to see how cache system works, but it could be adopted for further artists' usage (something like cache visuzlizer for simulations). - Added new theme area for Space Clip. No special colors were defined here yet. - Implementation of basic cache system for movies. This cache system is very familiar with sequence cache system, but it supposed to be more portable: at least cache keys aren't limited with sequence-based data and current seqcache could became an interface between sequencer and moviecache without much logic (only logic related on keys handling would be necessary here). Implemented basic limitors (ab\mount of cached imbuf's), so it'll be a bit more difficult to go out of memory when playing long animations in Image Editor (this cache system could be used for images too, in the future). - Very basic tools implementation -- only sceletion added, no real tool implemented (only camera focal length added to the UI which hasn't got real affect on anything). Assorted notes: - Not sure about best behaviour for Unlink clip button: should it be imageeditor-like (with de-referencing only) or text-editor like (with removing datablock from file). - Also not sure if tools/properties should be splitted into different areas or it'll be better to have tools and settings for this tool/item/etc in the same area (tools at the top, properties are under them). Code for properties area is '#if 0'-ed. - Sound isn't supported during playback in movie clip.
2011-05-30 04:18:02 +00:00
void BKE_tracking_clamp_track(struct MovieTrackingTrack *track, int event);
void BKE_tracking_track_flag(struct MovieTrackingTrack *track, int area, int flag, int clear);
struct MovieTrackingTrack *BKE_tracking_add_track(struct MovieTracking *tracking, float x, float y,
int framenr, int width, int height);
void BKE_tracking_insert_marker(struct MovieTrackingTrack *track, struct MovieTrackingMarker *marker);
void BKE_tracking_delete_marker(struct MovieTrackingTrack *track, int framenr);
struct MovieTrackingMarker *BKE_tracking_get_marker(struct MovieTrackingTrack *track, int framenr);
struct MovieTrackingMarker *BKE_tracking_ensure_marker(struct MovieTrackingTrack *track, int framenr);
struct MovieTrackingMarker *BKE_tracking_exact_marker(struct MovieTrackingTrack *track, int framenr);
int BKE_tracking_has_marker(struct MovieTrackingTrack *track, int framenr);
void BKE_tracking_free_track(struct MovieTrackingTrack *track);
struct MovieTrackingTrack *BKE_tracking_copy_track(struct MovieTrackingTrack *track);
void BKE_tracking_clear_path(struct MovieTrackingTrack *track, int ref_frame, int action);
int BKE_tracking_test_join_tracks(struct MovieTrackingTrack *dst_track, struct MovieTrackingTrack *src_track);
void BKE_tracking_join_tracks(struct MovieTrackingTrack *dst_track, struct MovieTrackingTrack *src_track);
void BKE_tracking_free(struct MovieTracking *tracking);
Camera tracking integration =========================== - Initial implementaiton of new ID named MovieClip. Currently it has plactically the same functionality as images, but this functionality would be widen in nearest future. - Initial implementation of SpaceClip. This space is supposed to be used for acting with MovieClips (opening, playbacking, math-moving interaction and so on). Currently you could open image sequence/movie file here, pan/zoom, use a playback here. I've added cache visualizer to this space, but it's currently more a developer's feature to see how cache system works, but it could be adopted for further artists' usage (something like cache visuzlizer for simulations). - Added new theme area for Space Clip. No special colors were defined here yet. - Implementation of basic cache system for movies. This cache system is very familiar with sequence cache system, but it supposed to be more portable: at least cache keys aren't limited with sequence-based data and current seqcache could became an interface between sequencer and moviecache without much logic (only logic related on keys handling would be necessary here). Implemented basic limitors (ab\mount of cached imbuf's), so it'll be a bit more difficult to go out of memory when playing long animations in Image Editor (this cache system could be used for images too, in the future). - Very basic tools implementation -- only sceletion added, no real tool implemented (only camera focal length added to the UI which hasn't got real affect on anything). Assorted notes: - Not sure about best behaviour for Unlink clip button: should it be imageeditor-like (with de-referencing only) or text-editor like (with removing datablock from file). - Also not sure if tools/properties should be splitted into different areas or it'll be better to have tools and settings for this tool/item/etc in the same area (tools at the top, properties are under them). Code for properties area is '#if 0'-ed. - Sound isn't supported during playback in movie clip.
2011-05-30 04:18:02 +00:00
struct ImBuf *BKE_tracking_get_pattern_imbuf(struct ImBuf *ibuf, struct MovieTrackingTrack *track,
struct MovieTrackingMarker *marker, int margin, int anchored, float pos[2], int origin[2]);
struct ImBuf *BKE_tracking_get_search_imbuf(struct ImBuf *ibuf, struct MovieTrackingTrack *track,
struct MovieTrackingMarker *marker, int margin, int anchored, float pos[2], int origin[2]);
Camera tracking integration =========================== - itasc adopted for Eigen3 library. It compiles well, but need deeper testing for regressions. - Removed Eigen2 library. - Added settings to tracker which could be changed from UI. - Pattern area is now affects on tracker. Currently libmv supports square patterns which are centered to marker's position. Maximal pattern dimensions is sending to libmv as pattern size. Would be changed when libmv would support non-centered and non-square patterns. - Fixed bug with syncing pattern's flags when tracking. - Current frame in cache line became a bit more visible. It's useful for me to when debugging. - Changed behaviour of "Add Marekr" operator: not it's non-modal and places marker on mouse position at click. - Added macro "Add Marekr and Move" which is used to place markers from toolbar button. - Added some utility functions to get image buffer under search and pattern area which also returns relative position of marker center for this images. Generated images are more "correct" from coords rounding POV, but re-calculation of marker position back to frame coords is more complicated and not implemented yet, so old not very accurate logic is still used. - Added preview widget with content of pattern area. NOTE: files saved in previous versions of this branch could easily crash on tracking. Use "Reset To Settings" button from Tracking Settings before tracking selected markers for such files. TODO: - Implement adjusting marker position from marker's preview widget. - We've got an idea of sliding marker after click before releasing mouse button.
2011-06-14 16:22:06 +00:00
struct MovieTrackingContext *BKE_tracking_context_new(struct MovieClip *clip, struct MovieClipUser *user,
short backwards, short disable_failed);
void BKE_tracking_context_free(struct MovieTrackingContext *context);
void BKE_tracking_sync(struct MovieTrackingContext *context);
Camera tracking integraiton =========================== - Corrected copyrights in my new files header. - Added debug option to dump as PNG image content of search areas tracking between which was failed. - Removed internal tracking settings like pyramid level and tolerance. Weren't useful neither for me nor for artists. - Fixed bug in BKE_tracking_get_marker which could lead to failure of getting marker for current frame when there's marker for requested frame. - Fixed bug with disappearing markers after tracking for cases when marker was added at frame different from tracking start frame and tracking start frame is equal to tracking end frame. - Stop tracking when no markers could be tracked. - Changed marker selection rules: * If marker isn't selected, all it's areas are getting selected with mouse. * If marker is selected and selection type doesn't have "extend" mode (SHIFT isn't holded down) the nearest to mouse cursor area would be selected. All the reast areas would loose selection. - Limit number of frames which would be used in "Track Markers" operator. So now you could easily track along 10/20/etc frames. - Change scene current frame after "Track Markers" operator. - Implemented speed limitors. Now tracking could happen: * As fast as possible * With reatime speed (scene FPS) * With half of realtime speed * With quarter of realtime speed. - Got rid of orig_user in MovieTrackingContext and user in TrackMarkersJob. This prevents crashes when user joins some space to SpaceClip from which tracking was started. - Made keyframes on path bigger and do not draw keyframes for non-selected markers. TODO: need to get rid of storing main, scene and screen in TrackMarkersJob. This is needed to set scene's current frame after tracking (such behavior is comfortable for artists) but this could lead to crash if scene is getting removed when tracking job is running. Render animation operator also stores scene and main, so such solution could be fine for first time before we've got something smarter.
2011-06-22 14:54:53 +00:00
void BKE_tracking_sync_user(struct MovieClipUser *user, struct MovieTrackingContext *context);
int BKE_tracking_next(struct MovieTrackingContext *context);
float BKE_tracking_solve_reconstruction(struct MovieTracking *tracking, int width, int height);
Camera tracking integration =========================== - ColaMD moved from OpenNL to extern/. It'll be needed for libmv. Also, it's a bit updated from year 1999 to 2007. Need to be tested for regressions. - Updated bundling script for libmv. Now it uses fuller subset of this library. - Bundled new libmv. - Request from Keir: add command line argument to toggle logging stuff on. Currently, if Blender is launched with -d argument libmv would start printing logging messages. There's no argument to increase verbosity, but there's API in libmv-capi, so it'll be easy to add. - Finally fixed crash when ibuf is acquiring with user=NULL. - Added ActiveClip property to the scene. This clip is used as default value for new match-moving constraints. - Added some flags to Display panel of View3D. Related on displaying match-moving stuff. - Internal change: bundles data moved inside to MovieTrackingTrack. - Initial implementation of 3d reconstruction. - Added constraint "Camera Solver". This constraint is supposed to be used to make camera follow the reconstructed camera path. - Added "reference" property to "Follow Track" constraint. Now object could be "parented" to 2D track position or to 3D bundle position. The very quick guide: To use reconstruction you should have footage with tracked markers, choose two keyframes in "Tracking settings" panel. There should be quite noticeable parallax effect between this two frames. This is used to initialize reconstruction stuff. Camera data (focal length and optical center) should be filled in "Camera Data" panel. Optical center is often the center of image, so it'll be filled in automatically. You should also set values for undistortion (K1, K2 and K3). Currently, there's no any visualization for this parameters and approach of "change value -> reconstruct -> see what've changed" is the only way for now. Libmv team is working on auto-calibration tool, so it should be easier to gather this coefficients in nearest (i hope) future. There's also no scene orientation stuff. Basic workflow: - Open footage. - Set markers and track them. - Fill in camera data and keyframes. - Hit "Solve Camera" button. - Add "Camera Solver" constraint to camera in scene. - Choose movieclip in that constraint. - To see bundles in 3D viewport active clip should be set in scene buttons.
2011-07-07 17:58:33 +00:00
void BKE_track_unique_name(struct MovieTracking *tracking, struct MovieTrackingTrack *track);
struct MovieTrackingTrack *BKE_find_track_by_name(struct MovieTracking *tracking, const char *name);
Camera tracking integration =========================== - ColaMD moved from OpenNL to extern/. It'll be needed for libmv. Also, it's a bit updated from year 1999 to 2007. Need to be tested for regressions. - Updated bundling script for libmv. Now it uses fuller subset of this library. - Bundled new libmv. - Request from Keir: add command line argument to toggle logging stuff on. Currently, if Blender is launched with -d argument libmv would start printing logging messages. There's no argument to increase verbosity, but there's API in libmv-capi, so it'll be easy to add. - Finally fixed crash when ibuf is acquiring with user=NULL. - Added ActiveClip property to the scene. This clip is used as default value for new match-moving constraints. - Added some flags to Display panel of View3D. Related on displaying match-moving stuff. - Internal change: bundles data moved inside to MovieTrackingTrack. - Initial implementation of 3d reconstruction. - Added constraint "Camera Solver". This constraint is supposed to be used to make camera follow the reconstructed camera path. - Added "reference" property to "Follow Track" constraint. Now object could be "parented" to 2D track position or to 3D bundle position. The very quick guide: To use reconstruction you should have footage with tracked markers, choose two keyframes in "Tracking settings" panel. There should be quite noticeable parallax effect between this two frames. This is used to initialize reconstruction stuff. Camera data (focal length and optical center) should be filled in "Camera Data" panel. Optical center is often the center of image, so it'll be filled in automatically. You should also set values for undistortion (K1, K2 and K3). Currently, there's no any visualization for this parameters and approach of "change value -> reconstruct -> see what've changed" is the only way for now. Libmv team is working on auto-calibration tool, so it should be easier to gather this coefficients in nearest (i hope) future. There's also no scene orientation stuff. Basic workflow: - Open footage. - Set markers and track them. - Fill in camera data and keyframes. - Hit "Solve Camera" button. - Add "Camera Solver" constraint to camera in scene. - Choose movieclip in that constraint. - To see bundles in 3D viewport active clip should be set in scene buttons.
2011-07-07 17:58:33 +00:00
struct MovieReconstructedCamera *BKE_tracking_get_reconstructed_camera(struct MovieTracking *tracking, int framenr);
void BKE_tracking_get_interpolated_camera(struct MovieTracking *tracking, int framenr, float mat[4][4]);
Camera tracking integration =========================== - ColaMD moved from OpenNL to extern/. It'll be needed for libmv. Also, it's a bit updated from year 1999 to 2007. Need to be tested for regressions. - Updated bundling script for libmv. Now it uses fuller subset of this library. - Bundled new libmv. - Request from Keir: add command line argument to toggle logging stuff on. Currently, if Blender is launched with -d argument libmv would start printing logging messages. There's no argument to increase verbosity, but there's API in libmv-capi, so it'll be easy to add. - Finally fixed crash when ibuf is acquiring with user=NULL. - Added ActiveClip property to the scene. This clip is used as default value for new match-moving constraints. - Added some flags to Display panel of View3D. Related on displaying match-moving stuff. - Internal change: bundles data moved inside to MovieTrackingTrack. - Initial implementation of 3d reconstruction. - Added constraint "Camera Solver". This constraint is supposed to be used to make camera follow the reconstructed camera path. - Added "reference" property to "Follow Track" constraint. Now object could be "parented" to 2D track position or to 3D bundle position. The very quick guide: To use reconstruction you should have footage with tracked markers, choose two keyframes in "Tracking settings" panel. There should be quite noticeable parallax effect between this two frames. This is used to initialize reconstruction stuff. Camera data (focal length and optical center) should be filled in "Camera Data" panel. Optical center is often the center of image, so it'll be filled in automatically. You should also set values for undistortion (K1, K2 and K3). Currently, there's no any visualization for this parameters and approach of "change value -> reconstruct -> see what've changed" is the only way for now. Libmv team is working on auto-calibration tool, so it should be easier to gather this coefficients in nearest (i hope) future. There's also no scene orientation stuff. Basic workflow: - Open footage. - Set markers and track them. - Fill in camera data and keyframes. - Hit "Solve Camera" button. - Add "Camera Solver" constraint to camera in scene. - Choose movieclip in that constraint. - To see bundles in 3D viewport active clip should be set in scene buttons.
2011-07-07 17:58:33 +00:00
void BKE_get_tracking_mat(struct Scene *scene, struct Object *ob, float mat[4][4]);
void BKE_tracking_projection_matrix(struct MovieTracking *tracking, int framenr, int winx, int winy, float mat[4][4]);
void BKE_tracking_apply_intrinsics(struct MovieTracking *tracking, float co[2], float nco[2]);
void BKE_tracking_invert_intrinsics(struct MovieTracking *tracking, float co[2], float nco[2]);
void BKE_tracking_detect_fast(struct MovieTracking *tracking, struct ImBuf *imbuf,
int framenr, int margin, int min_trackness, int min_distance, struct bGPDlayer *layer);
void BKE_tracking_detect_moravec(struct MovieTracking *tracking, struct ImBuf *imbuf,
int framenr, int margin, int count, int min_distance, struct bGPDlayer *layer);
struct MovieTrackingTrack *BKE_tracking_indexed_bundle(struct MovieTracking *tracking, int bundlenr);
void BKE_tracking_stabilization_data(struct MovieTracking *tracking, int framenr, int width, int height, float loc[2], float *scale, float *angle);
struct ImBuf *BKE_tracking_stabilize(struct MovieTracking *tracking, int framenr, struct ImBuf *ibuf, float loc[2], float *scale, float *angle);
void BKE_tracking_stabdata_to_mat4(int width, int height, float loc[2], float scale, float angle, float mat[4][4]);
/* Distortion/Undistortion */
struct MovieDistortion *BKE_tracking_distortion_create(void);
struct MovieDistortion *BKE_tracking_distortion_copy(struct MovieDistortion *distortion);
struct ImBuf *BKE_tracking_distortion_exec(struct MovieDistortion *distortion, struct MovieTracking *tracking,
struct ImBuf *ibuf, int width, int height, float overscan, int undistort);
void BKE_tracking_distortion_destroy(struct MovieDistortion *distortion);
struct ImBuf *BKE_tracking_undistort(struct MovieTracking *tracking, struct ImBuf *ibuf, int width, int height, float overscan);
struct ImBuf *BKE_tracking_distort(struct MovieTracking *tracking, struct ImBuf *ibuf, int width, int height, float overscan);
#define TRACK_SELECTED(track) ((((track)->flag&TRACK_HIDDEN)==0) && ((track)->flag&SELECT || (track)->pat_flag&SELECT || (track)->search_flag&SELECT))
#define TRACK_AREA_SELECTED(track, area) ((((track)->flag&TRACK_HIDDEN)==0) && ((area)==TRACK_AREA_POINT?(track)->flag&SELECT : ((area)==TRACK_AREA_PAT?(track)->pat_flag&SELECT:(track)->search_flag&SELECT)))
#define TRACK_VIEW_SELECTED(sc, track) ((TRACK_AREA_SELECTED(track, TRACK_AREA_POINT) || (((sc)->flag&SC_SHOW_MARKER_PATTERN && TRACK_AREA_SELECTED(track, TRACK_AREA_PAT))) || (((sc)->flag&SC_SHOW_MARKER_SEARCH && TRACK_AREA_SELECTED(track, TRACK_AREA_SEARCH)))))
#define MARKER_VISIBLE(sc, marker) (((marker)->flag&MARKER_DISABLED)==0 || ((sc)->flag&SC_HIDE_DISABLED)==0)
Camera tracking integration =========================== - Initial implementaiton of new ID named MovieClip. Currently it has plactically the same functionality as images, but this functionality would be widen in nearest future. - Initial implementation of SpaceClip. This space is supposed to be used for acting with MovieClips (opening, playbacking, math-moving interaction and so on). Currently you could open image sequence/movie file here, pan/zoom, use a playback here. I've added cache visualizer to this space, but it's currently more a developer's feature to see how cache system works, but it could be adopted for further artists' usage (something like cache visuzlizer for simulations). - Added new theme area for Space Clip. No special colors were defined here yet. - Implementation of basic cache system for movies. This cache system is very familiar with sequence cache system, but it supposed to be more portable: at least cache keys aren't limited with sequence-based data and current seqcache could became an interface between sequencer and moviecache without much logic (only logic related on keys handling would be necessary here). Implemented basic limitors (ab\mount of cached imbuf's), so it'll be a bit more difficult to go out of memory when playing long animations in Image Editor (this cache system could be used for images too, in the future). - Very basic tools implementation -- only sceletion added, no real tool implemented (only camera focal length added to the UI which hasn't got real affect on anything). Assorted notes: - Not sure about best behaviour for Unlink clip button: should it be imageeditor-like (with de-referencing only) or text-editor like (with removing datablock from file). - Also not sure if tools/properties should be splitted into different areas or it'll be better to have tools and settings for this tool/item/etc in the same area (tools at the top, properties are under them). Code for properties area is '#if 0'-ed. - Sound isn't supported during playback in movie clip.
2011-05-30 04:18:02 +00:00
Camera tracking integration =========================== Implemented basic structures and operators for markers manipulaiton. Markers contains: - Position of marker at frame in unified 0..1 coordinates - Relative positions of left-bottom and right-top corners of pattern area - Relative positions of left-bottom and right-top corners of search area - Selection flags New operators: - Create new maerker. It's a modal operator which creates markers at mouse position when LMB is clicking. - Delete selected markers. - Select marker using RMB. Some parts of marker (point, patter, search) could be deselected. - Select markers using rectangular selection. - Select markers using circle selection. - Marker translation (G-key). - Marker scaling (S-key). UI changes: - Added mode to space clip. Currently supported modes are: * View mode * Tracking mode This was intended to separate different categories of tools, so interface shouldn't be overheaded with plenty of tools which aren't actually using in the same time. - Created new panel when actiev tool is 'MARKER' and there's active marker where positions could be adjusted in pixel space. Internal changes: - Splitted DNA/RNA movieclip files to make separation of tracking data and movie data more clear. This could be useful in the future when we'll want to support multiplie moies for single camera tracking (to make tracking more accurate). - Added new file in blenkernel, where all tracking-related function would be stored. Not very much function here at this moment, but in the future all stuff related on converting DNA to external tracking data would be stored here.
2011-06-03 15:39:53 +00:00
#define CLAMP_PAT_DIM 1
#define CLAMP_PAT_POS 2
#define CLAMP_SEARCH_DIM 3
#define CLAMP_SEARCH_POS 4
#define CLAMP_PYRAMID_LEVELS 5
Camera tracking integration =========================== - Initial implementaiton of new ID named MovieClip. Currently it has plactically the same functionality as images, but this functionality would be widen in nearest future. - Initial implementation of SpaceClip. This space is supposed to be used for acting with MovieClips (opening, playbacking, math-moving interaction and so on). Currently you could open image sequence/movie file here, pan/zoom, use a playback here. I've added cache visualizer to this space, but it's currently more a developer's feature to see how cache system works, but it could be adopted for further artists' usage (something like cache visuzlizer for simulations). - Added new theme area for Space Clip. No special colors were defined here yet. - Implementation of basic cache system for movies. This cache system is very familiar with sequence cache system, but it supposed to be more portable: at least cache keys aren't limited with sequence-based data and current seqcache could became an interface between sequencer and moviecache without much logic (only logic related on keys handling would be necessary here). Implemented basic limitors (ab\mount of cached imbuf's), so it'll be a bit more difficult to go out of memory when playing long animations in Image Editor (this cache system could be used for images too, in the future). - Very basic tools implementation -- only sceletion added, no real tool implemented (only camera focal length added to the UI which hasn't got real affect on anything). Assorted notes: - Not sure about best behaviour for Unlink clip button: should it be imageeditor-like (with de-referencing only) or text-editor like (with removing datablock from file). - Also not sure if tools/properties should be splitted into different areas or it'll be better to have tools and settings for this tool/item/etc in the same area (tools at the top, properties are under them). Code for properties area is '#if 0'-ed. - Sound isn't supported during playback in movie clip.
2011-05-30 04:18:02 +00:00
Camera tracking integraiton =========================== - Corrected copyrights in my new files header. - Added debug option to dump as PNG image content of search areas tracking between which was failed. - Removed internal tracking settings like pyramid level and tolerance. Weren't useful neither for me nor for artists. - Fixed bug in BKE_tracking_get_marker which could lead to failure of getting marker for current frame when there's marker for requested frame. - Fixed bug with disappearing markers after tracking for cases when marker was added at frame different from tracking start frame and tracking start frame is equal to tracking end frame. - Stop tracking when no markers could be tracked. - Changed marker selection rules: * If marker isn't selected, all it's areas are getting selected with mouse. * If marker is selected and selection type doesn't have "extend" mode (SHIFT isn't holded down) the nearest to mouse cursor area would be selected. All the reast areas would loose selection. - Limit number of frames which would be used in "Track Markers" operator. So now you could easily track along 10/20/etc frames. - Change scene current frame after "Track Markers" operator. - Implemented speed limitors. Now tracking could happen: * As fast as possible * With reatime speed (scene FPS) * With half of realtime speed * With quarter of realtime speed. - Got rid of orig_user in MovieTrackingContext and user in TrackMarkersJob. This prevents crashes when user joins some space to SpaceClip from which tracking was started. - Made keyframes on path bigger and do not draw keyframes for non-selected markers. TODO: need to get rid of storing main, scene and screen in TrackMarkersJob. This is needed to set scene's current frame after tracking (such behavior is comfortable for artists) but this could lead to crash if scene is getting removed when tracking job is running. Render animation operator also stores scene and main, so such solution could be fine for first time before we've got something smarter.
2011-06-22 14:54:53 +00:00
#define TRACK_AREA_NONE -1
#define TRACK_AREA_POINT 1
#define TRACK_AREA_PAT 2
#define TRACK_AREA_SEARCH 4
#define TRACK_AREA_ALL (TRACK_AREA_POINT|TRACK_AREA_PAT|TRACK_AREA_SEARCH)
Camera tracking integration =========================== - Initial implementaiton of new ID named MovieClip. Currently it has plactically the same functionality as images, but this functionality would be widen in nearest future. - Initial implementation of SpaceClip. This space is supposed to be used for acting with MovieClips (opening, playbacking, math-moving interaction and so on). Currently you could open image sequence/movie file here, pan/zoom, use a playback here. I've added cache visualizer to this space, but it's currently more a developer's feature to see how cache system works, but it could be adopted for further artists' usage (something like cache visuzlizer for simulations). - Added new theme area for Space Clip. No special colors were defined here yet. - Implementation of basic cache system for movies. This cache system is very familiar with sequence cache system, but it supposed to be more portable: at least cache keys aren't limited with sequence-based data and current seqcache could became an interface between sequencer and moviecache without much logic (only logic related on keys handling would be necessary here). Implemented basic limitors (ab\mount of cached imbuf's), so it'll be a bit more difficult to go out of memory when playing long animations in Image Editor (this cache system could be used for images too, in the future). - Very basic tools implementation -- only sceletion added, no real tool implemented (only camera focal length added to the UI which hasn't got real affect on anything). Assorted notes: - Not sure about best behaviour for Unlink clip button: should it be imageeditor-like (with de-referencing only) or text-editor like (with removing datablock from file). - Also not sure if tools/properties should be splitted into different areas or it'll be better to have tools and settings for this tool/item/etc in the same area (tools at the top, properties are under them). Code for properties area is '#if 0'-ed. - Sound isn't supported during playback in movie clip.
2011-05-30 04:18:02 +00:00
Camera tracking integration =========================== Implemented basic structures and operators for markers manipulaiton. Markers contains: - Position of marker at frame in unified 0..1 coordinates - Relative positions of left-bottom and right-top corners of pattern area - Relative positions of left-bottom and right-top corners of search area - Selection flags New operators: - Create new maerker. It's a modal operator which creates markers at mouse position when LMB is clicking. - Delete selected markers. - Select marker using RMB. Some parts of marker (point, patter, search) could be deselected. - Select markers using rectangular selection. - Select markers using circle selection. - Marker translation (G-key). - Marker scaling (S-key). UI changes: - Added mode to space clip. Currently supported modes are: * View mode * Tracking mode This was intended to separate different categories of tools, so interface shouldn't be overheaded with plenty of tools which aren't actually using in the same time. - Created new panel when actiev tool is 'MARKER' and there's active marker where positions could be adjusted in pixel space. Internal changes: - Splitted DNA/RNA movieclip files to make separation of tracking data and movie data more clear. This could be useful in the future when we'll want to support multiplie moies for single camera tracking (to make tracking more accurate). - Added new file in blenkernel, where all tracking-related function would be stored. Not very much function here at this moment, but in the future all stuff related on converting DNA to external tracking data would be stored here.
2011-06-03 15:39:53 +00:00
#endif