-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathDeepPIV_3DR_CorrectManualAdd.m
60 lines (54 loc) · 1.75 KB
/
DeepPIV_3DR_CorrectManualAdd.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
clc; clear; close all; warning('off');tic
dataset='60p_f13_250sh';
display(dataset);
val=10;
vel=10; %mm/s %UNKNOWN
percent=0.05; %percent allowable change in imwarp transform
inc=1;
%retrieving data set-specific parameters
[dir,start,finish,fps,fstop,shutter,calib,red,aspectratio,contrast]=videoinfo(dataset,vel);
viddir=[dir,'clips/'];
indir=[dir,'input/'];
outdir=[dir,'output/'];
nFrames=finish-start;
%% extract body features manually
display('Extracting body features manually')
preim_file=[indir,dataset,'_',num2str(vel),'vel_IMAGEprebody'];
im_file=[indir,dataset,'_',num2str(vel),'vel_IMAGEbody.mat'];
mask_file=[indir,dataset,'_',num2str(vel),'vel_MASKbody.mat'];
% preim_file=[indir,dataset,'_IMAGEprebody'];
% im_file=[indir,dataset,'_IMAGEbody.mat'];
% mask_file=[indir,dataset,'_MASKbody.mat'];
if exist(im_file,'file')==2
display(' Loading IMAGE stacks...');
load(preim_file);
load(im_file);
load(mask_file);
else
display(' Body points are not extracted. Run DeepPIV_3DR_ManualBody.m.')
break
end
%%
for i=119:1:size(IMAGEprebody,3)
display(['frame number: ',num2str(i)]);
im=IMAGEprebody(:,:,i);
imfinal=IMAGEbody(:,:,i);
if size(MASK,3)<i
mask=im.*0;
else
mask=MASK(:,:,i);
end
figure(1)
imshowpair(imadjust(im,[0,0.5],[0,1]),imfinal);
n=input('Next image: Do you need to manually fill? no = [enter], yes = 0 ');
% n=0;
while n==0
[imfinal,mask]=bodyfillmanual(im,imfinal,mask);
n=input('Do you need to manually fill? no = [enter], yes = 0 ');
end
clear n
IMAGEbody(:,:,i)=imfinal;
MASK(:,:,i)=mask;
end
save(im_file,'IMAGEbody','-v7.3'); %save post-processing parameters
save(mask_file,'MASK','-v7.3'); %save post-processing parameters