match_images: Find matches from vectors of image paths

View source: R/match_images.R

match_imagesR Documentation

Find matches from vectors of image paths

Description

match_images is a convenience wrapper around the core workflow of matchr. It reads in one or two character vectors of image paths and then runs load_image, create_signature, match_signatures, and identify_matches, (in each case with the respective function's default arguments), and then optionally sends the results to the confirm_matches interactive Shiny app for manual verification and integrates any manual changes into the output data frame.

Usage

match_images(x, y = NULL, compare = TRUE, quiet = FALSE)

Arguments

x, y

Character vector of file paths or URLs. If y is supplied then matches will be identified between the two input vectors x and y; if it is not supplied then matches will be identified within the input vector x.

compare

A logical scalar. Should the interactive confirm_matches Shiny app be run to manually verify match results (default)?

quiet

A logical scalar. Should the function execute quietly, or should it return status updates throughout the function (default)?

Details

For large datasets where performance and memory considerations make it prudent to save intermediate outputs, or if any non-default options are required, it is recommended to run the component functions separately, but for small datasets match_images offers the simplest path from images to image matches.

Value

A tibble if dplyr is installed or a data frame if not, with one row per identified match, and the following columns:

  • x_path and y_path: The file paths for the images which were matched.

  • x_sig and y_sig: The matchr_signature vectors of the matched images.

  • distance: The Hamming distance between the two files' image signatures.

  • match: If compare = TRUE, a logical vector indicating match status.

  • highlight: If compare = TRUE, a logical vector indicating matches flagged for future review. #' (See confirm_matches for details.)

Examples

## Not run: 
# Use match_images with a single argument to identify matches within a set of images
match_images(example_urls)

# Or add a second argument to identify matches between two sets of images
match_images(example_urls[1:8], example_urls[9:15])

# To retrieve results without verification through the Shiny app, set `compare = FALSE`
match_images(example_urls, compare = FALSE)

## End(Not run)

UPGo-McGill/matchr documentation built on July 19, 2023, 1:02 p.m.