Saving Data from for loop using ginput to create data.

1 visualización (últimos 30 días)
Chris
Chris el 16 de Abr. de 2014
Comentada: Image Analyst el 19 de Abr. de 2014
I am using ginput to select locations of markers in video frames, however when it moves to the next frame it overwrites the data from the previous frame.
obj = VideoReader('Test.mp4'); nFrames=obj.NumberofFrames %nFrames will go in place of 2 in final code to run full length of video.
for k = 1: 2 %fill in the appropriate number this_frame = read(obj, k); thisfig = figure(); thisax = axes('Parent', thisfig); image(this_frame, 'Parent', thisax); title(thisax, sprintf('Frame #%d', k)); [x y] = ginput(3); data=[x y] end I've tried using this also but it gives an error that subscripted assigned indices are mismatched.
data= [] for data(end+1,:)=ginput(1); x=data(k,1) y=data(k,2) end Any help would be greatly appreciated.

Respuestas (0)

Categorías

Más información sobre Formatting and Annotation en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by