Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

analysis

Image Analysis


Description

Functions for image calculations and analysis. This part of the package needs more work.

Usage

image_compare(image, reference_image, metric = "", fuzz = 0)

image_compare_dist(image, reference_image, metric = "", fuzz = 0)

image_fft(image)

Arguments

image

magick image object returned by image_read() or image_graph()

reference_image

another image to compare to

metric

string with a metric from metric_types() such as "AE" or "phash"

fuzz

relative color distance (value between 0 and 100) to be considered similar in the filling algorithm

Details

For details see Image++ documentation. Short descriptions:

  • image_compare calculates a metric by comparing image with a reference image.

  • image_fft returns Discrete Fourier Transform (DFT) of the image as a magnitude / phase image pair. I wish I knew what this means.

Here image_compare() is vectorized over the first argument and returns the diff image with the calculated distortion value as an attribute.

See Also

Examples

out1 <- image_blur(logo, 3)
out2 <- image_oilpaint(logo, 3)
input <- c(logo, out1, out2, logo)
if(magick_config()$version >= "6.8.7"){
  diff_img <- image_compare(input, logo, metric = "AE")
  attributes(diff_img)
}

magick

Advanced Graphics and Image-Processing in R

v2.7.2
MIT + file LICENSE
Authors
Jeroen Ooms [aut, cre] (<https://orcid.org/0000-0002-4035-0289>)
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.