imager (version 0.41.2)

bbox: Compute the bounding box of a pixset

Description

This function returns the bounding box of a pixset as another pixset. If the image has more than one frame, a bounding cube is returned. If the image has several colour channels, the bounding box is computed separately in each channel. crop.bbox crops an image using the bounding box of a pixset.

Usage

bbox(px)

crop.bbox(im, px)

Arguments

px

a pixset

im

an image

Value

a pixset object

Functions

  • crop.bbox: crop image using the bounding box of pixset px

Examples

Run this code
# NOT RUN {
im <- grayscale(boats)
px <- im > .85
plot(im)
highlight(bbox(px))
highlight(px,col="green")
crop.bbox(im,px) %>% plot
# }

Run the code above in your browser using DataLab