modify2: Edge detection, post processing

View source: R/modify2.r

modify2R Documentation

Edge detection, post processing


Delete deceptive edge pixels that are scattered in the design space.


modify2(bandwidth, edge, plot)



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


A matrix of 0 and 1 represents detected edge pixels.


If plot = TRUE, images of detected edges before the modification and after the modification are plotted.


A local-smoothing based edge detection algorithm may flag deceptive edge pixel candidates. One kind of such candidates existis due to the nature of hypothesis testing, on which the threshold value of the edge detection criterion is based. That is, a point (x_i, y_j) could be flagged as a edge pixel with certain probability, even if it is actually not a edge pixel. Deceptive candidates of this kind are scattered in the whole design space. This modification procedure deletes scattered edge pixel candidates.


Returns a matrix of zeros and ones of the same size as edge.


Qiu, P. and Yandell, B., "Jump detection in regression surfaces," Journal of Computational and Graphical Statistics 6(3), 1997, 332-354.

See Also



data(sar) # SAR image is bundled with the package and it is a 
          # standard test image in statistics literature.
edge <- stepEdgeLCK(sar, 4, 20)
out <- modify2(4, edge)

DRIP documentation built on Sept. 1, 2023, 5:08 p.m.

Related to modify2 in DRIP...