Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
A
alta
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
5
Issues
5
List
Boards
Labels
Service Desk
Milestones
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
alta
alta
Commits
3bd27e30
Commit
3bd27e30
authored
Jun 06, 2014
by
Laurent Belcour
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Got some plugins not added to the scons scripts to work under Ubuntu 14, 64b
parent
43a720b8
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
26 additions
and
25 deletions
+26
-25
sources/core/function.cpp
sources/core/function.cpp
+2
-2
sources/core/function.h
sources/core/function.h
+2
-2
sources/plugins/rational_fitter_cgal/rational_fitter_cgal.cpp
...ces/plugins/rational_fitter_cgal/rational_fitter_cgal.cpp
+5
-5
sources/plugins/rational_fitter_cgal/rational_fitter_cgal.h
sources/plugins/rational_fitter_cgal/rational_fitter_cgal.h
+3
-2
sources/plugins/rational_fitter_parsec_multi/quadratic_program.h
.../plugins/rational_fitter_parsec_multi/quadratic_program.h
+3
-3
sources/plugins/rational_fitter_parsec_multi/rational_fitter.cpp
.../plugins/rational_fitter_parsec_multi/rational_fitter.cpp
+8
-8
sources/plugins/rational_fitter_parsec_multi/rational_fitter.h
...es/plugins/rational_fitter_parsec_multi/rational_fitter.h
+3
-3
No files found.
sources/core/function.cpp
View file @
3bd27e30
...
...
@@ -138,7 +138,7 @@ void function::save_call(std::ostream&, const arguments&) const
}
//! \brief L2 norm to data.
double
function
::
L2_distance
(
const
ptr
<
data
>
d
)
const
double
function
::
L2_distance
(
const
ptr
<
data
>
&
d
)
const
{
double
l2_dist
=
0.0
;
for
(
int
i
=
0
;
i
<
d
->
size
();
++
i
)
...
...
@@ -163,7 +163,7 @@ double function::L2_distance(const ptr<data> d) const
}
//! \brief Linf norm to data.
double
function
::
Linf_distance
(
const
ptr
<
data
>
d
)
const
double
function
::
Linf_distance
(
const
ptr
<
data
>
&
d
)
const
{
vec
mean
=
vec
::
Zero
(
dimY
());
vec
var
=
vec
::
Zero
(
dimY
());
...
...
sources/core/function.h
View file @
3bd27e30
...
...
@@ -77,14 +77,14 @@ class function : public parametrized
//! If the measurement points are not uniformly distributed, then the
//! metric does not represent the real difference integrated over the
//! hemisphere.
double
L2_distance
(
const
ptr
<
data
>
d
)
const
;
double
L2_distance
(
const
ptr
<
data
>
&
d
)
const
;
//! \brief Linf norm to data.
//! \note This distance is only valid with respect to the data sampling.
//! If the measurement points are not uniformly distributed, then the
//! metric does not represent the real difference integrated over the
//! hemisphere.
double
Linf_distance
(
const
ptr
<
data
>
d
)
const
;
double
Linf_distance
(
const
ptr
<
data
>
&
d
)
const
;
};
...
...
sources/plugins/rational_fitter_cgal/rational_fitter_cgal.cpp
View file @
3bd27e30
...
...
@@ -30,11 +30,11 @@ rational_fitter_cgal::~rational_fitter_cgal()
{
}
bool
rational_fitter_cgal
::
fit_data
(
const
ptr
<
data
>
dat
,
function
*
fit
,
const
arguments
&
args
)
bool
rational_fitter_cgal
::
fit_data
(
const
ptr
<
data
>
dat
,
function
*
fit
,
const
arguments
&
)
{
rational_function
*
r
=
dynamic_cast
<
rational_function
*>
(
fit
)
;
const
vertical_segment
*
d
=
dynamic_cast
<
const
vertical_segment
*
>
(
dat
)
;
if
(
r
==
NULL
||
d
==
NULL
)
const
ptr
<
vertical_segment
>
d
=
dynamic_pointer_cast
<
vertical_segment
>
(
dat
)
;
if
(
r
==
NULL
||
!
d
)
{
std
::
cerr
<<
"<<ERROR>> not passing the correct class to the fitter"
<<
std
::
endl
;
return
false
;
...
...
@@ -90,7 +90,7 @@ void rational_fitter_cgal::set_parameters(const arguments& args)
_min_nq
=
args
.
get_float
(
"min-nq"
,
_max_nq
)
;
}
bool
rational_fitter_cgal
::
fit_data
(
const
vertical_segment
*
d
,
int
np
,
int
nq
,
rational_function
*
r
)
bool
rational_fitter_cgal
::
fit_data
(
const
ptr
<
vertical_segment
>&
d
,
int
np
,
int
nq
,
rational_function
*
r
)
{
// For each output dimension (color channel for BRDFs) perform
// a separate fit on the y-1D rational function.
...
...
@@ -112,7 +112,7 @@ bool rational_fitter_cgal::fit_data(const vertical_segment* d, int np, int nq, r
// np and nq are the degree of the RP to fit to the data
// y is the dimension to fit on the y-data (e.g. R, G or B for RGB signals)
// the function return a ration BRDF function and a boolean
bool
rational_fitter_cgal
::
fit_data
(
const
vertical_segment
*
d
,
int
np
,
int
nq
,
int
ny
,
rational_function_1d
*
r
)
bool
rational_fitter_cgal
::
fit_data
(
const
ptr
<
vertical_segment
>&
d
,
int
np
,
int
nq
,
int
ny
,
rational_function_1d
*
r
)
{
// by default, we have a nonnegative QP with Ax - b >= 0
Program
qp
(
CGAL
::
LARGER
,
false
,
0
,
false
,
0
)
;
...
...
sources/plugins/rational_fitter_cgal/rational_fitter_cgal.h
View file @
3bd27e30
...
...
@@ -11,6 +11,7 @@
#include <core/vertical_segment.h>
#include <core/fitter.h>
#include <core/args.h>
#include <core/ptr.h>
/*! \brief A vertical segment fitter for rational function using the library CGAL
* \ingroup plugins
...
...
@@ -34,8 +35,8 @@ class rational_fitter_cgal : public fitter
// Fitting a data object using np elements in the numerator and nq
// elements in the denominator
virtual
bool
fit_data
(
const
vertical_segment
*
d
,
int
np
,
int
nq
,
rational_function
*
fit
)
;
virtual
bool
fit_data
(
const
vertical_segment
*
dat
,
int
np
,
int
nq
,
int
ny
,
rational_function_1d
*
fit
)
;
virtual
bool
fit_data
(
const
ptr
<
vertical_segment
>&
d
,
int
np
,
int
nq
,
rational_function
*
fit
)
;
virtual
bool
fit_data
(
const
ptr
<
vertical_segment
>&
dat
,
int
np
,
int
nq
,
int
ny
,
rational_function_1d
*
fit
)
;
// min and Max usable np and nq values for the fitting
int
_max_np
,
_max_nq
;
...
...
sources/plugins/rational_fitter_parsec_multi/quadratic_program.h
View file @
3bd27e30
...
...
@@ -169,7 +169,7 @@ class quadratic_program
//! \brief Test all the constraints of the data.
//! Add the sample that is farest away from the function.
bool
test_constraints
(
int
ny
,
const
rational_function_1d
*
r
,
const
vertical_segment
*
data
)
bool
test_constraints
(
int
ny
,
const
rational_function_1d
*
r
,
const
ptr
<
vertical_segment
>&
data
)
{
#ifdef PACANOWSKI2012
int
nb_failed
=
0
;
...
...
@@ -253,7 +253,7 @@ class quadratic_program
//! \brief Give the next position in the data that is not satisfied.
//! This method works only for a single color channel ny !
static
int
next_unmatching_constraint
(
int
i
,
int
ny
,
const
rational_function_1d
*
r
,
const
vertical_segment
*
data
);
const
ptr
<
vertical_segment
>&
data
);
protected:
int
_np
,
_nq
;
...
...
@@ -296,7 +296,7 @@ inline void quadratic_program::get_constraint(const vec& xi, const vec& yl, cons
}
int
quadratic_program
::
next_unmatching_constraint
(
int
i
,
int
ny
,
const
rational_function_1d
*
r
,
const
vertical_segment
*
data
)
const
ptr
<
vertical_segment
>&
data
)
{
for
(
int
n
=
i
;
n
<
data
->
size
();
++
n
)
{
...
...
sources/plugins/rational_fitter_parsec_multi/rational_fitter.cpp
View file @
3bd27e30
...
...
@@ -41,13 +41,13 @@ bool rational_fitter_parallel::fit_data(const ptr<data> dat, function* fit, cons
return
false
;
}
const
vertical_segment
*
d
=
dynamic_cast
<
const
vertical_segment
*
>
(
dat
)
;
if
(
d
==
NULL
)
ptr
<
vertical_segment
>
d
=
dynamic_pointer_cast
<
vertical_segment
>
(
dat
)
;
if
(
!
d
)
{
std
::
cerr
<<
"<<WARNING>> automatic convertion of the data object to vertical_segment,"
<<
std
::
endl
;
std
::
cerr
<<
"<<WARNING>> we advise you to perform convertion with a separate command."
<<
std
::
endl
;
vertical_segment
*
vs
=
new
vertical_segment
(
);
ptr
<
vertical_segment
>
vs
(
new
vertical_segment
()
);
for
(
int
i
=
0
;
i
<
dat
->
size
();
++
i
)
{
const
vec
x
=
dat
->
get
(
i
);
...
...
@@ -201,7 +201,7 @@ void rational_fitter_parallel::set_parameters(const arguments&)
}
bool
rational_fitter_parallel
::
fit_data
(
const
vertical_segment
*
d
,
int
np
,
int
nq
,
bool
rational_fitter_parallel
::
fit_data
(
const
ptr
<
vertical_segment
>&
d
,
int
np
,
int
nq
,
rational_function
*
r
,
const
arguments
&
args
,
double
&
delta
,
double
&
linf_dist
,
double
&
l2_dist
)
{
...
...
@@ -220,8 +220,8 @@ bool rational_fitter_parallel::fit_data(const vertical_segment* d, int np, int n
rf
->
update
(
p
,
q
);
}
linf_dist
=
r
->
Linf_distance
(
d
);
l2_dist
=
r
->
L2_distance
(
d
);
linf_dist
=
r
->
Linf_distance
(
d
ynamic_pointer_cast
<
data
>
(
d
)
);
l2_dist
=
r
->
L2_distance
(
d
ynamic_pointer_cast
<
data
>
(
d
)
);
return
true
;
}
...
...
@@ -230,7 +230,7 @@ bool rational_fitter_parallel::fit_data(const vertical_segment* d, int np, int n
// np and nq are the degree of the RP to fit to the data
// y is the dimension to fit on the y-data (e.g. R, G or B for RGB signals)
// the function returns a rational BRDF function and a boolean
bool
rational_fitter_parallel
::
fit_data
(
const
vertical_segment
*
d
,
int
np
,
int
nq
,
int
ny
,
bool
rational_fitter_parallel
::
fit_data
(
const
ptr
<
vertical_segment
>&
d
,
int
np
,
int
nq
,
int
ny
,
rational_function_1d
*
r
,
const
arguments
&
args
,
vec
&
p
,
vec
&
q
,
double
&
delta
)
{
...
...
@@ -295,7 +295,7 @@ bool rational_fitter_parallel::fit_data(const vertical_segment* d, int np, int n
}
void
rational_fitter_parallel
::
get_constraint
(
int
i
,
int
np
,
int
nq
,
int
ny
,
const
vertical_segment
*
data
,
const
ptr
<
vertical_segment
>&
data
,
const
rational_function_1d
*
func
,
vec
&
cu
,
vec
&
cl
)
{
...
...
sources/plugins/rational_fitter_parsec_multi/rational_fitter.h
View file @
3bd27e30
...
...
@@ -58,10 +58,10 @@ class rational_fitter_parallel : public fitter
// Fitting a data object using np elements in the numerator and nq
// elements in the denominator
virtual
bool
fit_data
(
const
vertical_segment
*
d
,
int
np
,
int
nq
,
virtual
bool
fit_data
(
const
ptr
<
vertical_segment
>&
d
,
int
np
,
int
nq
,
rational_function
*
fit
,
const
arguments
&
args
,
double
&
delta
,
double
&
linf_dist
,
double
&
l2_dist
)
;
virtual
bool
fit_data
(
const
vertical_segment
*
dat
,
int
np
,
int
nq
,
virtual
bool
fit_data
(
const
ptr
<
vertical_segment
>&
dat
,
int
np
,
int
nq
,
int
ny
,
rational_function_1d
*
fit
,
const
arguments
&
args
,
vec
&
p
,
vec
&
q
,
double
&
delta
)
;
...
...
@@ -71,7 +71,7 @@ class rational_fitter_parallel : public fitter
//! corresponding to the lower constraint and the upper constraint
//! of the vertical segment.
virtual
void
get_constraint
(
int
i
,
int
np
,
int
nq
,
int
ny
,
const
vertical_segment
*
data
,
const
ptr
<
vertical_segment
>&
data
,
const
rational_function_1d
*
func
,
vec
&
cu
,
vec
&
cl
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment