niBlackThreshold | R Documentation |
niBlackThreshold
performs thresholding on an
Image
object using Niblack's technique or some of the popular
variations it inspired.
niBlackThreshold(
image,
max_value = 255,
threshold_type = "binary",
block_size = 31,
k = 0.5,
method = "Niblack",
r = 128,
target = "new"
)
image |
An 8-bit (8U) single-channel |
max_value |
Non-zero value assigned to the pixels for which the
condition is satisfied (default: 255). It is used only if
|
threshold_type |
The name of the threshold type to use. It can be any of the following:
|
block_size |
Size of a pixel neighborhood that is used to calculate a threshold value for the pixel (default: 31). It must be an odd number greater than 1. |
k |
A user-adjustable parameter used by Niblack and inspired techniques. For Niblack, this is normally a value between 0 and 1 that is multiplied with the standard deviation and subtracted from the mean. |
method |
A string indicating the binarization method to use. It can be any of the following:
|
r |
A user-adjustable parameter used by Sauvola's technique. This is the dynamic range of standard deviation. |
target |
The location where the results should be stored. It can take 3 values:
|
If target="new"
, the function returns an Image
object. If target="self"
, the function returns nothing and modifies
image
in place. If target
is an Image
object,
the function returns nothing and modifies that Image
object in
place.
Simon Garnier, garnier@njit.edu
Image
, threshold
, autothreshold
balloon <- image(system.file("sample_img/balloon1.png", package = "Rvision"))
balloon_gray <- changeColorSpace(balloon, "GRAY")
balloon_th <- niBlackThreshold(balloon_gray)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.