Skip to content
This repository has been archived by the owner on Dec 30, 2023. It is now read-only.

Added: set/get_eps_angle and set/get_axis to SACSegmentation classes #314

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -35,3 +35,6 @@ pip-log.txt

# Vim
*.sw[op]

# PyCharm
.idea/
78 changes: 77 additions & 1 deletion pcl/pxi/Segmentation/Segmentation.pxi
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,29 @@ cdef class Segmentation:
self.me.setDistanceThreshold (d)


def set_MaxIterations(self, int count):
def set_max_iterations(self, int count):
self.me.setMaxIterations (count)


def set_eps_angle(self, double ea):
(<pcl_seg.SACSegmentation_t*>self.me).setEpsAngle (ea)


def get_eps_angle(self):
return (<pcl_seg.SACSegmentation_t*>self.me).getEpsAngle()


def set_axis(self, double ax1, double ax2, double ax3):
cdef eigen3.Vector3f* vec = new eigen3.Vector3f(ax1, ax2, ax3)
(<pcl_seg.SACSegmentation_t*>self.me).setAxis(deref(vec))


def get_axis(self):
vec = (<pcl_seg.SACSegmentation_t*>self.me).getAxis()
cdef float *data = vec.data()
return np.array([data[0], data[1], data[2]], dtype=np.float32)


cdef class Segmentation_PointXYZI:
"""
Segmentation class for Sample Consensus methods and models
Expand Down Expand Up @@ -83,6 +102,25 @@ cdef class Segmentation_PointXYZI:
self.me.setDistanceThreshold (d)


def set_eps_angle(self, double ea):
(<pcl_seg.SACSegmentation_PointXYZI_t*>self.me).setEpsAngle (ea)


def get_eps_angle(self):
return (<pcl_seg.SACSegmentation_PointXYZI_t*>self.me).getEpsAngle()


def set_axis(self, double ax1, double ax2, double ax3):
cdef eigen3.Vector3f* vec = new eigen3.Vector3f(ax1, ax2, ax3)
(<pcl_seg.SACSegmentation_PointXYZI_t*>self.me).setAxis(deref(vec))


def get_axis(self):
vec = (<pcl_seg.SACSegmentation_PointXYZI_t*>self.me).getAxis()
cdef float *data = vec.data()
return np.array([data[0], data[1], data[2]], dtype=np.float32)


cdef class Segmentation_PointXYZRGB:
"""
Segmentation class for Sample Consensus methods and models
Expand Down Expand Up @@ -119,6 +157,25 @@ cdef class Segmentation_PointXYZRGB:
self.me.setDistanceThreshold (d)


def set_eps_angle(self, double ea):
(<pcl_seg.SACSegmentation_PointXYZRGB_t*>self.me).setEpsAngle (ea)


def get_eps_angle(self):
return (<pcl_seg.SACSegmentation_PointXYZRGB_t*>self.me).getEpsAngle()


def set_axis(self, double ax1, double ax2, double ax3):
cdef eigen3.Vector3f* vec = new eigen3.Vector3f(ax1, ax2, ax3)
(<pcl_seg.SACSegmentation_PointXYZRGB_t*>self.me).setAxis(deref(vec))


def get_axis(self):
vec = (<pcl_seg.SACSegmentation_PointXYZRGB_t*>self.me).getAxis()
cdef float *data = vec.data()
return np.array([data[0], data[1], data[2]], dtype=np.float32)


