How to use reconstructScene with a disparity map from file, without calling rectifyStereoImages ?

5 ビュー (過去 30 日間)
Hello,
I have a code that computes the disparity map for multiple image pairs, using rectifyStereoImages and disparitySGM, and writes each map to a .mat file.
When I load one of those disparity maps from file and try to call reconstructScene on it, with the same stereoParams object, I obtain the error message
"Error using vision.internal.calibration.StereoParametersImpl/reconstructSceneImpl
You must call rectifyStereoImages on the stereoParams input before calling reconstructScene.".
If I do call rectifyStereoImages with stereoParams before, even without using any of its outputs, the error message does not show up and the code continues. But I don't want to do that function call in the same script. How to work around?

採用された回答

Qu Cao
Qu Cao 2022 年 8 月 22 日
You can use the reprojectionMatrix output from rectifyStereoImages to do the reconstruction. Otherwise, you need to save the stereoParam object after calling rectifyStereoImages ans save it together with the dispaity map to a .m file. Note that some internal properties of the stereoParam object get updated after calling rectifyStereoImages.
  2 件のコメント
Holger Mettelsiefen
Holger Mettelsiefen 2022 年 8 月 22 日
This surprises me. Which internal properties of the stereoParam object get updated?
Holger Mettelsiefen
Holger Mettelsiefen 2022 年 8 月 22 日
However, it works out with the reprojectionMatrix for me. Thank you!

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeComputer Vision with Simulink についてさらに検索

製品


リリース

R2022a

Community Treasure Hunt

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

Start Hunting!

Translated by