Version 18.55
This commit is contained in:
@@ -141,6 +141,8 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Reconstruction.example", "R
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "PointsToDisks", "PointsToDisks.vcxproj", "{6AE727A9-A3F0-4970-8F5B-1F1A3AEAC552}"
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ScaleNormals", "ScaleNormals.vcxproj", "{BB5F81BE-3FDD-4BB3-9358-9B908C3644DE}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|x64 = Debug|x64
|
||||
@@ -270,6 +272,14 @@ Global
|
||||
{6AE727A9-A3F0-4970-8F5B-1F1A3AEAC552}.Release|x64.Build.0 = Release|x64
|
||||
{6AE727A9-A3F0-4970-8F5B-1F1A3AEAC552}.Release|x86.ActiveCfg = Release|Win32
|
||||
{6AE727A9-A3F0-4970-8F5B-1F1A3AEAC552}.Release|x86.Build.0 = Release|Win32
|
||||
{BB5F81BE-3FDD-4BB3-9358-9B908C3644DE}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{BB5F81BE-3FDD-4BB3-9358-9B908C3644DE}.Debug|x64.Build.0 = Debug|x64
|
||||
{BB5F81BE-3FDD-4BB3-9358-9B908C3644DE}.Debug|x86.ActiveCfg = Debug|Win32
|
||||
{BB5F81BE-3FDD-4BB3-9358-9B908C3644DE}.Debug|x86.Build.0 = Debug|Win32
|
||||
{BB5F81BE-3FDD-4BB3-9358-9B908C3644DE}.Release|x64.ActiveCfg = Release|x64
|
||||
{BB5F81BE-3FDD-4BB3-9358-9B908C3644DE}.Release|x64.Build.0 = Release|x64
|
||||
{BB5F81BE-3FDD-4BB3-9358-9B908C3644DE}.Release|x86.ActiveCfg = Release|Win32
|
||||
{BB5F81BE-3FDD-4BB3-9358-9B908C3644DE}.Release|x86.Build.0 = Release|Win32
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
|
||||
@@ -10,6 +10,7 @@ AV_TARGET=AdaptiveTreeVisualization
|
||||
CP_TARGET=ChunkPLY
|
||||
RE_TARGET=ReconExample
|
||||
PTD_TARGET=PointsToDisks
|
||||
SN_TARGET=ScaleNormals
|
||||
|
||||
PR_SOURCE=PoissonRecon.cpp
|
||||
PRC_SOURCE=PoissonReconClient.cpp
|
||||
@@ -23,6 +24,7 @@ AV_SOURCE=AdaptiveTreeVisualization.cpp
|
||||
CP_SOURCE=ChunkPLY.cpp
|
||||
RE_SOURCE=Reconstruction.example.cpp
|
||||
PTD_SOURCE=PointsToDisks.cpp
|
||||
SN_SOURCE=ScaleNormals.cpp
|
||||
|
||||
COMPILER ?= gcc
|
||||
#COMPILER ?= clang
|
||||
@@ -81,6 +83,7 @@ AV_OBJECTS=$(addprefix $(BIN), $(addsuffix .o, $(basename $(AV_SOURCE))))
|
||||
CP_OBJECTS=$(addprefix $(BIN), $(addsuffix .o, $(basename $(CP_SOURCE))))
|
||||
RE_OBJECTS=$(addprefix $(BIN), $(addsuffix .o, $(basename $(RE_SOURCE))))
|
||||
PTD_OBJECTS=$(addprefix $(BIN), $(addsuffix .o, $(basename $(PTD_SOURCE))))
|
||||
SN_OBJECTS=$(addprefix $(BIN), $(addsuffix .o, $(basename $(SN_SOURCE))))
|
||||
|
||||
|
||||
all: CFLAGS += $(CFLAGS_RELEASE)
|
||||
@@ -175,6 +178,11 @@ pointstodisks: LFLAGS += $(LFLAGS_RELEASE)
|
||||
pointstodisks: make_dir
|
||||
pointstodisks: $(BIN)$(PTD_TARGET)
|
||||
|
||||
scalenormals: CFLAGS += $(CFLAGS_RELEASE)
|
||||
scalenormals: LFLAGS += $(LFLAGS_RELEASE)
|
||||
scalenormals: make_dir
|
||||
scalenormals: $(BIN)$(SN_TARGET)
|
||||
|
||||
clean:
|
||||
rm -rf $(BIN)$(PR_TARGET)
|
||||
rm -rf $(BIN)$(PRC_TARGET)
|
||||
@@ -199,9 +207,9 @@ clean:
|
||||
rm -rf $(CP_OBJECTS)
|
||||
rm -rf $(RE_OBJECTS)
|
||||
rm -rf $(PTD_OBJECTS)
|
||||
rm -rf $(SN_OBJECTS)
|
||||
cd PNG && make clean
|
||||
|
||||
|
||||
make_dir:
|
||||
$(MD) -p $(BIN)
|
||||
|
||||
@@ -247,6 +255,9 @@ $(BIN)$(RE_TARGET): $(RE_OBJECTS)
|
||||
$(BIN)$(PTD_TARGET): $(PTD_OBJECTS)
|
||||
$(CXX) -pthread -o $@ $(PTD_OBJECTS) -L$(BIN) $(LFLAGS)
|
||||
|
||||
$(BIN)$(SN_TARGET): $(SN_OBJECTS)
|
||||
$(CXX) -pthread -o $@ $(SN_OBJECTS) -L$(BIN) $(LFLAGS)
|
||||
|
||||
$(BIN)%.o: $(SRC)%.c
|
||||
$(CC) -c -o $@ -I$(INCLUDE) $<
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
<center><h2>Adaptive Multigrid Solvers (Version 18.50)</h2></center>
|
||||
<center><h2>Adaptive Multigrid Solvers (Version 18.55)</h2></center>
|
||||
<center>
|
||||
<a href="#LINKS">links</a>
|
||||
<a href="#COMPILATION">compilation</a>
|
||||
@@ -29,10 +29,11 @@ This code-base was born from the Poisson Surface Reconstruction code. It has evo
|
||||
<a href="https://www.cs.jhu.edu/~misha/MyPapers/CGF23.pdf">[Kazhdan and Hoppe, 2023]</a>
|
||||
<br>
|
||||
<b>Executables: </b>
|
||||
<a href="https://www.cs.jhu.edu/~misha/Code/PoissonRecon/Version18.50/AdaptiveSolvers.x64.zip">Win64</a><br>
|
||||
<a href="https://www.cs.jhu.edu/~misha/Code/PoissonRecon/Version18.55/AdaptiveSolvers.x64.zip">Win64</a><br>
|
||||
<b>Source Code:</b>
|
||||
<a href="https://www.cs.jhu.edu/~misha/Code/PoissonRecon/Version18.50/AdaptiveSolvers.zip">ZIP</a> <a href="https://github.com/mkazhdan/PoissonRecon">GitHub</a><br>
|
||||
<a href="https://www.cs.jhu.edu/~misha/Code/PoissonRecon/Version18.55/AdaptiveSolvers.zip">ZIP</a> <a href="https://github.com/mkazhdan/PoissonRecon">GitHub</a><br>
|
||||
<b>Older Versions:</b>
|
||||
<a href="https://www.cs.jhu.edu/~misha/Code/PoissonRecon/Version18.42/">V18.50</a>,
|
||||
<a href="https://www.cs.jhu.edu/~misha/Code/PoissonRecon/Version18.42/">V18.42</a>,
|
||||
<a href="https://www.cs.jhu.edu/~misha/Code/PoissonRecon/Version18.41/">V18.41</a>,
|
||||
<a href="https://www.cs.jhu.edu/~misha/Code/PoissonRecon/Version18.40/">V18.40</a>,
|
||||
@@ -1040,6 +1041,37 @@ If both the <b>--keep</b> flag and the <b>--fraction</b> flag are set, the <b>--
|
||||
</dl>
|
||||
</ul>
|
||||
|
||||
<ul>
|
||||
<dl>
|
||||
<DETAILS>
|
||||
<SUMMARY>
|
||||
<font size="+1"><b>ScaleNormals</b></font>:
|
||||
Scales the normal magnitudes using auxiliary confidence attributes encoded with the samples.
|
||||
</SUMMARY>
|
||||
<dt><b>--in</b> <<i>input points</i>>
|
||||
</dt><dd> This string is the name of the file from which the point set will be read.<br>
|
||||
The file is assumed to be in <a href="https://www.cc.gatech.edu/projects/large_models/ply.html">PLY</a> format.<br>
|
||||
|
||||
</dd><dt><b>--out</b> <<i>output ply file name</i>>
|
||||
</dt><dd> This string is the name of the file to which the point set should be written.<br>
|
||||
The file will be written out in <a href="https://www.cc.gatech.edu/projects/large_models/ply.html">PLY</a> format.<br>
|
||||
|
||||
</dd><dt><b>--cNames</b> <<i>confidence attribute count, confidence attribute name 1, confidence attribute name 2, ...</i>>]
|
||||
</dt><dd> These strings give the names of the attributes encoding confidence information.<BR>
|
||||
|
||||
</dd><dt><b>--cExps</b> <<i>confidence attribute count, confidence attribute value 1, confidence attribute value 2, ...</i>>]
|
||||
</dt><dd> These floating point values encode the exponents applied to the confidence attributes when scaling the normal magnitude.<BR>
|
||||
Note that the count of confidence attributes for the <B>--cNames</B> and <B>--cExps</B> need to match.
|
||||
|
||||
</dd><dt>[<b>--verbose</b>]
|
||||
</dt><dd> Enabling this flag provides a description of running state.
|
||||
|
||||
</dd>
|
||||
</DETAILS>
|
||||
</dl>
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
<hr>
|
||||
<a name="LIBRARY"><b>HEADER-ONLY LIBRARY</b></a><br>
|
||||
@@ -1732,6 +1764,11 @@ Similarly, to reduce compilation times, support for specific degrees can be remo
|
||||
<LI> Cleaned-up multi-threading code.
|
||||
</OL>
|
||||
|
||||
<a href="https://www.cs.jhu.edu/~misha/Code/PoissonRecon/Version18.50/">Version 18.55</a>:
|
||||
<OL>
|
||||
<LI> Added the <b>ScaleNormals</B> executable.
|
||||
</OL>
|
||||
|
||||
</DETAILS>
|
||||
|
||||
<hr>
|
||||
|
||||
@@ -0,0 +1,141 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup Label="ProjectConfigurations">
|
||||
<ProjectConfiguration Include="Debug|Win32">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|Win32">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Debug|x64">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|x64">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="Src\ScaleNormals.cpp" />
|
||||
</ItemGroup>
|
||||
<PropertyGroup Label="Globals">
|
||||
<VCProjectVersion>17.0</VCProjectVersion>
|
||||
<Keyword>Win32Proj</Keyword>
|
||||
<ProjectGuid>{bb5f81be-3fdd-4bb3-9358-9b908c3644de}</ProjectGuid>
|
||||
<RootNamespace>ScaleNormals</RootNamespace>
|
||||
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>true</UseDebugLibraries>
|
||||
<PlatformToolset>v143</PlatformToolset>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
<PlatformToolset>v143</PlatformToolset>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>true</UseDebugLibraries>
|
||||
<PlatformToolset>v143</PlatformToolset>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
<PlatformToolset>v143</PlatformToolset>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
||||
<ImportGroup Label="ExtensionSettings">
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="Shared">
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<PropertyGroup Label="UserMacros" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<OutDir>$(SolutionDir)\Bin\$(Platform)\$(Configuration)\</OutDir>
|
||||
<IntDir>$(SolutionDir)\Obj\$(TargetName)\$(Platform)\$(Configuration)\</IntDir>
|
||||
</PropertyGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<ClCompile>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<ConformanceMode>true</ConformanceMode>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<ClCompile>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<ConformanceMode>true</ConformanceMode>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<ClCompile>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<PreprocessorDefinitions>_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<ConformanceMode>true</ConformanceMode>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<ClCompile>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<PreprocessorDefinitions>NOMINMAX;_CRT_SECURE_NO_WARNINGS;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<ConformanceMode>true</ConformanceMode>
|
||||
<LanguageStandard>stdcpp17</LanguageStandard>
|
||||
<OpenMPSupport>true</OpenMPSupport>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
<ImportGroup Label="ExtensionTargets">
|
||||
</ImportGroup>
|
||||
</Project>
|
||||
+2
-2
@@ -2625,11 +2625,11 @@ namespace PoissonRecon
|
||||
template< unsigned int CoDim , unsigned int DensityDegree >
|
||||
typename FEMTree::template DensityEstimator< DensityDegree > *setDensityEstimator( const std::vector< PointSample >& samples , LocalDepth splatDepth , Real samplesPerNode );
|
||||
template< unsigned int CoDim , unsigned int DensityDegree >
|
||||
void updateDensityEstimator( typename FEMTree::template DensityEstimator< DensityDegree > &density , const std::vector< PointSample >& samples , LocalDepth minSplatDepth , LocalDepth maxSplatDepth , Real samplesPerNode );
|
||||
void updateDensityEstimator( typename FEMTree::template DensityEstimator< DensityDegree > &density , const std::vector< PointSample >& samples , LocalDepth minSplatDepth , LocalDepth maxSplatDepth );
|
||||
template< unsigned int CoDim , unsigned int DensityDegree >
|
||||
typename FEMTree::template DensityEstimator< DensityDegree > *setDensityEstimator( const std::vector< PointSample >& samples , LocalDepth splatDepth , std::function< int ( Point< Real , Dim > ) > pointDepthFunctor , Real samplesPerNode );
|
||||
template< unsigned int CoDim , unsigned int DensityDegree >
|
||||
void updateDensityEstimator( typename FEMTree::template DensityEstimator< DensityDegree > &density , const std::vector< PointSample >& samples , LocalDepth minSplatDepth , LocalDepth maxSplatDepth , std::function< int ( Point< Real , Dim > ) > pointDepthFunctor , Real samplesPerNode );
|
||||
void updateDensityEstimator( typename FEMTree::template DensityEstimator< DensityDegree > &density , const std::vector< PointSample >& samples , LocalDepth minSplatDepth , LocalDepth maxSplatDepth , std::function< int ( Point< Real , Dim > ) > pointDepthFunctor );
|
||||
|
||||
template< unsigned int ... DataSigs , unsigned int DensityDegree , class InData , class OutData >
|
||||
SparseNodeData< OutData , UIntPack< DataSigs ... > > setInterpolatedDataField( OutData zero , UIntPack< DataSigs ... > , const std::vector< PointSample >& samples , const std::vector< InData >& data , const DensityEstimator< DensityDegree >* density , LocalDepth minDepth , LocalDepth maxDepth , Real minDepthCutoff , ProjectiveData< Point< Real , 2 > , Real > &pointDepthAndWeight , std::function< bool ( InData , OutData & , Real & ) > ConversionAndBiasFunction );
|
||||
|
||||
+4
-4
@@ -788,7 +788,7 @@ typename FEMTree< Dim , Real >::template ApproximatePointAndDataInterpolationInf
|
||||
|
||||
template< unsigned int Dim , class Real >
|
||||
template< unsigned int CoDim , unsigned int DensityDegree >
|
||||
void FEMTree< Dim , Real >::updateDensityEstimator( typename FEMTree< Dim , Real >::template DensityEstimator< DensityDegree > &density , const std::vector< PointSample >& samples , LocalDepth minSplatDepth , LocalDepth maxSplatDepth , Real samplesPerNode )
|
||||
void FEMTree< Dim , Real >::updateDensityEstimator( typename FEMTree< Dim , Real >::template DensityEstimator< DensityDegree > &density , const std::vector< PointSample >& samples , LocalDepth minSplatDepth , LocalDepth maxSplatDepth )
|
||||
{
|
||||
// typename FEMTreeNode::SubTreeExtractor subtreeExtractor( _spaceRoot );
|
||||
SubTreeExtractor subtreeExtractor( _spaceRoot , _depthOffset );
|
||||
@@ -820,7 +820,7 @@ void FEMTree< Dim , Real >::updateDensityEstimator( typename FEMTree< Dim , Real
|
||||
|
||||
template< unsigned int Dim , class Real >
|
||||
template< unsigned int CoDim , unsigned int DensityDegree >
|
||||
void FEMTree< Dim , Real >::updateDensityEstimator( typename FEMTree< Dim , Real >::template DensityEstimator< DensityDegree > &density , const std::vector< PointSample >& samples , LocalDepth minSplatDepth , LocalDepth maxSplatDepth , std::function< int ( Point< Real , Dim > ) > pointDepthFunctor , Real samplesPerNode )
|
||||
void FEMTree< Dim , Real >::updateDensityEstimator( typename FEMTree< Dim , Real >::template DensityEstimator< DensityDegree > &density , const std::vector< PointSample >& samples , LocalDepth minSplatDepth , LocalDepth maxSplatDepth , std::function< int ( Point< Real , Dim > ) > pointDepthFunctor )
|
||||
{
|
||||
// typename FEMTreeNode::SubTreeExtractor subtreeExtractor( _spaceRoot );
|
||||
SubTreeExtractor subtreeExtractor( _spaceRoot , _depthOffset );
|
||||
@@ -863,7 +863,7 @@ typename FEMTree< Dim , Real >::template DensityEstimator< DensityDegree >* FEMT
|
||||
LocalDepth maxDepth = _spaceRoot->maxDepth();
|
||||
splatDepth = std::max< LocalDepth >( 0 , std::min< LocalDepth >( splatDepth , maxDepth ) );
|
||||
DensityEstimator< DensityDegree > *density = new DensityEstimator< DensityDegree >( splatDepth , CoDim , samplesPerNode );
|
||||
this->template updateDensityEstimator< CoDim , DensityDegree >( *density , samples , 0 , splatDepth , samplesPerNode );
|
||||
this->template updateDensityEstimator< CoDim , DensityDegree >( *density , samples , 0 , splatDepth );
|
||||
|
||||
return density;
|
||||
}
|
||||
@@ -875,7 +875,7 @@ typename FEMTree< Dim , Real >::template DensityEstimator< DensityDegree >* FEMT
|
||||
LocalDepth maxDepth = _spaceRoot->maxDepth();
|
||||
splatDepth = std::max< LocalDepth >( 0 , std::min< LocalDepth >( splatDepth , maxDepth ) );
|
||||
DensityEstimator< DensityDegree > *density = new DensityEstimator< DensityDegree >( splatDepth , CoDim , samplesPerNode );
|
||||
this->template updateDensityEstimator< CoDim , DensityDegree >( *density , samples , 0 , splatDepth , pointDepthFunctor , samplesPerNode );
|
||||
this->template updateDensityEstimator< CoDim , DensityDegree >( *density , samples , 0 , splatDepth , pointDepthFunctor );
|
||||
|
||||
return density;
|
||||
}
|
||||
|
||||
@@ -597,9 +597,9 @@ void Client< Real , Dim , BType , Degree >::_process1( const ClientReconstructio
|
||||
Timer timer;
|
||||
_density = _tree.template setDensityEstimator< 1 , Reconstructor::WeightDegree >( _samples , clientReconInfo.kernelDepth , clientReconInfo.samplesPerNode );
|
||||
#ifdef ADAPTIVE_PADDING
|
||||
_tree.template updateDensityEstimator< 1 , Reconstructor::WeightDegree >( *_density , _paddedSamples , 0 , clientReconInfo.kernelDepth , pointDepthFunctor , clientReconInfo.samplesPerNode );
|
||||
_tree.template updateDensityEstimator< 1 , Reconstructor::WeightDegree >( *_density , _paddedSamples , 0 , clientReconInfo.kernelDepth , pointDepthFunctor );
|
||||
#else // !ADAPTIVE_PADDING
|
||||
_tree.template updateDensityEstimator< 1 , Reconstructor::WeightDegree >( *_density , _paddedSamples , 0 , clientReconInfo.kernelDepth , clientReconInfo.samplesPerNode );
|
||||
_tree.template updateDensityEstimator< 1 , Reconstructor::WeightDegree >( *_density , _paddedSamples , 0 , clientReconInfo.kernelDepth );
|
||||
#endif // ADAPTIVE_PADDING
|
||||
profiler.update();
|
||||
if( clientReconInfo.verbose>1 ) std::cout << "# Got kernel density: " << timer << std::endl;
|
||||
|
||||
+1
-1
@@ -46,7 +46,7 @@ DAMAGE.
|
||||
#define USE_DEEP_TREE_NODES // Chances are that if you are using big data, you want to support a tree with depth>15.
|
||||
#endif // BIG_DATA
|
||||
|
||||
#define ADAPTIVE_SOLVERS_VERSION "18.50" // The version of the code
|
||||
#define ADAPTIVE_SOLVERS_VERSION "18.55" // The version of the code
|
||||
#define MEMORY_ALLOCATOR_BLOCK_SIZE 1<<12 // The chunk size for memory allocation
|
||||
|
||||
#define ADAPTIVE_PADDING // Only pushes padding points deep enough so that they are "close" to the slab in terms of units at that depth
|
||||
|
||||
@@ -0,0 +1,175 @@
|
||||
/*
|
||||
Copyright (c) 2024, Michael Kazhdan
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without modification,
|
||||
are permitted provided that the following conditions are met:
|
||||
|
||||
Redistributions of source code must retain the above copyright notice, this list of
|
||||
conditions and the following disclaimer. Redistributions in binary form must reproduce
|
||||
the above copyright notice, this list of conditions and the following disclaimer
|
||||
in the documentation and/or other materials provided with the distribution.
|
||||
|
||||
Neither the name of the Johns Hopkins University nor the names of its contributors
|
||||
may be used to endorse or promote products derived from this software without specific
|
||||
prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY
|
||||
EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO THE IMPLIED WARRANTIES
|
||||
OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT
|
||||
SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
|
||||
TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
|
||||
BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
|
||||
ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
|
||||
DAMAGE.
|
||||
*/
|
||||
|
||||
#include "PreProcessor.h"
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <assert.h>
|
||||
#include <algorithm>
|
||||
#include <iostream>
|
||||
#define _USE_MATH_DEFINES
|
||||
#include <cmath>
|
||||
#include "Ply.h"
|
||||
#include "CmdLineParser.h"
|
||||
#include "Geometry.h"
|
||||
#include "VertexFactory.h"
|
||||
#include "MyMiscellany.h"
|
||||
#include "DataStream.imp.h"
|
||||
|
||||
using namespace PoissonRecon;
|
||||
|
||||
CmdLineParameter< std::string >
|
||||
In( "in" ) ,
|
||||
Out( "out" );
|
||||
|
||||
CmdLineParameters< std::string >
|
||||
ConfidenceNames( "cNames" );
|
||||
|
||||
CmdLineParameters< float >
|
||||
ConfidenceExponents( "cExps" );
|
||||
|
||||
|
||||
CmdLineReadable
|
||||
Verbose( "verbose" );
|
||||
|
||||
CmdLineReadable* params[] =
|
||||
{
|
||||
&In ,
|
||||
&Out ,
|
||||
&ConfidenceNames ,
|
||||
&ConfidenceExponents ,
|
||||
&Verbose ,
|
||||
NULL
|
||||
};
|
||||
|
||||
|
||||
void ShowUsage( char* ex )
|
||||
{
|
||||
printf( "Usage: %s\n" , ex );
|
||||
printf( "\t --%s <input points>\n" , In.name );
|
||||
printf( "\t --%s <output points>\n" , Out.name );
|
||||
printf( "\t --%s <confidence counts, confidence name1, confidence name2...>\n" , ConfidenceNames.name );
|
||||
printf( "\t --%s <confidence counts, confidence exp1, confidence exp2...>\n" , ConfidenceExponents.name );
|
||||
printf( "\t[--%s]\n" , Verbose.name );
|
||||
}
|
||||
|
||||
template< typename Real , unsigned int Dim , typename Factory >
|
||||
void Execute( Factory factory )
|
||||
{
|
||||
auto Scale = [&]( Point< Real > scales )
|
||||
{
|
||||
Real s = (Real)1.;
|
||||
for( unsigned int d=0 ; d<scales.dim() ; d++ ) s *= (Real)pow( scales[d] , ConfidenceExponents.values[d] );
|
||||
return s;
|
||||
};
|
||||
|
||||
size_t count;
|
||||
PLYInputDataStream< Factory > inPointStream( In.value.c_str() , factory , count );
|
||||
PLYOutputDataStream< Factory > outPointStream( Out.value.c_str() , factory , count );
|
||||
|
||||
if( Verbose.set ) std::cout << "Points: " << count << std::endl;
|
||||
|
||||
typename Factory::VertexType v = factory();
|
||||
while( inPointStream.read( v ) )
|
||||
{
|
||||
v.template get<1>() *= Scale( v.template get<2>() );
|
||||
outPointStream.write( v );
|
||||
}
|
||||
};
|
||||
|
||||
template< typename Real , unsigned int Dim >
|
||||
void Execute( void )
|
||||
{
|
||||
std::vector< std::pair< std::string , VertexFactory::TypeOnDisk > > namesAndTypesOnDisk( ConfidenceNames.count );
|
||||
for( unsigned int i=0 ; i<ConfidenceNames.count ; i++ )
|
||||
{
|
||||
namesAndTypesOnDisk[i].first = ConfidenceNames.values[i];
|
||||
namesAndTypesOnDisk[i].second = VertexFactory::template GetTypeOnDisk< Real >();
|
||||
}
|
||||
|
||||
VertexFactory::PositionFactory< Real , Dim > positionFactory;
|
||||
VertexFactory::NormalFactory< Real , Dim > normalFactory;
|
||||
VertexFactory::DynamicFactory< Real > scaleFactory( namesAndTypesOnDisk );
|
||||
|
||||
typedef VertexFactory::Factory< Real , typename VertexFactory::PositionFactory< Real , Dim > , typename VertexFactory::NormalFactory< Real , Dim > , VertexFactory::DynamicFactory< Real > > Factory;
|
||||
Factory factory( positionFactory , normalFactory , scaleFactory );
|
||||
|
||||
bool *readFlags = new bool[ factory.plyReadNum() ];
|
||||
std::vector< PlyProperty > unprocessedProperties;
|
||||
|
||||
PLY::ReadVertexHeader( In.value , factory , readFlags , unprocessedProperties );
|
||||
if( !factory.plyValidReadProperties<0>( readFlags ) ) ERROR_OUT( "Ply file does not contain positions" );
|
||||
if( !factory.plyValidReadProperties<1>( readFlags ) ) ERROR_OUT( "Ply file does not contain normals" );
|
||||
if( !factory.plyValidReadProperties<2>( readFlags ) ) ERROR_OUT( "Ply file does not contain scales" );
|
||||
delete[] readFlags;
|
||||
|
||||
if( Verbose.set && unprocessedProperties.size() )
|
||||
{
|
||||
std::cout << "Unprocessed properties:" << std::endl;
|
||||
for( unsigned int i=0 ; i<unprocessedProperties.size() ; i++ ) std::cout << "\t" << unprocessedProperties[i] << std::endl;
|
||||
}
|
||||
|
||||
if( unprocessedProperties.size() )
|
||||
{
|
||||
using _Factory = VertexFactory::Factory< Real , typename VertexFactory::PositionFactory< Real , Dim > , typename VertexFactory::NormalFactory< Real , Dim > , VertexFactory::DynamicFactory< Real > , VertexFactory::DynamicFactory< Real > >;
|
||||
Execute< Real , Dim >( _Factory( positionFactory , normalFactory , scaleFactory , VertexFactory::DynamicFactory< Real >( unprocessedProperties ) ) );
|
||||
}
|
||||
else
|
||||
{
|
||||
using _Factory = VertexFactory::Factory< Real , typename VertexFactory::PositionFactory< Real , Dim > , typename VertexFactory::NormalFactory< Real , Dim > , VertexFactory::DynamicFactory< Real > >;
|
||||
Execute< Real , Dim >( _Factory( positionFactory , normalFactory , scaleFactory ) );
|
||||
}
|
||||
}
|
||||
|
||||
int main( int argc , char* argv[] )
|
||||
{
|
||||
CmdLineParse( argc-1 , &argv[1] , params );
|
||||
if( !In.set || !Out.set || !ConfidenceNames.set || !ConfidenceExponents.set )
|
||||
{
|
||||
ShowUsage( argv [0] );
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
|
||||
if( ConfidenceNames.count!=ConfidenceExponents.count )
|
||||
ERROR_OUT( "Number of confidence names and exponents does not match: " , ConfidenceNames.count , " != " , ConfidenceExponents.count );
|
||||
|
||||
if( Verbose.set )
|
||||
{
|
||||
std::cout << "*******************************************" << std::endl;
|
||||
std::cout << "*******************************************" << std::endl;
|
||||
std::cout << "** Running Scale Normals (Version " << ADAPTIVE_SOLVERS_VERSION << ") **" << std::endl;
|
||||
std::cout << "*******************************************" << std::endl;
|
||||
std::cout << "*******************************************" << std::endl;
|
||||
}
|
||||
|
||||
Execute< float , 3 >();
|
||||
|
||||
|
||||
return EXIT_SUCCESS;
|
||||
}
|
||||
Reference in New Issue
Block a user