getMargins: Find the margins in a text canvas

View source: R/textCanvas.R

getMarginsR Documentation

Find the margins in a text canvas

Description

None yet

Usage

getMargins(canvas)

Arguments

canvas

A N dimensional matrix (product of png::readPNG()) corresponding to bitmap image.

Details

None yet

Value

A named 4 vector containing top, right, bottom and left margins

Author(s)

Dave Braze <davebraze@gmail.com>

Examples

    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

    ## get margins
    getMargins(fcnvs)

davebraze/FDBeye documentation built on April 28, 2022, 1:20 a.m.