img_contrast | R Documentation |
img_contrast
returns the RMS contrast of an image img
. A higher
value indicates higher contrast.
img_contrast(img)
img |
An image in form of a matrix or array of numeric values. Use e.g.
|
The function returns the RMS contrast of an image img
. The
RMS contrast is defined as the standard deviation of the normalized pixel
intensity values. A higher value indicates higher contrast. The image is
automatically normalized if necessary (i.e., normalization into range [0,
1]).
For color images, the weighted average between each color channel's values is computed.
a numeric value (RMS contrast)
Peli, E. (1990). Contrast in complex images. Journal of the Optical Society of America A, 7, 2032–2040. \Sexpr[results=rd]{tools:::Rd_expr_doi("10.1364/JOSAA.7.002032")}
img_read
, img_complexity
,
img_self_similarity
, img_simplicity
,
img_symmetry
, img_typicality
,
# Example image with relatively high contrast: berries
berries <- img_read(system.file("example_images", "berries.jpg", package = "imagefluency"))
#
# display image
grid::grid.raster(berries)
#
# get contrast
img_contrast(berries)
# Example image with relatively low contrast: bike
bike <- img_read(system.file("example_images", "bike.jpg", package = "imagefluency"))
#
# display image
grid::grid.raster(bike)
#
# get contrast
img_contrast(bike)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.