getBGcol: Finds 'background' value in a matrix.

Description Usage Arguments Details Value Author(s) Examples

Description

Finds the most common value in a matrix and returns it.

Usage

1
getBGcol(cnvs)

Arguments

cnvs

A matrix representing a text canvas.

Details

Finds the 'background' value in a matrix, defined as the most common value in a matrix.

Not necessarily intended to be called by the end user.

Value

A numeric value corresponding to the the most common value in cnvs.

Author(s)

Dave Braze <[email protected]>

Examples

1
2
3
4
cnvs <- system.file("extdata/story01.png", package="FDBeye")
cnvs <- png::readPNG(cnvs)
fcnvs <- apply(cnvs, c(1,2), sum) # flatten to a single plane for convenience
getBGcol(fcnvs)

davebraze/FDBeye documentation built on May 14, 2019, 9 p.m.