Changeset 397 for trunk/src/civ.m
- Timestamp:
- Apr 26, 2012, 8:59:09 AM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/civ.m
r389 r397 520 520 dt=0.04;%default 521 521 if exist([RootName ext_imadoc],'file')==2 522 info=aviinfo([RootName ext_imadoc]);%read infos on the avi movie 523 dt=1/info.FramesPerSecond;%time interval between successive frames 524 MaxIndex_i=info.NumFrames;%number of frames 525 end 526 time=(dt*(0:MaxIndex_i-1))';%list of image times 527 TimeUnit='s'; 528 end 529 set(handles.ImaDoc,'BackgroundColor',[1 1 1])% set display box back to whiter 530 end 531 522 hhh=which('videoreader'); 523 if isempty(hhh)%use old video function of matlab 524 imainfo=aviinfo([RootName ext_imadoc]);%read infos on the avi movie 525 dt=1/imainfo.FramesPerSecond;%time interval between successive frames 526 MaxIndex_i=imainfo.NumFrames;%number of frames 527 % XmlData.Time=(0:1/imainfo.FramesPerSecond:(imainfo.NumFrames-1)/imainfo.FramesPerSecond)'; 528 % nbfield=imainfo.NumFrames; 529 % set(handles.Dt_txt,'String',['Dt=' num2str(1000/imainfo.FramesPerSecond) 'ms']);%display the elementary time interval in millisec 530 % ColorType=imainfo.ImageType;%='truecolor' for color images 531 else %use video function videoreader of matlab 532 imainfo=get(videoreader([RootName ext_imadoc]));%read infos on the avi movie 533 dt=1/imainfo.FrameRate;%time interval between successive frames 534 MaxIndex_i=imainfo.NumberOfFrames;%number of frames 535 % XmlData.Time=(0:1/imainfo.FrameRate:(imainfo.NumberOfFrames-1)/imainfo.FrameRate)'; 536 % nbfield=imainfo.NumberOfFrames; 537 % set(handles.Dt_txt,'String',['Dt=' num2str(1000/imainfo.FrameRate) 'ms']);%display the elementary time interval in millisec 538 % ColorType='truecolor'; 539 end 540 541 time=(dt*(0:MaxIndex_i-1))';%list of image times 542 TimeUnit='s'; 543 end 544 set(handles.ImaDoc,'BackgroundColor',[1 1 1])% set display box back to whiter 545 end 546 end 532 547 %% timing display 533 548 %show the reference image edit box if relevant (not needed for movies or in the absence of time information … … 1223 1238 Param.Civ1.Time=((time(i2_civ1(ifile)+1,j2_civ1(j)+1)+time(i1_civ1(ifile)+1,j1_civ1(j)+1))/2); 1224 1239 Param.Civ1.term_a=num2stra(j1_civ1(j),nom_type_nc);%UTILITE? 1225 Param.Civ1.term_b=num2stra(j2_civ1(j),nom_type_nc);% 1226 ImageInfo=imfinfo(filecell.ima1.civ1{1,1});%read the first image to get the size 1240 Param.Civ1.term_b=num2stra(j2_civ1(j),nom_type_nc);% 1241 form=imformats(regexprep(get(handles.ImaExt,'String'),'^.',''));%look for image formats 1242 if isempty(form) 1243 ImageInfo=get(VideoReader(filecell.ima1.civ1{1,1})); 1244 Param.Civ1.ImageBitDepth=ImageInfo.BitsPerPixel/3; 1245 else 1246 ImageInfo=imfinfo(filecell.ima1.civ1{1,1});%read the first image to get the size 1247 Param.Civ1.ImageBitDepth=ImageInfo.BitDepth; 1248 end 1227 1249 Param.Civ1.ImageWidth=ImageInfo.Width; 1228 1250 Param.Civ1.ImageHeight=ImageInfo.Height; 1229 Param.Civ1.ImageBitDepth=ImageInfo.BitDepth;1230 1251 Param.Civ1.i1=i1_civ1; 1231 1252 Param.Civ1.i2=i2_civ1; … … 1394 1415 end 1395 1416 end 1396 ImageInfo=imfinfo(filecell.ima1.civ2{1,1});%read the first image to get the size 1417 form=imformats(regexprep(get(handles.ImaExt,'String'),'^.',''));%look for image formats 1418 if isempty(form) 1419 ImageInfo=get(VideoReader(filecell.ima1.civ2{1,1})); 1420 Param.Civ2.ImageBitDepth=ImageInfo.BitsPerPixel/3; 1421 else 1422 ImageInfo=imfinfo(filecell.ima1.civ2{1,1});%read the first image to get the size 1423 Param.Civ2.ImageBitDepth=ImageInfo.BitDepth; 1424 end 1397 1425 Param.Civ2.ImageWidth=ImageInfo.Width; 1398 1426 Param.Civ2.ImageHeight=ImageInfo.Height; 1399 Param.Civ2.ImageBitDepth=ImageInfo.BitDepth;1400 1427 Param.Civ2.i1=i1_civ2; 1401 1428 Param.Civ2.i2=i2_civ2; 1402 % TODO: case of movie1403 1429 switch CivMode 1404 1430 case 'CivX' … … 3928 3954 par_civ1.ImageHeight=size(Data.A,1); 3929 3955 par_civ1.Mask='all';% will provide only the grid set for PIV, no image correlation 3930 par_civ1.i1= i1_civ1;3931 par_civ1.i2= i2_civ1;3956 par_civ1.i1=1;%i1_civ1; 3957 par_civ1.i2=2;%i2_civ1; 3932 3958 Param.Civ1=par_civ1; 3933 3959 Grid=civ_matlab(Param);% get the grid of x, y positions set for PIV
Note: See TracChangeset
for help on using the changeset viewer.