File: IntegralImageNormalEstimation.pxi

package info (click to toggle)
python-pcl 0.3.0~rc1%2Bdfsg-14
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 31,828 kB
  • sloc: python: 3,094; cpp: 283; makefile: 181; sh: 24; ansic: 12
file content (82 lines) | stat: -rw-r--r-- 3,616 bytes parent folder | download | duplicates (3)
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
82
# -*- coding: utf-8 -*-
cimport _pcl
from libcpp.vector cimport vector
from libcpp cimport bool

cimport pcl_defs as cpp
cimport pcl_features as pclftr

from boost_shared_ptr cimport sp_assign

cdef extern from "minipcl.h":
    void mpcl_features_NormalEstimationMethod_AVERAGE_3D_GRADIENT(pclftr.IntegralImageNormalEstimation_t ) except +
    void mpcl_features_NormalEstimationMethod_COVARIANCE_MATRIX(pclftr.IntegralImageNormalEstimation_t ) except +
    void mpcl_features_NormalEstimationMethod_AVERAGE_DEPTH_CHANGE(pclftr.IntegralImageNormalEstimation_t ) except +
    void mpcl_features_NormalEstimationMethod_SIMPLE_3D_GRADIENT(pclftr.IntegralImageNormalEstimation_t ) except +
    void mpcl_features_NormalEstimationMethod_compute(pclftr.IntegralImageNormalEstimation_t, cpp.PointCloud_Normal_t ) except +


cdef class IntegralImageNormalEstimation:
    """
    IntegralImageNormalEstimation class for Surface normal estimation on organized data using integral images. 
    """
    cdef pclftr.IntegralImageNormalEstimation_t *me


    def __cinit__(self, _pcl.PointCloud pc not None):
        # sp_assign(self.thisptr_shared, new pclftr.IntegralImageNormalEstimation[cpp.PointXYZ, cpp.Normal]())
        # self.thisptr().setInputCloud(pc.thisptr_shared)
        # NG : Reference Count 
        self.me = new pclftr.IntegralImageNormalEstimation_t()
        self.me.setInputCloud(pc.thisptr_shared)
        # pass


    def __dealloc__(self):
        del self.me


    def set_NormalEstimation_Method_AVERAGE_3D_GRADIENT (self):
       # mpcl_features_NormalEstimationMethod_AVERAGE_3D_GRADIENT(<pclftr.IntegralImageNormalEstimation_t> deref(self.thisptr()))
       mpcl_features_NormalEstimationMethod_AVERAGE_3D_GRADIENT(<pclftr.IntegralImageNormalEstimation_t> deref(self.me))


    def set_NormalEstimation_Method_COVARIANCE_MATRIX (self):
       # mpcl_features_NormalEstimationMethod_COVARIANCE_MATRIX(<pclftr.IntegralImageNormalEstimation_t> deref(self.thisptr()))
       mpcl_features_NormalEstimationMethod_COVARIANCE_MATRIX(<pclftr.IntegralImageNormalEstimation_t> deref(self.me))


    def set_NormalEstimation_Method_AVERAGE_DEPTH_CHANGE (self):
       # mpcl_features_NormalEstimationMethod_AVERAGE_DEPTH_CHANGE(<pclftr.IntegralImageNormalEstimation_t> deref(self.thisptr()))
       mpcl_features_NormalEstimationMethod_AVERAGE_DEPTH_CHANGE(<pclftr.IntegralImageNormalEstimation_t> deref(self.me))


    def set_NormalEstimation_Method_SIMPLE_3D_GRADIENT (self):
       # mpcl_features_NormalEstimationMethod_SIMPLE_3D_GRADIENT(<pclftr.IntegralImageNormalEstimation_t> deref(self.thisptr()))
       mpcl_features_NormalEstimationMethod_SIMPLE_3D_GRADIENT(<pclftr.IntegralImageNormalEstimation_t> deref(self.me))


    # enum Set NG
    # def set_NormalEstimation_Method (self):
    #    self.thisptr().setNormalEstimationMethod(pclftr.NormalEstimationMethod2.ESTIMATIONMETHOD_COVARIANCE_MATRIX)


    def set_MaxDepthChange_Factor(self, double param):
        # self.thisptr().setMaxDepthChangeFactor(param)
        self.me.setMaxDepthChangeFactor(param)


    def set_NormalSmoothingSize(self, double param):
        # self.thisptr().setNormalSmoothingSize(param)
        self.me.setNormalSmoothingSize(param)


    def compute(self):
        normal = PointCloud_Normal()
        sp_assign(normal.thisptr_shared, new cpp.PointCloud[cpp.Normal]())
        cdef cpp.PointCloud_Normal_t *cNormal = <cpp.PointCloud_Normal_t*>normal.thisptr()
        # (<pclftr.Feature_t*>self.thisptr()).compute(deref(cNormal))
        (<pclftr.Feature_t*>self.me).compute(deref(cNormal))
        return normal