Commit fe471314 authored by Laurent Belcour's avatar Laurent Belcour

Updating the core.

Some modifications to the rational fitting procedures.
parent 86631416
......@@ -186,7 +186,6 @@ class arguments
if(_map.count(key) > 0)
{
std::string s = _map.find(key)->second;
std::cout << s << std::endl;
if(s[0] == '[') // Is an array of type [a, b, c]
{
int i = 0;
......
......@@ -158,16 +158,19 @@ void params::to_cartesian(const double* invec, params::input intype,
case ISOTROPIC_TL_TV_PROJ_DPHI:
{
const double theta = sqrt(invec[1]*invec[1] + invec[2]*invec[2]);
// if(theta > 0.0)
// {
// theta can equals zero. In that case, you should not
// divide by its value, and the relative orientation does
// not matter (normal direction).
if(theta > 0.0)
{
outvec[0] = (invec[1]/theta)*sin(theta);
outvec[1] = (invec[2]/theta)*sin(theta);
// }
// else
// {
// outvec[0] = sin(theta);
// outvec[1] = 0.0;
// }
}
else
{
outvec[0] = 0.0;
outvec[1] = 0.0;
}
outvec[2] = cos(theta);
outvec[3] = sin(invec[0]);
outvec[4] = 0.0;
......
......@@ -89,8 +89,8 @@ class CeresFunctor : public ceres::CostFunction
for(int j=0; j<_f->nbParameters(); ++j)
{
fjac[0][i*_f->nbParameters() + j] = -_jac[i*_f->nbParameters() + j];
}
}
}
}
}
protected:
......
#!/usr/bin/python
"""@package Python command creator package
With this package, you can generate ALTA command lines within python.
"""
import os
class command:
def __init__(self):
self.name = 'data2brdf'
#end
def run(self):
cmd = self.name
for opt in self.options:
cmd + ' ' + opt
#endfor
os.system(cmd)
#end
def set_input(self, filename):
self.options.prepend('--input ' + filename)
#end
def set_output(self, filename):
self.options.prepend('--output ' + filename)
#end
name = ''
options = []
#endclass
......@@ -57,7 +57,7 @@ int main(int argc, char** argv)
arguments args(argc, argv) ;
#ifdef __linux__
//feenableexcept(FE_DIVBYZERO | FE_OVERFLOW | FE_INVALID);
feenableexcept(FE_DIVBYZERO | FE_OVERFLOW | FE_INVALID);
#endif
if(args.is_defined("help")) {
......
......@@ -18,24 +18,24 @@
<action name="data2brdf">
<!-- 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_dense__nbsgrid_81.alta" />
<input name="../papers/retro/mesures/original/3M_jaune/3d/633nm/Fichiers\ definitifs/densify_helmholtz/3M_jaune_3D+3DS+3DR_dense__nbsgrid_162.alta" />
<!--<input name="/tmp/yellow_slice_inc30.dat" />-->
<output name="./results/3d/retro/half/3M_jaune_rat.brdf" />
<!-- Define the function to use -->
<function name="rational_function_legendre" />
<function name="rational_function_cosine" />
<!-- Define the ftting procedure to use -->
<plugin type="fitter" name="rational_fitter_quadprog" />
<!--<plugin type="fitter" name="rational_fitter_parallel" />-->
<parameter name="min-np" value="50" />
<!--<plugin type="fitter" name="rational_fitter_quadprog" />-->
<plugin type="fitter" name="rational_fitter_parallel" />
<parameter name="min-np" value="60" />
<!--<parameter name="min-np" value="53" />-->
<parameter name="min-nq" value="50" />
<parameter name="min-nq" value="60" />
<parameter name="np" value="200" />
<parameter name="nq" value="200" />
<parameter name='np-step' value='5' />
<parameter name="dt" value="0.1" />
<parameter name="dt" value="0.5" />
<parameter name="dt-positive" value="" />
<!--<parameter name="dt-relative" value="" />-->
......
......@@ -62,12 +62,12 @@
<action name="data2data">
<!--- Input data file -->
<input name="../papers/retro/mesures/original/Bande_orange/3d/633nm/Fichiers_definitifs/densify_helmholtz/Bande_orange_3D_dense__nbsgrid_81.alta" />
<input name="../papers/retro/mesures/original/Bande_orange/3d/633nm/Fichiers_definitifs/densify_helmholtz/Bande_orange_3D_dense__nbsgrid_162.alta" />
<parameter name="min" value="[0, 0,-2]" />
<parameter name="max" value="[2, 2, 2]" />
<!-- Output data file -->
<output name="/temp/Bande_orange_back.dat" />
<output name="/tmp/Bande_orange_back.dat" />
<!-- Parameters -->
<parameter name="param" value="SCHLICK_TL_TK_PROJ_DPHI" />
......@@ -76,7 +76,7 @@
<action name="data2brdf">
<!-- Input arguments of the action -->
<input name="/temp/Bande_orange_back.dat" />
<input name="/tmp/Bande_orange_back.dat" />
<parameter name="dt" value="0.5" />
<!--<parameter name="dt-relative" value="" />-->
<parameter name="dt-positive" value="" />
......@@ -115,26 +115,25 @@
-->
<action name="data2brdf">
<!-- Input and output arguments of the action -->
<!-- Input arguments of the action -->
<input name="../papers/retro/mesures/original/Bande_orange/3d/633nm/Fichiers_definitifs/densify_helmholtz/Bande_orange_3D_dense__nbsgrid_162.alta" />
<!--<input name="/tmp/yellow_slice_inc30.dat" />-->
<parameter name="dt" value="0.1" />
<parameter name="data-positive" value="" />
<!--<parameter name="dt-relative" value="" />-->
<!-- Output arguments of the action -->
<output name="./results/3d/retro/half/Bande_orange_rat.brdf" />
<!-- Define the function to use -->
<function name="rational_function_cosine" />
<!--<function name="rational_function_cosine" />-->
<function name="rational_function_chebychev" />
<!-- Define the ftting procedure to use -->
<!--<plugin type="fitter" name="rational_fitter_quadprog" />-->
<plugin type="fitter" name="rational_fitter_parallel" />
<parameter name="min-np" value="60" />
<!--<parameter name="min-np" value="53" />-->
<parameter name="min-nq" value="60" />
<parameter name="min-np" value="70" />
<parameter name="np" value="100" />
<parameter name="nq" value="100" />
<parameter name="dt" value="0.1" />
<parameter name="data-positive" value="" />
<parameter name="nb-starting-points" value="1000" />
<!--<parameter name="dt-relative" value="" />-->
</action>
<!-- Export the fit -->
......
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