From c03c0918173191076e75655b6a41c4c2a7862962 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Albert=20Clap=C3=A9s?= Date: Tue, 13 Aug 2019 23:18:38 +0200 Subject: [PATCH 1/2] Ignore PyCharm files --- .gitignore | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.gitignore b/.gitignore index ffb5d8d44..0e2246174 100644 --- a/.gitignore +++ b/.gitignore @@ -35,3 +35,6 @@ pip-log.txt # Vim *.sw[op] + +# PyCharm +.idea/ From 5cdcde16c98a50e0b3cd81e594d8d3ee6b87fd97 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Albert=20Clap=C3=A9s?= Date: Tue, 13 Aug 2019 23:20:57 +0200 Subject: [PATCH 2/2] Added: set/get_eps_angle and set/get_axis to SACSegmentation classes --- pcl/pxi/Segmentation/Segmentation.pxi | 78 ++++++++++++++++++++++- pcl/pxi/Segmentation/Segmentation_172.pxi | 77 +++++++++++++++++++++- pcl/pxi/Segmentation/Segmentation_180.pxi | 76 +++++++++++++++++++++- 3 files changed, 228 insertions(+), 3 deletions(-) diff --git a/pcl/pxi/Segmentation/Segmentation.pxi b/pcl/pxi/Segmentation/Segmentation.pxi index cb1ef0730..29a7bf393 100644 --- a/pcl/pxi/Segmentation/Segmentation.pxi +++ b/pcl/pxi/Segmentation/Segmentation.pxi @@ -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): + (self.me).setEpsAngle (ea) + + + def get_eps_angle(self): + return (self.me).getEpsAngle() + + + def set_axis(self, double ax1, double ax2, double ax3): + cdef eigen3.Vector3f* vec = new eigen3.Vector3f(ax1, ax2, ax3) + (self.me).setAxis(deref(vec)) + + + def get_axis(self): + vec = (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 @@ -83,6 +102,25 @@ cdef class Segmentation_PointXYZI: self.me.setDistanceThreshold (d) + def set_eps_angle(self, double ea): + (self.me).setEpsAngle (ea) + + + def get_eps_angle(self): + return (self.me).getEpsAngle() + + + def set_axis(self, double ax1, double ax2, double ax3): + cdef eigen3.Vector3f* vec = new eigen3.Vector3f(ax1, ax2, ax3) + (self.me).setAxis(deref(vec)) + + + def get_axis(self): + vec = (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 @@ -119,6 +157,25 @@ cdef class Segmentation_PointXYZRGB: self.me.setDistanceThreshold (d) + def set_eps_angle(self, double ea): + (self.me).setEpsAngle (ea) + + + def get_eps_angle(self): + return (self.me).getEpsAngle() + + + def set_axis(self, double ax1, double ax2, double ax3): + cdef eigen3.Vector3f* vec = new eigen3.Vector3f(ax1, ax2, ax3) + (self.me).setAxis(deref(vec)) + + + def get_axis(self): + vec = (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 @@ -155,3 +212,22 @@ cdef class Segmentation_PointXYZRGBA: self.me.setDistanceThreshold (d) + def set_eps_angle(self, double ea): + (self.me).setEpsAngle (ea) + + + def get_eps_angle(self): + return (self.me).getEpsAngle() + + + def set_axis(self, double ax1, double ax2, double ax3): + cdef eigen3.Vector3f* vec = new eigen3.Vector3f(ax1, ax2, ax3) + (self.me).setAxis(deref(vec)) + + + def get_axis(self): + vec = (self.me).getAxis() + cdef float *data = vec.data() + return np.array([data[0], data[1], data[2]], dtype=np.float32) + + diff --git a/pcl/pxi/Segmentation/Segmentation_172.pxi b/pcl/pxi/Segmentation/Segmentation_172.pxi index 299af5e92..d442a3624 100644 --- a/pcl/pxi/Segmentation/Segmentation_172.pxi +++ b/pcl/pxi/Segmentation/Segmentation_172.pxi @@ -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): + (self.me).setEpsAngle (ea) + + + def get_eps_angle(self): + return (self.me).getEpsAngle() + + + def set_axis(self, double ax1, double ax2, double ax3): + cdef eigen3.Vector3f* vec = new eigen3.Vector3f(ax1, ax2, ax3) + (self.me).setAxis(deref(vec)) + + + def get_axis(self): + vec = (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 @@ -83,6 +102,25 @@ cdef class Segmentation_PointXYZI: self.me.setDistanceThreshold (d) + def set_eps_angle(self, double ea): + (self.me).setEpsAngle (ea) + + + def get_eps_angle(self): + return (self.me).getEpsAngle() + + + def set_axis(self, double ax1, double ax2, double ax3): + cdef eigen3.Vector3f* vec = new eigen3.Vector3f(ax1, ax2, ax3) + (self.me).setAxis(deref(vec)) + + + def get_axis(self): + vec = (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 @@ -119,6 +157,25 @@ cdef class Segmentation_PointXYZRGB: self.me.setDistanceThreshold (d) + def set_eps_angle(self, double ea): + (self.me).setEpsAngle (ea) + + + def get_eps_angle(self): + return (self.me).getEpsAngle() + + + def set_axis(self, double ax1, double ax2, double ax3): + cdef eigen3.Vector3f* vec = new eigen3.Vector3f(ax1, ax2, ax3) + (self.me).setAxis(deref(vec)) + + + def get_axis(self): + vec = (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 @@ -155,3 +212,21 @@ cdef class Segmentation_PointXYZRGBA: self.me.setDistanceThreshold (d) + def set_eps_angle(self, double ea): + (self.me).setEpsAngle (ea) + + + def get_eps_angle(self): + return (self.me).getEpsAngle() + + + def set_axis(self, double ax1, double ax2, double ax3): + cdef eigen3.Vector3f* vec = new eigen3.Vector3f(ax1, ax2, ax3) + (self.me).setAxis(deref(vec)) + + + def get_axis(self): + vec = (self.me).getAxis() + cdef float *data = vec.data() + return np.array([data[0], data[1], data[2]], dtype=np.float32) + diff --git a/pcl/pxi/Segmentation/Segmentation_180.pxi b/pcl/pxi/Segmentation/Segmentation_180.pxi index b7134cbc9..f76745762 100644 --- a/pcl/pxi/Segmentation/Segmentation_180.pxi +++ b/pcl/pxi/Segmentation/Segmentation_180.pxi @@ -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): + (self.me).setEpsAngle (ea) + + + def get_eps_angle(self): + return (self.me).getEpsAngle() + + + def set_axis(self, double ax1, double ax2, double ax3): + cdef eigen3.Vector3f* vec = new eigen3.Vector3f(ax1, ax2, ax3) + (self.me).setAxis(deref(vec)) + + + def get_axis(self): + vec = (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 @@ -83,6 +102,25 @@ cdef class Segmentation_PointXYZI: self.me.setDistanceThreshold (d) + def set_eps_angle(self, double ea): + (self.me).setEpsAngle (ea) + + + def get_eps_angle(self): + return (self.me).getEpsAngle() + + + def set_axis(self, double ax1, double ax2, double ax3): + cdef eigen3.Vector3f* vec = new eigen3.Vector3f(ax1, ax2, ax3) + (self.me).setAxis(deref(vec)) + + + def get_axis(self): + vec = (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 @@ -119,6 +157,24 @@ cdef class Segmentation_PointXYZRGB: self.me.setDistanceThreshold (d) + def set_eps_angle(self, double ea): + (self.me).setEpsAngle (ea) + + def get_eps_angle(self): + return (self.me).getEpsAngle() + + + def set_axis(self, double ax1, double ax2, double ax3): + cdef eigen3.Vector3f* vec = new eigen3.Vector3f(ax1, ax2, ax3) + (self.me).setAxis(deref(vec)) + + + def get_axis(self): + vec = (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 @@ -155,3 +211,21 @@ cdef class Segmentation_PointXYZRGBA: self.me.setDistanceThreshold (d) + def set_eps_angle(self, double ea): + (self.me).setEpsAngle (ea) + + + def get_eps_angle(self): + return (self.me).getEpsAngle() + + + def set_axis(self, double ax1, double ax2, double ax3): + cdef eigen3.Vector3f* vec = new eigen3.Vector3f(ax1, ax2, ax3) + (self.me).setAxis(deref(vec)) + + + def get_axis(self): + vec = (self.me).getAxis() + cdef float *data = vec.data() + return np.array([data[0], data[1], data[2]], dtype=np.float32) +