How to construct stereoParameters with intrinsic and extrinsic matrix?

5 ビュー (過去 30 日間)
IDK Chen
IDK Chen 2022 年 11 月 17 日
回答済み: Qu Cao 2022 年 11 月 21 日
I'm trying to reconstruct a 3D Scene from two images. Suppose camera has no distortions.
I have the images I1, I2 and the coressponding intrinsic_1, extrinsic_1, intrinsic_2, extrinsic_2 matrix. I also has the transaltion and rotation from camera1 to camera 2. How could I use them to construct a stereoParameters object? I found that cameraParameters has private attributes and extrinsic matrixs could not be set.
stereoParams = stereoParameters(cameraParameters1,cameraParameters2,poseCamera2)
[I1Rect, I2Rect, reprojectionMatrix] = rectifyStereoImages(I1,I2,stereoParams);
disparityMap = disparitySGM(I1Rect, I2Rect);
points3D = reconstructScene(disparityMap, reprojectionMatrix);
Or is it possible to figure out the reprojectionMatix directly using some functions with matched points inlierPts1 and inlierPts2?
[t1, t2] = estimateStereoRectification(fNorm8Point,inlierPts1.Location,inlierPts2.Location,size(I2));
reprojectionMatrix = some_function(t1, t2, intrinsic_1, extrinsic_1, intrinsic_2, extrinsic_2, rotations and translations between c1 to c2)
[I1Rect, I2Rect] = rectifyStereoImages(I1,I2,reprojectionMatrix);

回答 (1 件)

Qu Cao
Qu Cao 2022 年 11 月 21 日
poseCamera2 essentially transforms camera 2 to camer 1. If you have “the transaltion and rotation from camera1 to camera 2”, (let's call them t and R respectively), then you should be able to construct poseCamera2 as follows:
poseCamera2 = rigidtform3d(R', -R'*t)
I'm assuming that you're using R2022b.

カテゴリ

Help Center および File ExchangeMATLAB Support Package for USB Webcams についてさらに検索

製品


リリース

R2022b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by