simpleBlobDetector
implements a simple algorithm for
extracting blobs an Image
object. A blob is a region in an
image that differs in properties (e.g. brightness, color) from surrounding
regions.
simpleBlobDetector(
image,
min_threshold = 50,
max_threshold = 220,
threshold_step = 10,
min_repeatability = 2,
min_dist_between_blobs = 10,
filter_by_area = TRUE,
min_area = 25,
max_area = 5000,
filter_by_color = TRUE,
blob_color = 0,
filter_by_circularity = FALSE,
min_circularity = 0.8,
max_circularity = Inf,
filter_by_convexity = TRUE,
min_convexity = 0.95,
max_convexity = Inf,
filter_by_inertia = TRUE,
min_inertia_ratio = 0.1,
max_inertia_ratio = Inf
)
An Image
object.
A numeric value representing the starting thresholding value (see Note; default: 50).
A numeric value representing the ending thresholding value (see Note; default: 220).
A numeric value representing the step size to go from
min_threshold
to max_treshold
(see Note; default: 10).
A numeric value representing the number of threshold values a blob has to be detected at to be considered stable (see Note; default: 2).
A numeric value representing the minimum distance in pixels between pixel group centers from several binary (thresholded) images above which they are considered as distinct blobs (default: 10).
A logical indicating whether blobs should be filtered based on their area in pixels (default: TRUE).
A numeric value representing the smallest acceptable area for blobs (in pixels). Blobs smaller than this value are discarded (default: 25).
A numeric value representing the largest acceptable area for blobs (in pixels). Blobs larger than this value are discarded. (default: 5000).
A logical indicating whether blobs should be filtered based on color (default: TRUE).
An integer between 0 and 255 representing the color of the blobs. 0 will select dark blobs, 255 will select bright blobs (default: 0).
A logical indicating whether blobs should be filtered based on circularity (default: FALSE).
A numeric value representing the smallest acceptable circularity for blobs. Blobs with smaller circularity than this value are discarded. (default: 0.8).
A numeric value representing the largest acceptable circularity for blobs. Blobs with larger circularity than this value are discarded. (default: Inf).
A logical indicating whether blobs should be filtered based on convexity (default: TRUE).
A numeric value representing the smallest acceptable convexity for blobs. Blobs with smaller convexity than this value are discarded. (default: 0.95).
A numeric value representing the largest acceptable convexity for blobs. Blobs with larger convexity than this value are discarded. (default: Inf).
A logical indicating whether blobs should be filtered based on their inertia ratio (default: TRUE).
A numeric value representing the smallest acceptable inertia ratio for blobs. Blobs with smaller ratio than this value are discarded. (default: 0.1).
A numeric value representing the largest acceptable inertia ratio for blobs. Blobs with larger ratio than this value are discarded. (default: Inf).
A data frame of class blob
with the following columns:
"id":a unique identifier for each blob in the image.
"x":the x coordinate of each blob in the image.
"y":the y coordinate of each blob in the image.
"size":the diameter of the circle containing the blob.
# NOT RUN {
dots <- image(system.file("sample_img/dots.jpg", package = "Rvision"))
blobs <- simpleBlobDetector(invert(dots), min_threshold = 25, max_threshold = 220,
filter_by_area = TRUE, min_area = 200, max_area = Inf,
filter_by_color = FALSE)
# }
Run the code above in your browser using DataLab