Commit a43449a1 authored by PACANOWSKI Romain's avatar PACANOWSKI Romain
Browse files

Merge

parents 16b22100 add7a5e0
This is the repository for the ALTA Project
This is the repository for the ALTA library. ALTA is a set of cross-platform
command line executables and shared object plugins allowing to analyze, fit
and understand BRDF data and models.
ALTA targets: people working on BRDFs and willing to benchmark new BRDF models
and compare them with state-of-the-art BRDF models and data easily; people
working on optical measurements and wanting to experiment different fitting
procedures and models; or people wanting to perform statistical analysis on
your BRDF data.
1. Repository Organization
......
......@@ -2,8 +2,6 @@ CONFIG -= qt
TEMPLATE = subdirs
SUBDIRS = sources \
external/quadprog++ \
external/quadprog++-v2
external \
sources.depends = external/quadprog++
sources.depends = external/quadprog++-v2
sources.depends = external
......@@ -4,12 +4,20 @@
# ${ALTA}/external/ceres* directory once the obtain_ceres.py script has
# been runned. You need to have the env variable ALTA defined.
CONFIG += ceres
INCLUDEPATH += $$(ALTA)/external/build/include
LIBS += -L$$(ALTA)/external/build/lib \
-lceres -lglog
EXTERNAL = $$(ALTA)/external/
EXTERNAL_INC = $${EXTERNAL}/build/include
EXTERNAL_LIB = $${EXTERNAL}/build/lib
macx {
LIBS += -lamd -lcamd -lcolamd -lcholmod -lcxsparse
LIBS *= -lblas -llapack
exists($${EXTERNAL_INC}/ceres/ceres.h) {
CONFIG += ceres
INCLUDEPATH += $$(ALTA)/external/build/include
LIBS += -L$$(ALTA)/external/build/lib \
-lceres -lminiglog
macx {
LIBS *= -lamd -lcamd -lcolamd -lcholmod -lcxsparse
LIBS *= -lblas -llapack
}
} else {
warning("Did not find ceres.h in $${EXTERNAL_INC}/ceres")
}
......@@ -3,16 +3,26 @@
# Configuration file for CGAL library in the case where it is installed in
# the default location for your configuration.
CONFIG += cgal
unix {
exists("/usr/include/CGAL/version.h") {
CONFIG *= cgal
LIBS += -lCGAL -lCGAL_Core
}
}
macx {
INCLUDEPATH += /opt/local/include
LIBS += -L/opt/local/lib
exists("/opt/local/include/CGAL/version.h") {
CONFIG *= cgal
INCLUDEPATH *= /opt/local/include
LIBS *= -L/opt/local/lib
LIBS += -lCGAL -lCGAL_Core
}
}
win32 {
INCLUDEPATH += "C:\Program Files\CGAL-4.4\include"
LIBS += -L"C:\Program Files\CGAL-4.4\lib"
exists("C:\Program Files\CGAL-4.4\include\CGAL\version.h") {
CONFIG *= cgal
INCLUDEPATH *= "C:\Program Files\CGAL-4.4\include"
LIBS *= -L"C:\Program Files\CGAL-4.4\lib"
}
}
LIBS += -lCGAL -lCGAL_Core
......@@ -6,11 +6,15 @@
#
unix:!macx{
INCLUDEPATH += /usr/include/
LIBS += -L/usr/lib/x86_64-linux-gnu -lflann
CONFIG *= flann
INCLUDEPATH *= /usr/include/
LIBS *= -L/usr/lib/x86_64-linux-gnu
LIBS *= -lflann
}
macx{
INCLUDEPATH += /opt/local/include
LIBS += -L/opt/local/lib -lflann
CONFIG *= flann
INCLUDEPATH *= /opt/local/include
LIBS *= -L/opt/local/lib
LIBS *= -lflann
}
......@@ -4,6 +4,16 @@
# ${ALTA}/external/nlopt* directory once the obtain_nlopt.py script has
# been runned. You need to have the env variable ALTA defined.
INCLUDEPATH += $$(ALTA)/external/build/include
LIBS += -L$$(ALTA)/external/build/lib \
-lnlopt
EXTERNAL = $$(ALTA)/external/
EXTERNAL_INC = $${EXTERNAL}/build/include
EXTERNAL_LIB = $${EXTERNAL}/build/lib
exists($${EXTERNAL_INC}/nlopt.h) {
CONFIG += nlopt
INCLUDEPATH += $$(ALTA)/external/build/include
LIBS += -L$$(ALTA)/external/build/lib \
-lnlopt
} else {
warning("Did not find nlopt.h in $${EXTERNAL_INC}")
}
......@@ -57,7 +57,7 @@ QUADPROG_LIB = ['quadprog++']
##
CERES_INC = ['#external/build/include']
CERES_DIR = ['#external/build/lib']
CERES_LIB = ['ceres', 'glog']
CERES_LIB = ['ceres', 'miniglog']
CERES_OPT_LIB = ['gomp', 'lapack', 'blas', 'amd', 'camd', 'ccolamd', 'colamd', 'cholmod', 'cxsparse']
......
......@@ -61,7 +61,7 @@ QUADPROG_LIB = ['quadprog++']
##
CERES_INC = ['#external/build/include']
CERES_DIR = ['#external/build/lib']
CERES_LIB = ['ceres', 'glog']
CERES_LIB = ['ceres', 'miniglog']
CERES_OPT_LIB = ['lapack', 'blas', 'amd', 'camd', 'ccolamd', 'colamd', 'cholmod', 'cxsparse']
......
......@@ -57,7 +57,7 @@ QUADPROG_LIB = ['quadprog++']
##
CERES_INC = ['#external/build/include']
CERES_DIR = ['#external/build/lib']
CERES_LIB = ['ceres', 'glog']
CERES_LIB = ['ceres', 'miniglog']
CERES_OPT_LIB = ['gomp', 'lapack', 'blas', 'amd', 'camd', 'ccolamd', 'colamd', 'cholmod', 'cxsparse']
......
......@@ -57,7 +57,7 @@ QUADPROG_LIB = ['quadprog++']
##
CERES_INC = ['#external/build/include']
CERES_DIR = ['#external/build/lib']
CERES_LIB = ['ceres', 'glog']
CERES_LIB = ['ceres', 'miniglog']
CERES_OPT_LIB = ['gomp', 'lapack', 'blas']
......
......@@ -85,10 +85,6 @@ p.endtd {
/* @end */
caption {
font-weight: bold;
}
span.legend {
font-size: 70%;
text-align: center;
......@@ -755,20 +751,19 @@ address {
}
table.doxtable {
font-size:90%;
border-collapse:collapse;
margin-top: 4px;
margin-bottom: 4px;
margin-top: 4px;
margin-bottom: 4px;
}
table.doxtable td, table.doxtable th {
border: 1px solid #2D4068;
font-weight:normal;
padding: 3px 7px 2px;
}
table.doxtable th {
background-color: #374F7F;
color: #FFFFFF;
font-size: 110%;
color: #000000;
padding-bottom: 4px;
padding-top: 5px;
}
......@@ -836,7 +831,6 @@ table.fieldtable {
border-bottom: 1px solid #A8B8D9;
}
.tabsearch {
top: 0px;
left: 10px;
......@@ -1076,7 +1070,8 @@ dl.section dd {
.caption
{
font-weight: bold;
font-size:90%;
font-weight: normal;
}
div.zoom
......
......@@ -8,79 +8,57 @@ You can <a href="contacts.html">contact us</a> to get more information
about its features, roadmap, and missing documentation.
</center>
<h3>Description</h3>
ALTA is a multi-platform software library to analyze, fit and understand
BRDFs. It provides a set of command line softwares to fit measured data to
analytical forms, tools to understand models and data. You can find an
overview presentation of ALTA <a href="http://hal.inria.fr/hal-01016531">here</a>.
### Description
ALTA is part of the <a href="http://maverick.inria.fr/Projets/ALTA/ ">
ANR 11-BS02-006</a>, a research project on light transport analysis.
ALTA is a multi-platform software library to analyze, fit and understand BRDFs. It provides a set of command line softwares to fit measured data to analytical forms, tools to understand models and data. You can find an overview presentation of ALTA [here][alta-wk].
<h3>Target audience</h3>
You are working on BRDFs and you want to <b>benchmark new BRDF models</b> and
compare them with state-of-the-art BRDF models and data easily. You have working
on optical measurements and you want <b>experiment different fitting procedures
and models</b>, or just perform <b>statistical analysis</b> on your data.
[alta-wk]: http://hal.inria.fr/hal-01016531
<h3>Features</h3>
ALTA is part of the [ANR 11-BS02-006][alta-anr], a research project on light transport analysis.
Here is a list of the major features in the ALTA library (you can find
the complete list in the \ref features page):
[alta-anr]: http://hal.inria.fr/hal-01016531
+ Open common BRDF data formats (MERL, ASTM)
+ Non-linear fitting of BRDF (using third party packages)
### Target audience
+ Rational interpolation of BRDF
You are working on BRDFs and you want to **benchmark new BRDF models** and compare them with state-of-the-art BRDF models and data easily. You have working on optical measurements and you want **experiment different fitting procedures and models**, or just perform **statistical analysis** on your data.
+ Analytic BRDF models (see \ref functions)
### Features
Here is a list of the major features in the ALTA library (you can find the complete list in the \ref features page):
+ Open common BRDF data formats (MERL, ASTM)
+ Non-linear fitting of BRDF (using third party packages)
+ Rational interpolation of BRDF
+ Analytic BRDF models (see \ref functions)
+ Scripting mechanism to automatize fitting
<h3>Sample results</h3>
### Sample results
<center>
<table border="0" style='text-align:center'>
<tr>
<td>
\image html sample_result_01.png
</td>
<td>
\image html sample_result_02.png
</td>
<td>
\image html sample_result_03.png
</td>
</tr>
<tr>
<td>
Lafortune lobe
</td>
<td>
Blinn lobe
</td>
<td>
Beckmann lobe
</td>
</tr>
</table>
<caption>Fitting the MERL database with nonlinear lobe functions</caption>
| `blue-metallic-paint` | `gold-metallic-paint` | `black-phenolic` |
|---------------------------------------- | ------------------------------------ | -------------------------------------- |
| ![Lafortune lobe](sample_result_01.png) | ![Blinn lobe](sample_result_02.png) | ![Beckmann lobe](sample_result_03.png) |
</center>
<br />
<h2>Download and install</h2>
<h3>Obtain sources</h3>
Download and install
--------------------
### Obtain sources
To access the sources of ALTA, you can download the alpha sources:
<center>[http://alta.gforge.inria.fr/downloads/alta-alpha.zip](http://alta.gforge.inria.fr/downloads/alta-alpha.tar.gz)</center>
<center>
http://alta.gforge.inria.fr/downloads/alta-alpha.tar.gz
</center>
<h3>Build</h3>
### Build
You can build ALTA using either [qmake](http://qt-project.org) or [scons](http://www.scons.org). To start, we advise to use scons as it is lightweight and only requires Python to be installed (ALTA uses Python for its high level scripting mechanism). To build using scons, go to the root directory of ALTA and type:
......@@ -91,9 +69,9 @@ You need to provide a platform dependant configuration file. You will find examp
To use qmake, or for a more detailed view of ALTA's building scripts and dependencies, please refer to \ref install.
<br />
<h2>How to use it</h2>
### How to use it
ALTA uses command line programs to perform actions such as BRDF fitting, data conversion, etc. Each program needs plugins to handle its inputs and outputs. We provide three kind of plugins: \ref functions which correspond to BRDF models, \ref datas which correspond to BRDF measurments, and \ref fitters which correspond to fitting algorithms. In the following, we illustrate the use of programs and plugins.
......@@ -112,18 +90,20 @@ To convert this brdf file (in ALTA \ref format), you will need another command:
$ ./build/brdf2brdf --input Kirby.brdf --output Kirby.m --export matlab
\a brdf2brdf converts an ALTA brdf file into another format such as
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).
\a brdf2brdf converts an ALTA brdf file into another format such as 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.
<br />
<h2>Contribute</h2>
### Contribute
There are many ways in which you can extend ALTA. Please refer to
\ref contribute for more information.
<br />
<center>
<table border="0px">
......
......@@ -18,6 +18,11 @@ if env.GetOption('clean'):
#shutil.rmtree('nlopt-2.4.1', True)
else:
##
# IpOpt dependancies
##
execfile('obtain_ipopt.py')
##
# NlOpt dependancies
##
......
TEMPLATE = subdirs
SUBDIRS = quadprog++ \
# quadprog++-v2
quadprog++-v2
system("python --help") {
system("python obtain_eigen.py")
system("python obtain_ceres.py")
system("python obtain_nlopt.py")
system("python obtain_ipopt.py")
} else {
warning("Python has not been found, you will need to compile external dependancies on your own.")
}
\ No newline at end of file
......@@ -63,7 +63,7 @@ if compile_test:
#end
#cmake_cmd = 'cmake -DGLOG_LIB=' + build_dir + 'lib' + os.sep + libname + ' -DGLOG_INCLUDE=' + build_dir + 'include -DGFLAGS=OFF ' + '-DEIGEN_INCLUDE=' + build_dir + 'include -DCMAKE_INSTALL_PREFIX=' + build_dir + ' .' + ' -DDISABLE_TR1=ON -DBUILD_EXAMPLES=OFF ' + '-DBUILD_TESTING=OFF -DCMAKE_BUILD_TYPE=Release -DMINIGLOG=OFF'
cmake_cmd = 'cmake -DBUILD_SHARED_LIBS=ON -DGLOG_LIB=' + build_dir + 'lib' + ' -DGLOG_INCLUDE=' + build_dir + 'include -DGFLAGS=OFF ' + '-DEIGEN_INCLUDE=' + build_dir + 'include -DCMAKE_INSTALL_PREFIX=' + build_dir + ' .' + ' -DDISABLE_TR1=ON -DBUILD_EXAMPLES=OFF ' + '-DBUILD_TESTING=OFF -DCMAKE_BUILD_TYPE=Release -DMINIGLOG=ON'
cmake_cmd = 'cmake -DBUILD_SHARED_LIBS=OFF -DGLOG_LIB=' + build_dir + 'lib' + ' -DGLOG_INCLUDE=' + build_dir + 'include -DGFLAGS=OFF ' + '-DEIGEN_INCLUDE=' + build_dir + 'include -DCMAKE_INSTALL_PREFIX=' + build_dir + ' .' + ' -DDISABLE_TR1=ON -DBUILD_EXAMPLES=OFF ' + '-DBUILD_TESTING=OFF -DCMAKE_BUILD_TYPE=Release -DMINIGLOG=ON'
if os.name == 'nt':
ret = os.system(cmake_cmd + ' -G \"NMake Makefiles\"')
......
......@@ -151,6 +151,38 @@ class params
}
}
//! \brief static function for input type convertion. The outvec
//! resulting vector should be allocated with the correct
//! output size.
static void convert(const double* invec, params::output intype, int indim,
params::output outtype, int outdim, double* outvec)
{
// The convertion is done using the cartesian parametrization as
// an intermediate one. If the two parametrizations are equals
// there is no need to perform the conversion.
if(outdim == indim)
{
for(int i=0; i<outdim; ++i) { outvec[i] = invec[i]; }
}
// If the dimension of the output data is bigger than the
// dimensions of the input domain, and the input domain is of
// dimension one, spread the data over all dimensions.
else if(indim == 1)
{
for(int i=0; i<outdim; ++i) { outvec[i] = invec[0]; }
}
// If the output dimension is one, compute the average of the
// input vector values.
else if(outdim == 1)
{
for(int i=0; i<indim; ++i) { outvec[0] = invec[i]; }
}
else
{
NOT_IMPLEMENTED();
}
}
//! \brief static function for input type convertion. The outvec
//! resulting vector should be allocated with the correct
//! output size.
......
......@@ -41,7 +41,7 @@ class plugins_manager
//! \brief get an instance of the fitter that is defined in the plugin with
//! filename n. Return null if no one exist.
static ptr<fitter> get_fitter(const std::string& n) ;
//! \brief check if a data object and a function object are compatibles.
//! this has to be done before fitting to ensure that the
......
TEMPLATE = lib
CONFIG *= qt \
plugin
CONFIG *= plugin
DESTDIR = ../../build
INCLUDEPATH += ../..
HEADERS = data.h
SOURCES = data.cpp
load(eigen)
packagesExist(ceres, eigen) {
LIBS += -L../../build \
-lcore
INCLUDEPATH += ../..
HEADERS = data.h
SOURCES = data.cpp
LIBS += -L../../build \
-lcore
}
......@@ -54,7 +54,7 @@ vec data_brdf_slice::get(int id) const
res[0] = 0.5*M_PI*(i+0.5) / double(width);
res[1] = 0.5*M_PI*(j+0.5) / double(height);
res[2] = 0.5*M_PI*(k+0.5) / double(slice);
res[2] = M_PI*(k+0.5) / double(slice);
res[3] = _data[3*id + 0];
res[4] = _data[3*id + 1];
......@@ -76,7 +76,7 @@ void data_brdf_slice::set(vec x)
const int i = floor(x[0] * width / (0.5*M_PI));
const int j = floor(x[1] * height / (0.5*M_PI));
const int k = floor(x[2] * slice / (0.5*M_PI));
const int k = floor(x[2] * slice / (M_PI));
const int id = i + j*width + k*width*height;
_data[3*id + 0] = x[3];
......@@ -96,7 +96,7 @@ vec data_brdf_slice::value(vec x) const
const int i = floor(x[0] * width / (0.5*M_PI));
const int j = floor(x[1] * height / (0.5*M_PI));
const int k = floor(x[2] * slice / (0.5*M_PI));
const int k = floor(x[2] * slice / (M_PI));
const int id = (i + j*width)*k;
if(i < 0 || i >= width) { std::cerr << "<<ERROR>> out of bounds: " << x << std::endl; }
......@@ -129,7 +129,7 @@ vec data_brdf_slice::max() const
vec res(2);
res[0] = M_PI / 2 ;
res[1] = M_PI / 2 ;
res[2] = M_PI / 2;
res[2] = M_PI;
return res ;
}
......
load(openexr)
load(eigen)
requires(contains(CONFIG, openexr))
requires(contains(CONFIG, eigen))
TEMPLATE = lib
CONFIG *= plugin \
eigen \
openexr
CONFIG *= plugin
DESTDIR = ../../build
......@@ -11,4 +15,4 @@ SOURCES = data.cpp
LIBS += -L../../build \
-lcore
-lcore
......@@ -52,6 +52,8 @@ void data_interpolant::load(const std::string& filename)
setDimY(_data->dimY());
setMin(_data->min());
setMax(_data->max());
setParametrization(_data->input_parametrization());
setParametrization(_data->output_parametrization());
#ifdef USE_DELAUNAY
dD = dimX()+dimY();
......
TEMPLATE = lib
CONFIG *= plugin \
eigen \
flann
load(flann)
load(eigen)
requires(contains(CONFIG, flann))
requires(contains(CONFIG, eigen))
TEMPLATE = lib
CONFIG *= plugin
DESTDIR = ../../build
INCLUDEPATH += ../..
......@@ -11,9 +14,5 @@ SOURCES = data.cpp
LIBS += -L../../build \
-lcore \
-lCGAL
-lcore
unix {
QMAKE_CXXFLAGS += -frounding-math
}
TEMPLATE = lib
CONFIG *= plugin \
eigen \
matlab
load(matlab)
load(eigen)
requires(contains(CONFIG, eigen))
requires(contains(CONFIG, matlab))
TEMPLATE = lib
CONFIG *= plugin
DESTDIR = ../../build
INCLUDEPATH += ../..
HEADERS = data.h
SOURCES = data.cpp
LIBS += -L../../build \
-lcore
-lcore
load(ceres)
load(eigen)
load(openmp)
requires(contains(CONFIG, ceres))
requires(contains(CONFIG, eigen))
TARGET = nonlinear_fitter_ceres
TEMPLATE = lib
CONFIG *= plugin \
ceres \
eigen