-
Notifications
You must be signed in to change notification settings - Fork 0
/
UtilityFunctions.R
69 lines (56 loc) · 1.45 KB
/
UtilityFunctions.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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
# A couple utility functions to clean up the full segment code
library(R.matlab)
# -------------------------------------- ReadNorm -----------------
ReadNorm <- function(name) {
data <- readMat(name)$sample
x = data[,1]
y = data[,2]
z = data[,3]
intensity=data[,7]
neg_x = data[,8]
pos_x = data[,9]
neg_y = data[,10]
pos_y = data[,11]
neg_z = data[,12]
pos_z = data[,13]
color=data[,14]
data <- data.frame(x, y, z, intensity, neg_x, pos_x, neg_y, pos_y,
neg_z, pos_z, color)
return(data)
}
# -------------------------------------- ReadFuzzy -----------------
ReadFuzzy <- function(name) {
data <- readMat(name)$sample
x = data[,4]
y = data[,5]
z = data[,6]
intensity=data[,7]
neg_x = data[,8]
pos_x = data[,9]
neg_y = data[,10]
pos_y = data[,11]
neg_z = data[,12]
pos_z = data[,13]
color=data[,14]
data <- data.frame(x, y, z, intensity, neg_x, pos_x, neg_y, pos_y,
neg_z, pos_z, color)
return(data)
}
# -------------------------------------- ReadFull -----------------
ReadFull <- function(name) {
data <- readMat(name)$full
x = data[,1]
y = data[,2]
z = data[,3]
intensity=data[,7]
neg_x = data[,8]
pos_x = data[,9]
neg_y = data[,10]
pos_y = data[,11]
neg_z = data[,12]
pos_z = data[,13]
color=data[,14]
data <- data.frame(x, y, z, intensity, neg_x, pos_x, neg_y, pos_y,
neg_z, pos_z, color)
return(data)
}