diff --git a/bv/uebung8.txt b/bv/uebung8.txt new file mode 100644 index 0000000..96a9a31 --- /dev/null +++ b/bv/uebung8.txt @@ -0,0 +1,130 @@ +1. + ------ + | 1 | +-------------- ------ +| 1 | -2 | 1 | + | -2 | +-------------- ------ + | 1 | + ------ + +The image has to be padded by 2 rows of zeros. The result of the correlation +follows: + +--------------- +| 1 | -2 | 1 | +--------------- +|-2 | 4 | -2 | +--------------- +| 1 | -2 | 1 | +--------------- + +The resulting filter is the result of the outer product of both used filters +which makes it a separable filter. + + +2. + +The Prewitt edge detector for vertical edges follows: + +------------- +|-1 | 0 | 1 | +------------- +|-1 | 0 | 1 | +------------- +|-1 | 0 | 1 | +------------- + +The image of the exercise follows with 1 specifying white and 0 black. + +------------------------- +| 0 | 0 | 0 | 1 | 1 | 1 | +------------------------- +| 0 | 0 | 0 | 1 | 1 | 1 | +------------------------- +| 0 | 0 | 0 | 1 | 1 | 1 | +------------------------- +| 0 | 0 | 0 | 1 | 1 | 1 | +------------------------- +| 0 | 0 | 0 | 1 | 1 | 1 | +------------------------- +| 0 | 0 | 0 | 1 | 1 | 1 | +------------------------- + +The image has to be padded with 1 row and column of zeros to have a same size +result image. After that the convolution is applied. The padded image follows: + +--------------------------------- +| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | +--------------------------------- +| 0 | 0 | 0 | 0 | 1 | 1 | 1 | 0 | +--------------------------------- +| 0 | 0 | 0 | 0 | 1 | 1 | 1 | 0 | +--------------------------------- +| 0 | 0 | 0 | 0 | 1 | 1 | 1 | 0 | +--------------------------------- +| 0 | 0 | 0 | 0 | 1 | 1 | 1 | 0 | +--------------------------------- +| 0 | 0 | 0 | 0 | 1 | 1 | 1 | 0 | +--------------------------------- +| 0 | 0 | 0 | 0 | 1 | 1 | 1 | 0 | +--------------------------------- +| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | +--------------------------------- + +The result of the convolution follows (without scalar product): + + +--------------------------- +| 0 | 0 | -2 | -2 | 0 | 2 | +--------------------------- +| 0 | 0 | -3 | -3 | 0 | 3 | +--------------------------- +| 0 | 0 | -3 | -3 | 0 | 3 | +--------------------------- +| 0 | 0 | -3 | -3 | 0 | 3 | +--------------------------- +| 0 | 0 | -3 | -3 | 0 | 3 | +--------------------------- +| 0 | 0 | -2 | -2 | 0 | 2 | +--------------------------- + +When the non zero values are replaced by ones, this is the result: + + +------------------------- +| 0 | 0 | 1 | 1 | 0 | 1 | +------------------------- +| 0 | 0 | 1 | 1 | 0 | 1 | +------------------------- +| 0 | 0 | 1 | 1 | 0 | 1 | +------------------------- +| 0 | 0 | 1 | 1 | 0 | 1 | +------------------------- +| 0 | 0 | 1 | 1 | 0 | 1 | +------------------------- +| 0 | 0 | 1 | 1 | 0 | 1 | +------------------------- + +3. + +----- +| 1 | +----- -------------- +| 2 | * | -1 | 0 | 1 | +----- -------------- +| 1 | +----- + +To accurately process this convolution the image has to be padded by 2 columns +of zeros. + +The result of the convolution follows: +-------------- +| -1 | 0 | 1 | +-------------- +| -2 | 0 | 2 | +-------------- +| -1 | 0 | 1 | +-------------- + +This resulting filter is called Sobel edge detector for horizontal edges.