cdef class Segmentation_PointXYZRGBA:
"""
Segmentation class for Sample Consensus methods and models
Expand Down Expand Up @@ -155,3 +212,22 @@ cdef class Segmentation_PointXYZRGBA:
self.me.setDistanceThreshold (d)


def set_eps_angle(self, double ea):
(<pcl_seg.SACSegmentation_PointXYZRGBA_t*>self.me).setEpsAngle (ea)


def get_eps_angle(self):
return (<pcl_seg.SACSegmentation_PointXYZRGBA_t*>self.me).getEpsAngle()


def set_axis(self, double ax1, double ax2, double ax3):
cdef eigen3.Vector3f* vec = new eigen3.Vector3f(ax1, ax2, ax3)
(<pcl_seg.SACSegmentation_PointXYZRGBA_t*>self.me).setAxis(deref(vec))


def get_axis(self):
vec = (<pcl_seg.SACSegmentation_PointXYZRGBA_t*>self.me).getAxis()
cdef float *data = vec.data()
return np.array([data[0], data[1], data[2]], dtype=np.float32)


77 changes: 76 additions & 1 deletion pcl/pxi/Segmentation/Segmentation_172.pxi
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,29 @@ cdef class Segmentation:
self.me.setDistanceThreshold (d)


def set_MaxIterations(self, int count):
def set_max_iterations(self, int count):
self.me.setMaxIterations (count)


def set_eps_angle(self, double ea):
(<pcl_seg.SACSegmentation_t*>self.me).setEpsAngle (ea)


def get_eps_angle(self):
return (<pcl_seg.SACSegmentation_t*>self.me).getEpsAngle()


def set_axis(self, double ax1, double ax2, double ax3):
cdef eigen3.Vector3f* vec = new eigen3.Vector3f(ax1, ax2, ax3)
(<pcl_seg.SACSegmentation_t*>self.me).setAxis(deref(vec))


def get_axis(self):
vec = (<pcl_seg.SACSegmentation_t*>self.me).getAxis()
cdef float *data = vec.data()
return np.array([data[0], data[1], data[2]], dtype=np.float32)


cdef class Segmentation_PointXYZI:
"""
Segmentation class for Sample Consensus methods and models
Expand Down Expand Up @@ -83,6 +102,25 @@ cdef class Segmentation_PointXYZI:
self.me.setDistanceThreshold (d)


def set_eps_angle(self, double ea):
(<pcl_seg.SACSegmentation_PointXYZI_t*>self.me).setEpsAngle (ea)


def get_eps_angle(self):
return (<pcl_seg.SACSegmentation_PointXYZI_t*>self.me).getEpsAngle()


def set_axis(self, double ax1, double ax2, double ax3):
cdef eigen3.Vector3f* vec = new eigen3.Vector3f(ax1, ax2, ax3)
(<pcl_seg.SACSegmentation_PointXYZI_t*>self.me).setAxis(deref(vec))


def get_axis(self):
vec = (<pcl_seg.SACSegmentation_PointXYZI_t*>self.me).getAxis()
cdef float *data = vec.data()
return np.array([data[0], data[1], data[2]], dtype=np.float32)


cdef class Segmentation_PointXYZRGB:
"""
Segmentation class for Sample Consensus methods and models
Expand Down Expand Up @@ -119,6 +157,25 @@ cdef class Segmentation_PointXYZRGB:
self.me.setDistanceThreshold (d)


def set_eps_angle(self, double ea):
(<pcl_seg.SACSegmentation_PointXYZRGB_t*>self.me).setEpsAngle (ea)


def get_eps_angle(self):
return (<pcl_seg.SACSegmentation_PointXYZRGB_t*>self.me).getEpsAngle()


def set_axis(self, double ax1, double ax2, double ax3):
cdef eigen3.Vector3f* vec = new eigen3.Vector3f(ax1, ax2, ax3)
(<pcl_seg.SACSegmentation_PointXYZRGB_t*>self.me).setAxis(deref(vec))


def get_axis(self):
vec = (<pcl_seg.SACSegmentation_PointXYZRGB_t*>self.me).getAxis()
cdef float *data = vec.data()
return np.array([data[0], data[1], data[2]], dtype=np.float32)


cdef class Segmentation_PointXYZRGBA:
"""
Segmentation class for Sample Consensus methods and models
Expand Down Expand Up @@ -155,3 +212,21 @@ cdef class Segmentation_PointXYZRGBA:
self.me.setDistanceThreshold (d)


def set_eps_angle(self, double ea):
(<pcl_seg.SACSegmentation_PointXYZRGBA_t*>self.me).setEpsAngle (ea)


def get_eps_angle(self):
return (<pcl_seg.SACSegmentation_PointXYZRGBA_t*>self.me).getEpsAngle()


def set_axis(self, double ax1, double ax2, double ax3):
cdef eigen3.Vector3f* vec = new eigen3.Vector3f(ax1, ax2, ax3)
(<pcl_seg.SACSegmentation_PointXYZRGBA_t*>self.me).setAxis(deref(vec))


def get_axis(self):
vec = (<pcl_seg.SACSegmentation_PointXYZRGBA_t*>self.me).getAxis()
cdef float *data = vec.data()
return np.array([data[0], data[1], data[2]], dtype=np.float32)

