• 大小: 34.35MB
    文件类型: .zip
    金币: 2
    下载: 1 次
    发布日期: 2023-07-11
  • 语言: 其他
  • 标签: 点云  

资源简介

点云处理类的开源代码CloudCompare v2.9.1版,有需要的可以下载!

资源截图

代码片段和文件信息

//##########################################################################
//#                                                                        #
//#                               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 or later 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 “AutoSegmentationTools.h“

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

using namespace CCLib;

int AutoSegmentationTools::labelConnectedComponents(GenericIndexedCloudPersist* theCloud
unsigned char level
bool sixConnexity/*=false*/
GenericProgressCallback* progressCb/*=0*/
DgmOctree* inputOctree/*=0*/)
{
if (!theCloud)
{
return -1;
}

//compute octree if none was provided
DgmOctree* theOctree = inputOctree;
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(level sixConnexity progressCb);

//remove octree if it was not provided as input
if (theOctree && !inputOctree)
{
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;
}

//empty the input vector if necessary
while (!cc.empty())
{
delete cc.back();
cc.pop_back();
}

for (unsigned i = 0; i < numberOfPoints; ++i)
{
ScalarType slabel = theCloud->getPointScalarValue(i);
if (slabel >= 1) //labe

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----
     目录           0  2017-11-03 11:30  CloudCompare\
     文件         483  2017-11-03 11:30  CloudCompare\.gitattributes
     目录           0  2017-11-03 11:30  CloudCompare\.github\
     文件         929  2017-11-03 11:30  CloudCompare\.github\ISSUE_TEMPLATE.md
     文件        1916  2017-11-03 11:30  CloudCompare\.gitignore
     文件         547  2017-11-03 11:30  CloudCompare\.gitmodules
     目录           0  2017-11-03 11:30  CloudCompare\.snapcraft\
     文件        2400  2017-11-03 11:30  CloudCompare\.snapcraft\travis_snapcraft.cfg
     文件        1502  2017-11-03 11:30  CloudCompare\.travis.yml
     文件       14066  2017-11-03 11:30  CloudCompare\BUILD.md
     目录           0  2017-11-03 11:30  CloudCompare\CC\
     文件        1197  2017-11-03 11:30  CloudCompare\CC\CGALSupport.cmake
     文件        2341  2017-11-03 11:30  CloudCompare\CC\CMakeLists.txt
     目录           0  2017-11-03 11:30  CloudCompare\CC\doc\
     文件           7  2017-11-03 11:30  CloudCompare\CC\doc\.gitignore
     文件      107584  2017-11-03 11:30  CloudCompare\CC\doc\CCLib_doxygen_file
     文件        1384  2017-11-03 11:30  CloudCompare\CC\doc\cclib_logo.png
     目录           0  2017-11-03 11:30  CloudCompare\CC\include\
     文件        6653  2017-11-03 11:30  CloudCompare\CC\include\AutoSegmentationTools.h
     文件        4029  2017-11-03 11:30  CloudCompare\CC\include\CCConst.h
     文件        2202  2017-11-03 11:30  CloudCompare\CC\include\CCCoreLib.h
     文件       14223  2017-11-03 11:30  CloudCompare\CC\include\CCGeom.h
     文件        4071  2017-11-03 11:30  CloudCompare\CC\include\CCMiscTools.h
     文件        1870  2017-11-03 11:30  CloudCompare\CC\include\CCPlatform.h
     文件        2371  2017-11-03 11:30  CloudCompare\CC\include\CCShareable.h
     文件        1550  2017-11-03 11:30  CloudCompare\CC\include\CCToolbox.h
     文件        1532  2017-11-03 11:30  CloudCompare\CC\include\CCTypes.h
     文件        2946  2017-11-03 11:30  CloudCompare\CC\include\ChamferDistanceTransform.h
     文件       10585  2017-11-03 11:30  CloudCompare\CC\include\ChunkedPointCloud.h
     文件       14149  2017-11-03 11:30  CloudCompare\CC\include\CloudSamplingTools.h
     文件        4125  2017-11-03 11:30  CloudCompare\CC\include\ConjugateGradient.h
............此处省略2075个文件信息

评论

共有 条评论