diff options
author | shamikam | 2017-01-16 02:56:17 +0530 |
---|---|---|
committer | shamikam | 2017-01-16 02:56:17 +0530 |
commit | a6df67e8bcd5159cde27556f4f6a315f8dc2215f (patch) | |
tree | e806e966b06a53388fb300d89534354b222c2cad /macros/triangulatePoints.sci | |
download | FOSSEE_Image_Processing_Toolbox-master.tar.gz FOSSEE_Image_Processing_Toolbox-master.tar.bz2 FOSSEE_Image_Processing_Toolbox-master.zip |
Diffstat (limited to 'macros/triangulatePoints.sci')
-rw-r--r-- | macros/triangulatePoints.sci | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/macros/triangulatePoints.sci b/macros/triangulatePoints.sci new file mode 100644 index 0000000..5b56061 --- /dev/null +++ b/macros/triangulatePoints.sci @@ -0,0 +1,40 @@ +function [worldPoints] = triangulatePoints(projMat1, projMat2, points1, points2) +// Returns the worldPoint coordinates of the feature points. +// +// Calling Sequence +// [worldPoints] = triangulatePoints(projMat1, projMat2, points1, points2) +// +// Parameters +// projMat1: 3X4 projection matrix for the first Camera matrix +// projMat2: 3X4 projection matrix for the second Camera matrix +// points1: 2xN array of feature points in the 1st image. In case of c++ version it can be also a vector of feature points or two-channel matrix of size 1xN or Nx1 +// points2: 2xN array of feature points in the 2nd image. In case of c++ version it can be also a vector of feature points or two-channel matrix of size 1xN or Nx1 +// worldPoints: 4XN array or matrix of reconstructed points +// +// Description +// Returns 4D location of the matched feature points from the two projected matrices. The 4D location of the feature points is reconstructed using triangulation. +// +// Examples +// [projMat1] = [12 21 21 19; 34 12 0 2; 112 431 890 32.1] +// [projMat2] = [16 17 32 1; 64 90 12 11; 123 43.5 895 9.8] +// [points1] = [1 2 3 4;5 6 7 8] +// [points2] = [32 1 3 5; 9 8 3 4] +// [worldPoints] = triangulatePoints(projMat1, projMat2, points1, points2) +// +// +// Authors +// Deepshikha + +// code for the above function +// + + output = opencv_triangulatePoints(projMat1, projMat2, points1, points2) + + channels = size(output) + + for i = 1:channels + worldPoints(:,:,1) = output(1) + end + +endfunction + |