76 changes: 75 additions & 1 deletion pcl/pxi/Segmentation/Segmentation_180.pxi
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,29 @@ cdef class Segmentation:
self.me.setDistanceThreshold (d)


def set_MaxIterations(self, int count):
def set_max_iterations(self, int count):
self.me.setMaxIterations (count)


def set_eps_angle(self, double ea):
(<pcl_seg.SACSegmentation_t*>self.me).setEpsAngle (ea)


def get_eps_angle(self):
return (<pcl_seg.SACSegmentation_t*>self.me).getEpsAngle()


def set_axis(self, double ax1, double ax2, double ax3):
cdef eigen3.Vector3f* vec = new eigen3.Vector3f(ax1, ax2, ax3)
(<pcl_seg.SACSegmentation_t*>self.me).setAxis(deref(vec))


def get_axis(self):
vec = (<pcl_seg.SACSegmentation_t*>self.me).getAxis()
cdef float *data = vec.data()
return np.array([data[0], data[1], data[2]], dtype=np.float32)


cdef class Segmentation_PointXYZI:
"""
Segmentation class for Sample Consensus methods and models
Expand Down Expand Up @@ -83,6 +102,25 @@ cdef class Segmentation_PointXYZI:
self.me.setDistanceThreshold (d)


def set_eps_angle(self, double ea):
(<pcl_seg.SACSegmentation_PointXYZI_t*>self.me).setEpsAngle (ea)


def get_eps_angle(self):
return (<pcl_seg.SACSegmentation_PointXYZI_t*>self.me).getEpsAngle()


def set_axis(self, double ax1, double ax2, double ax3):
cdef eigen3.Vector3f* vec = new eigen3.Vector3f(ax1, ax2, ax3)
(<pcl_seg.SACSegmentation_PointXYZI_t*>self.me).setAxis(deref(vec))


def get_axis(self):
vec = (<pcl_seg.SACSegmentation_PointXYZI_t*>self.me).getAxis()
cdef float *data = vec.data()
return np.array([data[0], data[1], data[2]], dtype=np.float32)


cdef class Segmentation_PointXYZRGB:
"""
Segmentation class for Sample Consensus methods and models
Expand Down Expand Up @@ -119,6 +157,24 @@ cdef class Segmentation_PointXYZRGB:
self.me.setDistanceThreshold (d)


def set_eps_angle(self, double ea):
(<pcl_seg.SACSegmentation_PointXYZRGB_t*>self.me).setEpsAngle (ea)

def get_eps_angle(self):
return (<pcl_seg.SACSegmentation_PointXYZRGB_t*>self.me).getEpsAngle()


def set_axis(self, double ax1, double ax2, double ax3):
cdef eigen3.Vector3f* vec = new eigen3.Vector3f(ax1, ax2, ax3)
(<pcl_seg.SACSegmentation_PointXYZRGB_t*>self.me).setAxis(deref(vec))


def get_axis(self):
vec = (<pcl_seg.SACSegmentation_PointXYZRGB_t*>self.me).getAxis()
cdef float *data = vec.data()
return np.array([data[0], data[1], data[2]], dtype=np.float32)


cdef class Segmentation_PointXYZRGBA:
"""
Segmentation class for Sample Consensus methods and models
Expand Down Expand Up @@ -155,3 +211,21 @@ cdef class Segmentation_PointXYZRGBA:
self.me.setDistanceThreshold (d)


def set_eps_angle(self, double ea):
(<pcl_seg.SACSegmentation_PointXYZRGBA_t*>self.me).setEpsAngle (ea)


def get_eps_angle(self):
return (<pcl_seg.SACSegmentation_PointXYZRGBA_t*>self.me).getEpsAngle()


def set_axis(self, double ax1, double ax2, double ax3):
cdef eigen3.Vector3f* vec = new eigen3.Vector3f(ax1, ax2, ax3)
(<pcl_seg.SACSegmentation_PointXYZRGBA_t*>self.me).setAxis(deref(vec))


def get_axis(self):
vec = (<pcl_seg.SACSegmentation_PointXYZRGBA_t*>self.me).getAxis()
cdef float *data = vec.data()
return np.array([data[0], data[1], data[2]], dtype=np.float32)