request for clarification_slightly not open ptv related

22 views
Skip to first unread message

Hadeel Alzawaidah

unread,
Jun 27, 2023, 5:43:40 AM6/27/23
to openptv
Hi everyone, 

I am trying to study a single particle transport in 3D using two cameras. at the moment I was able to get the following using Matlab: 
1- particle location (x,y) per time step in Camera 1 
2- particle location (x,y) per time step in Camera 2 
3- camera matrix for Camera1 of 3x4  P1 using 3D calibration object 
4 - camera matrix for Camera2 of 3x4  P2 using 3D calibration object 
5 - the x,y,z distance between the cameras and the 0,0,0 reference point of the calibration object
I tried to write a function to obtain the object location in world x,y,z coordinates (see below) yet it seams to return in correct values. would truly appreciate an advice with this regards. 


best, 
Hadeel 


function triangulatedPoints = triangulatePoints(P1, P2, imagePoints1, imagePoints2)
% Perform triangulation
homogeneousPoints1 = [imagePoints1, ones(size(imagePoints1, 1), 1)];
homogeneousPoints2 = [imagePoints2, ones(size(imagePoints2, 1), 1)];
% Triangulation
points3D = zeros(size(homogeneousPoints1, 1), 3);
for i = 1:size(homogeneousPoints1, 1)
A = [
homogeneousPoints1(i, 1) * P1(3, :) - P1(1, :);
homogeneousPoints1(i, 2) * P1(3, :) - P1(2, :);
homogeneousPoints2(i, 1) * P2(3, :) - P2(1, :);
homogeneousPoints2(i, 2) * P2(3, :) - P2(2, :)
];
[~, ~, V] = svd(A);
triangulatedPoint = V(:, end)';
triangulatedPoint = triangulatedPoint / triangulatedPoint(4);
points3D(i, :) = triangulatedPoint(1:3);
end
% Return the triangulated 3D points
triangulatedPoints = points3D;
end
  

Alex Liberzon

unread,
Jun 29, 2023, 6:27:46 AM6/29/23
to openptv
Sorry, I do not know how to engage Matlab, or any other external calibration into OpenPTV - we tried easyWand, DLT, Matlab, OpenCV, multicam, etc. all these, likewise myPTV have their own calibration models and this creates such a difficult transition that we simply failed :)
Reply all
Reply to author
Forward
0 new messages