count_neighbors {ggbrain}R Documentation

This function counts the number of neighboring/touching pixels in a 2D binary image

Description

This function counts the number of neighboring/touching pixels in a 2D binary image

Arguments

im

A boolean matrix representing a binary image

diagonal

Whether to count diagonal elements as valid neighbors

Details

This is an internal function used by geom_outline to clean up outlines

Value

A matrix of the same size as im containing the number of neighboring pixels

Author(s)

Michael Hallquist


[Package ggbrain version 0.8.1 Index]