matlabでの車両認識
2 views (last 30 days)
Show older comments
Daichi Saitou
on 5 Feb 2020
Commented: Daichi Saitou
on 5 Feb 2020
このサイトにある車両認識をやりたいんですけど、難しくて分かりません。
function [lidarData,imageData] = loadLidarAndImageData(initTime,finalTime)
initFrame = max(1,floor(initTime*10));
lastFrame = min(350,ceil(finalTime*10));
load ('imageData_35seconds.mat','allImageData');
imageData = allImageData(initFrame:lastFrame);
numFrames = lastFrame - initFrame + 1;
lidarData = cell(numFrames,1);
% Each file contains 70 frames.
initFileIndex = floor(initFrame/70) + 1;
lastFileIndex = ceil(lastFrame/70);
frameIndices = [1:70:numFrames numFrames + 1];
counter = 1;
for i = initFileIndex:lastFileIndex
startFrame = frameIndices(counter);
endFrame = frameIndices(counter + 1) - 1;
load(['lidarData_',num2str(i)],'currentLidarData');
lidarData(startFrame:endFrame) = currentLidarData(1:(endFrame + 1 - startFrame));
counter = counter + 1;
end
end
4行目の
load ('imageData_35seconds.mat','allImageData');
の部分に何が入るのか分かりません。画像データか、動画データか、どのような保存方法なのかも分かりません。
サイト内では、一番下のプログラムです。
0 Comments
Accepted Answer
Shunichi Kusano
on 5 Feb 2020
.matで表されるファイル形式はmatlabで読み書きできるデータ形式で、中身は画像でも音声でもなんでもいいです。
この例では何が入っているか、実際に読んでみると、350x1のセル配列となっています。各セルには144x192x3の数値配列が入っています。imshowで見るとこれは画像なので、350フレームの動画ファイルということになります。
データの中身がわからない場合はワークスペースを見ましょう。データ型やサイズなんかが表示されているはずですので、何のデータか想像がつく場合があります。
More Answers (0)
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!