Skip to contents

Fingerprints every image and lists the pairs that are identical or visually similar. Results describe visual relations between images, never misconduct: a similar pair may be a legitimate reuse, a control shown twice or an honest error, and always needs expert review.

Usage

ri_analyze(x, thresholds = default_thresholds, progress = FALSE)

Arguments

x

A folder (searched recursively for PNG, TIFF and JPEG files) or a character vector of image files.

thresholds

Maximum dHash and pHash distances for "similar".

progress

Show progress messages.

Value

An object of class reproimage_result, with the structure of the Python tool's result.json (schema reproimage-result/1). It has print(), summary() and as.data.frame() methods and can be written with ri_write().

Examples

res <- ri_analyze(ri_example_dir())
res
#> ReproImage analysis
#> 12 images, 18 related pairs (algorithm version 1, thresholds dHash 10 / pHash 10)
#> 
#> cells_a.png         similar           cells_a_16bit.png  (identity, distances 1/4)
#> cells_a.png         similar           cells_a_16bit.tif  (identity, distances 1/4)
#> cells_a_16bit.png   identical_pixels  cells_a_16bit.tif
#> gel_a.png           identical_pixels  gel_a.tif
#> gel_a.png           similar           gel_a_contrast.png  (identity, distances 2/0)
#> gel_a.png           identical_file    gel_a_copy.png
#> gel_a.png           similar           gel_a_flip.png  (flip, distances 0/0)
#> gel_a.png           similar           gel_a_rot90.png  (rot270, distances 0/0)
#> gel_a.tif           similar           gel_a_contrast.png  (identity, distances 2/0)
#> gel_a.tif           identical_pixels  gel_a_copy.png
#> gel_a.tif           similar           gel_a_flip.png  (flip, distances 0/0)
#> gel_a.tif           similar           gel_a_rot90.png  (rot270, distances 0/0)
#> gel_a_contrast.png  similar           gel_a_copy.png  (identity, distances 2/0)
#> gel_a_contrast.png  similar           gel_a_flip.png  (flip, distances 2/0)
#> gel_a_contrast.png  similar           gel_a_rot90.png  (rot270, distances 2/0)
#> gel_a_copy.png      similar           gel_a_flip.png  (flip, distances 0/0)
#> gel_a_copy.png      similar           gel_a_rot90.png  (rot270, distances 0/0)
#> gel_a_flip.png      similar           gel_a_rot90.png  (flip_rot90, distances 0/0)
#> 
#> Requires expert review: visual relations, not evidence of misconduct.
head(as.data.frame(res))
#>                   a                  b         category orientation
#> 1       cells_a.png  cells_a_16bit.png          similar    identity
#> 2       cells_a.png  cells_a_16bit.tif          similar    identity
#> 3 cells_a_16bit.png  cells_a_16bit.tif identical_pixels        <NA>
#> 4         gel_a.png          gel_a.tif identical_pixels        <NA>
#> 5         gel_a.png gel_a_contrast.png          similar    identity
#> 6         gel_a.png     gel_a_copy.png   identical_file        <NA>
#>   dhash_distance phash_distance
#> 1              1              4
#> 2              1              4
#> 3              0              0
#> 4              0              0
#> 5              2              0
#> 6              0              0