thr.check: Evaluate a range of threshold values for creating binary...

Description Usage Arguments Details Value See Also Examples

View source: R/image.R

Description

Converts an image to grayscale, applies a user defined threshold range to segment the binary the image, and then plots segmented images that reflect 9 discrete values in the range.

Usage

1
thr.check(img, min = NULL, max = NULL, otsu = TRUE, plot.grid = TRUE)

Arguments

img

character, a path to an image file.

min

numeric, the minimum threshold value (0-1).

max

numeric, the maximum threshold value (0-1).

otsu

logical, should the automatically determined threshold value be printed. See Details.

plot.grid

logical, should the grid of images be plotted.

Details

Displays a grid of 9 images as an R raster graphic, each the result of 9 discrete values within the range describe by min and max. If both min and max are NULL, then the threshold range is defined by the default seq(0.1,0.9,.1). This function should help users refine threshold values for detecting ROIs with kin.search and kin.simple if automatic thresholding using Otsu's method is not satisfactory.

Value

If 'otsu=TRUE', a single automated threshold value is returned using Otsu's method. See otsu.

See Also

kin.simple, kin.search, otsu

Examples

1
2
3
4
5
6
7
8
#access image in system
 y <-system.file("extdata/img", "sunfish_BCF.jpg", package = "trackter")

# default values
thr.check(y)

#custom values
thr.check(y,min=0.2,max=1.5)

ckenaley/trackter documentation built on Feb. 11, 2022, 6:43 a.m.