r_verify_recon.m 1.72 KB
function r_verify_recon(expNumber,camNumber,rowNumber)
% R_VERIFY_RECON -  Loads data file obtained from recon and places circle
% around floes detected. (You can see, for example, if r_recon detected
% water as a floe.)
%
% Syntax:  r_verify_recon(expNumber,camNumber,rowNumber)
%
% Inputs:
%    expNumber - The experiment identifier
%    camNumber - The camera number
%    rowNumber - The row number
%
% Example:
%    r_verify_recon(201307231530,1,4)
%
% Other m-files required: Image Processing Toolbox
% Subfunctions: none
% MAT-files required: data_$expNumber_$camNumber_$rowNumber.mat 
%                              obtained from R_RECON
%                  or dataCircle_$expNumber_$camNumber_$rowNumber.mat
%                              obtained from r_isolateCircle
%
% See also: R_RECON, R_ISOLATE

% Author: Marie-Pier Marquis, Dany Dumont
% UQAR/ISMER
% email: dany_dumont@uqar.ca
% Website: http://www.ismer.ca/dumont-dany
% July 2014, Last revision: October 2014
% ______________________________________________________________________

cstr = num2str(camNumber);
estr = num2str(expNumber);
rstr = num2str(rowNumber);

rootdir = '/Users/marie-pier/Desktop/MP/images/multicam';
expdir  = [rootdir,'/',estr,'_multicam'];
camdir  = [expdir,'/cam',cstr];
intdir  = [camdir,'/interp'];
datafile = [expdir,'/data_',estr,'_',cstr,'_',rstr];

load(datafile)
cd(intdir)

imfiles  = dir('im*.jpg');
nFiles   = size(imfiles,1);
nObjects = size(xpos,2);

for n = 1:nFiles
    
    imfilename = imfiles(n).name;
    I0 = imread(imfilename);
    imshow(I0)
    
    if ~isnan(xpos(n,1))
        viscircles([xpos(n,:)' ypos(n,:)'], 49.5.*ones(1,nObjects),...
            'EdgeColor','w');
    end
 
    F = getframe(gcf);
    [X,Map] = frame2im(F);
    
end