RNotes | EBImage


library(EBImage)

Example from Andrzej Oles on 2015-01-19

x <- readImage(system.file("images", "shapes.png", package="EBImage"))[25:74, 60:109]
x <- resize(x, 200)
y <- gblur(x, 3) > .3
display(y)

contours <- ocontour(bwlabel(y))
c <- localCurvature(x=contours[[1]], h=11)
i <- c$curvature >= 0
neg <- array(0, dim(x))
pos <- neg
pos[c$contour[i,]+1]  <- c$curvature[i]
neg[c$contour[!i,]+1] <- -c$curvature[!i]
display(10*(rgbImage(pos, , neg)), title = "Image curvature")  


packageVersion("EBImage")
## [1] '4.8.2'

efg
2015-01-21 2154