Take-home questions——L2

1.Write down a 3x3 filter that returns a positive value if the average value of the 4-adjacent neighbors is less than the center and a negative value otherwise.


we need to design the filter in such a way that it emphasizes the center pixel while subtracting the average contribution of its four immediate neighbors

the filter can be :
[ 0 − 1 0 − 1 4 − 1 0 − 1 0 ] \left[\begin{matrix} 0& -1 & 0\\ -1&4&-1 \\ 0& -1&0 \end{matrix}\right] 010141010

or :
[ 0 − 1 / 4 0 − 1 / 4 1 − 1 / 4 0 − 1 / 4 0 ] \left[\begin{matrix} 0& -1/4 & 0\\ -1/4&1&-1/4 \\ 0& -1/4&0 \end{matrix}\right] 01/401/411/401/40

The center position (2,2) has a coefficient of 4 because we want to subtract the average value of the four neighbors from the center value. Since we are dealing with an average and there are four neighbors, multiplying the center value by 4 allows for this operation in a single step when the kernel is applied.

2.Write down a filter that will compute the gradient in the x-direction:

gradx(y,x) = im(y,x+1) - im(y,x) for each x, y


Since the operation only involves the current and the right pixel, a 2x2 or even a 1x2 filter is technically sufficient for this specific computation.

The filter for computing gradx(y,x) is: [ − 1 1 ] \left[\begin{matrix} -1 & 1\\ \end{matrix}\right] [11]

The value −1 is applied to the current pixel im(y,x), and the value 1 is applied to the pixel to its immediate right im(y,x+1).When this filter is applied across an image, it effectively calculates the difference between each pixel and its neighbor to the right, which corresponds to the horizontal gradient.

3.Fill in the blanks:

a) G = D * B
b) A = B * C
c) F = D * E
d) I = D * D

analyze the images:

‘A’ is a blurred image, which suggests that ‘B’ is a blurring kernel (low-pass filter).
在这里插入图片描述在这里插入图片描述
‘E’ may be a step function or a representation of a binary image

‘F’ shows the edges in ‘D’, which is typically the result of a high-pass filter or an edge detection operation

‘G’ could potentially be a high-pass filter, as it seems to emphasize the edges and textures.
在这里插入图片描述
‘H’ is another blurred image, possibly the result of applying a different type of blur than ‘A’.

‘I’ looks like a gradient image, possibly the result of a gradient filter applied to ‘D’.
在这里插入图片描述

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值