Learn R Programming

dcemriS4 (version 0.55)

findCenter: Find the Center of a Binary Mask

Description

The center of a binary mask is determined.

Usage

findCenter(M)

Arguments

M

is a binary mask (multidimensional array of logical values).

Value

A vector of values the same length as the input array.

Details

This method most likely only works with convex three-dimensional shapes (e.g., a hyper-rectangle). Further testing is required to know the limits of the current implementation.

See Also

fastTemplateMatching

Examples

Run this code
# NOT RUN {
M <- array(FALSE, rep(10,3))
M[6:10,6:10,6:10] <- TRUE
Mc <- findCenter(M)
print(Mc)
# }

Run the code above in your browser using DataLab