ステレオカメラによる深度測定

5 vues (au cours des 30 derniers jours)
naoya uwa
naoya uwa le 9 Sep 2019
Commenté : naoya uwa le 20 Sep 2019
ステレオカメラによる深度測定を実施しておりますが、
ターゲット画像を読み込んで出力するとピクセル数が下がってしまいます。
これが原因で測定したい範囲が網羅できていないのですが、解決方法を教えてください。
(下記画像のワークスペースを参照ください。)
%ステレオ カメラのパラメーターの読み込み
% Load the stereoParameters object.
load('handshakeStereoParams.mat');
% Visualize camera extrinsics.
showExtrinsics(stereoParams);
%ビデオフレームの読み取りと平行化
frameLeft = imread('I1(left).jpg');
frameRight = imread('I2(right).jpg');
[frameLeftRect, frameRightRect] = ...
rectifyStereoImages(frameLeft, frameRight, stereoParams);
figure;
imshow(stereoAnaglyph(frameLeftRect, frameRightRect));
title('pit_fig');
%視差の計算
frameLeftGray = rgb2gray(frameLeftRect);
frameRightGray = rgb2gray(frameRightRect);
disparityMap = disparity(frameLeftGray, frameRightGray);
figure;
imshow(disparityMap, [0, 100]);
title('Disparity Map');
colormap jet
colorbar
%3次元シーン再構成
points3D = reconstructScene(disparityMap, stereoParams);
% Convert to meters and create a pointCloud object
points3D = points3D ./1000;
ptCloud = pointCloud(points3D, 'Color', frameLeftRect);
% Create a streaming point cloud viewer
player3D = pcplayer([-3, 3], [-3, 3], [0, 8], 'VerticalAxis', 'y', ...
'VerticalAxisDir', 'down');
% Visualize the point cloud
view(player3D, ptCloud);
MATLAB.png

Réponse acceptée

Kenta
Kenta le 9 Sep 2019
入力画像のサイズより、キャリブレーション後のサイズが小さくなってしまっている、という意味で正しいでしょうか。
カメラパラメータが原因で、キャリブレーション後のほうが、サイズが小さくなってしまっているのではないでしょうか。カメラパラメータを変えれば、キャリブレーション後の画像サイズも変わると思います。
例えば、
figure;imshow(frameLeftRect)
で、確認した場合、入力画像と似たものが見えると思うのですが、いかがでしょうか。
その場合でも画像の一部が欠損していますか。
  13 commentaires
Kenta
Kenta le 18 Sep 2019
>>やはり原因はこの関数にあるようですが
そのエラーがでるのは、stereoParams.matが現在のパスにないからではないでしょうか。
質問のところでの添付画像で「現在のフォルダー」とありますが、そこに、stereoParames.matをおいて、再度実行いただけますか。
ちなみに、stereoParames.matとhandshakeStereoParames.matのちがいはなんでしょうか。
stereoParames.matは現在お使いのものでとったキャリブレーションファイルではないということでしょうか。
ひとまず、stereoParamesでは全体の画像が出ることを確認いただけると幸いです。
naoya uwa
naoya uwa le 20 Sep 2019
仰る通り、変更後実行できました。
handshakeを記載するとウェブから読み込んでくるようです。
ありがとうございました。

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur 単一カメラとステレオ カメラのキャリブレーション dans Help Center et File Exchange

Produits

Community Treasure Hunt

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

Start Hunting!