I am currently writing the code in order to collect the average value for centroids coordinate inside a while loop for each video frame. For each loop cycle there will be only one average value as the output for each single frame. My objective is to collect all the average values and plot it out.
for object = 1:length(centroid);
centX = centroid(1,object);
centY = centroid(2,object);
vidIn = step(htextinsCent, vidIn, [centY centX], [centY-6 centX-9]); %this line is for coordinate display purpose on each frame
end
for object = length(centroid)>0;
columncentroid=centroid';
average=mean(columncentroid);
end
I am having difficulty to list all the average values from all the frames at the end of code run.The earlier average value is replaced by latest value after each loop. Kindly advice me for appropiate steps. Thank you in advanced.