Numerical solution of Perona-Malik equation: How to handle the boundary properly?

25 Views Asked by At

In the paper Perona-Malik equation and its numerical properties, the following PDE is considered:

enter image description here

The $u_0$ I'm (and so is the author) interested in is given by an image and hence decomposes into pixels. The author is proposing the following scheme for a numerical solution:

enter image description here

This is just an example of many similar schemes you can find to solve (1.6). However, no matter in which reference I look, it is never explained how we deal with $i,j$ corresponding to boundary pixels. Say the image is of resolution $n_1\times n_2$. What do we do for $i\in\{0,n_1-1\}$ or $j\in\{0,n_2-1\}$? If you take a close look to (2.1), you see that even $u_{i+2,\:j}$ and $u_{i,\:j+2}$ are accessed. So, in fact, the formula (2.1) is only clear for me for pixels which are at least 2 pixels away from the border.

I'm also not 100% sure about the Neumann boundary. The normal derivative on $\Omega=[0,1)^2$ (which is the $\Omega$ I'm assuming to be in place here) is clearly simple. Depending on the boundary (top, left, bottom, right) it should simply mean that $u_{n_1,\:j}=u_{n_1-2,\:j}$ for all $j\in\{0,\ldots,n_2-1\}$ for example. But what do we do at the corners where theoretically more than one boundary part is "active"?