/normxcorr/trunk

To get this branch, use:
bzr branch http://suren.me/webbzr/normxcorr/trunk
1 by Suren A. Chilingaryan
Initial import
1
% Captures frames with your images and an overlay of the tracking marker
2
% written by Chris
3
4
function [validx,validy]=Markerplotting(validx,validy);
5
6
if exist('validx')==0
7
    [validx,Pathvalidx] = uigetfile('*.mat','Open validx.mat');
8
    cd(Pathvalidx);
9
    validx=importdata(validx,'\t');
10
end
11
if exist('validy')==0
12
    [validy,Pathvalidy] = uigetfile('*.mat','Open validy.mat');
13
    cd(Pathvalidy);
14
    validy=importdata(validy,'\t');
15
end
16
if exist('filenamelist')==0
17
load('filenamelist')
18
end
19
20
sizevalidx=size(validx);
21
sizevalidy=size(validy);
22
looppoints=sizevalidx(1,1);
23
loopimages=sizevalidx(1,2);
24
25
h=figure;
26
videoselection = menu(sprintf('Do you want to create a video?'),'Yes','No')
27
if videoselection==1
28
    mkdir('Video_Markers')
29
    Vid='Vid';
30
end
31
for i=1:(loopimages-1)
32
    imshow(filenamelist(i,:))
33
    hold on
34
    title(['Displacement in y-direction versus x-y-position',sprintf(' (Current image #: %1g)',i)]);
35
    plot(validx(:,i),validy(:,i),'.g','MarkerSize',2)
36
    hold off
37
    drawnow
38
    if videoselection==1
39
        u=i+10000;
40
        ustr=num2str(u);
41
        videoname=[Vid ustr '.jpg']
42
        cd('Video_Markers');
43
        saveas(h,videoname,'jpg')
44
        cd('..')
45
    end
46
    
47
end