powered by
countNonZero returns the number of non-zero pixels in an Image object.
countNonZero
Image
countNonZero(image)
A single-channel Image object.
An integer.
# 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