[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [37739] branches/soc-2011-salad: Merging r37599 through r37737 from soc-2011-tomato into soc-2011-salad

Sergey Sharybin g.ulairi at gmail.com
Wed Jun 22 19:38:48 CEST 2011


Revision: 37739
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=37739
Author:   nazgul
Date:     2011-06-22 17:38:47 +0000 (Wed, 22 Jun 2011)
Log Message:
-----------
Merging r37599 through r37737 from soc-2011-tomato into soc-2011-salad

Revision Links:
--------------
    http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=37599
    http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=37737

Modified Paths:
--------------
    branches/soc-2011-salad/extern/libmv/CMakeLists.txt
    branches/soc-2011-salad/extern/libmv/libmv-capi.cpp
    branches/soc-2011-salad/extern/libmv/libmv-capi.h
    branches/soc-2011-salad/release/scripts/startup/bl_ui/space_clip.py
    branches/soc-2011-salad/source/blender/blenkernel/BKE_moviecache.h
    branches/soc-2011-salad/source/blender/blenkernel/BKE_movieclip.h
    branches/soc-2011-salad/source/blender/blenkernel/BKE_tracking.h
    branches/soc-2011-salad/source/blender/blenkernel/intern/moviecache.c
    branches/soc-2011-salad/source/blender/blenkernel/intern/movieclip.c
    branches/soc-2011-salad/source/blender/blenkernel/intern/tracking.c
    branches/soc-2011-salad/source/blender/blenloader/intern/readfile.c
    branches/soc-2011-salad/source/blender/editors/interface/resources.c
    branches/soc-2011-salad/source/blender/editors/space_clip/CMakeLists.txt
    branches/soc-2011-salad/source/blender/editors/space_clip/clip_buttons.c
    branches/soc-2011-salad/source/blender/editors/space_clip/clip_draw.c
    branches/soc-2011-salad/source/blender/editors/space_clip/clip_editor.c
    branches/soc-2011-salad/source/blender/editors/space_clip/clip_header.c
    branches/soc-2011-salad/source/blender/editors/space_clip/clip_intern.h
    branches/soc-2011-salad/source/blender/editors/space_clip/clip_ops.c
    branches/soc-2011-salad/source/blender/editors/space_clip/space_clip.c
    branches/soc-2011-salad/source/blender/editors/space_clip/tracking_ops.c
    branches/soc-2011-salad/source/blender/makesdna/DNA_movieclip_types.h
    branches/soc-2011-salad/source/blender/makesdna/DNA_tracking_types.h
    branches/soc-2011-salad/source/blender/makesrna/intern/rna_tracking.c

Property Changed:
----------------
    branches/soc-2011-salad/


Property changes on: branches/soc-2011-salad
___________________________________________________________________
Modified: svn:mergeinfo
   - /branches/soc-2010-jwilkins:28499-37009
/branches/soc-2010-nicolasbishop:28448-30783,30792-30793,30797-30798,30815
/branches/soc-2011-cucumber:36829-36994
/branches/soc-2011-onion:36833-37529
/branches/soc-2011-pepper:36830-37151
/branches/soc-2011-tomato:36831-37598
/trunk/blender:36834-37735
   + /branches/soc-2010-jwilkins:28499-37009
/branches/soc-2010-nicolasbishop:28448-30783,30792-30793,30797-30798,30815
/branches/soc-2011-cucumber:36829-36994
/branches/soc-2011-onion:36833-37529
/branches/soc-2011-pepper:36830-37151
/branches/soc-2011-tomato:36831-37737
/trunk/blender:36834-37735

Modified: branches/soc-2011-salad/extern/libmv/CMakeLists.txt
===================================================================
--- branches/soc-2011-salad/extern/libmv/CMakeLists.txt	2011-06-22 17:35:05 UTC (rev 37738)
+++ branches/soc-2011-salad/extern/libmv/CMakeLists.txt	2011-06-22 17:38:47 UTC (rev 37739)
@@ -15,7 +15,7 @@
 # along with this program; if not, write to the Free Software Foundation,
 # Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 #
-# The Original Code is Copyright (C) 2006, Blender Foundation
+# The Original Code is Copyright (C) 2011 Blender Foundation.
 # All rights reserved.
 #
 # Contributor(s): Blender Foundation,

Modified: branches/soc-2011-salad/extern/libmv/libmv-capi.cpp
===================================================================
--- branches/soc-2011-salad/extern/libmv/libmv-capi.cpp	2011-06-22 17:35:05 UTC (rev 37738)
+++ branches/soc-2011-salad/extern/libmv/libmv-capi.cpp	2011-06-22 17:38:47 UTC (rev 37739)
@@ -17,7 +17,7 @@
  * along with this program; if not, write to the Free Software Foundation,
  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
  *
- * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
+ * The Original Code is Copyright (C) 2011 Blender Foundation.
  * All rights reserved.
  *
  * Contributor(s): Blender Foundation,
@@ -26,6 +26,10 @@
  * ***** END GPL LICENSE BLOCK *****
  */
 
+/* define this to generate PNg images with content of search areas
+  tracking between which failed */
+#undef DUMP_FAILURE
+
 #include "libmv-capi.h"
 
 #include "libmv/tracking/klt_region_tracker.h"
@@ -35,6 +39,10 @@
 
 #include <stdlib.h>
 
+#ifdef DUMP_FAILURE
+#  include <png.h>
+#endif
+
 #define DEFAULT_WINDOW_HALFSIZE	5
 
 typedef struct ConfiguredRegionTracker {
@@ -72,14 +80,107 @@
 
 	for (y = 0; y < height; y++) {
 		for (x = 0; x < width; x++) {
-		  (*image)(y, x, 0) = buf[a++];
+			(*image)(y, x, 0) = buf[a++];
 		}
 	}
 }
 
+#ifdef DUMP_FAILURE
+void savePNGImage(png_bytep *row_pointers, int width, int height, int depth, int color_type, char *file_name)
+{
+	png_infop info_ptr;
+	png_structp png_ptr;
+	FILE *fp = fopen(file_name, "wb");
+
+	if (!fp)
+		return;
+
+	/* Initialize stuff */
+	png_ptr = png_create_write_struct(PNG_LIBPNG_VER_STRING, NULL, NULL, NULL);
+	info_ptr = png_create_info_struct(png_ptr);
+
+	if (setjmp(png_jmpbuf(png_ptr))) {
+		fclose(fp);
+		return;
+	}
+
+	png_init_io(png_ptr, fp);
+
+	/* write header */
+	if (setjmp(png_jmpbuf(png_ptr))) {
+		fclose(fp);
+		return;
+	}
+
+	png_set_IHDR(png_ptr, info_ptr, width, height,
+		depth, color_type, PNG_INTERLACE_NONE,
+		PNG_COMPRESSION_TYPE_BASE, PNG_FILTER_TYPE_BASE);
+
+	png_write_info(png_ptr, info_ptr);
+
+	/* write bytes */
+	if (setjmp(png_jmpbuf(png_ptr))) {
+		fclose(fp);
+		return;
+	}
+
+	png_write_image(png_ptr, row_pointers);
+
+	/* end write */
+	if (setjmp(png_jmpbuf(png_ptr))) {
+		fclose(fp);
+		return;
+	}
+
+	png_write_end(png_ptr, NULL);
+
+	fclose(fp);
+}
+
+static void saveImage(libmv::FloatImage image, int x0, int y0)
+{
+	int x, y;
+	png_bytep *row_pointers;
+
+	row_pointers= (png_bytep*)malloc(sizeof(png_bytep)*image.Height());
+
+	for (y = 0; y < image.Height(); y++) {
+		row_pointers[y]= (png_bytep)malloc(sizeof(png_byte)*4*image.Width());
+
+		for (x = 0; x < image.Width(); x++) {
+			if (x0 == x && y0 == y) {
+				row_pointers[y][x*4+0]= 255;
+				row_pointers[y][x*4+1]= 0;
+				row_pointers[y][x*4+2]= 0;
+				row_pointers[y][x*4+3]= 255;
+			}
+			else {
+				float pixel = image(y, x, 0);
+				row_pointers[y][x*4+0]= pixel*255;
+				row_pointers[y][x*4+1]= pixel*255;
+				row_pointers[y][x*4+2]= pixel*255;
+				row_pointers[y][x*4+3]= 255;
+			}
+		}
+	}
+
+	{
+		static int a= 0;
+		char buf[128];
+		snprintf(buf, sizeof(buf), "%02d.png", ++a);
+		savePNGImage(row_pointers, image.Width(), image.Height(), 8, PNG_COLOR_TYPE_RGBA, buf);
+	}
+
+	for (y = 0; y < image.Height(); y++) {
+		free(row_pointers[y]);
+	}
+	free(row_pointers);
+}
+#endif
+
 int libmv_regionTrackerTrack(libmv_regionTrackerHandle tracker, const float *ima1, const float *ima2,
 			 int width, int height, int half_window_size,
-			 double  x1, double  y1, double *x2, double *y2)
+			 double x1, double y1, double *x2, double *y2)
 {
 	ConfiguredRegionTracker *configured_region_tracker;
 	libmv::RegionTracker *region_tracker;
@@ -95,7 +196,21 @@
 	floatBufToImage(ima1, width, height, &old_patch);
 	floatBufToImage(ima2, width, height, &new_patch);
 
+#ifndef DUMP_FAILURE
 	return region_tracker->Track(old_patch, new_patch, x1, y1, x2, y2);
+#else
+	{
+		double sx2 = *x2, sy2 = *y2;
+		int result = region_tracker->Track(old_patch, new_patch, x1, y1, x2, y2);
+
+		if (!result) {
+			saveImage(old_patch, x1, y1);
+			saveImage(new_patch, sx2, sy2);
+		}
+
+		return result;
+	}
+#endif
 }
 
 void libmv_regionTrackerDestroy(libmv_regionTrackerHandle tracker)

