ringBorders: Ring borders

Description Usage Arguments Value Author(s) Examples

Description

This function can find the ring borders in a gray matrix.

Usage

1
2
ringBorders(image, auto.det = TRUE, darker = TRUE, origin = 0, 
    inclu = NULL, exclu = NULL, ...)

Arguments

image

character or matrix. Either path of an image section or an array ##representing a gray matrix.

auto.det

logical. If TRUE the linear detection is implemented (see linearDetect).

darker

logical. If TRUE the algorithm uses the negative extremes on smoothed grays to detect the ring borders. If FALSE the possitive extremes are used.

origin

numeric. an origin in smoothed gray to find the ring borders.

inclu

NULL or vector with column numbers in gray matrix, other than those automatically detected, to be considered as ring borders.If NULL no column numbers are included.

exclu

NULL or vector with column numbers in gray

...

arguments to be passed to imageTogray.

Value

a data frame with the smoothed grays and the identified ring borders (see grayDarker, graySmoothed, and linearDetect).

Author(s)

Wilson Lara, Carlos Sierra, Felipe Bravo

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
## (not run) Read one image sample in folder of package
## measuRing:
image1 <- system.file("P105_a.tif", package="measuRing")        
## column numbers in gray matrix to be included/avoided:
Toinc <- c(196,202,387,1564) 
Toexc <- c(21,130,197,207,1444,1484)        
##(not run) the ring borders:
borders <- ringBorders(image1,inclu = Toinc,exclu = Toexc)
str(borders)
##(not run) Plot of smoothed grays with the ring borders:
Smooth <- ts(borders[,1])
inclupix <- subset(borders,borders%in%TRUE)
inclucol <- as.numeric(rownames(inclupix))
xyborders <- data.frame(column=inclucol,smooth=inclupix[,1])
y.lim <- c(-0.05,0.05)
main. <- 'Ring borders'
{plot(Smooth,xlab = 'Column',ylab = 'Smoothed gray',
      main=main.,col = 'darkgoldenrod1')
 points(xyborders[,1],xyborders[,2],pch=19,cex=0.5,col='orangered')}

Example output

Loading required package: pastecs
Loading required package: boot
Loading required package: png
Loading required package: tiff
Loading required package: dplR
'data.frame':	1610 obs. of  2 variables:
 $ P105_a : num  0.0832 0.0962 0.1098 0.1211 0.1304 ...
 $ borders: logi  NA NA NA NA NA NA ...
 - attr(*, "gray.dim")= int  20 1610
 - attr(*, "image")= chr "/usr/local/lib/R/site-library/measuRing/P105_a.tif"
 - attr(*, "ppi")= num 1000
 - attr(*, "rgb")= num  0.3 0.6 0.1
 - attr(*, "p.row")= num 1
 - attr(*, "origin")= num 0
 - attr(*, "auto.det")= logi TRUE
 - attr(*, "darker")= logi TRUE
 - attr(*, "inclu")= num  196 202 387 1564
 - attr(*, "exclu")= num  21 130 197 207 1444 ...

measuRing documentation built on May 2, 2019, 12:48 p.m.