ringBorders | R Documentation |
This function can find the ring borders in a gray matrix.
ringBorders(image, auto.det = TRUE,
darker = TRUE, origin = 0,
inclu = NULL, exclu = NULL,
...)
image |
character or matrix. Either path of an |
auto.det |
logical. If TRUE the linear detection is
implemented (see
|
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 |
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 |
a data frame with the smoothed grays and the identified
ring borders (see grayDarker
,
graySmoothed
, and
linearDetect
).
Wilson Lara <wilarhen@gmail.com> [aut, cre] (<https://orcid.org/0000-0003-3527-1380>), Carlos Sierra [aut] (<https://orcid.org/0000-0003-0009-4169>), Felipe Bravo [aut] (<https://orcid.org/0000-0001-7348-6695>)
## (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')}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.