Learn R Programming

Rvision (version 0.6.0)

countNonZero: Count Non-Zero Pixels

Description

countNonZero returns the number of non-zero pixels in an Image object.

Usage

countNonZero(image)

Arguments

image

A single-channel Image object.

Value

An integer.

See Also

Image

Examples

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

# }

Run the code above in your browser using DataLab