[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [39395] branches/soc-2011-salad: Merging r39253 through r39394 from soc-2011-tomato into soc-2011-salad
Sergey Sharybin
g.ulairi at gmail.com
Sun Aug 14 14:42:43 CEST 2011
Revision: 39395
http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=39395
Author: nazgul
Date: 2011-08-14 12:42:43 +0000 (Sun, 14 Aug 2011)
Log Message:
-----------
Merging r39253 through r39394 from soc-2011-tomato into soc-2011-salad
Revision Links:
--------------
http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=39253
http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=39394
Modified Paths:
--------------
branches/soc-2011-salad/extern/libmv/ChangeLog
branches/soc-2011-salad/extern/libmv/libmv/simple_pipeline/camera_intrinsics.cc
branches/soc-2011-salad/extern/libmv/libmv/simple_pipeline/camera_intrinsics.h
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_tracking.h
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/gpencil/CMakeLists.txt
branches/soc-2011-salad/source/blender/editors/gpencil/gpencil_edit.c
branches/soc-2011-salad/source/blender/editors/gpencil/gpencil_intern.h
branches/soc-2011-salad/source/blender/editors/gpencil/gpencil_ops.c
branches/soc-2011-salad/source/blender/editors/gpencil/gpencil_paint.c
branches/soc-2011-salad/source/blender/editors/include/ED_gpencil.h
branches/soc-2011-salad/source/blender/editors/space_clip/clip_draw.c
branches/soc-2011-salad/source/blender/editors/space_clip/space_clip.c
branches/soc-2011-salad/source/blender/editors/util/undo.c
branches/soc-2011-salad/source/blender/makesdna/DNA_space_types.h
branches/soc-2011-salad/source/blender/makesrna/intern/rna_space.c
branches/soc-2011-salad/source/blender/makesrna/intern/rna_tracking.c
Added Paths:
-----------
branches/soc-2011-salad/source/blender/editors/gpencil/gpencil_undo.c
Property Changed:
----------------
branches/soc-2011-salad/
branches/soc-2011-salad/source/blender/editors/space_outliner/
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-carrot:36828-39099
/branches/soc-2011-cucumber:36829-36994
/branches/soc-2011-onion:36833-38309
/branches/soc-2011-pepper:36830-39215
/branches/soc-2011-tomato:36831-39252
/trunk/blender:36834-39391
+ /branches/soc-2010-jwilkins:28499-37009
/branches/soc-2010-nicolasbishop:28448-30783,30792-30793,30797-30798,30815
/branches/soc-2011-carrot:36828-39099
/branches/soc-2011-cucumber:36829-36994
/branches/soc-2011-onion:36833-38309
/branches/soc-2011-pepper:36830-39215
/branches/soc-2011-tomato:36831-39394
/trunk/blender:36834-39391
Modified: branches/soc-2011-salad/extern/libmv/ChangeLog
===================================================================
--- branches/soc-2011-salad/extern/libmv/ChangeLog 2011-08-14 12:11:46 UTC (rev 39394)
+++ branches/soc-2011-salad/extern/libmv/ChangeLog 2011-08-14 12:42:43 UTC (rev 39395)
@@ -1,3 +1,33 @@
+commit 10bdad9ad2cea2603896263cde5a5339169a9af0
+Author: Matthias Fauconneau <matthias.fauconneau at gmail.com>
+Date: Fri Aug 12 21:05:32 2011 +0200
+
+ Fix out of bound access in warp bilinear sampling.
+
+commit dd9a418db021a28af2c1198d5e5b9e68fe048a03
+Author: Matthias Fauconneau <matthias.fauconneau at gmail.com>
+Date: Fri Aug 12 19:14:36 2011 +0200
+
+ Fix compilation with -funsigned-char.
+
+commit bd1a268ede39b67f2ba4b360f6fc693419e7cd7f
+Author: Matthias Fauconneau <matthias.fauconneau at gmail.com>
+Date: Fri Aug 12 18:39:27 2011 +0200
+
+ CameraIntrinsics fixes.
+
+commit ae513b39fb779632f96ceff7c1e014fb8e68702a
+Author: Matthias Fauconneau <matthias.fauconneau at gmail.com>
+Date: Tue Aug 9 19:38:58 2011 +0200
+
+ Remove stray QDebug include.
+
+commit 1e58f55078ce6009a885be30ae0316aec6ed8239
+Author: Matthias Fauconneau <matthias.fauconneau at gmail.com>
+Date: Tue Aug 9 14:16:31 2011 +0200
+
+ Make API future-proof (for an eventual affine or planar tracker).
+
commit c2af303e7bf0dddcb02937323ac5846b1801e6cc
Author: Matthias Fauconneau <matthias.fauconneau at gmail.com>
Date: Tue Aug 9 11:13:29 2011 +0200
@@ -388,58 +418,3 @@
Add feature detection.
Remove unused keyframe selection code.
-
-commit 1088517da70ae9ec2369752fbc17dde4bb869c47
-Author: Matthias Fauconneau <matthias.fauconneau at gmail.com>
-Date: Mon Jul 11 22:42:14 2011 +0200
-
- Replace system file dialog with custom one which supports multiple file/folder selection.
- Add Stop button when adding frame from video.
-
-commit 323af7a3a1344e7ef419c72fe22b674c17c578e3
-Author: Matthias Fauconneau <matthias.fauconneau at gmail.com>
-Date: Mon Jul 11 16:30:59 2011 +0200
-
- Add stub for feature detection.
-
-commit 739ec729fa8bc6e0ba6a40cc7b89d85e5332e900
-Author: Matthias Fauconneau <matthias.fauconneau at gmail.com>
-Date: Mon Jul 11 16:30:42 2011 +0200
-
- Fix compilation of Qt Calibration tool.
-
-commit 113ccc413db6bdfb75839418bddfba5ce3ba60f7
-Author: Matthias Fauconneau <matthias.fauconneau at gmail.com>
-Date: Mon Jul 11 12:27:47 2011 +0200
-
- Add raw on-disk video cache.
-
- This is useful for faster testing iterations.
- It avoids waiting for the footage to decode on startup.
- Using file memory mapping, we let the OS handle caching.
- The OS disk cache also has the advantage of being kept in memory between runs.
- A cache is only created for shot < 1GiB (e.g 17s of 1080 at 30).
-
-commit efbe8b6a3e2a8cff497726e11afffbce0ec6aa53
-Author: Matthias Fauconneau <matthias.fauconneau at gmail.com>
-Date: Mon Jul 11 11:11:47 2011 +0200
-
- Miscellaneous UI fixes, faster grayscale conversion, compute window size from pattern size and pyramid level count.
-
-commit 0c6911831b0a391da14bf1c5833b1e5c0d5056b7
-Author: Matthias Fauconneau <matthias.fauconneau at gmail.com>
-Date: Sun Jul 10 22:48:15 2011 +0200
-
- Add Video support using FFmpeg to Qt Calibration.
-
-commit c9f2bd5a17585f816bf0ef89097ac8f222ad058e
-Author: Matthias Fauconneau <matthias.fauconneau at gmail.com>
-Date: Sun Jul 10 19:44:35 2011 +0200
-
- Add Video support using FFmpeg to Qt Tracker.
-
-commit af8f9c412b0592868a0e68a14686651b45de9737
-Author: Matthias Fauconneau <matthias.fauconneau at gmail.com>
-Date: Sat Jul 9 12:08:28 2011 +0200
-
- Update README with instructions to build Qt OpenCV Calibration tool.
Modified: branches/soc-2011-salad/extern/libmv/libmv/simple_pipeline/camera_intrinsics.cc
===================================================================
--- branches/soc-2011-salad/extern/libmv/libmv/simple_pipeline/camera_intrinsics.cc 2011-08-14 12:11:46 UTC (rev 39394)
+++ branches/soc-2011-salad/extern/libmv/libmv/simple_pipeline/camera_intrinsics.cc 2011-08-14 12:42:43 UTC (rev 39395)
@@ -23,7 +23,7 @@
namespace libmv {
-struct Offset { char ix,iy; unsigned char fx,fy; };
+struct Offset { signed char ix,iy; unsigned char fx,fy; };
CameraIntrinsics::CameraIntrinsics()
: K_(Mat3::Identity()),
@@ -42,6 +42,44 @@
if(undistort_) delete[] undistort_;
}
+/// Set the entire calibration matrix at once.
+void CameraIntrinsics::SetK(const Mat3 new_k) {
+ K_ = new_k;
+ FreeLookupGrid();
+}
+
+/// Set both x and y focal length in pixels.
+void CameraIntrinsics::SetFocalLength(double focal_x, double focal_y) {
+ K_(0, 0) = focal_x;
+ K_(1, 1) = focal_y;
+ FreeLookupGrid();
+}
+
+void CameraIntrinsics::SetPrincipalPoint(double cx, double cy) {
+ K_(0, 2) = cx;
+ K_(1, 2) = cy;
+ FreeLookupGrid();
+}
+
+void CameraIntrinsics::SetImageSize(int width, int height) {
+ image_width_ = width;
+ image_height_ = height;
+ FreeLookupGrid();
+}
+
+void CameraIntrinsics::SetRadialDistortion(double k1, double k2, double k3) {
+ k1_ = k1;
+ k2_ = k2;
+ k3_ = k3;
+ FreeLookupGrid();
+}
+
+void CameraIntrinsics::SetTangentialDistortion(double p1, double p2) {
+ p1_ = p1;
+ p2_ = p2;
+ FreeLookupGrid();
+}
+
void CameraIntrinsics::ApplyIntrinsics(double normalized_x,
double normalized_y,
double *image_x,
@@ -117,18 +155,11 @@
int fx = round((warp_x-ix)*256), fy = round((warp_y-iy)*256);
if(fx == 256) { fx=0; ix++; }
if(fy == 256) { fy=0; iy++; }
-#ifdef CLIP
// Use nearest border pixel
if( ix < 0 ) { ix = 0, fx = 0; }
if( iy < 0 ) { iy = 0, fy = 0; }
- if( ix >= width-1 ) { ix = width-1, fx = 0; }
- if( iy >= height-1 ) { iy = height-1, fy = 0; }
-#else
- // No offset: Avoid adding out of bounds to error.
- if( ix < 0 || iy < 0 || ix >= width-1 || iy >= height-1 ) {
- ix = x; iy = y; fx = fy = 0;
- }
-#endif
+ if( ix >= width-2 ) ix = width-2;
+ if( iy >= height-2 ) iy = height-2;
//assert( ix-x > -128 && ix-x < 128 && iy-y > -128 && iy-y < 128 );
Offset offset = { ix-x, iy-y, fx, fy };
grid[y*width+x] = offset;
@@ -152,6 +183,11 @@
}
}
+void CameraIntrinsics::FreeLookupGrid() {
+ if(distort_) delete distort_, distort_=0;
+ if(undistort_) delete undistort_, undistort_=0;
+}
+
// FIXME: C++ templates limitations makes thing complicated, but maybe there is a simpler method.
struct ApplyIntrinsicsFunction {
ApplyIntrinsicsFunction(CameraIntrinsics* intrinsics, double x, double y,
Modified: branches/soc-2011-salad/extern/libmv/libmv/simple_pipeline/camera_intrinsics.h
===================================================================
--- branches/soc-2011-salad/extern/libmv/libmv/simple_pipeline/camera_intrinsics.h 2011-08-14 12:11:46 UTC (rev 39394)
+++ branches/soc-2011-salad/extern/libmv/libmv/simple_pipeline/camera_intrinsics.h 2011-08-14 12:42:43 UTC (rev 39395)
@@ -49,36 +49,18 @@
double p2() const { return p2_; }
/// Set the entire calibration matrix at once.
- void SetK(const Mat3 new_k) {
- K_ = new_k;
- }
+ void SetK(const Mat3 new_k);
/// Set both x and y focal length in pixels.
- void SetFocalLength(double focal_x, double focal_y) {
- K_(0, 0) = focal_x;
- K_(1, 1) = focal_y;
- }
+ void SetFocalLength(double focal_x, double focal_y);
- void SetPrincipalPoint(double cx, double cy) {
- K_(0, 2) = cx;
- K_(1, 2) = cy;
- }
+ void SetPrincipalPoint(double cx, double cy);
- void SetImageSize(int width, int height) {
- image_width_ = width;
- image_height_ = height;
- }
+ void SetImageSize(int width, int height);
- void SetRadialDistortion(double k1, double k2, double k3 = 0) {
- k1_ = k1;
- k2_ = k2;
- k3_ = k3;
- }
+ void SetRadialDistortion(double k1, double k2, double k3 = 0);
- void SetTangentialDistortion(double p1, double p2) {
- p1_ = p1;
- p2_ = p2;
- }
+ void SetTangentialDistortion(double p1, double p2);
/*!
Apply camera intrinsics to the normalized point to get image coordinates.
@@ -142,6 +124,7 @@
private:
template<typename WarpFunction> void ComputeLookupGrid(Offset* grid, int width, int height);
+ void FreeLookupGrid();
// The traditional intrinsics matrix from x = K[R|t]X.
Mat3 K_;
Modified: branches/soc-2011-salad/extern/libmv/libmv-capi.cpp
===================================================================
--- branches/soc-2011-salad/extern/libmv/libmv-capi.cpp 2011-08-14 12:11:46 UTC (rev 39394)
+++ branches/soc-2011-salad/extern/libmv/libmv-capi.cpp 2011-08-14 12:42:43 UTC (rev 39395)
@@ -501,6 +501,56 @@
delete (std::vector<libmv::Corner> *)libmv_corners;
}
+/* ************ distortion ************ */
+
+void libmv_undistortByte(double focal_length, double principal_x, double principal_y, double k1, double k2, double k3,
+ unsigned char *src, unsigned char *dst, int width, int height, int channels)
+{
+ libmv::CameraIntrinsics intrinsics;
+
+ intrinsics.SetFocalLength(focal_length, focal_length);
+ intrinsics.SetPrincipalPoint(principal_x, principal_y);
+ intrinsics.SetRadialDistortion(k1, k2, k3);
+
+ intrinsics.Undistort(src, dst, width, height, channels);
+}
+
+void libmv_undistortFloat(double focal_length, double principal_x, double principal_y, double k1, double k2, double k3,
+ float *src, float *dst, int width, int height, int channels)
+{
+ libmv::CameraIntrinsics intrinsics;
+
+ intrinsics.SetFocalLength(focal_length, focal_length);
+ intrinsics.SetPrincipalPoint(principal_x, principal_y);
+ intrinsics.SetRadialDistortion(k1, k2, k3);
+
@@ Diff output truncated at 10240 characters. @@
More information about the Bf-blender-cvs
mailing list