if(spatstat.options("gpclib")) {
v <- opening(letterR, 0.3)
} else {
v <- opening(letterR, 0.3, dimyx=256, polygonal=FALSE)
}
plot(letterR, type="n", main="opening")
plot(v, add=TRUE, col="grey")
plot(letterR, add=TRUE)
Run the code above in your browser using DataLab