blob: 82982bae0bf00426843593f10995d33d7934d52a (
plain)
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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
|
#!/bin/bash
filename=$1
cleanFilename=$2
regexN='^N[0-9]'
regexData='(D/RefocusFilter)'
regexNum='^[1-7]\.'
sum=0
InitializeSum=0
UnpackInputImageSum=0
MarkLayerMaskSum=0
ComputeLayerMatteBehindFocalDepthSum=0
ComputeIntegralImageForLayerBehindFocalDepthSum=0
FilterLayerBehindFocalDepthSum=0
updateSharpImageUsingFuzzyImageSum=0
ComputeLayerMatteInFrontOfFocalDepthSum=0
ComputeIntegralImageForLayerInFrontOfFocalDepthSum=0
FilterLayerInFrontOfFocalDepthSum=0
finalizeFuzzyImageUsingSharpImageSum=0
PackOutputImageSum=0
while read line;do
if [[ $line =~ $regexN ]];
then
echo "Initialize: $InitializeSum" >> $cleanFilename
InitializeSum=0
echo "UnpackInputImage: $UnpackInputImageSum" >> $cleanFilename
UnpackInputImageSum=0
echo "MarkLayerMask: $MarkLayerMaskSum" >> $cleanFilename
MarkLayerMaskSum=0
echo "ComputeLayerMatteBehindFocalDepth: $ComputeLayerMatteBehindFocalDepthSum" >> $cleanFilename
ComputeLayerMatteBehindFocalDepthSum=0
echo "ComputeIntegralImageForLayerBehindFocalDepth: $ComputeIntegralImageForLayerBehindFocalDepthSum" >> $cleanFilename
ComputeIntegralImageForLayerBehindFocalDepthSum=0
echo "FilterLayerBehindFocalDepth: $FilterLayerBehindFocalDepthSum" >> $cleanFilename
FilterLayerBehindFocalDepthSum=0
echo "updateSharpImageUsingFuzzyImage: $updateSharpImageUsingFuzzyImageSum" >> $cleanFilename
updateSharpImageUsingFuzzyImageSum=0
echo "ComputeLayerMatteInFrontOfFocalDepth: $ComputeLayerMatteInFrontOfFocalDepthSum" >> $cleanFilename
ComputeLayerMatteInFrontOfFocalDepthSum=0
echo "ComputeIntegralImageForLayerInFrontOfFocalDepth: $ComputeIntegralImageForLayerInFrontOfFocalDepthSum" >> $cleanFilename
ComputeIntegralImageForLayerInFrontOfFocalDepthSum=0
echo "FilterLayerInFrontOfFocalDepth: $FilterLayerInFrontOfFocalDepthSum" >> $cleanFilename
FilterLayerInFrontOfFocalDepthSum=0
echo "finalizeFuzzyImageUsingSharpImage: $finalizeFuzzyImageUsingSharpImageSum" >> $cleanFilename
finalizeFuzzyImageUsingSharpImageSum=0
echo "PackOutputImage: $PackOutputImageSum" >> $cleanFilename
PackOutputImageSum=0
echo $line >> $cleanFilename
elif [[ $line =~ $regexData ]];
then
#collect corresponding data
newLine=`echo $line|grep -oE '[0-9]+ ns'|awk '{print $1}'`
sum=`echo $((sum+newLine))`
if [[ $line =~ 'Initialize' ]];
then
InitializeSum=`echo $((InitializeSum+newLine))`;
elif [[ $line =~ 'UnpackInputImage' ]];
then
UnpackInputImageSum=`echo $((UnpackInputImageSum+newLine))`
elif [[ $line =~ 'MarkLayerMask' ]];
then
MarkLayerMaskSum=`echo $((MarkLayerMaskSum+newLine))`
elif [[ $line =~ 'ComputeLayerMatteBehindFocalDepth' ]];
then
ComputeLayerMatteBehindFocalDepthSum=`echo $((ComputeLayerMatteBehindFocalDepthSum+newLine))`
elif [[ $line =~ 'ComputeIntegralImageForLayerBehindFocalDepth' ]];
then
ComputeIntegralImageForLayerBehindFocalDepthSum=`echo $((ComputeIntegralImageForLayerBehindFocalDepthSum+newLine))`
elif [[ $line =~ 'FilterLayerBehindFocalDepth' ]];
then
FilterLayerBehindFocalDepthSum=`echo $((FilterLayerBehindFocalDepthSum+newLine))`
elif [[ $line =~ [uU]pdateSharpImageUsingFuzzyImage ]];
then
updateSharpImageUsingFuzzyImageSum=`echo $((updateSharpImageUsingFuzzyImageSum+newLine))`
elif [[ $line =~ 'ComputeLayerMatteInFrontOfFocalDepth' ]];
then
ComputeLayerMatteInFrontOfFocalDepthSum=`echo $((ComputeLayerMatteInFrontOfFocalDepthSum+newLine))`
elif [[ $line =~ 'ComputeIntegralImageForLayerInFrontOfFocalDepth' ]];
then
ComputeIntegralImageForLayerInFrontOfFocalDepthSum=`echo $((ComputeIntegralImageForLayerInFrontOfFocalDepthSum+newLine))`
elif [[ $line =~ 'FilterLayerInFrontOfFocalDepth' ]];
then
FilterLayerInFrontOfFocalDepthSum=`echo $((FilterLayerInFrontOfFocalDepthSum+newLine))`
elif [[ $line =~ [fF]inalizeFuzzyImageUsingSharpImage ]];
then
finalizeFuzzyImageUsingSharpImageSum=`echo $((finalizeFuzzyImageUsingSharpImageSum+newLine))`
elif [[ $line =~ 'PackOutputImage' ]];
then
PackOutputImageSum=`echo $((PackOutputImageSum+newLine))`
fi
elif [[ $line =~ $regexNum ]];
then
if ! [[ $line =~ '1.' ]];
then
echo "Initialize: $InitializeSum" >> $cleanFilename
InitializeSum=0
echo "UnpackInputImage: $UnpackInputImageSum" >> $cleanFilename
UnpackInputImageSum=0
echo "MarkLayerMask: $MarkLayerMaskSum" >> $cleanFilename
MarkLayerMaskSum=0
echo "ComputeLayerMatteBehindFocalDepth: $ComputeLayerMatteBehindFocalDepthSum" >> $cleanFilename
ComputeLayerMatteBehindFocalDepthSum=0
echo "ComputeIntegralImageForLayerBehindFocalDepth: $ComputeIntegralImageForLayerBehindFocalDepthSum" >> $cleanFilename
ComputeIntegralImageForLayerBehindFocalDepthSum=0
echo "FilterLayerBehindFocalDepth: $FilterLayerBehindFocalDepthSum" >> $cleanFilename
FilterLayerBehindFocalDepthSum=0
echo "updateSharpImageUsingFuzzyImage: $updateSharpImageUsingFuzzyImageSum" >> $cleanFilename
updateSharpImageUsingFuzzyImageSum=0
echo "ComputeLayerMatteInFrontOfFocalDepth: $ComputeLayerMatteInFrontOfFocalDepthSum" >> $cleanFilename
ComputeLayerMatteInFrontOfFocalDepthSum=0
echo "ComputeIntegralImageForLayerInFrontOfFocalDepth: $ComputeIntegralImageForLayerInFrontOfFocalDepthSum" >> $cleanFilename
ComputeIntegralImageForLayerInFrontOfFocalDepthSum=0
echo "FilterLayerInFrontOfFocalDepth: $FilterLayerInFrontOfFocalDepthSum" >> $cleanFilename
FilterLayerInFrontOfFocalDepthSum=0
echo "finalizeFuzzyImageUsingSharpImage: $finalizeFuzzyImageUsingSharpImageSum" >> $cleanFilename
finalizeFuzzyImageUsingSharpImageSum=0
echo "PackOutputImage: $PackOutputImageSum" >> $cleanFilename
PackOutputImageSum=0
fi
echo $line >> $cleanFilename
fi
done < $filename
echo $filename
|