fillPoly | R Documentation |
fillPoly
fills all the pixels of an image withing a
given polygon with a given color.
fillPoly(image, polygon, color = "white")
image |
An |
polygon |
An m x 2 matrix (or an object that can be converted to an m x 2 matrix) or a list of m x 2 matrices, with the first column containing the x coordinates of the polygons and the second column containing the y coordinates of the polygons. |
color |
A value or vector of any kind of R color specification compatible
with |
This function does not return anything. It modifies image
in
place.
Simon Garnier, garnier@njit.edu
Image
, selectROI
, fillConvexPoly
balloon <- image(system.file("sample_img/balloon1.png", package = "Rvision"))
poly <- data.frame(x = c(290, 290, 440, 440), y = c(170, 325, 325, 170))
fillPoly(balloon, poly, color = "red")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.