# NOT RUN {
img <- matrix(rnorm(100),10,10)
w <- 3
K <- kerMat((w + 1)/2)
## for pixels with the boundary problem, e.g., Pixel (5,1),
# running bp2(img,5,1,w,K) will produce an error; instead, use bp() in this case:
bp(img,5,1,w,K)
## for pixels without the boundary problem, e.g., Pixel (5,5),
# both can be used, but bp2() is more efficient than bp()
bp2(img,5,5,w,K)
bp(img,5,5,w,K)
# }
Run the code above in your browser using DataLab