img_connected_components: Connected components

Description Usage Arguments Details Value Raises

View source: R/image_ops.R


Labels the connected components in a batch of images.





A 2D (H, W) or 3D (N, H, W) Tensor of image (integer, floating point and boolean types are supported).


The name of the op.


A component is a set of pixels in a single input image, which are all adjacent and all have the same non-zero value. The components using a squared connectivity of one (all equal entries are joined with their neighbors above,below, left, and right). Components across all images have consecutive ids 1 through n. Components are labeled according to the first pixel of the component appearing in row-major order (lexicographic order by image_index_in_batch, row, col). Zero entries all have an output id of 0. This op is equivalent with 'scipy.ndimage.measurements.label' on a 2D array with the default structuring element (which is the connectivity used here).


Components with the same shape as 'images'. entries that evaluate to FALSE (e.g. 0/0.0f, FALSE) in 'images' have value 0, and all other entries map to a component id > 0.


TypeError: if 'images' is not 2D or 3D.

tfaddons documentation built on July 2, 2020, 2:12 a.m.