3Dカメラのデータをfor文とmeshで確認したいです。
3 views (last 30 days)
Show older comments
clear all
%以下のmatファイルは120x212x1200 doubleの配列です。
load('F:\釜堀\Intel RealSense SDK 2.0\matlab\2022\09\13\16\MAT\2022_09_13_164718.mat');
for i = 1:1200
A = Depth_Data(:,:,i);
mesh(A);
end
%最後のフレームのみ表示されました。
0 Comments
Accepted Answer
Atsushi Ueno
on 14 Sep 2022
下記のサンプルデータ1200フレームをアニメーション表示するのに約26秒掛かりました。
clear all
%以下のmatファイルは120x212x1200 doubleの配列です。
%load('F:\釜堀\Intel RealSense SDK 2.0\matlab\2022\09\13\16\MAT\2022_09_13_164718.mat');
loops = 1200;
[X,Y] = meshgrid(linspace(-3,3,loops/10));
Depth_Data = repmat(peaks(X,Y),[1 1 loops]) ...
.* sin(permute(1:loops,[3 1 2])*pi/loops); % サンプルデータ120x120x1200 doubleの作成
mesh(Depth_Data(:,:,loops/2)); % 一旦グラフに表示し座標軸の固定や描画方法を設定する
axis tight manual
ax = gca;
ax.NextPlot = 'replaceChildren';
for i = 1:loops
mesh(Depth_Data(:,:,i));
drawnow; % ここにdrawnow関数を置く
end
0 Comments
More Answers (0)
See Also
Categories
Find more on アニメーション 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!