Modified: branches/soc-2011-salad/extern/libmv/libmv-capi.h
===================================================================
--- branches/soc-2011-salad/extern/libmv/libmv-capi.h	2011-06-22 17:35:05 UTC (rev 37738)
+++ branches/soc-2011-salad/extern/libmv/libmv-capi.h	2011-06-22 17:38:47 UTC (rev 37739)
@@ -17,7 +17,7 @@
  * along with this program; if not, write to the Free Software Foundation,
  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
  *
- * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
+ * The Original Code is Copyright (C) 2011 Blender Foundation.
  * All rights reserved.
  *
  * Contributor(s): Blender Foundation,

Modified: branches/soc-2011-salad/release/scripts/startup/bl_ui/space_clip.py
===================================================================
--- branches/soc-2011-salad/release/scripts/startup/bl_ui/space_clip.py	2011-06-22 17:35:05 UTC (rev 37738)
+++ branches/soc-2011-salad/release/scripts/startup/bl_ui/space_clip.py	2011-06-22 17:38:47 UTC (rev 37739)
@@ -110,12 +110,12 @@
         clip = context.space_data.clip
         settings = clip.tracking.settings
 
-        layout.prop(settings, "max_iterations")
-        layout.prop(settings, "pyramid_level")
-        layout.prop(settings, "tolerance")
+        layout.prop(settings, "speed")
+        layout.prop(settings, "use_frames_limit")
 
