binimage: Generate binary ordered dissimilarities matrix for VAT...

Description Usage Arguments Details Value Author(s) References See Also Examples

View source: R/binimage.R

Description

This function generates the binary ordered dissimilarity matrix (BDM) for VAT analysis.

Usage

1
binimage(img, method="otsu", t=NULL, q=0.10, greylevel=256, disp=FALSE)

Arguments

img

A numeric matrix containing the greyscale ordered dissimilarities.

method

A character string describes the name of thresholding method to generate the binary image matrix from the greyscale ordered dissimilarities. The default value is 'otsu' for the Otsu's thresholding method. The option 'fixed' is for describing an user-defined value as the threshold. If it is assigned as the thresholding method, the user should define an integer threshold value with the argument t, otherwise the arithmetic mean of the matrix is used as the threshold value. The option 'auto' automatically computes the threshold using the formula: sqrt(2*sigma^2 * log(n)/n). The option 'median' uses the middle value of greyscale range as the threshold. The 'quant' option computes a user-defined quantile of the dissimilarites. If this method is used, the argument q should be assigned between 0 and 1. The default value of q is 0.10 (

t

A numeric threshold value for converting the ordered dissimilarities to a binary image matrix. It is used if the method argument is set to fixed. The default value is the arithmetic mean of the matrix img.

q

A numeric quantile value when the method argument is set to quant. The default q value is 0.10.

greylevel

An integer describing the grey levels in the greyscale image. The default value is 256.

disp

A logical value whether the the ordered dissimilarities image will be displayed or not. The default value is TRUE.

Details

Since this function uses the grey-level dissimilarities matrix as the input, the greyscale image should be generated using the function greyimage at first.

Value

binimg

Binary ordered dissimilarities matrix

threshold

Threshold value computed to generate the binary matrix

Author(s)

Zeynel Cebeci

References

Cebeci, Z. & Yildiz, F. (2015). Gorsel Kumelenme Egilimi Degerlendirmesi ve R'de Uygulamasi. Cukurova Universitesi Ziraat Fakultesi Dergisi, 30 (2), 1-8. (URL: https://dergipark.org.tr/en/download/article-file/219860)

See Also

findk, findk2, genbinimg, greyimage, vatimage, vatdisp

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
# Load the dataset iris and use the first four feature columns 
data(protcarbo)
# Run vatimage to build ordered dissimilarities matrix 
vatmat <- vatimage(protcarbo, disp=FALSE)$odm
# Generate grey-level image matrix
greymat <- greyimage(vatmat, greylevel=256, disp=FALSE)
# Generate binary image matrix with automatic thresholding method
binmat <- binimage(vatmat, method="auto", greylevel=256, disp=TRUE)
# Generate binary image matrix with fixed thresholding method
binmat <- binimage(vatmat, method="fixed", t=50, greylevel=256, disp=TRUE)

zcebeci/VatAna documentation built on Dec. 25, 2019, 7:07 p.m.