/*********************************************************************** ** Image Component Library (ICL) ** ** ** ** Copyright (C) 2006-2013 CITEC, University of Bielefeld ** ** Neuroinformatics Group ** ** Website: www.iclcv.org and ** ** http://opensource.cit-ec.de/projects/icl ** ** ** ** File : ICLGeom/src/ICLGeom/CutfreeAdjacencyFeatureExtractor.cpp ** ** Module : ICLGeom ** ** Authors: Andre Ueckermann ** ** ** ** ** ** GNU LESSER GENERAL PUBLIC LICENSE ** ** This file may be used under the terms of the GNU Lesser General ** ** Public License version 3.0 as published by the ** ** ** ** Free Software Foundation and appearing in the file LICENSE.LGPL ** ** included in the packaging of this file. Please review the ** ** following information to ensure the license requirements will ** ** be met: http://www.gnu.org/licenses/lgpl-3.0.txt ** ** ** ** The development of this software was supported by the ** ** Excellence Cluster EXC 277 Cognitive Interaction Technology. ** ** The Excellence Cluster EXC 277 is a grant of the Deutsche ** ** Forschungsgemeinschaft (DFG) in the context of the German ** ** Excellence Initiative. ** ** ** **********************************************************************/ #include #include namespace icl { namespace geom { struct CutfreeAdjacencyFeatureExtractor::Data { Data(Mode mode) { if(mode==BEST || mode==GPU){ ransac=new PlanarRansacEstimator(PlanarRansacEstimator::GPU); }else{ ransac=new PlanarRansacEstimator(PlanarRansacEstimator::CPU); } } ~Data() { } PlanarRansacEstimator* ransac; }; CutfreeAdjacencyFeatureExtractor::CutfreeAdjacencyFeatureExtractor(Mode mode) : m_data(new Data(mode)) { } CutfreeAdjacencyFeatureExtractor::~CutfreeAdjacencyFeatureExtractor() { delete m_data; } math::DynMatrix CutfreeAdjacencyFeatureExtractor::apply(core::DataSegment &xyzh, std::vector > &surfaces, math::DynMatrix &testMatrix, float euclideanDistance, int passes, int tolerance, core::Img32s labelImage){ math::DynMatrix cutfreeMatrix(testMatrix); for(unsigned int x=0; x result = m_data->ransac->apply(xyzh, surfaces, cutfreeMatrix, euclideanDistance, passes, tolerance, PlanarRansacEstimator::ON_ONE_SIDE, labelImage); for(unsigned int x=0; x=result(x,y).acc){ cutfreeMatrix(x,y)=false; cutfreeMatrix(y,x)=false; } } } return cutfreeMatrix; } math::DynMatrix CutfreeAdjacencyFeatureExtractor::apply(core::DataSegment &xyzh, std::vector > &surfaces, math::DynMatrix &testMatrix, float euclideanDistance, int passes, int tolerance, core::Img32s labelImage, std::vector feature, float minAngle){ math::DynMatrix cutfreeMatrix(testMatrix); for(unsigned int x=0; x result = m_data->ransac->apply(xyzh, surfaces, cutfreeMatrix, euclideanDistance, passes, tolerance, PlanarRansacEstimator::ON_ONE_SIDE, labelImage); for(unsigned int x=0; x=result(x,y).acc){ cutfreeMatrix(x,y)=false; cutfreeMatrix(y,x)=false; } } } return cutfreeMatrix; } } // namespace geom }