Mise à jour terminée. Pour connaître les apports de la version 13.8.4 par rapport à notre ancienne version vous pouvez lire les "Release Notes" suivantes :
https://about.gitlab.com/releases/2021/02/11/security-release-gitlab-13-8-4-released/
https://about.gitlab.com/releases/2021/02/05/gitlab-13-8-3-released/

Commit 7bef7190 authored by Laurent Belcour's avatar Laurent Belcour

Changing the input configuration of lafortune. It helds better results. Still not satisfactory?

I added the generation of 2 new examples of a Lafortune lobe.
parent 78e2196d
......@@ -82,7 +82,7 @@ void params::to_cartesian(const double* invec, params::input intype,
break;
case params::RUSIN_TH_TD:
half_to_cartesian(invec[0], 0.0, invec[1], 0.0, outvec);
half_to_cartesian(invec[0], 0.0, invec[1], 0.5*M_PI, outvec);
break;
// 3D Parametrization
......
......@@ -290,8 +290,8 @@ void lafortune_function::bootstrap(const data* d, const arguments& args)
{
double theta = 0.5 * M_PI * n / (double)_n;
_C[(n*dimY() + i)*3 + 0] = 1.0;
_C[(n*dimY() + i)*3 + 1] = sin(theta);
_C[(n*dimY() + i)*3 + 0] = -sin(theta);
_C[(n*dimY() + i)*3 + 1] = -sin(theta);
_C[(n*dimY() + i)*3 + 2] = cos(theta);
_N[n*dimY() + i] = (double)_n;
}
......
TEMPLATE = subdirs
SUBDIRS = \
# rational_fitter_cgal \
rational_fitter_cgal \
rational_fitter_quadprog \
rational_fitter_parallel \
# rational_fitter_quadproge \
rational_fitter_eigen \
rational_fitter_leastsquare \
rational_function_chebychev \
# rational_fitter_matlab \
rational_fitter_matlab \
# rational_fitter_dca \
nonlinear_levenberg_eigen \
nonlinear_function_phong \
......
......@@ -20,6 +20,10 @@ typedef CGAL::Quadratic_program<ET> Program ;
typedef CGAL::Quadratic_program_solution<ET> Solution ;
typedef CGAL::Quadratic_program_options Options ;
ALTA_DLL_EXPORT fitter* provide_fitter()
{
return new rational_fitter_cgal();
}
data* rational_fitter_cgal::provide_data() const
{
......
......@@ -11,9 +11,17 @@ if [ $use_relative -eq 1 ]; then
relative="--dt-relative"
fi
test_generated=0
test_generated=1
test_kirby=1
test_alta=0
test_alta=1
#fitter="matlab"
fitter="quadprog"
#fitter="cgal"
#fitter="parallel"
fitter_args="--min-np 1 --np 100 --min-nq 1 --nq 100"
mkdir tests
## Test with generated data
##
......@@ -22,12 +30,12 @@ min_test=1; max_test=6
for i in `seq $min_test $max_test`
do
./build/generate_data --f $i
mv input.gnuplot input_$i.gnuplot
./build/data2brdf --input input_$i.gnuplot --output output${function_append}.rational $function --fitter /build/librational_fitter_quadprog.so --np 20 --nq 20 --dt 0.01 $relative > output${function_append}_$i.out
mv input.gnuplot tests/input_$i.gnuplot
./build/data2brdf --input tests/input_$i.gnuplot --output tests/output${function_append}_$i.rational $function --fitter /build/librational_fitter_${fitter}.so ${fitter_args} --dt 0.1 $relative > tests/output${function_append}_$i.out
if [ $? -eq 0 ]; then
echo "Test number $i passed"
./build/brdf2gnuplot --input output${function_append}.rational $function --data input_$i.gnuplot --output output_$i.gnuplot > /dev/null
./build/brdf2gnuplot --input tests/output${function_append}_$i.rational $function --data tests/input_$i.gnuplot --output tests/output_$i.gnuplot > /dev/null
else
echo "Test number $i failed"
fi
......@@ -37,11 +45,11 @@ fi
## Test with Kirby2 dataset
##
if [ $test_kirby -eq 1 ]; then
./build/data2brdf --input ../data/1d/Kirby2/Kirby2.dat --output Kirby2${function_append}.rational $function --fitter /build/librational_fitter_parallel.so --min-np 1 --np 100 --dt 0.01 $relative
./build/data2brdf --input ../data/1d/Kirby2/Kirby2.dat --output tests/Kirby2${function_append}.rational $function --fitter /build/librational_fitter_${fitter}.so ${fitter_args} --dt 0.1 $relative > tests/Kirby2${function_append}.out
if [ $? -eq 0 ]; then
echo "Test Kirby2 passed"
./build/brdf2gnuplot --input Kirby2${function_append}.rational $function --data ../data/1d/Kirby2/Kirby2.dat --output Kirby2.gnuplot > /dev/null
./build/brdf2gnuplot --input tests/Kirby2${function_append}.rational $function --data ../data/1d/Kirby2/Kirby2.dat --output tests/Kirby2.gnuplot > /dev/null
else
echo "Test Kirby2 failed"
fi
......@@ -50,11 +58,11 @@ fi
## Test with ALTA internal data
##
if [ $test_alta -eq 1 ]; then
./build/data2brdf --input ../data/2d/matusik_merl/beige-fabric-double-cc-cos-th-td-90deg.dat --output beige${function_append}.rational $function --fitter /build/librational_fitter_parallel.so --min-np 60 --np 100 --dt 0.5 --dt-relative > /dev/null
./build/data2brdf --input ../data/2d/matusik_merl/beige-fabric-double-cc-cos-th-td-90deg.dat --output tests/beige${function_append}.rational $function --fitter /build/librational_fitter_${fitter}.so ${fitter_args} --dt 0.5 --dt-relative > tests/beige${function_append}.out
if [ $? -eq 0 ]; then
echo "Test beige matusik passed"
./build/brdf2gnuplot --input beige${function_append}.rational $function --data ../data/2d/matusik_merl/beige-fabric-double-cc-cos-th-td-90deg.dat --output output_beige.gnuplot > beige.out
./build/brdf2gnuplot --input tests/beige${function_append}.rational $function --data ../data/2d/matusik_merl/beige-fabric-double-cc-cos-th-td-90deg.dat --output tests/output_beige.gnuplot > /dev/null
else
echo "Test beige matusik failed"
fi
......
......@@ -6,3 +6,7 @@ DESTDIR = ../../build
SOURCES += main.cpp
LIBS += -L../../build -lcore
unix{
PRE_TARGETDEPS += ../../build/libcore.a
}
......@@ -5,3 +5,7 @@ DESTDIR = ../../build
SOURCES += main.cpp
LIBS += -L../../build -lcore
unix{
PRE_TARGETDEPS += ../../build/libcore.a
}
......@@ -5,3 +5,7 @@ DESTDIR = ../../build
SOURCES += main.cpp
LIBS += -L../../build -lcore
unix{
PRE_TARGETDEPS += ../../build/libcore.a
}
SOURCES += main.cpp
DESTDIR = ../../build
CONFIG += qt
INCLUDEPATH += ../../
DESTDIR = ../../build
SOURCES += main.cpp
LIBS += -L../../build -lcore
unix{
PRE_TARGETDEPS += ../../build/libcore.a
}
......@@ -3,6 +3,7 @@
#include <cmath>
#include <core/args.h>
#include <core/params.h>
int main(int argc, char** argv)
{
......@@ -23,13 +24,13 @@ int main(int argc, char** argv)
if(k == 1)
{
f << "#DIM 1 1" << std::endl ;
f << "#PARAM_IN COS_TH" << std::endl;
f << "#VS 2" << std::endl;
f << "#PARAM_IN UNKNOWN" << std::endl;
//f << "#VS 2" << std::endl;
for(int i=0; i<nbx; ++i)
{
const float x = i / (float)nbx ;
//const float y = 100.0f * exp(-10.0 * x*x) * x*x - 0.01 *x*x*x + 0.1 ;
const float y = (1.0) / (1.0E-5 + x*x*x);
const float y = (1.0) / (1.0E-10 + x*x*x);
f << x << "\t" << y << "\t" << y*0.9f << "\t" << y*1.1f << std::endl ;
}
......@@ -37,7 +38,7 @@ int main(int argc, char** argv)
else if(k == 2)
{
f << "#DIM 1 1" << std::endl ;
f << "#PARAM_IN COS_TH" << std::endl;
f << "#PARAM_IN UNKNOWN" << std::endl;
for(int i=0; i<nbx; ++i)
{
const float x = i / (float)nbx ;
......@@ -54,14 +55,15 @@ int main(int argc, char** argv)
{
const float x = i / (float)nbx ;
const float y = j / (float)nby ;
const float z = 1 + 0.1f*x;
const float z = 10 * x + 1.0;
f << x << "\t" << y << "\t" << z << "\t" << z-0.1f << "\t" << z+0.1 << std::endl ;
f << x << "\t" << y << "\t" << z << "\t" << z-0.1f << "\t" << z << std::endl ;
}
}
else if(k == 4)
{
f << "#DIM 2 1" << std::endl ;
f << "#PARAM_IN UNKNOWN" << std::endl;
for(int i=0; i<nbx; ++i)
for(int j=0; j<nby; ++j)
{
......@@ -70,7 +72,7 @@ int main(int argc, char** argv)
const float z = x*y / (1.0E-3 + x*x*x) + 10.;
f << x << "\t" << y << "\t" << z << "\t" << 0.1f << std::endl ;
f << x << "\t" << y << "\t" << z << std::endl ;
}
}
else if(k == 5)
......@@ -104,6 +106,72 @@ int main(int argc, char** argv)
f << x << "\t" << z << std::endl ;
}
}
// Lafortune fitting
// Single lobe (0.86, 0.77, 18.6)
else if(k == 7)
{
f << "#DIM 2 1" << std::endl ;
f << "#PARAM_IN RUSIN_TH_TD" << std::endl;
for(int i=0; i<nbx; ++i)
{
for(int j=0; j<nby; ++j)
{
double in_r[2], in_c[6];
in_r[0] = M_PI * 0.5 * i / (float)nbx ;
in_r[1] = M_PI * 0.5 * j / (float)nby ;
params::convert(in_r, params::RUSIN_TH_TD, params::CARTESIAN, in_c);
const double Cx =0.86;
const double Cz =0.77;
const double n = 18.6;
const double cos = Cx * (in_c[0]*in_c[3] + in_c[1]*in_c[4]) + Cz*in_c[2]*in_c[5];
if(cos > 0.0)
{
const double z = std::pow(cos, n) ;
f << in_r[0] << "\t" << in_r[1] << "\t" << z << std::endl ;
}
}
}
}
// Lafortune fitting
// Triple lobe (0.86, 0.77, 18.6), (-0.41, 0.018, 2.58), (-1.03, 0.7, 63.8)
else if(k == 8)
{
f << "#DIM 2 1" << std::endl ;
f << "#PARAM_IN RUSIN_TH_TD" << std::endl;
for(int i=0; i<nbx; ++i)
{
for(int j=0; j<nby; ++j)
{
double in_r[2], in_c[6];
in_r[0] = M_PI * 0.5 * i / (float)nbx ;
in_r[1] = M_PI * 0.5 * j / (float)nby ;
params::convert(in_r, params::RUSIN_TH_TD, params::CARTESIAN, in_c);
const double Cx[3] = {0.86, -0.410, -1.03};
const double Cz[3] = {0.77, 0.018, 0.70};
const double n[3] = {18.6, 2.580, 63.8};
double z = 0.0;
for(int k=0; k<3; ++k)
{
const double cos = Cx[k] * (in_c[0]*in_c[3] + in_c[1]*in_c[4]) + Cz[k]*in_c[2]*in_c[5];
if(cos > 0.0)
{
z += std::pow(cos, n[k]) ;
}
}
f << in_r[0] << "\t" << in_r[1] << "\t" << z << std::endl ;
}
}
}
return 0 ;
}
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