Changeset 822 for trunk/src/series/civ_series.m
 Timestamp:
 Oct 10, 2014, 10:11:30 AM (9 years ago)
 File:

 1 edited
Legend:
 Unmodified
 Added
 Removed

trunk/src/series/civ_series.m
r819 r822 78 78 if ischar(Param) 79 79 Param=xml2struct(Param);% read Param as input file (batch case) 80 Param.InputTable{1}81 Param.InputTable{2}82 Param.InputTable{3}83 80 checkrun=0; 84 81 end … … 153 150 [i1_series_Civ2,i2_series_Civ2,j1_series_Civ2,j2_series_Civ2,check_bounds,NomTypeNc]=... 154 151 find_pair_indices(PairCiv2,i1_series{2},j1_series{2},MinIndex_i(2),MaxIndex_i(2),MinIndex_j(2),MaxIndex_j(2)); 155 % check_bounds=check_bounds  check_bounds_Civ2;156 152 end 157 153 end … … 204 200 FrameIndex_A_Civ2=i1_series_Civ2; 205 201 FrameIndex_B_Civ2=i2_series_Civ2; 202 j1_series_Civ2=ones(size(i1_series_Civ2)); 203 j2_series_Civ2=ones(size(i1_series_Civ2)); 206 204 else 207 205 FrameIndex_A_Civ2=j1_series_Civ2; … … 253 251 return 254 252 end 255 [FileType_A,FileInfo_A,VideoObject_A]=get_file_info(ImageName_A); 253 [FileInfo_A,VideoObject_A]=get_file_info(ImageName_A); 254 FileType_A=FileInfo_A.FileType; 256 255 [par_civ1.ImageA,VideoObject_A] = read_image(ImageName_A,FileInfo_A.FileType,VideoObject_A,FrameIndex_A_Civ2(1)); 257 256 ImageName_B=fullfile_uvmat(RootPath_B,SubDir_B,RootFile_B,FileExt_B,NomType_B,i2_series_Civ2(1),[],j2_series_Civ2(1)); … … 264 263 [par_civ1.ImageB,VideoObject_B] = read_image(ImageName_B,FileType_B,VideoObject_B,FrameIndex_B_Civ2(1)); 265 264 NbField=numel(i1_series_Civ2); 265 else 266 NbField=numel(i1_series_Civ1);% no image used (only fix or patch) TO CHECK 266 267 end 267 268 catch ME … … 280 281 Data.Program='civ_series'; 281 282 Data.CivStage=0;%default 282 % ListVarCiv1={'Civ1_X','Civ1_Y','Civ1_U','Civ1_V','Civ1_C','Civ1_F'}; %variables to read283 % ListVarFix1={'Civ1_X','Civ1_Y','Civ1_U','Civ1_V','Civ1_C','Civ1_F','Civ1_FF'};284 % mask='';285 283 maskname='';%default 286 284 check_civx=0;%default 287 % check_civ1=0;%default288 % check_patch1=0;%default289 285 290 286 %% get timing from the ImaDoc file or input video 287 if iview_A~=0 291 288 XmlFileName=find_imadoc(RootPath_A,SubDir_A,RootFile_A,FileExt_A); 292 289 time=[]; … … 316 313 end 317 314 if isempty(time)% time = index i +0.001 index j by default 318 time=(MinIndex_i:MaxIndex_i)'*ones(1,MaxIndex_jMinIndex_j+1); 319 time=time+0.001*ones(MaxIndex_iMinIndex_i+1,1)*(MinIndex_j:MaxIndex_j); 320 time=[zeros(1,MaxIndex_jMinIndex_j+1);time];% insert a first line of zeros 321 time=[zeros(MaxIndex_iMinIndex_i+2,1) time];% insert a first column of zeros 315 %MinIndex_i=min(i1_series_Civ1); 316 MaxIndex_i=max(i2_series_Civ1); 317 %MinIndex_j=min(j1_series_Civ1); 318 MaxIndex_j=max(j2_series_Civ1); 319 time=(1:MaxIndex_i)'*ones(1,MaxIndex_j); 320 time=time+0.001*ones(MaxIndex_i,1)*(1:MaxIndex_j); 321 time=[zeros(1,MaxIndex_j);time];% insert a first line of zeros 322 time=[zeros(MaxIndex_i+1,1) time];% insert a first column of zeros 322 323 end 323 324 … … 325 326 nbfield=length(FileInfo_A); 326 327 nbfield_j=1; 328 end 327 329 end 328 330 … … 334 336 break 335 337 end 336 if iview_A==1% if Civ1 is performed 337 Civ1Dir=OutputDir; 338 if iview_A==0 339 ncfile=fullfile_uvmat(Param.InputTable{1,1},Param.InputTable{1,2},Param.InputTable{1,3},Param.InputTable{1,5},... 340 NomTypeNc,i1_series_Civ1(ifield),i2_series_Civ1(ifield),j1_series_Civ1(ifield),j2_series_Civ1(ifield)); 338 341 else 339 Civ1Dir=Param.InputTable{1,2}; 340 end 341 if strcmp(Param.ActionInput.ListCompareMode,'PIV') 342 ncfile=fullfile_uvmat(RootPath_A,Civ1Dir,RootFile_A,'.nc',NomTypeNc,i1_series_Civ1(ifield),i2_series_Civ1(ifield),... 343 j1_series_Civ1(ifield),j2_series_Civ1(ifield)); 344 else 345 ncfile=fullfile_uvmat(RootPath_A,Civ1Dir,RootFile_A,'.nc',NomTypeNc,i2_series_Civ1(ifield),[],... 346 j1_series_Civ1(ifield),j2_series_Civ1(ifield)); 347 end 348 342 if iview_A==1% if Civ1 is performed 343 Civ1Dir=OutputDir; 344 else 345 Civ1Dir=Param.InputTable{1,2}; 346 end 347 if strcmp(Param.ActionInput.ListCompareMode,'PIV') 348 ncfile=fullfile_uvmat(RootPath_A,Civ1Dir,RootFile_A,'.nc',NomTypeNc,i1_series_Civ1(ifield),i2_series_Civ1(ifield),... 349 j1_series_Civ1(ifield),j2_series_Civ1(ifield)); 350 else 351 ncfile=fullfile_uvmat(RootPath_A,Civ1Dir,RootFile_A,'.nc',NomTypeNc,i2_series_Civ1(ifield),[],... 352 j1_series_Civ1(ifield),j2_series_Civ1(ifield)); 353 end 354 end 349 355 %% Civ1 350 356 % if Civ1 computation is requested … … 466 472 %% Fix1 467 473 if isfield (Param.ActionInput,'Fix1') 474 if ~isfield (Param.ActionInput,'Civ1')% if we use existing Civ1, remove previous data beyond Civ1 475 Fix1_attr=find(strcmp('Fix1',Data.ListGlobalAttribute)); 476 Data.ListGlobalAttribute(Fix1_attr)=[]; 477 for ilist=1:numel(Fix1_attr) 478 Data=rmfield(Data,Data.ListGlobalAttribute{Fix1_attr(ilist)}); 479 end 480 end 468 481 ListFixParam=fieldnames(Param.ActionInput.Fix1); 469 482 for ilist=1:length(ListFixParam) … … 615 628 par_civ2.SearchBoxSize(1)=2*ibx2+9;% search ara +4 pixels around the guess 616 629 par_civ2.SearchBoxSize(2)=2*iby2+9; 617 % i1=i1_series_Civ2(ifield);618 % i2=i1;619 % if ~isempty(i2_series_Civ2)620 % i2=i2_series_Civ2(ifield);621 % end622 % j1=1;623 % if ~isempty(j1_series_Civ2)624 % j1=j1_series_Civ2(ifield);625 % end626 % j2=j1;627 % if ~isempty(j2_series_Civ1)628 % j2=j2_series_Civ2(ifield);629 % end630 630 Civ2_Dt=time(i2+1,j2+1)time(i1+1,j1+1); 631 631 par_civ2.SearchBoxShift=(Civ2_Dt/Data.Civ1_Dt)*[Shiftx(nbval>=1)./nbval(nbval>=1) Shifty(nbval>=1)./nbval(nbval>=1)]; … … 693 693 nbvar=length(Data.ListVarName); 694 694 Data.VarAttribute{nbvar}.Role='errorflag'; 695 Data.Civ2_FF= fix(Param.ActionInput.Fix2,Data.Civ2_F,Data.Civ2_C,Data.Civ2_U,Data.Civ2_V);695 Data.Civ2_FF=double(fix(Param.ActionInput.Fix2,Data.Civ2_F,Data.Civ2_C,Data.Civ2_U,Data.Civ2_V)); 696 696 Data.CivStage=Data.CivStage+1; 697 697 end
Note: See TracChangeset
for help on using the changeset viewer.