-
Notifications
You must be signed in to change notification settings - Fork 0
/
mcc.R
36 lines (18 loc) · 820 Bytes
/
mcc.R
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#Scale Parameter = 1.5
#Curvature Threshold = 0.3
#================================================================================
library(lidR)
library(RMCC)
#Read LAS file
LASfile <- system.file("extdata", "Megaplot.laz", package="lidR")
las <- readLAS(LASfile, select = "xyzrn")
#Prompt for param: scale parameter
scaleParameter = readline(prompt = "Enter scale parameter: ")
scaleParameter = as.double(scaleParameter)
#Prompt for param: curvature threshold
curvatureThreshold = readline(prompt = "Enter curvature threshold: ")
curvatureThreshold = as.double(curvatureThreshold)
#Implement MCC algorithm
las <- classify_ground(las, mcc(s=scaleParameter, t=curvatureThreshold))
#Plot Result (3D view)
plot(las, color = "Classification", size = 2, bg = "white")