Help writing a tracking code for 1 hour of data at a time

1 visualización (últimos 30 días)
Kate
Kate el 2 de Ag. de 2012
Hello,
I am very new to Matlab and am writing a code to analyse some data I have filmed. The code is to track two (relatively large) particles within an area for an hour at a time. I have created a code that states the region of interest, and finds the centre of mass for a single frame of film:
obj=VideoReader('shortvideoM.mov') originalImage= read(obj,1); colormap('gray'),imagesc(originalImage); greyImage=rgb2gray(originalImage); colormap('gray'),imagesc(greyImage); invertImage=255-greyImage; colormap('gray'),imagesc(invertImage); m= invertImage(128.5:302.5,35.5:603.5); colormap('gray'),imagesc(m); blackImage=bpass(m,1,5,5); figure;colormap('gray'),image(blackImage); max= max(max(blackImage)); display(max); pk = pkfnd(blackImage,35,5); cnt = cntrd(blackImage,pk,5); whos cnt figure; hist(mod(cnt(:,1),1),20);
I know that I need to loop the data and then get an array into which to put the coordinates and time, I was just wondering what the general commands are best for this.
Thanks if anyone can help me out, I'm not sure how difficult it is (well very for me).
-Kate

Respuestas (1)

Babak
Babak el 2 de Ag. de 2012
you may want to use these commands:
save data.mat
and later say
load data.mat
you can put them in a for loop for example

Categorías

Más información sobre Loops and Conditional Statements 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