-        layout.operator("clip.reset_tracking_settings", \
-            text="Reset To Defaults")
+        row = layout.row()
+        row.active = settings.use_frames_limit
+        row.prop(settings, "frames_limit")
 
 
 class CLIP_PT_tracking_camera(bpy.types.Panel):

Modified: branches/soc-2011-salad/source/blender/blenkernel/BKE_moviecache.h
===================================================================
--- branches/soc-2011-salad/source/blender/blenkernel/BKE_moviecache.h	2011-06-22 17:35:05 UTC (rev 37738)
+++ branches/soc-2011-salad/source/blender/blenkernel/BKE_moviecache.h	2011-06-22 17:38:47 UTC (rev 37739)
@@ -17,7 +17,7 @@
  * along with this program; if not, write to the Free Software Foundation,
  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
  *
- * The Original Code is Copyright (C) Blender Foundation.
+ * The Original Code is Copyright (C) 2011 Blender Foundation.
  * All rights reserved.
  *
  * Contributor(s): Blender Foundation,

Modified: branches/soc-2011-salad/source/blender/blenkernel/BKE_movieclip.h
===================================================================
--- branches/soc-2011-salad/source/blender/blenkernel/BKE_movieclip.h	2011-06-22 17:35:05 UTC (rev 37738)
+++ branches/soc-2011-salad/source/blender/blenkernel/BKE_movieclip.h	2011-06-22 17:38:47 UTC (rev 37739)
@@ -17,7 +17,7 @@
  * along with this program; if not, write to the Free Software Foundation,
  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
  *
- * The Original Code is Copyright (C) Blender Foundation.
+  * The Original Code is Copyright (C) 2011 Blender Foundation.
  * All rights reserved.
  *
  * Contributor(s): Blender Foundation,

Modified: branches/soc-2011-salad/source/blender/blenkernel/BKE_tracking.h
===================================================================
--- branches/soc-2011-salad/source/blender/blenkernel/BKE_tracking.h	2011-06-22 17:35:05 UTC (rev 37738)
+++ branches/soc-2011-salad/source/blender/blenkernel/BKE_tracking.h	2011-06-22 17:38:47 UTC (rev 37739)
@@ -17,7 +17,7 @@
  * along with this program; if not, write to the Free Software Foundation,
  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
  *
- * The Original Code is Copyright (C) Blender Foundation.
+ * The Original Code is Copyright (C) 2011 Blender Foundation.
  * All rights reserved.
  *
  * Contributor(s): Blender Foundation,
@@ -58,10 +58,9 @@
 struct MovieTrackingContext *BKE_tracking_context_new(struct MovieClip *clip, struct MovieClipUser *user, int backwards);
 void BKE_tracking_context_free(struct MovieTrackingContext *context);
 void BKE_tracking_sync(struct MovieTrackingContext *context);
+void BKE_tracking_sync_user(struct MovieClipUser *user, struct MovieTrackingContext *context);
 int BKE_tracking_next(struct MovieTrackingContext *context);
 
-void BKE_tracking_reset_settings(struct MovieTracking *tracking);
-
 #define TRACK_SELECTED(track) ((track)->flag&SELECT || (track)->pat_flag&SELECT || (track)->search_flag&SELECT)
 #define TRACK_AREA_SELECTED(track, area) ((area)==TRACK_AREA_POINT?(track)->flag&SELECT : ((area)==TRACK_AREA_PAT?(track)->pat_flag&SELECT:(track)->search_flag&SELECT))
 
@@ -70,7 +69,7 @@
 #define CLAMP_SEARCH_DIM	3
 #define CLAMP_SEARCH_POS	4
 
-#define TRACK_AREA_NONE	-	1
+#define TRACK_AREA_NONE		-1
 #define TRACK_AREA_POINT	1
 #define TRACK_AREA_PAT		2
 #define TRACK_AREA_SEARCH	4


@@ Diff output truncated at 10240 characters. @@



More information about the Bf-blender-cvs mailing list