distanceToRefParallel: distanceToRefParallel

Description Usage Arguments Value

View source: R/compare.R

Description

Function performing batched matching between a query catalogue to a reference catalogue To call from opencpu, basic format resembles hashes=[0.1, 1.5, 2.2, 3.0],[6.0, 3.3, 4.1, 5.3] where each vector denotes the featues extracted from an image of a dorsal fin.

Usage

1
2
3
4
5
6
curl http://localhost:8004/ocpu/library/finFindR/R/distanceToRefParallel/json\
 -d "{\
 \"queryHashData\":{\"unk1\":[1,2,3]},\
 \"referenceHashData\":{\"sal\":[-1,2,4],\"bob\":[-1,-2,-4]},\
 \"justIndex\":0}"\
 -H "Content-Type: application/json"

Arguments

queryHashData

dataframe (or list) containing the hashes for matching

referenceHashData

dataframe (or list) containing a reference catalogue of hashes

batchSize

int denoting the number of query instances to process at once

counterEnvir

r environment object to hold a progress counter for display purposes

displayProgressInShiny

bool denoting if function is called inside an rshiny instance

justIndex

bool denoting if comparison should just return index dataframes or ordered names (mainly for opencpu api)

Value

list of two dataframes. The dataframes are formatted as follows: If justIndex is true: Each row denotes a query image in the same order as provided in the function call. ie If the first hash in queryHashData was extracted from an image of dolphin "alice", the first row contains matches to dolphin "alice" Each column represents a potential match from the referenceHashData, Columns are ordered by proximity of match from with the closest match being in column 1 The index refers to the referenceHashData list provided. If column 1 for dolphin "alice" is 12, then the 12th element in referenceHashData is the best match. "sortingIndex" denotes the element from best to worst match in the reference catalogue. "distances" denotes the distance to the index specified in "sorting Index" If justIndex is false: Two named lists are returned: "sortingIndex" list of vectors containing referenceHashData names, ordered by proximety of match. Each list is named after the queryHashData element it represents "distances" list of vectors containing distances to each match. Each list is named after the queryHashData element it represents


haimeh/finFindR documentation built on July 17, 2021, 12:56 a.m.