필터 지우기
필터 지우기

loading multiple groundtruth .mat files

조회 수: 1 (최근 30일)
Matpar
Matpar 2020년 4월 13일
편집: Stephen23 2020년 4월 14일
Hi and good day to all,
I have 8 ground truth labelled .mat files from videos done by the matlab labeller.
I am trying to load such and I am uncertain of the next move.
Can a profession assist me please?
I have gotten this far with google, here's my code!
Thank you in advance!!
filenames = {'Beat1GTruth.mat','Beat2GTruth.mat','Fight1GTruth.mat','Fight2GTruth.mat','Shoot1GTruth.mat'...
,'Shoot2GTruth.mat','Stab1GTruth.mat','Stab2GTruth.mat'};
for kk = 1:numel(filenames)
load(filenames{kk})
end

답변 (1개)

Stephen23
Stephen23 2020년 4월 13일
편집: Stephen23 2020년 4월 13일
Always load into an output variable (which is a scalar structure), e.g.:
F = {'Beat1GTruth.mat', 'Beat2GTruth.mat', 'Fight1GTruth.mat', 'Fight2GTruth.mat', 'Shoot1GTruth.mat', 'Shoot2GTruth.mat', 'Stab1GTruth.mat', 'Stab2GTruth.mat'};
N = numel(F);
C = cell(1,N);
for kk = 1:N
S = load(F{kk}); % load into a structure
% you can do anything with the structure contents, e.g.:
C{kk} = S.somefield; % !!! use an appropriate fieldname !!!
end
See also:
  댓글 수: 8
Stephen23
Stephen23 2020년 4월 13일
편집: Stephen23 2020년 4월 14일
You do not appear to be running the complete code from my last comment.
Pease run the complete code that I gave, including the last line:
T = [C{:}];
T will then be a 1xN structure with two fields, it contains all of the data from all of your files.
Matpar
Matpar 2020년 4월 14일
I did see it and I ran it just as is!! that is what is confusing me!
I got to the step of training the cnn objectdetector but it came back with an error about the groundtruths not being in the right format!!
I am learning and it is fun! but not so much fun when I am stuck and not knowing nor understanding the full processes to move forward!
Please help!
and thank you in advance pal!

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Convert Image Type에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by