# Given a Vertical Derivative Kernel, Find the output image after K is applied to the above input image [closed]

Im not sure how to solve this, if someone can please help me a bit id appreciate it. I have to solve this by hand. (I know how to solve using matlab).

The size of the kernel determines the block of pixels to be used. Here, you have a filter kernel

$$\begin{bmatrix}0 & -1 & 0\\ 0 & 0 & 0\\ 0 & 1 & 0\end{bmatrix}$$ and for each $3\times 3$ block of pixels: $$\begin{bmatrix}a & b & c\\ d & e & f\\ g & h & i\end{bmatrix}$$

The recipe is: flip one (only) of them left-right and up-down:

$$\begin{bmatrix}i & h & g\\ f & e & d\\ c & b & a\end{bmatrix}$$

multiply term-wise:

$$\begin{bmatrix}0.i & -1.h & 0.g\\ 0.f & 0.e & 0.d\\ 0.c & 1.b & 0.a\end{bmatrix}$$

and sum, put that value at the place of $e$ in the output image:

$$e' = b-h$$.

Repeat. Verify to got the same result if you had flipped the kernel instead of the pixel block. This second option might be simpler in your case.

• so do i have to do it for every 3x3 matrix in the input image? – Master Mhd Apr 20 '17 at 22:31
• Indeed. You may assume 0 values outside – Laurent Duval Apr 20 '17 at 23:06