cube_sample | R Documentation |
Sample hyperspectral cube with points or lines
cube_sample( n, cube, type = c("points", "lines"), buffer = 0, dir = "y", use.roi = FALSE, reuse, ... )
n |
The number of samples to take. |
cube |
The hyperspectral cube returned by the function |
type |
The type of sample. One of "points" or "lines". |
buffer |
Buffer to be used if type == "points". Defaults to 0. |
dir |
Direction to be sampled if type == "lines". One of "x" or "y". Defaults to "y". |
reuse |
an object previously returned by this function. See Details. |
... |
Arguments to be passed to |
This is an interactive function to sample per points of lines an hyperspectral cube. If sampling per points it is possible to define the buffer radius (in pixel units) to expand the point before sampling.
If sampling per lines, it is necessary to define a direction of sampling. If dir == "y" sample will be enforced to be a vertical line. If dir == "x", it will be enforced to an horizontal line.
It is possible to reuse information from a previous sample for a new sample. This is because the object returned by this function contain data on the positions and Spatial* objects used for sampling, with positions relative to the xy origin of the original image. This can be useful if testing different processing methods and is wished to apply the same sampling, or if working with data collected in a measurement setup that ensure the same position on the image frame.
A list with components type and n from the arguments, sp with the Spatial* object used for sampling and data with a matrix per sample organized in a list. Additionally, if type == "points", xy is a data frame with the original points and buffer copies the argument.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.