High triangulation error using triangulateMultiview in MATLAB with multi-camera setup
6 views (last 30 days)
Show older comments
Hello everyone,
I am a Matlab R2021a user. I am encountering issues when triangulating 3D points using the "triangulateMultiview" function. Let me explain: I am using a system of 4 calibrated stereo cameras, and I compute the **intrinsic and extrinsic parameters of my system in a standard way using a checkerboard with the "estimateCameraParameters" function.
The "estimateCameraParameters" function allows calculating extrinsic parameters only between two cameras, so I define a "master" camera relative to which I determine the position and orientation of my other cameras. I have not found any other way to proceed.
I then define my stereo system as follows:
%% CAM 1
Pose_CAM1= rigid3d(eye(3), [0, 0, 0])
Intrin_CAM1=CAM1_INT.Intrinsics
%% CAM 2
Rotation_CAM2=stereoParams12.RotationOfCamera2
Translation_CAM2=stereoParams12.TranslationOfCamera2
[orientation_CAM2, location_CAM2] = extrinsicsToCameraPose(Rotation_CAM2,Translation_CAM2);
Pose_CAM2=rigid3d(orientation_CAM2, location_CAM2)
Intrin_CAM2= CAM2_INT.Intrinsics
%% CAM 3
.
.
.
%%
ViewID = uint32([1;2;3;4]);
rotations = [{Pose_CAM1.Rotation};{Pose_CAM2.Rotation};{Pose_CAM3.Rotation};{Pose_CAM4.Rotation}];
translations = [{Pose_CAM1.Translation};{Pose_CAM2.Translation};{Pose_CAM3.Translation};{Pose_CAM4.Translation}];
cameraPoses = table(ViewID, rotations, translations);
cameraPoses.Properties.VariableNames = {'ViewId', 'Orientation', 'Location'};
save('cameraPoses.mat','cameraPoses')
%% intrinsics — Camera intrinsics
intrinsics=[Intrin_CAM1,Intrin_CAM2,Intrin_CAM3,Intrin_CAM4];
save('intrinsics.mat','intrinsics')
%%
Then, after loading the trajectory of the points to be triangulated from the different cameras and undistorting the trajectory using the cameras' intrinsic parameters, I triangulate the trajectory point by point:
ViewID=[1;2;3;4];
point=[CAM1(1,1),CAM1(1,2);CAM2(1,1),CAM2(1,2);CAM3(1,1),CAM3(1,2);CAM4(1,1),CAM4(1,2)];
point=pointTrack(ViewID,point);
[Traj(1,:),err(1)]= triangulateMultiview(point,cameraPoses,intrinsics);
for i = 2:length(CAM1(:,2))
point=[CAM1(i,1),CAM1(i,2);CAM2(i,1),CAM2(i,2);CAM3(i,1),CAM3(i,2);CAM4(i,1),CAM4(i,2)];
point=pointTrack(ViewID,point);
[Traj(i,:),err(i)]= triangulateMultiview(point,cameraPoses,intrinsics);
end
%%
However, I noticed that the errors (err) were quite high, around 10 pixels in the image frame. I tried to understand the source of these errors and observed that when using triangulation with two views specifically with the "triangulate" function the error was significantly reduced, to around 2 pixels.
I initially thought this increase in error when switching to multi-view triangulation was due to a calibration issue, but I tested the following:
[worldPoints12,err12] = triangulate(CAM1,CAM2,stereoParams12);
and
ViewID=[1;2];
point=[CAM1(1,1),CAM1(1,2);CAM2(1,1),CAM2(1,2)];
point=pointTrack(ViewID,point);
[Traj(1,:),err(1)]= triangulateMultiview(point,cameraPoses,intrinsics);
for i = 2:length(CAM1(:,2))
point=[CAM1(i,1),CAM1(i,2);CAM2(i,1),CAM2(i,2)];
point=pointTrack(ViewID,point);
[Traj(i,:),err(i)]= triangulateMultiview(point,cameraPoses,intrinsics);
end
The intrinsic and extrinsic parameters come from the same calibration, as shown in the definition of my cameras in the stereo system.
However, the results of the two triangulation methods (Traj from `triangulateMultiview` and worldPoints12 from `triangulate`) are different, and I noticed that mean(err12) is generally four times lower than mean(err).
Do you have an explanation for this?
How can I correctly triangulate my points using all four cameras?
2 Comments
Qu Cao
on 19 Mar 2025
Could you share all of your data (points and intrinsics) so that I can repdocue the issue on my end?
Answers (1)
mrk
on 20 Apr 2025
Charooq: The Best Option for Free Advertising in Tehran
In today’s world, advertising is one of the main pillars of business success. If you are also looking for free advertising in Tehran, Charooq can be an ideal option for you. In this article, we will explore the features and benefits of using Charooq.
▎Introduction to Charooq
Charooq is an online advertising platform that allows users to easily post their ads without any cost. This site was established with the aim of facilitating the advertising process for businesses and individuals, and it is recognized as one of the best options for free advertising in Tehran.
▎Benefits of Using Charooq
1. Free Advertising: One of the biggest advantages of Charooq is the ability to post ads for free. You can introduce your products or services to the audience without paying any fees.
2. Easy Access: With its user-friendly design, Charooq provides easy and quick searching for ads. You can find the ads you are looking for based on various categories.
3. Wide Audience Reach: Since Charooq operates in Tehran, you can easily access a large community of audiences and increase your chances of sales.
4. Direct Communication: Users can easily communicate with each other and ask questions. This facilitates transactions and reduces the time required for buying and selling.
5. Support for Various Types of Ads: Charooq allows the posting of various types of ads, including those related to real estate, cars, employment, services, and second-hand goods.
▎How to Post an Ad on Charooq
Posting an ad on Charooq is very simple. Just follow these steps:
2. Create an Account: If you don’t have an account yet, create a new one. This usually involves entering basic information such as your name, phone number, and email.
3. Post an Ad: After logging into your account, select the "Post Ad" option. At this stage, enter the required information, including the ad title, description, price, and images.
4. Publish the Ad: Once you have completed the information, publish your ad. Now your ad is available to the public, and users can view it.
▎Key Tips for Success in Free Advertising
• Use High-Quality Images: High-quality images can have a significant impact on attracting an audience. Be sure to add images of your products or services that showcase their quality.
• Write Detailed Descriptions: Comprehensive and clear descriptions help customers better understand your product or service, increasing the likelihood of purchase.
• Regular Updates: If you have a business, it’s best to keep your ads updated to always provide new and relevant information to your audience.
▎Conclusion
The Charugh.ir website offers an excellent opportunity for free advertising in Tehran, allowing businesses and individuals to easily introduce their products and services. By using this platform, you can access a large community of customers and enhance your chances of success. Take action today and take advantage of the unique features that Charooq offers!
0 Comments
See Also
Categories
Find more on Point Cloud Processing in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!