Commit d7ad340c authored by pacanows's avatar pacanows
Browse files

Merge

parents 52ad5d49 2d6b7151
<doxygenlayout version="1.0">
<navindex>
<tab type="mainpage" visible="yes" title="Overview"/>
<tab type="user" url="@ref examples" title="Examples"/>
<tab type="user" url="@ref tutorials" title="Tutorials"/>
<tab type="user" url="@ref license" title="License"/>
<tab type="user" url="@ref contacts" title="Contacts"/>
</navindex>
......
......@@ -80,6 +80,8 @@ Matlab m file, C++ code, or BRDF Explorer shader. Note that this tool cannot
convert to another ALTA file (e.g. converting a Blinn lobe to a Beckmann
distribution).
You can find more examples of how to use ALTA on the \ref tutorials page.
<h2>Contribute</h2>
......
/*!
\page tutorials Tutorials
<h2>Fitting using the command line</h2>
The \a data2brdf allows to perform a fitting procedure by converting a \ref
data object into a brdf object (also named \ref function).
\verbatim
./build/data2brdf --input ../data/1d/Kirby2/Kirby2.dat --output Kirby.brdf --fitter ./build/librational_fitter_eigen.so
\endverbatim
<h2>Moment analysis using the command line</h2>
The \a data2moment allows to perform a moment analysis on a \ref data object.
It can be useful to determine whether a given data correspond to a separable
function along its different axis.
*/
......@@ -9,4 +9,5 @@ obtain.obtain('Eigen v3.2.1', 'eigen-eigen-ffa86ffb5570', 'http://bitbucket.org/
rep = 'build' + os.sep + 'include' + os.sep + 'Eigen'
if not os.path.exists(rep):
shutil.copytree('eigen-eigen-ffa86ffb5570' + os.sep + 'Eigen', rep)
shutil.copytree('eigen-eigen-ffa86ffb5570' + os.sep + 'unsupported', rep)
#end
......@@ -500,9 +500,12 @@ int params::dimension(params::input t)
void params::print_input_params()
{
std::cout << "List of available input parametrizations in the ALTA library:" << std::endl;
for(std::map<params::input, const param_info>::const_iterator it=input_map.begin(); it != input_map.end(); ++it)
{
std::cout << it->second.name << std::endl;
std::cout << " - " << it->second.name;
for(int i=it->second.name.size(); i<26; ++i) { std::cout << " "; }
std::cout << it->second.info << std::endl;
}
}
......
......@@ -5,6 +5,7 @@ SConscript('data_interpolant/SConscript')
# Building fitters
SConscript('nonlinear_fitter_ceres/SConscript')
SConscript('nonlinear_fitter_eigen/SConscript')
SConscript('rational_fitter_eigen/SConscript')
SConscript('rational_fitter_quadprog/SConscript')
......
env = Environment()
env.Append(CPPPATH = ['../../../external/build/include', '../../'])
env.Append(LIBPATH = ['../../build'])
sources = ['fitter.cpp']
libs = ['-lcore']
env.SharedLibrary('../../build/nonlinear_fitter_eigen', sources, LIBS=libs)
......@@ -28,9 +28,14 @@ bool rational_fitter_eigen::fit_data(const data* dat, function* fit, const argum
{
rational_function* r = dynamic_cast<rational_function*>(fit) ;
const vertical_segment* d = dynamic_cast<const vertical_segment*>(dat) ;
if(r == NULL || d == NULL)
if(r == NULL)
{
std::cerr << "<<ERROR>> not passing the correct class to the fitter" << std::endl ;
std::cerr << "<<ERROR>> not passing the correct function object to the fitter" << std::endl ;
return false ;
}
if(d == NULL)
{
std::cerr << "<<ERROR>> not passing the correct data object to the fitter" << std::endl ;
return false ;
}
......
......@@ -23,6 +23,21 @@
int main(int argc, char** argv)
{
arguments args(argc, argv) ;
if(args.is_defined("help")) {
std::cout << "Usage: brdf2brdf [options] --input data.file --output data.file" << std::endl ;
std::cout << "Re-export a function object to another output format."<< std::endl ;
std::cout << std::endl;
std::cout << "Mandatory arguments:" << std::endl;
std::cout << " --input [filename]" << std::endl;
std::cout << " --output [filename]" << std::endl;
std::cout << std::endl;
std::cout << "Optional arguments:" << std::endl;
std::cout << " --export [type] Name of the export format used to save the outputed" << std::endl ;
std::cout << " function file. Available types are: alta, matlab," << std::endl ;
std::cout << " explorer or shader." << std::endl ;
return 0 ;
}
if(! args.is_defined("input")) {
std::cerr << "<<ERROR>> the input filename is not defined" << std::endl ;
......
......@@ -35,6 +35,24 @@ int main(int argc, char** argv)
#ifdef __linux__
//feenableexcept(FE_DIVBYZERO | FE_OVERFLOW | FE_INVALID);
#endif
if(args.is_defined("help")) {
std::cout << "Usage: data2brdf [options] --input data.file --output data.file" << std::endl ;
std::cout << "Convert a data object to a function object using a fitting procedure."<< std::endl ;
std::cout << std::endl;
std::cout << "Mandatory arguments:" << std::endl;
std::cout << " --input [filename]" << std::endl;
std::cout << " --output [filename]" << std::endl;
std::cout << " --fitter [filename]" << std::endl;
std::cout << std::endl;
std::cout << "Optional arguments:" << std::endl;
std::cout << " --func [filename] Name of the function plugin. If not defined, a" << std::endl ;
std::cout << " monomial rational function will be used." << std::endl ;
std::cout << " --data [filename] Name of the data plugin used to load the input" << std::endl ;
std::cout << " data file. If no plugin is defined, the data file" << std::endl ;
std::cout << " will be load using ALTA format." << std::endl ;
return 0 ;
}
fitter* fit = plugins_manager::get_fitter(args["fitter"]) ;
if(fit == NULL)
......
......@@ -65,6 +65,8 @@ int main(int argc, char** argv)
std::cout << " No output data plugin is specified. Please see " << std::endl;
std::cout << " --help-params for the list of available " << std::endl ;
std::cout << " parametrizations." << std::endl ;
std::cout << " --data-correct-cosine Divide the value of the data points by the product of" << std::endl;
std::cout << " the light and view vector dot product with the normal." << std::endl ;
return 0 ;
}
if(args.is_defined("help-params")) {
......
......@@ -283,6 +283,24 @@ int main(int argc, char** argv)
std::cout << "<<RESULT>> moment xyyy: " << m_xyyy << std::endl;
std::cout << "<<RESULT>> moment yyyy: " << m_yyyy << std::endl;
#endif
file << "\\mu_0 = " << m_0 << std::endl;
file << "\\mu_x = " << m_x << std::endl;
file << "\\mu_y = " << m_y << std::endl;
file << "\\mu_{xx} = " << m_xx << std::endl;
file << "\\mu_{xy} = " << m_xy << std::endl;
file << "\\mu_{yy} = " << m_yy << std::endl;
file << "\\mu_{xxx} = " << m_xxx << std::endl;
file << "\\mu_{xxy} = " << m_xxy << std::endl;
file << "\\mu_{xyy} = " << m_xyy << std::endl;
file << "\\mu_{yyy} = " << m_yyy << std::endl;
#ifdef NOT
file << "\\mu_{xxxx} = " << m_xxxx << std::endl;
file << "\\mu_{xxxy} = " << m_xxxy << std::endl;
file << "\\mu_{xxyy} = " << m_xxyy << std::endl;
file << "\\mu_{xyyy} = " << m_xyyy << std::endl;
file << "\\mu_{yyyy} = " << m_yyyy << std::endl;
#endif
#else
// Options
bool with_cosine = args.is_defined("cosine");
......
<?xml version="1.0"?>
<alta>
<!-- This script file compute the fitting of the retro-reflecting materials
present in the ALTA library. This script file should be executed in
the sources directory of repository as all directories are relative.
It is also necessary to create a results/3d/retro directory to store
the resulting fits and exports to BRDF-explorer and matlab.
-->
<configuration>
<parameter name="lib-dir" value="./build" />
</configuration>
<!-- Compute the moments on the 15 degrees data slice -->
<action name="data2moments">
<!-- Input and output arguments of the action -->
<input name="../papers/retro/mesures/original/3M_jaune/3d/633nm/Fichiers\ definitifs/densify_helmholtz/3M_jaune_3D+3DS+3DR_inci-15_BRDF_2D_retro_lobe.alta" />
<output name="./results/3d/retro/3M_jaune_inc-15.mnt" />
<!-- Define the data interpolant to use -->
<plugin type="data" name="data_interpolant" />
<!-- Parameters -->
</action>
<!-- Compute the moments on the 30 degrees data slice -->
<action name="data2moments">
<!-- Input and output arguments of the action -->
<input name="../papers/retro/mesures/original/3M_jaune/3d/633nm/Fichiers\ definitifs/densify_helmholtz/3M_jaune_3D+3DS+3DR_inci-30_BRDF_2D_retro_lobe.alta" />
<output name="./results/3d/retro/3M_jaune_inc-30.mnt" />
<!-- Define the data interpolant to use -->
<plugin type="data" name="data_interpolant" />
<!-- Parameters -->
</action>
<!-- Compute the moments on the 60 degrees data slice -->
<action name="data2moments">
<!-- Input and output arguments of the action -->
<input name="../papers/retro/mesures/original/3M_jaune/3d/633nm/Fichiers\ definitifs/densify_helmholtz/3M_jaune_3D+3DS+3DR_inci-60_BRDF_2D_retro_lobe.alta" />
<output name="./results/3d/retro/3M_jaune_inc-60.mnt" />
<!-- Define the data interpolant to use -->
<plugin type="data" name="data_interpolant" />
<!-- Parameters -->
</action>
<!-- Convert the data from a TV_PROJ_DPHI parametrization to a TK_PROJ_DPHI one -->
<action name="data2data">
<!-- Input and output arguments of the action -->
<input name="../papers/retro/mesures/original/3M_jaune/3d/633nm/Fichiers\ definitifs/densify_helmholtz/3M_jaune_3D+3DS+3DR__clusterized_BRDF_retro_lobe.alta" />
<output name="/tmp/3M_jaune_inc-15.alta" />
<!-- Parameters -->
<parameter name="param" value="SCHLICK_TL_TK_PROJ_DPHI" />
<parameter name="min" value="[0.2, -2, -2]" />
<parameter name="max" value="[0.3, 2, 2]" />
</action>
<!-- Compute the moments on the 15 degrees data slice -->
<action name="data2moments">
<!-- Input and output arguments of the action -->
<input name="/tmp/3M_jaune_inc-15.alta" />
<output name="./results/3d/retro/3M_jaune_inc-15_TK.mnt" />
<!-- Define the data interpolant to use -->
<plugin type="data" name="data_interpolant" />
<!-- Parameters -->
<parameter name="dim" value="[1, 2]" />
</action>
<!-- Convert the data from a TV_PROJ_DPHI parametrization to a TK_PROJ_DPHI one -->
<action name="data2data">
<!-- Input and output arguments of the action -->
<input name="../papers/retro/mesures/original/3M_jaune/3d/633nm/Fichiers\ definitifs/densify_helmholtz/3M_jaune_3D+3DS+3DR__clusterized_BRDF_retro_lobe.alta" />
<output name="/tmp/3M_jaune_inc-30.alta" />
<!-- Parameters -->
<parameter name="param" value="SCHLICK_TL_TK_PROJ_DPHI" />
<parameter name="min" value="[0.5, -2, -2]" />
<parameter name="max" value="[0.6, 2, 2]" />
</action>
<!-- Compute the moments on the 15 degrees data slice -->
<action name="data2moments">
<!-- Input and output arguments of the action -->
<input name="/tmp/3M_jaune_inc-30.alta" />
<output name="./results/3d/retro/3M_jaune_inc-30_TK.mnt" />
<!-- Define the data interpolant to use -->
<plugin type="data" name="data_interpolant" />
<!-- Parameters -->
<parameter name="dim" value="[1, 2]" />
</action>
<!-- Convert the data from a TV_PROJ_DPHI parametrization to a TK_PROJ_DPHI one -->
<action name="data2data">
<!-- Input and output arguments of the action -->
<input name="../papers/retro/mesures/original/3M_jaune/3d/633nm/Fichiers\ definitifs/densify_helmholtz/3M_jaune_3D+3DS+3DR__clusterized_BRDF_retro_lobe.alta" />
<output name="/tmp/3M_jaune_inc-60.alta" />
<!-- Parameters -->
<parameter name="param" value="SCHLICK_TL_TK_PROJ_DPHI" />
<parameter name="min" value="[0.9, -2, -2]" />
<parameter name="max" value="[1.1, 2, 2]" />
</action>
<!-- Compute the moments on the 15 degrees data slice -->
<action name="data2moments">
<!-- Input and output arguments of the action -->
<input name="/tmp/3M_jaune_inc-60.alta" />
<output name="./results/3d/retro/3M_jaune_inc-60_TK.mnt" />
<!-- Define the data interpolant to use -->
<plugin type="data" name="data_interpolant" />
<!-- Parameters -->
<parameter name="dim" value="[1, 2]" />
</action>
</alta>
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment