[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [40850] branches/soc-2011-tomato: Camera tracking integration

Sergey Sharybin g.ulairi at gmail.com
Fri Oct 7 21:21:30 CEST 2011


Revision: 40850
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=40850
Author:   nazgul
Date:     2011-10-07 19:21:29 +0000 (Fri, 07 Oct 2011)
Log Message:
-----------
Camera tracking integration
===========================

Fixed threading issues used to happen when compositor tree
and rendering happened in the same time. Problem was caused
by cached camera intrinsics stored in MovieTracking structure
and access to which wasn't thread-safe.

Now each movie distoriton mode stores it's own camera intrinsics
in it's storage which makes compositor (un)distoriton be totally
thread-safe and this also makes compositor tree faster when
(un)distortion happens on images with different resolution.

Modified Paths:
--------------
    branches/soc-2011-tomato/extern/libmv/ChangeLog
    branches/soc-2011-tomato/extern/libmv/bundle.sh
    branches/soc-2011-tomato/extern/libmv/libmv/simple_pipeline/camera_intrinsics.cc
    branches/soc-2011-tomato/extern/libmv/libmv/simple_pipeline/camera_intrinsics.h
    branches/soc-2011-tomato/extern/libmv/libmv-capi.cpp
    branches/soc-2011-tomato/extern/libmv/libmv-capi.h
    branches/soc-2011-tomato/extern/libmv/patches/scaled_distortion.patch
    branches/soc-2011-tomato/source/blender/blenkernel/BKE_movieclip.h
    branches/soc-2011-tomato/source/blender/blenkernel/BKE_tracking.h
    branches/soc-2011-tomato/source/blender/blenkernel/intern/movieclip.c
    branches/soc-2011-tomato/source/blender/blenkernel/intern/tracking.c
    branches/soc-2011-tomato/source/blender/blenloader/intern/readfile.c
    branches/soc-2011-tomato/source/blender/blenloader/intern/writefile.c
    branches/soc-2011-tomato/source/blender/editors/space_clip/clip_ops.c
    branches/soc-2011-tomato/source/blender/nodes/composite/node_composite_tree.c
    branches/soc-2011-tomato/source/blender/nodes/composite/nodes/node_composite_moviedistortion.c

Modified: branches/soc-2011-tomato/extern/libmv/ChangeLog
===================================================================
--- branches/soc-2011-tomato/extern/libmv/ChangeLog	2011-10-07 18:57:26 UTC (rev 40849)
+++ branches/soc-2011-tomato/extern/libmv/ChangeLog	2011-10-07 19:21:29 UTC (rev 40850)
@@ -1,3 +1,15 @@
+commit 531c79bf95fddaaa70707d1abcd4fdafda16bbf0
+Author: Matthias Fauconneau <matthias.fauconneau at gmail.com>
+Date:   Sat Aug 20 00:00:42 2011 +0200
+
+    Display warped pattern in marker preview.
+
+commit bb5c27e671b6f8eb56ddf490f0795d59bede591b
+Author: Matthias Fauconneau <matthias.fauconneau at gmail.com>
+Date:   Fri Aug 19 18:37:48 2011 +0200
+
+    Fix CMake build.
+
 commit 2ac7281ff6b9545b425dd84fb03bf9c5c98b4de2
 Author: Matthias Fauconneau <matthias.fauconneau at gmail.com>
 Date:   Fri Aug 19 17:34:45 2011 +0200
@@ -298,197 +310,3 @@
 Date:   Wed Jul 27 10:27:07 2011 +0200
 
     Image Distortion: Bilinear sampling, Optimization, Instantiate all variants (Distort/Undistort, float/ubyte, 1-4 channels).
-
-commit 91916db921e1f2818f0aa2be823bf92c50ad4de9
-Author: Matthias Fauconneau <matthias.fauconneau at gmail.com>
-Date:   Tue Jul 26 22:51:21 2011 +0200
-
-    New Undistortion API in CameraIntrinsics.h.
-    Implement Undistortion API in CameraIntrinsics.cc.
-
-commit 8c47a26072cfa9cf216771e5ae7a1dc60a770f82
-Author: Matthias Fauconneau <matthias.fauconneau at gmail.com>
-Date:   Tue Jul 26 22:16:06 2011 +0200
-
-    Qt Calibration fixes. Image undistortion experiments.
-
-commit b575d9f68856b4e95a6b0a92ecc4e7d635342f95
-Author: Matthias Fauconneau <matthias.fauconneau at gmail.com>
-Date:   Tue Jul 26 22:14:54 2011 +0200
-
-    Qt Calibration fixes.
-    Image undistortion experiments.
-
-commit fac2b3e88ef8f14fa62149f6fc929c623d73fe39
-Author: Matthias Fauconneau <matthias.fauconneau at gmail.com>
-Date:   Mon Jul 25 11:44:17 2011 +0200
-
-    Merge uncalibrated reconstruction.
-    UI fixes.
-
-commit d04071ee210baef5ff657441c8c5284c235e93a3
-Merge: 795e50f c4c67db
-Author: Matthias Fauconneau <matthias.fauconneau at gmail.com>
-Date:   Sat Jul 23 12:18:58 2011 +0200
-
-    Merge branch 'master' of git://github.com/keir/libmv
-    
-    Conflicts:
-    	src/libmv/simple_pipeline/initialize_reconstruction.h
-    	src/ui/tracker/main.cc
-    	src/ui/tracker/main.h
-    	src/ui/tracker/scene.cc
-    	src/ui/tracker/scene.h
-
-commit 795e50fa1ca9ca4373ad9b5432916edf2f1940a0
-Author: Matthias Fauconneau <matthias.fauconneau at gmail.com>
-Date:   Sat Jul 23 12:12:53 2011 +0200
-
-    Support creating FloatImage without copying data.
-
-commit c4c67db84cc6e972be19c3e0f495477a1419200e
-Author: Keir Mierle <mierle at gmail.com>
-Date:   Thu Jul 21 10:24:06 2011 -0700
-
-    Add an uncalibrated reconstruction pipeline to libmv.
-    
-    Note: The pipeline doesn't actually work yet! It runs, but the resulting
-    reconstruction is wildly broken. I have a number of theories as to why this is,
-    and will write tests to track this down, but this change has grown out of
-    control in the meantime.
-
-commit 584e0ddc4058a6a4e41b1fd9665654097af177d4
-Author: Matthias Fauconneau <matthias.fauconneau at gmail.com>
-Date:   Wed Jul 20 20:21:55 2011 +0200
-
-    Latest working revision of simple optimized tracker.
-
-commit 7983f86ff93f1ccd06f78439fb87387aecdfe49e
-Author: Matthias Fauconneau <matthias.fauconneau at gmail.com>
-Date:   Wed Jul 20 20:10:12 2011 +0200
-
-    Revert "Incremental optimization: Change API to take float*."
-    
-    This reverts commit 922dc5c31022afc7fd14b2ead32491c079565d7b.
-
-commit 922dc5c31022afc7fd14b2ead32491c079565d7b
-Author: Matthias Fauconneau <matthias.fauconneau at gmail.com>
-Date:   Wed Jul 20 17:11:20 2011 +0200
-
-    Incremental optimization: Change API to take float*.
-
-commit 9d9fab4165aabad6474bb879b5f418c1b7a7862e
-Author: Matthias Fauconneau <matthias.fauconneau at gmail.com>
-Date:   Wed Jul 20 17:05:14 2011 +0200
-
-    Incremental optimization.
-
-commit 739fe5a118a2a5c90cf2c6d66c776231da0fb92b
-Author: Matthias Fauconneau <matthias.fauconneau at gmail.com>
-Date:   Wed Jul 20 16:57:37 2011 +0200
-
-    Incremental optimization.
-
-commit c48ba3b9f49e8fc5ef45ab1b6753f70bfdef0c34
-Author: Matthias Fauconneau <matthias.fauconneau at gmail.com>
-Date:   Wed Jul 20 15:05:11 2011 +0200
-
-    Inline.
-
-commit 2b7e704d947cafd12d67b3904365feb7c2b3e89a
-Author: Matthias Fauconneau <matthias.fauconneau at gmail.com>
-Date:   Wed Jul 20 14:59:12 2011 +0200
-
-    Keep relative marker position in tracker.
-
-commit a92e1fb70c2be05f9808bc43b87d3949790ef7ed
-Author: Matthias Fauconneau <matthias.fauconneau at gmail.com>
-Date:   Wed Jul 20 10:56:52 2011 +0200
-
-    Avoid unecessary pyramid copy.
-
-commit 31908b280e8862f15c3f67f697727dd692db9997
-Author: Matthias Fauconneau <matthias.fauconneau at gmail.com>
-Date:   Wed Jul 20 10:45:54 2011 +0200
-
-    tracker.cc: Extract float image only when necessary.
-    klt.cc: Remove retrack which wasn't useful when we already use robust time-reversible KLT (+40% speed)
-    klt.cc: Factorize bilinear sampling
-    
-    We are probably limited by bandwidth because of the float image filtering.
-    Next optimization step would require reducing filter sizes and use integer filtering.
-    Though, it will be necessary to verify the impact of tracking quality.
-
-commit 433cd976f6047324ba27f21b3cafe3ecfbcb5aa1
-Author: Matthias Fauconneau <matthias.fauconneau at gmail.com>
-Date:   Tue Jul 19 23:21:47 2011 +0200
-
-    Really add the simplified and optimized tracker.
-
-commit caf938781bcd3e695f127a548678a1cf0a426b8f
-Author: Matthias Fauconneau <matthias.fauconneau at gmail.com>
-Date:   Tue Jul 19 23:19:24 2011 +0200
-
-    Replace tracking/* trackers with the new simplified and optimized version.
-    
-    This first optimization pass should result in a 4x speedup.
-    TODO: Integrating optimized filtering and optimized bilinear sampling should provide additionnal performance.
-
-commit 13f5707573757a37d72b3d5be21a019049de9523
-Author: Matthias Fauconneau <matthias.fauconneau at gmail.com>
-Date:   Tue Jul 19 23:14:19 2011 +0200
-
-    Update documentation.
-
-commit a002fcf0ee42bd15991df34832cf557a5653c48e
-Author: Matthias Fauconneau <matthias.fauconneau at gmail.com>
-Date:   Tue Jul 19 23:07:05 2011 +0200
-
-    Incremental Optimization #4: Keep last filtered pyramid.
-    
-    This avoid computing the pyramid downsampling twice (as new patch and then as old patch).
-    API was changed as this require the client to keep our state.
-
-commit 6772d7916126e710179370a5412d9380f05995a9
-Author: Matthias Fauconneau <matthias.fauconneau at gmail.com>
-Date:   Tue Jul 19 22:54:30 2011 +0200
-
-    Incremental Optimization #3: Move Filtering in MakePyramid.
-    
-    This avoid computing each pyramid filter twice (i.e for each call to TrackImage).
-
-commit eec24f8c8b21ec286d12990b6e63772d7559bccc
-Author: Matthias Fauconneau <matthias.fauconneau at gmail.com>
-Date:   Tue Jul 19 22:42:35 2011 +0200
-
-    Incremental Optimization #2: Move pyramid downsampling up to Track.
-    
-    This avoid computing the pyramid downsampling twice (forward and backward).
-
-commit 35cd70d321113956f2413084102a3a76ca35186f
-Author: Matthias Fauconneau <matthias.fauconneau at gmail.com>
-Date:   Tue Jul 19 22:37:01 2011 +0200
-
-    Incremental optimization #1: Convert retrack/pyramid/KLT tracker objects to respective methods in a single Tracker object.
-    
-    This is necessary to allow retrack to reuse pyramids and avoid filtering images multiple times.
-
-commit 84341da380c585645f38e67dce5a8e1fd58242ac
-Author: Matthias Fauconneau <matthias.fauconneau at gmail.com>
-Date:   Tue Jul 19 22:17:58 2011 +0200
-
-    Revert to working tracker in Qt Tracker.
-    
-    TODO: The optimization changes shall be done incrementally.
-
-commit 1d15e8572e8922c2a7aa8927f6f82c13ed6c3fc8
-Author: Matthias Fauconneau <matthias.fauconneau at gmail.com>
-Date:   Tue Jul 19 21:18:21 2011 +0200
-
-    Fix missing deallocation.
-
-commit a3ca18db4dec90414e658d480ea5f19b31bb8a77
-Author: Matthias Fauconneau <matthias.fauconneau at gmail.com>
-Date:   Tue Jul 19 21:00:37 2011 +0200
-
-    Progress in debugging optimized KLT.

Modified: branches/soc-2011-tomato/extern/libmv/bundle.sh
===================================================================
--- branches/soc-2011-tomato/extern/libmv/bundle.sh	2011-10-07 18:57:26 UTC (rev 40849)
+++ branches/soc-2011-tomato/extern/libmv/bundle.sh	2011-10-07 19:21:29 UTC (rev 40850)
@@ -13,7 +13,8 @@
 
 git clone $repo $tmp/libmv
 
-git --git-dir $tmp/libmv/.git --work-tree $tmp/libmv log --since="1 month ago" > ChangeLog
+#git --git-dir $tmp/libmv/.git --work-tree $tmp/libmv log --since="1 month ago" > ChangeLog
+git --git-dir $tmp/libmv/.git --work-tree $tmp/libmv log -n 50 > ChangeLog
 
 for p in `cat ./patches/series`; do
   echo "Applying patch $p..."

Modified: branches/soc-2011-tomato/extern/libmv/libmv/simple_pipeline/camera_intrinsics.cc
===================================================================
--- branches/soc-2011-tomato/extern/libmv/libmv/simple_pipeline/camera_intrinsics.cc	2011-10-07 18:57:26 UTC (rev 40849)
+++ branches/soc-2011-tomato/extern/libmv/libmv/simple_pipeline/camera_intrinsics.cc	2011-10-07 19:21:29 UTC (rev 40850)
@@ -23,9 +23,33 @@
 
 namespace libmv {
 
-struct Offset { signed char ix,iy; unsigned char fx,fy; };
-struct Grid { struct Offset *offset; int width, height; };
+struct Offset {
+  signed char ix, iy;
+  unsigned char fx,fy;
+};
 
+struct Grid {
+  struct Offset *offset;
+  int width, height;
+};
+
+static struct Grid *copyGrid(struct Grid *from)
+{
+  struct Grid *to = NULL;
+
+  if (from) {
+    to = new Grid;
+
+    to->width = from->width;
+    to->height = from->height;
+
+    to->offset = new Offset[to->width*to->height];
+    memcpy(to->offset, from->offset, sizeof(struct Offset)*to->width*to->height);
+  }
+
+  return to;
+}
+
 CameraIntrinsics::CameraIntrinsics()
     : K_(Mat3::Identity()),
       image_width_(0),
@@ -38,6 +62,20 @@
       distort_(0),
       undistort_(0) {}
 
+CameraIntrinsics::CameraIntrinsics(const CameraIntrinsics &from)
+    : K_(from.K_),
+      image_width_(from.image_width_),
+      image_height_(from.image_height_),
+      k1_(from.k1_),
+      k2_(from.k2_),
+      k3_(from.k3_),
+      p1_(from.p1_),
+      p2_(from.p2_)
+{
+  distort_ = copyGrid(from.distort_);
+  undistort_ = copyGrid(from.undistort_);
+}
+
 CameraIntrinsics::~CameraIntrinsics() {
   FreeLookupGrid();
 }
@@ -155,8 +193,8 @@

@@ Diff output truncated at 10240 characters. @@



More information about the Bf-blender-cvs mailing list