View source: R/compare_images.R
compare_images | R Documentation |
compare_images
takes two sets of images and displays them in pairs
for comparison.
compare_images(
x,
y,
match = NULL,
batch_size = 100L,
match_defaults = c(Match = TRUE, `Likely match` = TRUE,
`Possible match` = FALSE, `No match` = FALSE),
info = NULL,
...
)
x, y |
A |
match |
An optional character vector. Image pairs will be grouped by these values. (If there are more than 10 unique values, the function will issue a warning, since this probably implies that the wrong vector was passed to the argument.) |
batch_size |
An integer scalar. The number of images to display at a time in the Shiny app (default 100). |
match_defaults |
A named logical vector. Rows whose |
info |
An optional data frame with information to be shown at the top of the comparison app. |
... |
Additional named vectors which will be displayed per-image pair
when the "Show details" button is toggled in the comparison app. These
vectors must be the same length as the |
The interface presents pairs of images alongside a best guess as to the match status ("Match" or "No match"). For matches which are correctly identified, no further action is necessary, while incorrect identifications can be corrected by clicking "Match" or "No match" next to the image pair. Images are presented in batches, and at any point the user can click the "Save and exit" button to close the comparison app and retrieve the results up through the last batch which was viewed. This means that even extremely large sets of potential matches can be manually verified over the course of several sessions. Through the "Enable highlighting" button, specific matches can be highlighted for further follow-up after image comparison is finished.
The match
field can contain any character strings, and image pairs will be
grouped by these values. (If there are more than 10 unique values for
match
, the function will issue a warning, since this probably implies that
the match
field was misidentified.) By default, all image pairs will start
with a value of "match" in the comparison app. But if the values of the
match
field correspond to a name in the function's "match" argument, then
the value will be "match" if the corresponding "match" argument value is
TRUE, and "no match" if the corresponding "match" argument value is FALSE.
For example, by default the "match" argument is:
c("Match" = TRUE, "Likely match" = TRUE, "Possible match" = FALSE
.
So any image pairs with a match
field value of "Match" or "Likely match"
will start with a value of "match" in the comparison app, while any image
pairs with a match
field value of "Possible match" will start with a value
of "no match" in the comparison app.
A data frame with the following fields: x
and y
(or whatever
these fields were originally named) from the original df
data frame;
new_match_status
, which is a character vector with possible entries "match"
and "no match"; and a logical vector new_highlight
which is TRUE for any
matches which were highlighted using the in-app interface. The output will
only have non-missing new_match_status
values for each image pairing that
confirmed, which is determined by how many pages into the Shiny app the user
proceeded, and thus how many pairings were viewed. Rows with pairings which
were not viewed will have an NA value in new_match_status
and
new_highlight
. If all pages are viewed, then the output will have no NA
values.
## Not run:
# Assign the output of compare_images to retrieve results
change_table <- compare_images(test_urls, test_urls)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.