improfile | R Documentation |
improfile
finds all pixels intersected by a line segment
and returns their coordinates and color values.
improfile(image, xi, yi, connectivity = 8, left_to_right = FALSE)
image |
An |
xi , yi |
Two-element vectors containing the x and y coordinates of the start and end points of a line segment. The points can lie outside of the image boundaries but then the line will be clipped on the image boundaries. |
connectivity |
The connectivity neighborhood to decide whether 2 pixels are contiguous. This parameter can take two values:
|
left_to_right |
If 'TRUE', the line segment is traversed from the
leftmost endpoint to the rightmost endpoint, regardless of the order in
which they are specified in |
A matrix in which the first two columns indicate the coordinates of the points traversed by the line segment, and the other columns indicate the color values at each location.
Simon Garnier, garnier@njit.edu
dots <- image(system.file("sample_img/dots.jpg", package = "Rvision"))
improfile(dots, c(1, ncol(dots)), c(nrow(dots) / 2, nrow(dots) / 2))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.