Description Usage Arguments Value Functions Examples
View source: R/calculate_features.R
Calculates features for each pixel based on sobel filters, gaussian and difference of gaussians, adds as well the position in the image
| 1 2 3 4 5 6 7 8 9 10 11 12 13 | calc_features(
  img,
  filter_widths = c(3, 5, 11, 23),
  shape_sizes = c(51, 101, 151, 201, 251),
  verbose = FALSE
)
compile_calc_features(
  filter_widths = c(3, 5, 11, 23),
  shape_sizes = c(51, 101, 151, 201, 251),
  img_dim,
  verbose = FALSE
)
 | 
| img | an imput image or matrix | 
| filter_widths | a numeric vector of odd numbers to be used as the width of the feature filters | 
| shape_sizes | a numeric vector of odd numbers indicating the expected size of the shapes to be found | 
| verbose | wether to display progress messages | 
data.frame
compile_calc_features: returns a named list of functions that can be applied to an image
| 1 2 3 4 5 6 7 8 9 10 11 12 13 | test_image <- matrix(runif(10201), 101)
feature_df <- calc_features(
    test_image, filter_widths = c(3,5),
    shape_sizes = c(11, 21))
head(feature_df)
feature_funs <- compile_calc_features(
     filter_widths = c(3,5), shape_sizes = c(11, 21),
     dim(test_image))
feature_funs[[1]](test_image)
feature_df2 <- purrr::map_dfc(feature_funs, ~ as.numeric(.x(test_image)))
head(feature_df2)
 | 
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.