# How to store data from iterative processes?

4 views (last 30 days)
Fabian Aguilar on 12 Nov 2018
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?

Ashutosh Prasad on 15 Nov 2018
You can create structure array in each iteration and add the fields 'Time' and 'Coordinates' for each frame.

### Categories

Find more on Computer Vision Toolbox 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!

Translated by