-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathFPFHEstimation.lua
81 lines (64 loc) · 1.75 KB
/
FPFHEstimation.lua
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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
local ffi = require 'ffi'
local torch = require 'torch'
local utils = require 'pcl.utils'
local pcl = require 'pcl.PointTypes'
local FPFHEstimation = torch.class('pcl.FPFHEstimation', pcl)
local func_by_type = {}
local function init()
local FPFHEstimation_method_names = {
'new',
'delete',
'setInputCloud',
'setInputNormals',
'setIndices',
'compute',
'setKSearch',
'getKSearch',
'setRadiusSearch',
'getRadiusSearch'
}
for k,v in pairs(utils.type_key_map) do
func_by_type[k] = utils.create_typed_methods("pcl_FPFHEstimation_TYPE_KEY_", FPFHEstimation_method_names, v)
end
end
init()
function FPFHEstimation:__init(pointType)
pointType = pcl.pointType(pointType or pcl.PointXYZ)
rawset(self, 'f', func_by_type[pointType])
self.pointType = pointType
self.o = self.f.new()
end
function FPFHEstimation:cdata()
return self.o
end
function FPFHEstimation:setInputCloud(cloud)
self.f.setInputCloud(self.o, cloud:cdata())
end
function FPFHEstimation:setInputNormals(normals)
self.f.setInputNormals(self.o, normals:cdata())
end
function FPFHEstimation:setIndices(indices)
self.f.setIndices(self.o, indices:cdata())
end
function FPFHEstimation:compute(output)
if not output then
output = pcl.PointCloud(pcl.FPFHSignature33)
end
self.f.compute(self.o, output:cdata())
return output
end
function FPFHEstimation:setNumberOfThreads(num_threads)
self.f.setNumberOfThreads(self.o, num_threads)
end
function FPFHEstimation:setKSearch(k)
self.f.setKSearch(self.o, k)
end
function FPFHEstimation:getKSearch()
self.f.getKSearch(self.o)
end
function FPFHEstimation:setRadiusSearch(radius)
self.f.setRadiusSearch(self.o, radius)
end
function FPFHEstimation:getRadiusSearch()
self.f.getRadiusSearch(self.o)
end