필터 지우기
필터 지우기

How to store data from iterative processes?

조회 수: 1 (최근 30일)
Fabian Aguilar
Fabian Aguilar 2018년 11월 12일
답변: Ashutosh Prasad 2018년 11월 15일
I want to store the results from an iterative video processing, which means I am getting data from every single frame on the video.
I am calculating depth estimation from an stereo video, I am calculating:
  • Frame
  • Time (video time)
  • Target World Coordinates (X, Y, Z), where this is a m x 3 matrix
  • ... Among others ...
All this variables are gonna change at every single instant of time, let's say:
  • Frame will increase for every iteration, i.e. Frame = Frame + 1;
  • Time will read the instant of time of the video which belongs to the frame beign process, i.e. 1 seg;
  • Coordinates, where it will store the world coordinates of the targets, i. e, [2 4 5 ; 1 8 9];
For example:
Frame = 0; % Frame reader
Time = 0; % Time reader
Coordinates = zeros(m , 3) % World Coordinates
while hasFrame(Video)
Frame = Frame + 1; % Increase the counter for the Frames
% {
% This Section contains all the video processing
% }
Coordinates = [X1 Y1 Z1
X2 Y2 Z2
X3 Y3 Z3
...
Xn Yn Zn]; % This will return the world coordinates of the targets that are in the video, this might change in size of rows...
end
I want to store each of the variables avobe in a single object with the following (or similar) format as a class or something.
Frame(1).Time; % Whatever time is on the video
Frame(1).Coordinates; % Results from the processing
Frame(2).Time; % Whatever time is on the video
Frame(2).Coordinates; % Results from the processing
Is there a way I can achieve what I want?

답변 (1개)

Ashutosh Prasad
Ashutosh Prasad 2018년 11월 15일
You can create structure array in each iteration and add the fields 'Time' and 'Coordinates' for each frame.

카테고리

Help CenterFile Exchange에서 Computer Vision with Simulink에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by