coo_slidegap: Slides coordinates using the widest gap

Description Usage Arguments Value See Also Examples

View source: R/coo-utilities.R

Description

When slicing a shape using two landmarks, or functions such as coo_up, an open curve is obtained and the rank of points make wrong/artefactual results. If the widest gap is > 5 * median of other gaps, then the couple of coordinates forming this widest gap is used as starting and ending points. This switch helps to deal with open curves. Examples are self-speaking. Use force=TRUE to bypass this check

Usage

1

Arguments

coo

a matrix of (x; y) coordinates or a list, or any Coo object.

force

logical whether to use the widest gap, with no check, as the real gap

Value

a matrix of (x; y) coordinates or a Coo object.

See Also

Other sliding functions: coo_slidedirection, coo_slide

Other coo_ utilities: coo_aligncalliper, coo_alignminradius, coo_alignxax, coo_align, coo_baseline, coo_bookstein, coo_boundingbox, coo_calliper, coo_centdist, coo_center, coo_centpos, coo_chull_onion, coo_close, coo_down, coo_dxy, coo_extract, coo_flipx, coo_force2close, coo_interpolate, coo_jitter, coo_left, coo_nb, coo_perimcum, coo_perimpts, coo_perim, coo_rev, coo_right, coo_rotatecenter, coo_rotate, coo_samplerr, coo_sample, coo_scalex, coo_scale, coo_shearx, coo_slice, coo_slidedirection, coo_slide, coo_smoothcurve, coo_smooth, coo_template, coo_trans, coo_trimbottom, coo_trimtop, coo_trim, coo_up, is_clockwise, is_closed, is_equallyspacedradii

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
cat <- coo_center(shapes[4])
coo_plot(cat)

# we only retain the bottom of the cat
cat_down <- coo_down(cat, slidegap=FALSE)

# see? the segment on the x-axis coorespond to the widest gap.
coo_plot(cat_down)

# that's what we meant
coo_plot(coo_slidegap(cat_down))

Momocs documentation built on Sept. 28, 2017, 9:04 a.m.