combineClusters: Average 3D color histograms by subdirectory

Description Usage Arguments Examples

View source: R/03_cluster_averaging.R

Description

Calculates color histograms for images in immediate subdirectories of a folder, and averages histograms for images in the same subdirectory.

Usage

1
combineClusters(folder, method = "mean", ...)

Arguments

folder

Path to the folder containing subdirectories of images. Must be a character vector.

method

Method for combining color histograms. Default is "mean", but other generic functions ("median", "sum", etc) will work. String is evaluated using "eval" so any appropriate R function is accepted.

...

Additional arguments passed to getHistList, including number of bins, HSV flag, etc.

Examples

1
2
3
combined_clusters <- colordistance::combineClusters(system.file("extdata",
"Heliconius", package="colordistance"), method="median", bins=2,
lower=rep(0.8, 3), upper=rep(1, 3))

Example output

Heliconius_A: 4 images

  |                                                                            
  |                                                                      |   0%
  |                                                                            
  |==================                                                    |  25%
  |                                                                            
  |===================================                                   |  50%
  |                                                                            
  |====================================================                  |  75%
  |                                                                            
  |======================================================================| 100%Heliconius_B: 4 images

  |                                                                            
  |                                                                      |   0%
  |                                                                            
  |==================                                                    |  25%
  |                                                                            
  |===================================                                   |  50%
  |                                                                            
  |====================================================                  |  75%
  |                                                                            
  |======================================================================| 100%Loading required namespace: abind
Warning messages:
1: In colordistance::getHistList(images[[i]], ...) :
  RGB and HSV are device-dependent, perceptually non-uniform color spaces. See 'Color spaces' vignette for more information.

2: In colordistance::getHistList(images[[i]], ...) :
  RGB and HSV are device-dependent, perceptually non-uniform color spaces. See 'Color spaces' vignette for more information.

colordistance documentation built on March 21, 2021, 1:06 a.m.