contours | R Documentation |
This is just a light interface over contourLines. See help for contourLines for details. If the image has more than one colour channel, return a list with the contour lines in each channel. Does not work on 3D images.
contours(x, nlevels, ...)
x |
an image or pixset |
nlevels |
number of contour levels. For pixsets this can only equal two. |
... |
extra parameters passed to contourLines |
a list of contours
Simon Barthelme
highlight
boats.gs <- grayscale(boats)
ct <- contours(boats.gs,nlevels=3)
plot(boats.gs)
#Add contour lines
purrr::walk(ct,function(v) lines(v$x,v$y,col="red"))
#Contours of a pixel set
px <- boats.gs > .8
plot(boats.gs)
ct <- contours(px)
#Highlight pixset
purrr::walk(ct,function(v) lines(v$x,v$y,col="red"))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.