[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [58874] branches/soc-2011-tomato: Fix wrong usage of mul_v3_m3v3.
Sergey Sharybin
sergey.vfx at gmail.com
Sat Aug 3 21:53:38 CEST 2013
Revision: 58874
http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=58874
Author: nazgul
Date: 2013-08-03 19:53:38 +0000 (Sat, 03 Aug 2013)
Log Message:
-----------
Fix wrong usage of mul_v3_m3v3.
You couldn't use the same vector as input and output.
Modified Paths:
--------------
branches/soc-2011-tomato/extern/libmv/libmv-capi.cc
branches/soc-2011-tomato/source/blender/blenkernel/intern/tracking.c
Modified: branches/soc-2011-tomato/extern/libmv/libmv-capi.cc
===================================================================
--- branches/soc-2011-tomato/extern/libmv/libmv-capi.cc 2013-08-03 19:53:30 UTC (rev 58873)
+++ branches/soc-2011-tomato/extern/libmv/libmv-capi.cc 2013-08-03 19:53:38 UTC (rev 58874)
@@ -1107,12 +1107,12 @@
x2_mat.col(i) = libmv::Vec2(x2[i][0], x2[i][1]);
}
- LG << "x1: " << x1_mat;
- LG << "x2: " << x2_mat;
+ LG << "x1:\n" << x1_mat;
+ LG << "x2:\n" << x2_mat;
libmv::Homography2DFromCorrespondencesLinear(x1_mat, x2_mat, &H_mat, expected_precision);
- LG << "H: " << H_mat;
+ LG << "H:\n" << H_mat;
memcpy(H, H_mat.data(), 9 * sizeof(double));
}
Modified: branches/soc-2011-tomato/source/blender/blenkernel/intern/tracking.c
===================================================================
--- branches/soc-2011-tomato/source/blender/blenkernel/intern/tracking.c 2013-08-03 19:53:30 UTC (rev 58873)
+++ branches/soc-2011-tomato/source/blender/blenkernel/intern/tracking.c 2013-08-03 19:53:38 UTC (rev 58874)
@@ -3374,7 +3374,7 @@
point_markers_correspondences_on_both_image(plane_track, current_frame, current_frame + frame_delta,
&x1, &x2);
- if (num_correspondences == 0) {
+ if (num_correspondences < 4) {
MEM_freeN(x1);
MEM_freeN(x2);
@@ -3386,17 +3386,17 @@
mat3f_from_mat3d(H, H_double);
for (i = 0; i < 4; i++) {
- float vec[3] = {0.0f, 0.0f, 1.0f};
+ float vec[3] = {0.0f, 0.0f, 1.0f}, vec2[3];
copy_v2_v2(vec, new_plane_marker.corners[i]);
/* Apply homography */
- mul_v3_m3v3(vec, H, vec);
+ mul_v3_m3v3(vec2, H, vec);
/* Normalize. */
- vec[0] /= vec[2];
- vec[1] /= vec[2];
+ vec2[0] /= vec2[2];
+ vec2[1] /= vec2[2];
- copy_v2_v2(new_plane_marker.corners[i], vec);
+ copy_v2_v2(new_plane_marker.corners[i], vec2);
}
new_plane_marker.framenr = current_frame + frame_delta;
More information about the Bf-blender-cvs
mailing list