Learn R Programming

odiffr (version 0.5.1)

summary.odiffr_batch: Summarize Batch Comparison Results

Description

Generate a summary of batch image comparison results, including pass/fail statistics, failure reasons, and worst offenders.

Usage

# S3 method for odiffr_batch
summary(object, n_worst = 5, ...)

# S3 method for odiffr_batch_summary print(x, ...)

Value

An odiffr_batch_summary object with the following components:

total

Total number of comparisons.

passed

Number of matching image pairs.

failed

Number of non-matching image pairs.

pass_rate

Proportion of passing comparisons (0 to 1).

reason_counts

Table of failure reasons (NULL if no failures).

diff_stats

List with min, median, mean, max diff percentages (NULL if no failures with diff data).

worst

Data frame of worst offenders by diff percentage (NULL if no failures).

Arguments

object

An odiffr_batch object returned by compare_images_batch() or compare_image_dirs().

n_worst

Integer; number of worst offenders to include in the summary. Default is 5.

...

Additional arguments (currently unused).

x

An odiffr_batch_summary object.

Details

The summary method expects the standard output of compare_images_batch(), which includes columns: match, reason, diff_percentage, diff_count, pair_id, and img2.

See Also

compare_images_batch(), compare_image_dirs()

Examples

Run this code
if (FALSE) {
# Compare image pairs and summarize
pairs <- data.frame(
  img1 = c("baseline/a.png", "baseline/b.png", "baseline/c.png"),
  img2 = c("current/a.png", "current/b.png", "current/c.png")
)
results <- compare_images_batch(pairs)
summary(results)

# Get summary with more worst offenders
summary(results, n_worst = 10)
}

Run the code above in your browser using DataLab