306
F. Firouzi et al.
Fig. 5.59 Different types of
filters
-1
Horizontal filter
1
1
1
1
1
1
1
1
1
1
1
1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
0
0
0
0
0
0
VerƟcal filter
135 degree filter
45 degree filter
Fig. 5.60 An example of filter (Left: original picture. Right: horizontal edges produced by
horizontal filters)
image. Note that the local region should be exactly the same dimension as the filter.
We iteratively apply the filter to the image, and in each iteration we slide/move/shift
the filter just one pixel. As a result of this process, we can eventually generate a
4 × 4 matrix (on the right). As we can see, this matrix marks the vertical line in the
middle while zeroing on the side.
5.6.5.2 Stride
The abovementioned sliding window technique has a name called stride. Stride is
defined as the number of pixel shifts when sliding a filter over the input. For instance,
if the stride is equal to 1, then we slide the filter by only 1 pixel at a time. When the
F. Firouzi et al.
Fig. 5.59 Different types of
filters
-1
Horizontal filter
1
1
1
1
1
1
1
1
1
1
1
1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
0
0
0
0
0
0
VerƟcal filter
135 degree filter
45 degree filter
Fig. 5.60 An example of filter (Left: original picture. Right: horizontal edges produced by
horizontal filters)
image. Note that the local region should be exactly the same dimension as the filter.
We iteratively apply the filter to the image, and in each iteration we slide/move/shift
the filter just one pixel. As a result of this process, we can eventually generate a
4 × 4 matrix (on the right). As we can see, this matrix marks the vertical line in the
middle while zeroing on the side.
5.6.5.2 Stride
The abovementioned sliding window technique has a name called stride. Stride is
defined as the number of pixel shifts when sliding a filter over the input. For instance,
if the stride is equal to 1, then we slide the filter by only 1 pixel at a time. When the
