Learn R Programming

Rvision (version 0.4.2)

findNonZero: Find Non-Zero Pixels in an Image

Description

findNonZero retrieves the locations of all non-zero pixels in an image.

Usage

findNonZero(image)

Arguments

image

An an 8-bit (8U) single-channel Image object.

Value

A data frame with two columns, corresponding to the x (columns) and y (rows) coordinates of the non-zero pixels.

See Also

Image

Examples

Run this code
# NOT RUN {
balloon <- image(system.file("sample_img/balloon1.png", package = "Rvision"))
balloon_gray <- changeColorSpace(balloon, "GRAY")
findNonZero(balloon_gray)

# }

Run the code above in your browser using DataLab