Detect roof/valley edges in an image using piecewise local linear kernel smoothing.
roofEdge(image, bandwidth, thresh, edge1, blur, plot)
Returns a matrix of zeros and ones of the same size as image.
A square matrix object of size n by n, no missing value allowed.
A positive integer to specify the number of pixels used in the local smoothing.
Threshold value used in the edge detection criterion.
Step edges. The function excludes step edges when detects roof/valley edges.
If blur = TRUE, besides the conventional 2-D kernel function, a univariate kernel function is used in the local smoothing to address the issue of blur.
If plot = TRUE, an image of detected edges is plotted.
At each pixel, the second-order derivarives (i.e.,
Qiu, P., and Kang, Y. "Blind Image Deblurring Using Jump Regression Analysis," Statistica Sinica, 25, 2015, 879-899.
roofEdgeParSel
, roofDiff
data(peppers)
# Not run
#step.edges = stepEdgeLLK(peppers, bandwidth=6, thresh=25, plot=FALSE)
#roof.edges = roofEdge(image=peppers, bandwidth=9, thresh=3000, edge1=step.edges,
# blur=FALSE, plot=FALSE) # Time consuming
#edges = step.edges + roof.edges
#par(mfrow=c(2,2))
#image(1-step.edges, col=gray(0:1))
#image(1-roof.edges, col=gray(0:1))
#image(1-edges, col=gray(0:1))
#image(peppers, col=gray(c(0:255)/255))
Run the code above in your browser using DataLab