data(bambooleaves)
uni.C <- sort( unique(bambooleaves$Code) )
ind <- 3
Data <- bambooleaves[bambooleaves$Code==uni.C[ind], ]
x0 <- Data$x
y0 <- Data$y
dev.new()
plot( x0, y0, asp=1, type="l", cex.lab=1.5, cex.axis=1.5,
xlab=expression(italic(x)), ylab=expression(italic(y)) )
Res1 <- adjdata(x0, y0, ub.np=2000, len.pro=1/20)
x1 <- Res1$x
y1 <- Res1$y
# \donttest{
Res2 <- bilat( x=x1, y=y1, time.interval=0.00045,
peri.np=NULL, auto.search=TRUE,
fd.opt=TRUE )
Res2$scan.perimeter
set.seed(123)
Res3 <- bilat( x=x1, y=y1, time.interval=0.00045,
peri.np=500, n.loop=30,
auto.search=TRUE, fd.opt=FALSE )
Res3$scan.perimeter
set.seed(123)
Res4 <- bilat( x=x1, y=y1, time.interval=0.00045,
peri.np=500, n.loop=30,
auto.search=TRUE, fd.opt=FALSE, angle=pi/4 )
Res4$scan.perimeter
set.seed(123)
Res5 <- bilat( x=x1, y=y1, time.interval=0.00045,
peri.np=500, n.loop=30,
auto.search=TRUE, fd.opt=FALSE, angle=0 )
Res5$scan.perimeter
if(interactive()){
# The angle between the leaf length axis (namely the straight
# line through the leaf apex and base) and the horizontal axis
# should be between 0 and pi/2 for a scanned leaf's profile.
# Here, the user needs to first click the leaf apex,
# and then click the leaf base.
set.seed(123)
Res6 <- bilat( x=x1, y=y1, time.interval=0.00045,
peri.np=500, n.loop=30,
auto.search=FALSE, fd.opt=FALSE, angle=NULL )
Res6$scan.perimeter
}
set.seed(NULL)
# }
graphics.off()
Run the code above in your browser using DataLab