Image Processing Reference
In-Depth Information
0
0
1
2
3
4
5
6
7
8
9
0
1
2
3
4
5
6
7
8
9
10
11
12
0
0
0
0
0
0
0
0
0
0
133
141
147
150
144
135
124 124
131
0
140
145
149
150
141
130
119 123
132
0
143
148
150
150
138
125
118 125
136
0
144
148
150
147
134
125
122 130
140
0
144
147
147
141
131
127
130 138
144
smooth =
0
146
148
146
136
129
129
137 142
144
0
146
148
142
131
127
133
142 144
141
0
144
147
139
126
126
134
142 143
138
0
143
145
134
122
124
135
143 141
134
0
141
142
132
121
124
132
141 139
136
0
140
137
128
120
122
127
134 134
134
0
136
130
122
118
121
125
130 131
133
(b)
(a)
Note the blurring in the result, as well as the increased uniformity of the background;
this is equivalent to reducing the background noise. Try other ( odd ) numbers for the size,
say 5, 7 or 9. Do you expect the observed effects? There is a mean operator in Mathcad
which we shall use for future averaging operations, as:
ave(pic,winsize):= newpic zero(pic)
for x floor winsize
..cols(pic)-floor winsize
2
-1
2
for y floor winsize
..rows(pic)-floor winsize
2
-1
2
half floor winsize
newpic y,x floor(mean(submatrix
(pic,y-half,y+half,x-half,x+half)))
2
newpic
with the same result. An alternative is to use the centre smoothing operation in Mathcad,
put centsmooth in place of mean . To use the template convolution operator, tmconv ,
we need to define an averaging template:
averaging_template(winsize):=
sum winsize·winsize
for y 0..winsize-1
for x 0..winsize-1
template y,x
1
template
sum
Search WWH ::




Custom Search