フィルターのクリア

rectifyStereoImages Rotation Matrix output is coming out 3 x 4 instead of 3 x 3

3 ビュー (過去 30 日間)
Hi, i am using the Matlab function rectifyStereoImages to calculate the camera1 rotation matrix and camera 2 rotation matrix (R1 and R2) as suggested in the documentation.
Documentation Example :-
[___,camMatrix1,camMatrix2,R1,R2] = rectifyStereoImages(I1,I2,stereoParams) returns the 3-by-4 camera projection matrices camMatrix1 and camMatrix2 for the rectified cameras, and the corresponding rectification rotation matrices, R1 and R2.
R1 and R2 should be 3 x 3 as said in the documentation.
Here is what i am doing :-
load("CameraCalib.mat")
LeftImage = imread("Left.png");
RightImage = imread("Right.png");
[~, CamMatLeft, CamMatRight, R1, R2] = rectifyStereoImages(LeftImage, RightImage, CameraCalib);
according to the documentation R1 and R2 should be 3 x 3 but in my workspace i am getting R1 and R2 to be 3 x 4 projection matrices.
Any idea what am i doing wrong here ? If so how should i fix this to get the desired matrices ?

採用された回答

chicken vector
chicken vector 2023 年 4 月 28 日
編集済み: chicken vector 2023 年 4 月 28 日
It looks like you are missing two output arguments, so what you call R1 is actually camMatrix1.
The default syntax of the function is:
[J1,J2,reprojectionMatrix] = rectifyStereoImages(I1,I2,stereoParams)
It means that when you use this:
[___,camMatrix1,camMatrix2,R1,R2] = rectifyStereoImages(I1,I2,stereoParams)
^This line takes into account the three output J1, J2 and reprojectionMatrix.
You need to do:
load("CameraCalib.mat")
LeftImage = imread("Left.png");
RightImage = imread("Right.png");
[~, ~, ~, CamMatLeft, CamMatRight, R1, R2] = rectifyStereoImages(LeftImage, RightImage, CameraCalib);
  3 件のコメント
chicken vector
chicken vector 2023 年 5 月 4 日
I am not sure. If the stereo parameters remain the same, probably yes, but I don't know how much time you can save by doing that.
Anyway, you can try to use the function on different frames and see if the rotation matricees are the same.
Soumya Dubey
Soumya Dubey 2023 年 5 月 4 日
Yeah it worked. Thanks.

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeCamera Calibration についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by