find_area: Find continuous group of pixels with a tolerance of 'px_tol'...

Description Usage Arguments Value Examples

View source: R/ipa.R

Description

Find continuous group of pixels with a tolerance of px_tol pixels

Usage

1
find_area(img, start = c(1, 1), px_tol = 20, quiet = TRUE)

Arguments

img

image object (cimg class)

start

starting point: c(x0, y0)

px_tol

number of non-continuous pixels to accept

quiet

boolean flag to hide messages of progress

Value

blobs containing adjacent groups of non-zero pixels

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
## Not run: 
    # Create test alpha layer
    alpha <- matrix(0, 50, 50)
    alpha[10:20, 15:25] <- 1
    alpha[25:35, 15:25] <- 1
    alpha[1:50, 40:50] <- 1
    alpha <- imager::as.cimg(alpha)
    blobs1 <- find_area(alpha, start = c(10, 15), px_tol = 1)
    blobs2 <- find_area(alpha, start = c(1, 40), px_tol = 1)
    blobs3 <- find_area(alpha, start = c(10, 15),
                        px_tol = 1,
                        quiet = FALSE))

## End(Not run)

villegar/IPA documentation built on Aug. 11, 2021, 12:50 a.m.