Cost: Compute area-based cost

View source: R/Cost.R

CostR Documentation

Compute area-based cost

Description

This function computes an area associated with a transition between two correspondences on two paths. A number of cost functions can be specified, but the most reasonable are Cost.quadratic (the default) and Cost.area. other cost functions are not robust to choices of segmentation.

Usage

Cost(xy1, xy2, i, j, pi, pj, opposite, costfn)

Arguments

xy1

A path of x,y coordinates (a matrix in two columns)

xy2

A second path of x,y coordinates (a matrix in two columns)

i

Index of Node i of path xy1

j

Index of Node j of path xy2

pi

Index of node previous to node i on path xy1

pj

Index of node previous to node j on path xy2

opposite

matrix specifying whether points on one path are 'opposite' points on another path, and if so the proportion between the two points where the orthogonal line falls.

costfn

Specify a cost function to use. By default, Cost.quadratic is used, although Cost.area is also reasonable. Other cost functions are provided but may be sensitive to segmentation.

Details

This is the basic cost function for a transition between nodes. This function does not need to be used directly, but is called repeatedly by CreateMap

Value

returns a floating-point value descibing the area defined by the the two path transitions provided the transitions are legal (according to connected. Otherwise, it will return Inf.

Author(s)

Shane T. Mueller and Brandon Perelman

References

See Mueller et al., (2016). https://sites.google.com/a/mtu.edu/mapping/


stmueller/pathmapping documentation built on Nov. 13, 2023, 12:39 p.m.