clear_border: Clear connected regions touching edges

View source: R/segmentation.R

clear_borderR Documentation

Clear connected regions touching edges

Description

Clear connect regions of a binary image that touch either the edges of the image or edges in specified binary mask (or window).

Usage

clear_border(image, win = NULL, r = image$xstep * 2, output_mask = FALSE)

Arguments

image

binary image (instance of im object)

win

Optional. Window/mask that defines edges (instance of owin object)

r

Optional. Radius of morphological erosion operation to use to define the edge. This will determine the 'thickness' of the edge. Defaults to 2px.

output_mask

Optional. Logical value to indicate whether a mask of objects should be returned. If FALSE a labelled image will be returned.

Value

labelled image (im object) or mask excluding any connected components that touch the border of the win.


keithschulze/supr documentation built on Nov. 26, 2022, 7:09 a.m.