
Extract pixels from image which fall inbetween lower- and upper bounds.
Source:R/extract_pixels_HSV.R
extract_pixels_HSV.RdExtract pixels from image which fall inbetween lower- and upper bounds.
Usage
extract_pixels_HSV(
pixel.array,
lower_bound,
upper_bound,
fast_eval = TRUE,
bundle_pixelarray = FALSE,
check_value = FALSE,
use_single_iteration_cpp = FALSE
)Arguments
- pixel.array
image array as loaded via duflor::load_image()
- lower_bound
see
upper_bound- upper_bound
EITHER:
list of upper HSV-bounds, e.g.
list(green = c(H_green_lower,S_green_lower,V_green_lower),drought = c(H_drought_lower,S_drought_lower,V_drought_lower))single vector of length 3 declaring a set of HSV-values
- fast_eval
Use
C++-code where possible to reduce execution time?- bundle_pixelarray
logical, indicating if the input parameter
pixel.arrayis to be bundled into the return-value This is useful to retainpixel.arrayinto the output if this function is called in a loop.- check_value
boolean toggle to also check the
VALUE-component of an HSV-pixel- use_single_iteration_cpp
Use
rectangularRange_HSV_iteronce_cpp()for computing hits per range. This is slightly more efficient than usingrectangularRange_HSV_cpp().
Value
EITHER: list-object with the following elements (when supplying one one pair of bounds)
pixel.idx- pixel-locations of pixels detected between lower and upper bound.pixel.count- number of pixels detected between lower and upper boundimg.fraction- fraction of image detected between lower and upper boundoriginal.img- fed-in pixel.array or list-object with the following elements (when supplying one one pair of bounds)pixel.idx- pixel-locations of pixels detected between lower and upper bound.pixel.count- number of pixels detected between lower and upper boundimg.fraction- fraction of image detected between lower and upper boundoriginal.img- fed-in pixel.arrayindicator.img-pixel.arraywith hsv-values of pixels at positionspixel.idxmodified.