compare_documents | R Documentation |
Compare two handwritten documents to predict whether they were written by the same person. Use either a similarity score or a score-based likelihood ratio as a comparison method.
compare_documents(
sample1,
sample2,
score_only = TRUE,
rforest = NULL,
project_dir = NULL,
reference_scores = NULL
)
sample1 |
A filepath to a handwritten document scanned and saved as a PNG file. |
sample2 |
A filepath to a handwritten document scanned and saved as a PNG file. |
score_only |
TRUE returns only the similarity score. FALSE returns the
similarity score and a score-based likelihood ratio for that score,
calculated using |
rforest |
Optional. A random forest created with |
project_dir |
Optional. A folder in which to save helper files and a CSV file with the results. If no project directory is supplied. Helper files will be saved to tempdir() > comparison but deleted before the function terminates. A CSV file with the results will not be saved, but a dataframe of the results will be returned. |
reference_scores |
Optional. A list of same writer and different writer
similarity scores used for reference to calculate a score-based likelihood
ratio. If reference scores are not supplied, |
A dataframe
# Compare two documents from the same writer with a similarity score
s1 <- system.file(file.path("extdata", "docs", "w0005_s01_pLND_r03.png"),
package = "handwriterRF"
)
s2 <- system.file(file.path("extdata", "docs", "w0005_s02_pWOZ_r02.png"),
package = "handwriterRF"
)
compare_documents(s1, s2, score_only = TRUE)
# Compare two documents from the same writer with a score-based
# likelihood ratio
s1 <- system.file(file.path("extdata", "docs", "w0005_s01_pLND_r03.png"),
package = "handwriterRF"
)
s2 <- system.file(file.path("extdata", "docs", "w0005_s02_pWOZ_r02.png"),
package = "handwriterRF"
)
compare_documents(s1, s2, score_only = FALSE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.