| img_fluency | R Documentation |
img_fluency computes the image fluency scores for several images at
once and returns the results as a data frame with one row per image.
img_fluency(
imgs,
metrics = c("contrast", "self_similarity", "simplicity", "symmetry"),
gray = FALSE,
progress = interactive()
)
imgs |
Either a character vector with the paths to the image files
(e.g., created by |
metrics |
Character vector that specifies which scores are computed.
One or more of |
gray |
logical. Should color images be converted into grayscale (using
|
progress |
logical. Should a progress bar be shown? (default:
|
The function reads one image after the other and computes the requested scores with the respective functions of the package using their default settings:
"contrast": img_contrast()
"self_similarity": img_self_similarity()
"simplicity": img_simplicity()
"symmetry": vertical symmetry, i.e.,
img_symmetry() with horizontal = FALSE
"typicality": img_typicality()
Typicality is not computed by default (but can be added to
metrics) for two reasons. First, typicality is not a
characteristic of a single image, but of an image relative to all other
images that are analyzed. Thus, the typicality scores change if images are
added or removed. Second, all images have to be kept in memory at the same
time to compute typicality, which might be a problem if you analyze many
or large images. For all other scores, only one image is kept in memory at
a time.
The function does not stop if an image file cannot be read or if a score
cannot be computed for an image (e.g., symmetry for an image without any
variation in one image half). Instead, the respective scores in the
results are NA, and a warning at the end lists the images concerned.
Warnings of the individual functions are not shown. Use the individual
functions if you need other than the default settings or want to find out
why a score could not be computed for an image.
a data frame with one row per image (in the order of imgs).
The first column filename contains the file names of the images (for
a list of pre-loaded images: the names of the list; img1,
img2, ... for images without a name). The other columns contain the
scores and are named after metrics.
img_read, img_contrast,
img_self_similarity, img_simplicity,
img_symmetry, img_typicality
# paths to some of the example images
files <- system.file("example_images", c("rails.jpg", "sky.jpg", "trees.jpg"),
package = "imagefluency")
# contrast and symmetry scores of all images
img_fluency(files, metrics = c("contrast", "symmetry"))
# add typicality (of the images relative to each other)
img_fluency(files, metrics = c("contrast", "symmetry", "typicality"))
# all scores except typicality (default)
img_fluency(files)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.