[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [59195] branches/soc-2013-cycles_mblur: Merged trunk into branch.
Gavin Howard
gavin.d.howard at gmail.com
Sat Aug 17 06:35:26 CEST 2013
Revision: 59195
http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=59195
Author: gdh
Date: 2013-08-17 04:35:23 +0000 (Sat, 17 Aug 2013)
Log Message:
-----------
Merged trunk into branch. Includes r59149 to r59194.
Revision Links:
--------------
http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=59149
http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=59194
Modified Paths:
--------------
branches/soc-2013-cycles_mblur/build_files/scons/tools/Blender.py
branches/soc-2013-cycles_mblur/extern/libmv/libmv/multiview/euclidean_resection.cc
branches/soc-2013-cycles_mblur/extern/libmv/libmv/multiview/euclidean_resection.h
branches/soc-2013-cycles_mblur/extern/libmv/libmv-capi.cc
branches/soc-2013-cycles_mblur/extern/libmv/libmv-capi.h
branches/soc-2013-cycles_mblur/extern/libmv/libmv-capi_stub.cc
branches/soc-2013-cycles_mblur/intern/guardedalloc/intern/mallocn.c
branches/soc-2013-cycles_mblur/release/scripts/startup/bl_ui/properties_mask_common.py
branches/soc-2013-cycles_mblur/release/scripts/startup/bl_ui/space_clip.py
branches/soc-2013-cycles_mblur/release/scripts/startup/nodeitems_builtins.py
branches/soc-2013-cycles_mblur/source/blender/blenkernel/BKE_mask.h
branches/soc-2013-cycles_mblur/source/blender/blenkernel/BKE_node.h
branches/soc-2013-cycles_mblur/source/blender/blenkernel/BKE_tracking.h
branches/soc-2013-cycles_mblur/source/blender/blenkernel/intern/mask.c
branches/soc-2013-cycles_mblur/source/blender/blenkernel/intern/node.c
branches/soc-2013-cycles_mblur/source/blender/blenkernel/intern/tracking.c
branches/soc-2013-cycles_mblur/source/blender/blenlib/BLI_linklist.h
branches/soc-2013-cycles_mblur/source/blender/blenlib/intern/BLI_linklist.c
branches/soc-2013-cycles_mblur/source/blender/blenloader/intern/readfile.c
branches/soc-2013-cycles_mblur/source/blender/blenloader/intern/writefile.c
branches/soc-2013-cycles_mblur/source/blender/bmesh/CMakeLists.txt
branches/soc-2013-cycles_mblur/source/blender/bmesh/bmesh.h
branches/soc-2013-cycles_mblur/source/blender/bmesh/intern/bmesh_queries.c
branches/soc-2013-cycles_mblur/source/blender/bmesh/intern/bmesh_queries.h
branches/soc-2013-cycles_mblur/source/blender/bmesh/operators/bmo_create.c
branches/soc-2013-cycles_mblur/source/blender/bmesh/operators/bmo_edgenet.c
branches/soc-2013-cycles_mblur/source/blender/bmesh/operators/bmo_normals.c
branches/soc-2013-cycles_mblur/source/blender/compositor/CMakeLists.txt
branches/soc-2013-cycles_mblur/source/blender/compositor/intern/COM_Converter.cpp
branches/soc-2013-cycles_mblur/source/blender/compositor/operations/COM_ImageOperation.cpp
branches/soc-2013-cycles_mblur/source/blender/compositor/operations/COM_ImageOperation.h
branches/soc-2013-cycles_mblur/source/blender/compositor/operations/COM_MapUVOperation.cpp
branches/soc-2013-cycles_mblur/source/blender/compositor/operations/COM_MultilayerImageOperation.cpp
branches/soc-2013-cycles_mblur/source/blender/compositor/operations/COM_ReadBufferOperation.cpp
branches/soc-2013-cycles_mblur/source/blender/compositor/operations/COM_ReadBufferOperation.h
branches/soc-2013-cycles_mblur/source/blender/compositor/operations/COM_WriteBufferOperation.cpp
branches/soc-2013-cycles_mblur/source/blender/compositor/operations/COM_WriteBufferOperation.h
branches/soc-2013-cycles_mblur/source/blender/editors/mask/mask_relationships.c
branches/soc-2013-cycles_mblur/source/blender/editors/mask/mask_shapekey.c
branches/soc-2013-cycles_mblur/source/blender/editors/space_clip/clip_draw.c
branches/soc-2013-cycles_mblur/source/blender/editors/space_clip/clip_graph_ops.c
branches/soc-2013-cycles_mblur/source/blender/editors/space_clip/clip_intern.h
branches/soc-2013-cycles_mblur/source/blender/editors/space_clip/clip_utils.c
branches/soc-2013-cycles_mblur/source/blender/editors/space_clip/space_clip.c
branches/soc-2013-cycles_mblur/source/blender/editors/space_clip/tracking_ops.c
branches/soc-2013-cycles_mblur/source/blender/editors/space_clip/tracking_select.c
branches/soc-2013-cycles_mblur/source/blender/editors/space_file/file_panels.c
branches/soc-2013-cycles_mblur/source/blender/editors/space_node/drawnode.c
branches/soc-2013-cycles_mblur/source/blender/editors/transform/transform.c
branches/soc-2013-cycles_mblur/source/blender/editors/transform/transform.h
branches/soc-2013-cycles_mblur/source/blender/editors/transform/transform_conversions.c
branches/soc-2013-cycles_mblur/source/blender/editors/transform/transform_generics.c
branches/soc-2013-cycles_mblur/source/blender/gpu/intern/gpu_draw.c
branches/soc-2013-cycles_mblur/source/blender/makesdna/DNA_mask_types.h
branches/soc-2013-cycles_mblur/source/blender/makesdna/DNA_node_types.h
branches/soc-2013-cycles_mblur/source/blender/makesdna/DNA_scene_types.h
branches/soc-2013-cycles_mblur/source/blender/makesdna/DNA_tracking_types.h
branches/soc-2013-cycles_mblur/source/blender/makesrna/intern/rna_curve.c
branches/soc-2013-cycles_mblur/source/blender/makesrna/intern/rna_mask.c
branches/soc-2013-cycles_mblur/source/blender/makesrna/intern/rna_nodetree.c
branches/soc-2013-cycles_mblur/source/blender/makesrna/intern/rna_tracking.c
branches/soc-2013-cycles_mblur/source/blender/nodes/CMakeLists.txt
branches/soc-2013-cycles_mblur/source/blender/nodes/NOD_composite.h
branches/soc-2013-cycles_mblur/source/blender/nodes/NOD_static_types.h
branches/soc-2013-cycles_mblur/source/gameengine/BlenderRoutines/BL_KetsjiEmbedStart.cpp
branches/soc-2013-cycles_mblur/source/gameengine/GamePlayer/ghost/GPG_Application.cpp
branches/soc-2013-cycles_mblur/source/gameengine/Ketsji/KX_PythonInit.cpp
Added Paths:
-----------
branches/soc-2013-cycles_mblur/source/blender/bmesh/tools/bmesh_edgenet.c
branches/soc-2013-cycles_mblur/source/blender/bmesh/tools/bmesh_edgenet.h
branches/soc-2013-cycles_mblur/source/blender/compositor/nodes/COM_PlaneTrackDeformNode.cpp
branches/soc-2013-cycles_mblur/source/blender/compositor/nodes/COM_PlaneTrackDeformNode.h
branches/soc-2013-cycles_mblur/source/blender/compositor/operations/COM_PlaneTrackCommonOperation.cpp
branches/soc-2013-cycles_mblur/source/blender/compositor/operations/COM_PlaneTrackCommonOperation.h
branches/soc-2013-cycles_mblur/source/blender/compositor/operations/COM_PlaneTrackMaskOperation.cpp
branches/soc-2013-cycles_mblur/source/blender/compositor/operations/COM_PlaneTrackMaskOperation.h
branches/soc-2013-cycles_mblur/source/blender/compositor/operations/COM_PlaneTrackWarpImageOperation.cpp
branches/soc-2013-cycles_mblur/source/blender/compositor/operations/COM_PlaneTrackWarpImageOperation.h
branches/soc-2013-cycles_mblur/source/blender/nodes/composite/nodes/node_composite_planetrackdeform.c
Property Changed:
----------------
branches/soc-2013-cycles_mblur/
branches/soc-2013-cycles_mblur/source/blender/editors/interface/interface.c
branches/soc-2013-cycles_mblur/source/blender/editors/space_outliner/
Property changes on: branches/soc-2013-cycles_mblur
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/ge_dev:58091-58422
/branches/ge_harmony:42255,42279-42282,42286,42302,42338,42349,42616,42620,42698-42699,42739,42753,42773-42774,42832,44568,44597-44598,44793-44794
/branches/soc-2011-cucumber:37517,38166-38167,38177,38179-38180,38187,38242,38384,38387,38403-38404,38407,38968,38970,38973,39045,40845,42997-42998,43439
/branches/soc-2011-tomato:42376,42378-42379,42383,42385,42395,42397-42400,42407,42411,42418,42443-42444,42446,42467,42472,42486,42650-42652,42654-42655,42709-42710,42733-42734,42801,43872,44130,44141,44147-44149,44151-44152,44229-44230,45623-45625,46037,48089,48092,48551-48552,48679,48790,48792-48793,49076,49087,49292,49294,49466,49894,50052,50126,52854-52856,54573
/branches/soc-2013-depsgraph_mt:57516
/branches/soc-2013-dingto:57424,57487,57507,57525,57599,57670,57918-57919,57981,58091,58245,58253,58587,58772,58774-58775,58828,58835,59032
/tags/blender-2.67b-release/blender:57122
/trunk/blender:57388-59148
+ /branches/ge_dev:58091-58422
/branches/ge_harmony:42255,42279-42282,42286,42302,42338,42349,42616,42620,42698-42699,42739,42753,42773-42774,42832,44568,44597-44598,44793-44794
/branches/soc-2011-cucumber:37517,38166-38167,38177,38179-38180,38187,38242,38384,38387,38403-38404,38407,38968,38970,38973,39045,40845,42997-42998,43439
/branches/soc-2011-tomato:42376,42378-42379,42383,42385,42395,42397-42400,42407,42411,42418,42443-42444,42446,42467,42472,42486,42650-42652,42654-42655,42709-42710,42733-42734,42801,43872,44130,44141,44147-44149,44151-44152,44229-44230,45623-45625,46037,48089,48092,48551-48552,48679,48790,48792-48793,49076,49087,49292,49294,49466,49894,50052,50126,52854-52856,54573,58822,58989
/branches/soc-2013-depsgraph_mt:57516
/branches/soc-2013-dingto:57424,57487,57507,57525,57599,57670,57918-57919,57981,58091,58245,58253,58587,58772,58774-58775,58828,58835,59032
/tags/blender-2.67b-release/blender:57122
/trunk/blender:57388-59194
Modified: branches/soc-2013-cycles_mblur/build_files/scons/tools/Blender.py
===================================================================
--- branches/soc-2013-cycles_mblur/build_files/scons/tools/Blender.py 2013-08-17 02:06:45 UTC (rev 59194)
+++ branches/soc-2013-cycles_mblur/build_files/scons/tools/Blender.py 2013-08-17 04:35:23 UTC (rev 59195)
@@ -151,12 +151,6 @@
libincs += Split(lenv['BF_JACK_LIBPATH'])
if lenv['WITH_BF_SNDFILE']:
libincs += Split(lenv['BF_SNDFILE_LIBPATH'])
- if lenv['WITH_BF_OPENEXR']:
- libincs += Split(lenv['BF_OPENEXR_LIBPATH'])
- if lenv['WITH_BF_STATICOPENEXR']:
- statlibs += Split(lenv['BF_OPENEXR_LIB_STATIC'])
- if lenv['WITH_BF_ZLIB'] and lenv['WITH_BF_STATICZLIB']:
- statlibs += Split(lenv['BF_ZLIB_LIB_STATIC'])
if lenv['WITH_BF_TIFF']:
libincs += Split(lenv['BF_TIFF_LIBPATH'])
if lenv['WITH_BF_STATICTIFF']:
@@ -212,6 +206,12 @@
libincs += Split(lenv['BF_OIIO_LIBPATH'])
if lenv['WITH_BF_STATICOIIO']:
statlibs += Split(lenv['BF_OIIO_LIB_STATIC'])
+ if lenv['WITH_BF_OPENEXR']:
+ libincs += Split(lenv['BF_OPENEXR_LIBPATH'])
+ if lenv['WITH_BF_STATICOPENEXR']:
+ statlibs += Split(lenv['BF_OPENEXR_LIB_STATIC'])
+ if lenv['WITH_BF_ZLIB'] and lenv['WITH_BF_STATICZLIB']:
+ statlibs += Split(lenv['BF_ZLIB_LIB_STATIC'])
if lenv['WITH_BF_OCIO']:
libincs += Split(lenv['BF_OCIO_LIBPATH'])
Modified: branches/soc-2013-cycles_mblur/extern/libmv/libmv/multiview/euclidean_resection.cc
===================================================================
--- branches/soc-2013-cycles_mblur/extern/libmv/libmv/multiview/euclidean_resection.cc 2013-08-17 02:06:45 UTC (rev 59194)
+++ branches/soc-2013-cycles_mblur/extern/libmv/libmv/multiview/euclidean_resection.cc 2013-08-17 04:35:23 UTC (rev 59195)
@@ -34,6 +34,11 @@
namespace euclidean_resection {
typedef unsigned int uint;
+
+bool EuclideanResectionPPnP(const Mat2X &x_camera,
+ const Mat3X &X_world,
+ Mat3 *R, Vec3 *t,
+ double tolerance);
bool EuclideanResection(const Mat2X &x_camera,
const Mat3X &X_world,
@@ -47,6 +52,9 @@
case RESECTION_EPNP:
return EuclideanResectionEPnP(x_camera, X_world, R, t, success_threshold);
break;
+ case RESECTION_PPNP:
+ return EuclideanResectionPPnP(x_camera, X_world, R, t, success_threshold);
+ break;
default:
LOG(FATAL) << "Unknown resection method.";
}
@@ -674,6 +682,107 @@
// TODO(julien): Improve the solutions with non-linear refinement.
return true;
}
+
+/*
+
+ Straight from the paper:
+ http://www.diegm.uniud.it/fusiello/papers/3dimpvt12-b.pdf
+
+ function [R T] = ppnp(P,S,tol)
+ % input
+ % P : matrix (nx3) image coordinates in camera reference [u v 1]
+ % S : matrix (nx3) coordinates in world reference [X Y Z]
+ % tol: exit threshold
+ %
+ % output
+ % R : matrix (3x3) rotation (world-to-camera)
+ % T : vector (3x1) translation (world-to-camera)
+ %
+ n = size(P,1);
+ Z = zeros(n);
+ e = ones(n,1);
+ A = eye(n)-((e*e’)./n);
+ II = e./n;
+ err = +Inf;
+ E_old = 1000*ones(n,3);
+ while err>tol
+ [U,˜,V] = svd(P’*Z*A*S);
+ VT = V’;
+ R=U*[1 0 0; 0 1 0; 0 0 det(U*VT)]*VT;
+ PR = P*R;
+ c = (S-Z*PR)’*II;
+ Y = S-e*c’;
+ Zmindiag = diag(PR*Y’)./(sum(P.*P,2));
+ Zmindiag(Zmindiag<0)=0;
+ Z = diag(Zmindiag);
+ E = Y-Z*PR;
+ err = norm(E-E_old,’fro’);
+ E_old = E;
+ end
+ T = -R*c;
+ end
+
+ */
+// TODO(keir): Re-do all the variable names and add comments matching the paper.
+// This implementation has too much of the terseness of the original. On the
+// other hand, it did work on the first try.
+bool EuclideanResectionPPnP(const Mat2X &x_camera,
+ const Mat3X &X_world,
+ Mat3 *R, Vec3 *t,
+ double tolerance) {
+ int n = x_camera.cols();
+ Mat Z = Mat::Zero(n, n);
+ Vec e = Vec::Ones(n);
+ Mat A = Mat::Identity(n, n) - (e * e.transpose() / n);
+ Vec II = e / n;
+
+ Mat P(n, 3);
+ P.col(0) = x_camera.row(0);
+ P.col(1) = x_camera.row(1);
+ P.col(2).setConstant(1.0);
+
+ Mat S = X_world.transpose();
+
+ double error = std::numeric_limits<double>::infinity();
+ Mat E_old = 1000 * Mat::Ones(n, 3);
+
+ Vec3 c;
+ Mat E(n, 3);
+
+ int iteration = 0;
+ tolerance = 1e-5;
+ // TODO(keir): The limit of 100 can probably be reduced, but this will require
+ // some investigation.
+ while (error > tolerance && iteration < 100) {
+ Mat3 tmp = P.transpose() * Z * A * S;
+ Eigen::JacobiSVD<Mat3> svd(tmp, Eigen::ComputeFullU | Eigen::ComputeFullV);
+ Mat3 U = svd.matrixU();
+ Mat3 VT = svd.matrixV().transpose();
+ Vec3 s;
+ s << 1, 1, (U * VT).determinant();
+ *R = U * s.asDiagonal() * VT;
+ Mat PR = P * *R; // n x 3
+ c = (S - Z*PR).transpose() * II;
+ Mat Y = S - e*c.transpose(); // n x 3
+ Vec Zmindiag = (PR * Y.transpose()).diagonal()
+ .cwiseQuotient(P.rowwise().squaredNorm());
+ for (int i = 0; i < n; ++i) {
+ Zmindiag[i] = std::max(Zmindiag[i], 0.0);
+ }
+ Z = Zmindiag.asDiagonal();
+ E = Y - Z*PR;
+ error = (E - E_old).norm();
+ LOG(INFO) << "PPnP error(" << (iteration++) << "): " << error;
+ E_old = E;
+ }
+ *t = -*R*c;
+ // TODO(keir): Figure out what the failure cases are. Is it too many
+ // iterations? Spend some time going through the math figuring out if there
+ // is some way to detect that the algorithm is going crazy, and return false.
+ return true;
+}
+
+
} // namespace resection
} // namespace libmv
Modified: branches/soc-2013-cycles_mblur/extern/libmv/libmv/multiview/euclidean_resection.h
===================================================================
--- branches/soc-2013-cycles_mblur/extern/libmv/libmv/multiview/euclidean_resection.h 2013-08-17 02:06:45 UTC (rev 59194)
+++ branches/soc-2013-cycles_mblur/extern/libmv/libmv/multiview/euclidean_resection.h 2013-08-17 04:35:23 UTC (rev 59195)
@@ -33,6 +33,10 @@
// The "EPnP" algorithm by Lepetit et al.
// http://cvlab.epfl.ch/~lepetit/papers/lepetit_ijcv08.pdf
RESECTION_EPNP,
+
+ // The Procrustes PNP algorithm ("PPnP")
+ // http://www.diegm.uniud.it/fusiello/papers/3dimpvt12-b.pdf
+ RESECTION_PPNP
};
/**
Modified: branches/soc-2013-cycles_mblur/extern/libmv/libmv-capi.cc
===================================================================
--- branches/soc-2013-cycles_mblur/extern/libmv/libmv-capi.cc 2013-08-17 02:06:45 UTC (rev 59194)
+++ branches/soc-2013-cycles_mblur/extern/libmv/libmv-capi.cc 2013-08-17 04:35:23 UTC (rev 59195)
@@ -58,6 +58,8 @@
#include "libmv/simple_pipeline/reconstruction_scale.h"
#include "libmv/simple_pipeline/keyframe_selection.h"
+#include "libmv/multiview/homography.h"
+
#ifdef _MSC_VER
# define snprintf _snprintf
#endif
@@ -1080,4 +1082,28 @@
}
}
+void libmv_homography2DFromCorrespondencesLinear(double (*x1)[2], double (*x2)[2], int num_points,
+ double H[3][3], double expected_precision)
+{
+ libmv::Mat x1_mat, x2_mat;
+ libmv::Mat3 H_mat;
+
+ x1_mat.resize(2, num_points);
+ x2_mat.resize(2, num_points);
+
+ for (int i = 0; i < num_points; i++) {
+ x1_mat.col(i) = libmv::Vec2(x1[i][0], x1[i][1]);
+ x2_mat.col(i) = libmv::Vec2(x2[i][0], x2[i][1]);
+ }
+
+ LG << "x1: " << x1_mat;
+ LG << "x2: " << x2_mat;
+
+ libmv::Homography2DFromCorrespondencesLinear(x1_mat, x2_mat, &H_mat, expected_precision);
+
+ LG << "H: " << H_mat;
+
+ memcpy(H, H_mat.data(), 9 * sizeof(double));
+}
+
#endif
Modified: branches/soc-2013-cycles_mblur/extern/libmv/libmv-capi.h
===================================================================
--- branches/soc-2013-cycles_mblur/extern/libmv/libmv-capi.h 2013-08-17 02:06:45 UTC (rev 59194)
+++ branches/soc-2013-cycles_mblur/extern/libmv/libmv-capi.h 2013-08-17 04:35:23 UTC (rev 59195)
@@ -159,6 +159,9 @@
void libmv_cameraIntrinsicsInvert(const libmv_CameraIntrinsicsOptions *libmv_camera_intrinsics_options,
double x, double y, double *x1, double *y1);
+void libmv_homography2DFromCorrespondencesLinear(double (*x1)[2], double (*x2)[2], int num_points,
@@ Diff output truncated at 10240 characters. @@
More information about the Bf-blender-cvs
mailing list