is to do invariant filtering within each patch.
Typically, we apply a filter, say
, in each patch.
The composite operator, filtering in patches,
,is given by
| |
(2) |
|
rabdomain
Figure 4 Domain of inputs and outputs of a two-dimensional prediction-error filter. | ![]() |
|
rabtent
Figure 5 Placement of tent-like weighting function in the space of filter inputs and outputs. | ![]() |
We need a weighting function that vanishes where the filter
has no outputs.
The amplitude of the weighting function is not very important
because we have learned how to put signals back together
properly for arbitrary weighting functions.
We can use any pyramidal or tent-like shape
that drops to zero outside the domain of the filter output.
The job is done by subroutine tentn().
A new parameter needed by tentn
is a, the coordinate of the beginning of the tent.
module tent { # triangle tent weights in N dimensions
use cartesian
contains
subroutine tentn ( nwind, center, a, windwt) {
integer, dimension (:), intent (in) :: nwind, center, a
real, dimension (:), intent (out) :: windwt
integer, dimension( size( nwind)) :: start, end, x
real, dimension( size( nwind)) :: mid, wid
integer :: i
start= 1+a-center; end= nwind-center+1 # a is beginning of tent
mid= (end+start)/2.; wid= (end-start+1.)/2.
do i = 1, size( windwt) {
call line2cart( nwind, i, x)
if( all( x >= start) .and. all( x <= end))
windwt( i) = product( max( 0., 1. - abs((x-mid)/wid)))
else
windwt( i) = 0.
}
}
}
In applications where triangle weights are needed on the inputs (or where we can work on a patch without having interference with edges), we can get ``triangle tent'' weights from tentn() if we set filter dimensions and lags to unity, as shown in Figure 6.
|
windwt90
Figure 6 Window weights from tentn() with nwind=(61,19), center=(31,1), a=(1,1) . | ![]() |
Triangle weighting functions
can sum to a constant
if the spacing is such that the midpoint of one triangle
is at the beginning of the next.
I imagined in two dimensions that something similar would happen
with shapes like Egyptian pyramids of Cheops, 2-|x-y|+|x+y|.
Instead,
the equation (1-|x|)(1-|y|)
which has the tent-like shape shown
in Figure 6
adds up to the constant flat top shown in Figure 7.
(To add interest to Figure 7,
I separated the windows by a little more than the precise matching distance.)
In practice we may chose window shapes and overlaps for
reasons other than the constancy of the sum of weights,
because mkwallwt
accounts for that.
|
wallwt90
Figure 7 (Inverse) wall weights with n1=100, w1=61, k1=2, n2=30, w2=19, k2=2 | ![]() |
Finally is an example of filtering a plane of uniform constants with an impulse function. The impulse function is surrounded by zeros, so the filter output patches are smaller than the input patches back in Figure 3. Here in Figure 8, both axes need more window density.
|
cinloip90
Figure 8 Filtering in patches with the same parameters as in Figures 2 and 3. Additionally, the filter parameters are a1=11 a2=5 lag1=6 lag2=1 . Thus, windows are centered on the 1-axis and pushed back out the 2-axis. | ![]() |