patLanHSV {patternize}R Documentation

Aligns images usings transformations obtained from fixed landmarks and extracts colors using a predefined RGB values and cutoff value.

Description

Aligns images usings transformations obtained from fixed landmarks and extracts colors using a predefined RGB values and cutoff value.

Usage

patLanHSV(
  sampleList,
  landList,
  HSV,
  resampleFactor = NULL,
  colOffset = 0.1,
  crop = FALSE,
  cropOffset = c(0, 0, 0, 0),
  res = 300,
  transformRef = "meanshape",
  transformType = "tps",
  adjustCoords = FALSE,
  plot = NULL,
  focal = FALSE,
  sigma = 3,
  iterations = 0,
  ignoreHSVvalue = FALSE,
  patternsToFile = NULL
)

Arguments

sampleList

List of RasterStack objects.

landList

Landmark list as returned by makeList.

HSV

HSV values for color pattern extraction specified as vector.

resampleFactor

Integer for downsampling used by redRes.

colOffset

Color offset for color pattern extraction (default = 0.10).

crop

Whether to use the landmarks range to crop the image. This can speed up the analysis (default = FALSE).

cropOffset

Vector c(xmin, xmax, ymin, ymax) that specifies the number of pixels you want the cropping to be offset from the landmarks (in case the landmarks do not surround the entire color pattern). The values specified should present the percentage of the maximum landmark value along the x and y axis.

res

Resolution for color pattern raster (default = 300). This should be reduced if the number of pixels in the image is lower than th raster.

transformRef

ID of reference sample for shape to which color patterns will be transformed to. Can be 'meanshape' for transforming to mean shape of Procrustes analysis.

transformType

Transformation type as used by computeTransform (default ='tps').

adjustCoords

Adjust landmark coordinates in case they are reversed compared to pixel coordinates (default = FALSE).

plot

Whether to plot transformed color patterns while processing (default = NULL). Transformed color patterns can be plot on top of each other ('stack') or next to the original image for each sample ('compare').

focal

Whether to perform Gaussian blurring (default = FALSE).

sigma

Size of sigma for Gaussian blurring (default = 3).

iterations

Number of iterations for recalculating average color.

ignoreHSVvalue

Whether to ignore the HSV value (~darkness).

patternsToFile

Name of directory to which the color pattern of each individual will be outputted (default = NULL).

Value

List of raster objects.

Examples


## Not run: 
IDlist <- c('BC0077','BC0071','BC0050','BC0049','BC0004')
prepath <- system.file("extdata",  package = 'patternize')
extension <- '_landmarks_LFW.txt'

landmarkList <- makeList(IDlist, 'landmark', prepath, extension)

extension <- '.jpg'
imageList <- makeList(IDlist, 'image', prepath, extension)

HSV <- c(0.025,1,0.45)
rasterList_lanHSV <- patLanRGB(imageList, landmarkList, HSV,
colOffset = 0.15, crop = TRUE, res = 100, adjustCoords = TRUE, plot = 'stack')

## End(Not run)


[Package patternize version 0.0.5 Index]