bzr branch
http://suren.me/webbzr/normxcorr/trunk
1
by Suren A. Chilingaryan
Initial import |
1 |
function [validx,validy]=resume_automate_image(grid_x,grid_y,filenamelist,resultsimcorrx,resultsimcorry); |
2 |
||
3 |
% Code to resume image correlation after error or user intervention
|
|
4 |
% Programmed by Chris
|
|
5 |
% Last revision: 12/26/06
|
|
6 |
||
7 |
% Load necessary files
|
|
8 |
if exist('grid_x')==0 |
|
9 |
load('grid_x.dat') % file with x position, created by grid_generator.m |
|
10 |
end
|
|
11 |
if exist('grid_y')==0 |
|
12 |
load('grid_y.dat') % file with y position, created by grid_generator.m |
|
13 |
end
|
|
14 |
if exist('filenamelist')==0 |
|
15 |
load('filenamelist') % file with the list of filenames to be processed |
|
16 |
end
|
|
17 |
||
18 |
if exist('resultsimcorrx')==0 |
|
19 |
resultsimcorrx = dlmread('resultsimcorrx.txt','\t'); % file with x position, created by grid_generator.m |
|
20 |
end
|
|
21 |
if exist('resultsimcorry')==0 |
|
22 |
resultsimcorry = dlmread('resultsimcorry.txt','\t'); % file with y position, created by grid_generator.m |
|
23 |
end
|
|
24 |
||
25 |
[r c]=size(grid_x); |
|
26 |
[Imagenum Rasternum]=size(resultsimcorrx); |
|
27 |
||
28 |
if r*c<Rasternum |
|
29 |
resultsimcorrx(:,(r*c+1):Rasternum)=[]; |
|
30 |
resultsimcorry(:,(r*c+1):Rasternum)=[]; |
|
31 |
end
|
|
32 |
||
33 |
resultsimcorrx(Imagenum,:)=[]; |
|
34 |
resultsimcorry(Imagenum,:)=[]; |
|
35 |
||
36 |
||
37 |
validx=resultsimcorrx'; |
|
38 |
validy=resultsimcorry'; |
|
39 |
||
40 |
save resultsimcorrx.txt resultsimcorrx -ascii -tabs |
|
41 |
save resultsimcorry.txt resultsimcorry -ascii -tabs |
|
42 |
||
43 |
[validx,validy]=automate_image(grid_x,grid_y,filenamelist,validx,validy); |