makeOverlay {imageUtilities}R Documentation

overlays a single-channel binary image onto another.

Description

overlays a single-channel binary image onto another.

Usage

  makeOverlay(img, ovl, transparency = 0.5,
    max = imageUtilities.option("max"), col = c(255, 0, 0))

Arguments

img

the input image

ovl

the overlay image. It will be coerced to binary. Where it is 1 or TRUE, the overlay will be shown on the input image.

transparency

the transparency of the overlay, from 0 to 1. 0 corresponds to an opaque overlay, and 1 corresponds to a transparent overlay.

max

the maximum intensity of the images (ie 0 to 1 or 0 to 255)

col

The colour to draw the overlay in. Either a string of a colour recognised by R, or a numeric vector c(R,G,B) with red/green/blue values the desired colour, from 0 to max

Value

an image with the overlay on top of it in the specified transparency and colour.

Note

This essentially performs the calcuation:

outI = transparency * colour * overlay + (1-transparency) * image

See Also

Other overlay: makeOverlay.grid, showOverlay


[Package imageUtilities version 1.0.3 Index]