Skip to contents

minMaxLoc returns the maximum and minimum pixel values of an Image object, as well as their coordinates in the image. If the Image object has more than one channel, it returns the values for each channel.

Usage

minMaxLoc(x, mask = NULL)

Arguments

x

An Image object.

mask

A single-channel (GRAY) 8-bit (8U) Image object with the same dimensions as x. This can be used to mask out pixels that should not be considered when calculating the minima and maxima (pixels set to 0 in the mask will be ignored during the calculation).

Value

A matrix (or a list of matrices for multi-channels images).

Author

Simon Garnier, garnier@njit.edu

Examples

balloon <- image(system.file("sample_img/balloon1.png", package = "Rvision"))
minMaxLoc(balloon)
#> $B
#>     val   x   y
#> min   0 406 295
#> max 255 306 304
#> 
#> $G
#>     val   x   y
#> min  15 395 249
#> max 248 343 306
#> 
#> $R
#>     val   x   y
#> min  17 398 244
#> max 254 343 307
#>