Commit Graph

307 Commits

Author SHA1 Message Date
81e3db364d Camera tracking refactoring:
- Deduplicate patetrn sampling used in esm and lmicklt trackers and
  move SamplePattern to image/sample.h - Move computation of Pearson
  product-moment correlation into own function in new file image/correlation.h
  so all trackers can use it to check final correlation.
- Remove SAD tracker. It's almost the same as brute tracker, with only two differences:
  1. It does brute search of affine transformation which in some cases helps to track
     rotating features 2. It didn't use common tracker api which probably gave some
     speed advantage, but lead to a real headache to use it together with other
     trackers leading to duplicated code in blender side.
- Switch blenedr to use brute tracker instead of sad tracker which tracking made
  source code much more simple to follow.
2012-03-30 10:37:39 +00:00
52b26c4e4e Default settings for new movie clip tracking now is the same as Default preset 2012-03-26 14:30:30 +00:00
1ce2c73816 Code style cleaup for motion-tracking modules.
Should be no functional changes.
2012-03-25 23:19:21 +00:00
b8a71efeba style cleanup: follow style guide for/with/if spacing 2012-03-24 07:52:14 +00:00
69e6894b15 style cleanup: follow style guide for formatting of if/for/while loops, and else if's 2012-03-24 06:18:31 +00:00
af46a2902f Use linear interpolation for intersecting tracks when joining them together. 2012-03-21 17:21:27 +00:00
e82cd12560 Tracking objects were creating with zero scale. 2012-03-21 16:45:27 +00:00
d110ae7791 Allow merging two tracks in cases when they've got overlapping tracked/keyframed
frame ranges using average position of both tracks as position/
2012-03-16 14:06:43 +00:00
f34c3580ac Fix possible usage of NULL function reported by clang 2012-03-13 10:31:42 +00:00
78941c1676 Remove remained part of debug code. 2012-03-10 17:14:50 +00:00
c175ed8b9b Forgot to remove code used for debuggning in previous commit. 2012-03-10 16:55:09 +00:00
be9aa6eada Finally 2D stabilization auto scale factor should be calculated perfectly 2012-03-10 16:31:12 +00:00
0c68f0eee8 Previous fix for stabilization autoscale actually broke stabilizaiton itself
(median point was sliding a bit from it's original position)

This happens because of how transformation for stabilization calculates:
image is scaling around it's center, so image translation should be recalculated
after scale was changed, but scale also depends on translation. That's where
tricky things happens. It's still not ideal for case of rotation, but before
fixing this issue better to figure out usecase and see if it's indeed
so needed to scale around image center (it might only be helpful to use
stabilization parameters in compositor nodes).
2012-03-09 13:37:42 +00:00
eb1b38f31a Some fixes for 2D stabilization:
- Ron aspect ratio correction after applying location
  There're still some annoynments with rotation stabilization with
  pixel aspect != 1, will be fixed later.
- Joining tracks will update track used for rotation stabilization/
2012-03-09 10:01:29 +00:00
4f7bdc59d3 style cleanup: spelling.
also remove large, duplicate comments from sunsky.h
2012-03-09 00:41:09 +00:00
95670e03a0 style cleanup / comment formatting for bli/bke/bmesh 2012-03-03 20:19:11 +00:00
ea13ec1699 Spelling Cleanup 2012-03-01 12:20:18 +00:00
47c373c7a9 style cleanup (mostly whitespace) 2012-02-27 10:35:39 +00:00
8285fef0e8 Fixed for selected bundles drawing in 3D viewport:
- If track was hidded in clip editor it wasn't highlighted in 3d viewport
  even if it's selected.
- If two tracks has got the same bundle coordinate and one of them is
  selected it might not be highlighted in 3d viewport because of
  draw order.
2012-02-26 08:14:14 +00:00
c8de268e1b Camera tracing: search area was always centered to marker's position when tracking 2012-02-21 12:59:52 +00:00
62d09c9103 Tomato: configurable filter type for 2d stabilization 2012-02-16 15:03:37 +00:00
14a92fc3a2 Tomato: run aspect correction before stabilizing shot. 2012-02-16 15:03:18 +00:00
aa747f5889 Tomato: fixed issue when track used for rotation stabilization points to a freed memory after re-tracking this track. 2012-02-16 13:15:01 +00:00
fedb95da23 Tomato: fixed incorrect auto-scale calculation for 2d stabilization 2012-02-16 13:14:28 +00:00
ca927b5771 Fixed typo in tracking context creation. Wasn't harmful because because of definition value,
but better avoid such confusing assignment.
2012-02-01 19:36:39 +00:00
2f90477272 Camera tracking: regression fixed after recent frame postprocessing refactor
No-proxied frames using for 2D tracking used to be putting to cache which lead
to extra memory usage which shouldn't happen.
2012-02-01 19:06:21 +00:00
bcbe9ca5fc Color channels used for tracking is now a part of default tracking settings and also a part of presets. 2012-01-26 15:33:16 +00:00
bce89860f5 Various fixes for camera tracking stuff
- Fixed tooltip displaying for track sequence forwards in clip editor
- Corrected detection of 8 tracks so it wouldn't count tracks disabled
  on keyframes.
- Scale track preview to actual track widget size instead of scaling the
  whole preview image with given zoom ratio, so no extra memory needed to
  store zoomed margin would be used.
- Track's statistics text will fit pattern position instead of search if
  marker is disabled on current frame.
- Fixed toggle selection operator if selected track is hidden due to
  "Hide Disabled" policy.
2012-01-25 13:37:11 +00:00
128741a02e Fix typo in camera reconstruction context creation.
Thanks to Lockal to pointing out!
2012-01-25 09:27:18 +00:00
1c33126cf5 Fix #29975: Track Preview color channels not filtering correctly
Typo in checking bitflags
2012-01-24 12:25:03 +00:00
91835abde4 Remove unused code and code sued for debug 2012-01-15 13:32:07 +00:00
f37d1b7b4e Color channels now can be disabled for the whole frame in clip editor 2012-01-15 13:31:58 +00:00
fca385ca9a - opengl render in quadview wasn't using camera.
- minor change to FTOCHAR use.
2012-01-14 11:21:00 +00:00
e10fd04db0 use BLI_strncpy and BLI_snprintf when the size of the string is known.
fix for sequencer unique naming which was missed with string length update.
2012-01-11 12:33:51 +00:00
51bada696f Longer names support for all ID and other object names
This commit extends limit of ID and objects to 64 (it means 63 meaning
characters and 1 for zero-terminator). CustomData layers names are also
extended.
Changed DNA structures and all places where length constants were hardcoded.

All names which are "generating" from ID block should be limited by MAX_ID_NAME-2,
all non-id names now has got own define called MAX_NAME which should be used all
over for non-id names to make further name migration stuff easier.

All name fields in DNA now have comment with constant which corresponds to
hardcoded numeric value which should make it easier to further update this
limits or even switch to non-hardcoded values in DNA.

Special thanks to Campbell who helped figuring out some issues and helped a lot
in finding all cases where hardcoded valued were still used in code.

Both of forwards and backwards compatibility is stored with blender versions newer
than January 5, 2011. Older versions had issue with placing null-terminator to
DNA strings on file load which will lead to some unpredictable behavior or even
crashes.
2012-01-11 08:51:06 +00:00
0e4f4acc2f comment unused vars 2012-01-09 22:18:04 +00:00
5bf5d5a844 Camera tracking: tracks copy/paste operator
This commit implements basic clipboard support for movie tracking data
int clip editor. Used own implementation of clipboard like it's done
for sequencer.
Ideally it needed to be switched to more general clipboard system, but
currently this system is designed for text data only and it need to
be re-designed itself. But this feature is quite useful since object
tracking is implemented, so it should be OK to live with such own
implementation for a while.
2012-01-09 20:18:48 +00:00
a69904aefe Camera tracking: improvements of python api
- marker_find_frame moved to MovieTrack.markers and called find_frame
- Added MovieTrack.markers.insert_frame to insert marker at specified frame
- Added MovieTrack.markers.delete_frame to delete marker from specified frame
2012-01-09 20:18:28 +00:00
a4604c457d Camera tracking: more accurate track preview widget
- Added 1px extra margin to deal with bicubic interpolation nicely
- Code should be a bit more clear now
2012-01-04 15:25:43 +00:00
3bb3d46ccf Code cleanup: do not use check for nan when doing check for finite due to
finite() would be FALSE in case of nan to.

Thanks to Campbell for this information.
2011-12-31 11:03:32 +00:00
59b406ce73 Minor code cleanup after resolving conflicts 2011-12-31 09:30:39 +00:00
65c74f1570 workaround for error building with clang and quiet some warnings building without libmv. 2011-12-31 03:01:18 +00:00
792452a7e5 Disable markers when doing frame-by-frame tracking and tracker library returns failure 2011-12-30 18:15:44 +00:00
3c6e818b22 Object tracking integration
This commits merges object tracking implementation from tomato branch.

Summarized changes from branch:

- Added list of objects to be tracked. Default there's only one object called
  "Camera" which is used for solving camera motion. Other objects can be added
  and each of them will have it;s own list of tracks. Only one object can be used
  for camera solving at this moment.
- Added new constraint called "Object Tracking" which makes oriented object be
  moving in the save way as solved object motion.
- Scene orientation tools can be used for orienting object to bundles.
- Object has got scale to define "depth" in camera space.
- All tools which works with list of tracks or reconstruction data now
  gets that lists from active editing object.
- All objects and their tracking data are available via python api.
- Improvements in witness cameras workflow,
2011-12-30 18:06:02 +00:00
c21cfb4fcd Camera tracking: improvements of track preview widget
- Enable bicybic filtering fir image displayed in track preview
- Option to show grayscale content of track preview
- When some channels are disabled, display exactly the same
  content of preview image which is sending to tracker library.

Merged from tomato branch using command:
    svn merge -r42382:42383 -r42384:42385 -r42394:42395 \
	    -r42397:42398 -r42398:42399 -r42406:42407 \
		-r42410:42411 -r42417:42418 -r42471:42472 \
		^/branches/soc-2011-tomato
2011-12-30 10:20:29 +00:00
90760b9f87 Fixed low boundary when detecting frames range for camera solver 2011-12-30 08:40:36 +00:00
7c5c256fd5 Fix #29729: Blender crashes when camera solving with a disabled marker
Stupid mistake in index of last marker when detecting frames bounds
2011-12-30 08:34:00 +00:00
c2ae77e5bd Merging r42896 through r42944 from trunk into soc-2911-tomato 2011-12-28 18:31:32 +00:00
6963e43148 More fixes for timecode usage with BKE_movieclip_get_ibuf_flag 2011-12-27 11:09:06 +00:00
0ac3ab752f Fix #29688: Timecode is not used in tracking
Use proper timecode flags sending to BKE_movieclip_get_ibuf_flag function,
so now frames for tracking would be full-resolution but calculated using
timecode defined in th interface,
2011-12-27 10:52:23 +00:00