roofDiff | R Documentation |

Compute difference between two one-sided gradient estimators.

```
roofDiff(image, bandwidth, blur)
```

`image` |
A square matrix object of size n by n, no missing value allowed. |

`bandwidth` |
A positive integer to specify the number of pixels used in the local smoothing. |

`blur` |
If blur = TRUE, besides the conventional 2-D kernel function, a univariate kernel function is used to address the issue of blur. |

At each pixel, the second-order derivarives (i.e., `f''_{xx}`

,
`f''_{xy}`

, and `f''_{yy}`

) are estimated by
a local quadratic kernel smoothing procedure. Next, the local
neighborhood is first divided into two halves along the direction
perpendicular to (`\widehat{f}''_{xx}`

, `\widehat{f}''_{xy}`

). Then the
one-sided estimates of `f'_{x+}`

and `f'_{x-}`

are obtained
respectively by local linear kernel smoothing. The estimates of
`f'_{y+}`

and `f'_{y-}`

are obtained by the same procedure
except that the neighborhood is divided along the direction
(`\widehat{f}''_{xy}`

, `\widehat{f}''_{yy}`

).

Returns a matrix where each entry is the maximum of the
differences: `|\widehat{f}_{x+} - \widehat{f}_{x-}|`

and
`|\widehat{f}_{y+} - \widehat{f}_{y-}|`

at each pixel.

Qiu, P., and Kang, Y. "Blind Image Deblurring Using Jump Regression
Analysis," *Statistica Sinica*, **25**, 2015, 879-899.

`roofEdgeParSel`

, `roofEdge`

```
data(peppers)
#diff <- roofDiff(image = peppers, bandwidth = 8) # Time consuming
```

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.