资源简介

该代码是CloudCompare源码,中间有自己添加的两个基于PCL的插件,使用前需要事先编译好PCL,并且需在区域增长分割插件工程目录下按照readme文档,添加相关文件目录和文件。

资源截图

代码片段和文件信息

//##########################################################################
//#                                                                        #
//#                               CCLIB                                    #
//#                                                                        #
//#  This program is free software; you can redistribute it and/or modify  #
//#  it under the terms of the GNU Library General Public License as       #
//#  published by the Free Software Foundation; version 2 of the License.  #
//#                                                                        #
//#  This program is distributed in the hope that it will be useful       #
//#  but WITHOUT ANY WARRANTY; without even the implied warranty of        #
//#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         #
//#  GNU General Public License for more details.                          #
//#                                                                        #
//#          COPYRIGHT: EDF R&D / TELECOM ParisTech (ENST-TSI)             #
//#                                                                        #
//##########################################################################

#include “GenericChunkedArray.h“
#include “AutoSegmentationTools.h“

//local
#include “GenericIndexedCloudPersist.h“
#include “GenericProgressCallback.h“
#include “ReferenceCloud.h“
#include “DgmOctree.h“
#include “FastMarchingForPropagation.h“
#include “ScalarFieldTools.h“
#include “ScalarField.h“

//system
#include 

using namespace CCLib;

int AutoSegmentationTools::labelConnectedComponents(GenericIndexedCloudPersist* theCloud uchar level bool sixConnexity GenericProgressCallback* progressCb DgmOctree* _theOctree)
{
if (!theCloud)
return -1;

//compute octree if none was provided
DgmOctree* theOctree = _theOctree;
if (!theOctree)
{
theOctree = new DgmOctree(theCloud);
if (theOctree->build(progressCb)<1)
{
delete theOctree;
return -1;
}
}

//we use the default scalar field to store components labels
theCloud->enableScalarField();

int result = theOctree->extractCCs(levelsixConnexityprogressCb);

//remove octree if it was not provided as input
if (!_theOctree)
delete theOctree;

return result;
}

bool AutoSegmentationTools::extractConnectedComponents(GenericIndexedCloudPersist* theCloud ReferenceCloudContainer& cc)
{
unsigned numberOfPoints = (theCloud ? theCloud->size() : 0);
if (numberOfPoints == 0)
return false;

//components should have already been labeled and labels should have been stored in the active scalar field!
if (!theCloud->isScalarFieldEnabled())
return false;

cc.clear();

for (unsigned i=0;i {
ScalarType slabel = theCloud->getPointScalarValue(i);
if (slabel >= 1.0) //rejects NaN values as well
{
int ccLabel = (int)theCloud->getPointScalarValue(i)-1; //labels stat from 1!

//we fill the CCs vector with empty components until we reac

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----
     目录           0  2014-03-02 15:53  trunk-2.5.1\
     文件         483  2013-07-13 16:43  trunk-2.5.1\.gitattributes
     文件        1873  2013-07-13 16:43  trunk-2.5.1\.gitignore
     目录           0  2014-03-02 15:52  trunk-2.5.1\CC\
     文件        1469  2013-07-13 16:43  trunk-2.5.1\CC\CMakeLists.txt
     目录           0  2014-03-02 15:52  trunk-2.5.1\CC\doc\
     文件           7  2013-07-13 16:43  trunk-2.5.1\CC\doc\.gitignore
     文件       82224  2013-07-13 16:43  trunk-2.5.1\CC\doc\CCLib_doxygen_file
     文件        2832  2013-07-13 16:43  trunk-2.5.1\CC\doc\cclib_logo.png
     目录           0  2014-03-02 15:52  trunk-2.5.1\CC\include\
     文件        6466  2013-07-13 16:43  trunk-2.5.1\CC\include\AutoSegmentationTools.h
     文件        3553  2013-07-13 16:43  trunk-2.5.1\CC\include\CCConst.h
     文件        9160  2013-07-13 16:43  trunk-2.5.1\CC\include\CCGeom.h
     文件        3834  2013-07-13 16:43  trunk-2.5.1\CC\include\CCMiscTools.h
     文件        2336  2013-07-13 16:43  trunk-2.5.1\CC\include\CCShareable.h
     文件        1515  2013-07-13 16:43  trunk-2.5.1\CC\include\CCToolbox.h
     文件        1554  2013-07-13 16:43  trunk-2.5.1\CC\include\CCTypes.h
     文件        4896  2013-07-13 16:43  trunk-2.5.1\CC\include\ChamferDistanceTransform.h
     文件       10758  2013-07-13 16:43  trunk-2.5.1\CC\include\ChunkedPointCloud.h
     文件        1833  2013-07-13 16:43  trunk-2.5.1\CC\include\CloudCompareDll.h
     文件       10633  2013-07-13 16:43  trunk-2.5.1\CC\include\CloudSamplingTools.h
     文件        3991  2013-07-13 16:43  trunk-2.5.1\CC\include\ConjugateGradient.h
     文件        2507  2013-07-13 16:43  trunk-2.5.1\CC\include\DebugProgressCallback.h
     文件        3915  2013-07-13 16:43  trunk-2.5.1\CC\include\Delaunay2dMesh.h
     文件       49469  2013-07-13 16:43  trunk-2.5.1\CC\include\DgmOctree.h
     文件        4062  2013-07-13 16:43  trunk-2.5.1\CC\include\DgmOctreeReferenceCloud.h
     文件       19788  2013-07-13 16:43  trunk-2.5.1\CC\include\DistanceComputationTools.h
     文件        2579  2013-07-13 16:43  trunk-2.5.1\CC\include\ErrorFunction.h
     文件        6819  2013-07-13 16:43  trunk-2.5.1\CC\include\FastMarching.h
     文件        5176  2013-07-13 16:43  trunk-2.5.1\CC\include\FastMarchingForPropagation.h
     文件       30687  2013-07-13 16:43  trunk-2.5.1\CC\include\GenericChunkedArray.h
............此处省略1672个文件信息

评论

共有 条评论