substract_point_clouds: Point clouds substraction: identification of changes between...

Description Usage Arguments Details Value Note Examples

View source: R/substract.R

Description

Identify the point that are unique to one of two point clouds to detect the changes that occured between two measuring times (e.g. growth, branches losses, branch motion). Two methods are available (see details).

Usage

1

Arguments

t0

a data.frame or data.table containing the x, y, z, ... coordinates of a point cloud or voxel cloud acquired at time 0.

t1

a data.frame or data.table containing the x, y, z, ... coordinates of a point cloud or voxel cloud acquired at time 1.

method

character. The method to use to identify the difference between t0 and t1. Can be either "hull" or "distance", see details.

dist

numeric. The threshold distance to consider a point is unique to t1 if method = "distance".

message

logical. If FALSE, messages are disabled. Default = TRUE.

Details

If method = "hull", the convex hull that wraps t0 is constructed and the difference between t1 and t0 are the points outside the convex hull. If method = "distance", the points in t1 that are distant (i.e. further than dist) from the points in t0 are returned.

Value

a data.frame or data.table containing the x, y, z, ... coordinates of points that are unique to t1.

Note

t0 and t1 must be registered in the same coordinates system.

@references Lecigne, B., Delagrange, S., & Messier, C. (2018). Exploring trees in three dimensions: VoxR, a novel voxel-based R package dedicated to analysing the complex arrangement of tree crowns. Annals of botany, 121(4), 589-601.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
#- import datasets
t0=data.table::fread(system.file("extdata", "Tree_t0.asc", package="VoxR"))
t1=data.table::fread(system.file("extdata", "Tree_t1.asc", package="VoxR"))

#- keep only the tree crown
t0 = t0[z>=0,]
t1 = t1[z>=0,]

####- substract t0 to t1 with the hull method
diff = VoxR::substract_point_clouds(t0 = t0,t1 = t1, method = "hull")
#- plot the result (t0 in black, the difference between t1 and t0 in red)
rgl::open3d()
rgl::plot3d(t0,add=TRUE)
rgl::plot3d(diff,col="red",add=TRUE)

####- substract t0 to t1 with the distance based method
diff = substract_point_clouds(t0 = t0,t1 = t1, method = "distance",dist = 0.1)
#- plot the result (t0 in black, the difference between t1 and t0 in red)
rgl::open3d()
rgl::plot3d(t0,add=TRUE)
rgl::plot3d(diff,col="red",add=TRUE)

VoxR documentation built on Nov. 16, 2020, 9:14 a.m.