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
C
CGoGN
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
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
Thomas Pitiot
CGoGN
Commits
9013a7b6
Commit
9013a7b6
authored
Feb 23, 2011
by
Kenneth Vanhoey
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Decimation Lightfield works correctly
parent
ddefd869
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
20 additions
and
15 deletions
+20
-15
include/Algo/Decimation/lightfieldApproximator.hpp
include/Algo/Decimation/lightfieldApproximator.hpp
+4
-4
include/Algo/Decimation/selector.hpp
include/Algo/Decimation/selector.hpp
+2
-2
include/Utils/quadricRGBfunctions.hpp
include/Utils/quadricRGBfunctions.hpp
+14
-9
No files found.
include/Algo/Decimation/lightfieldApproximator.hpp
View file @
9013a7b6
...
...
@@ -162,17 +162,16 @@ void Approximator_RGBfunctions<PFP>::approximate(Dart d)
assert
(
-
3.15
<
alpha2
&&
alpha2
<=
3.15
)
;
// Create and sum quadrics
// std::cout << "angles1 : " << gamma1 << " " << alpha1 << std::endl ;
// std::cout << "angles2 : " << gamma2 << " " << alpha2 << std::endl ;
m_quadricRGBfunctions
[
d
]
+=
QuadricRGBfunctions
<
REAL
>
(
this
->
m_attrV
[
d
],
gamma1
,
alpha1
)
;
m_quadricRGBfunctions
[
d
]
+=
QuadricRGBfunctions
<
REAL
>
(
this
->
m_attrV
[
dd
],
gamma2
,
alpha2
)
;
std
::
cout
<<
"plop"
<<
std
::
endl
;
std
::
cout
<<
m_quadricRGBfunctions
[
d
]
<<
std
::
endl
;
// Compute new function
if
(
!
m_quadricRGBfunctions
[
d
].
findOptimizedRGBfunctions
(
this
->
m_approx
[
d
]))
{
this
->
m_approx
[
d
]
=
this
->
m_attrV
[
d
];
// if fail take first one
}
// if (gamma2 < -1) {
// std::cout << "Approx of : " <<std::endl ;
// std::cout << "Frame1 : " << m_frame[d] << std::endl ;
// std::cout << "Function1 : "<< this->m_attrV[d] << std::endl ;
...
...
@@ -181,6 +180,7 @@ void Approximator_RGBfunctions<PFP>::approximate(Dart d)
// std::cout << "is " << std::endl ;
// std::cout << "Frame :" << m_approxFrame[d] << std::endl ;
// std::cout << "Function : " << this->m_approx[d] << std::endl << std::endl ;
// }
}
}
//namespace Decimation
...
...
include/Algo/Decimation/selector.hpp
View file @
9013a7b6
...
...
@@ -714,8 +714,8 @@ void EdgeSelector_Lightfield<PFP>::computeEdgeInfo(Dart d, EdgeInfo& einfo)
// Compute error
REAL
err
=
quad
(
newPos
)
+
(
2
*
acos
(
n1
*
n2
))
+
quadRGBf
(
newRGBf
)
;
// std::cout << err << "
-- " << quad(newPos) << " -- " << (2 * acos (n1 * n2)) << " --
" << quadRGBf(newRGBf) << std::endl ;
std
::
cout
<<
quadRGBf
<<
std
::
endl
;
// std::cout << err << "
= " << quad(newPos) << " + " << (2 * acos (n1 * n2)) << " +
" << quadRGBf(newRGBf) << std::endl ;
//
std::cout << quadRGBf << std::endl ;
einfo
.
it
=
edges
.
insert
(
std
::
make_pair
(
err
,
d
))
;
einfo
.
valid
=
true
;
}
...
...
include/Utils/quadricRGBfunctions.hpp
View file @
9013a7b6
...
...
@@ -54,7 +54,7 @@ QuadricRGBfunctions<REAL>::QuadricRGBfunctions(const RGBFUNCTIONS& cf, const REA
MATRIX66
R1
,
R2_A
,
R2_b
,
R2_c
;
buildRotateMatrix
(
R1
,
gamma
);
// Rotation 1
R1
.
transpose
()
;
buildIntegralMatrix_A
(
R2_A
,
alpha
);
// Parameterized integral matrix A
buildIntegralMatrix_b
(
R2_b
,
alpha
);
// Parameterized integral matrix b
buildIntegralMatrix_c
(
R2_c
,
alpha
);
// Parameterized integral matrix c
...
...
@@ -63,10 +63,13 @@ QuadricRGBfunctions<REAL>::QuadricRGBfunctions(const RGBFUNCTIONS& cf, const REA
A
=
R2_A
;
// Matrix A : integral
for
(
unsigned
col
=
RED
;
col
<
BLUE
+
1
;
++
col
)
{
Geom
::
Vector
<
6
,
REAL
>
function
;
// get function coefficients
if
(
!
cf
.
getSubVectorH
(
col
,
0
,
function
))
assert
(
!
"QuadricRGBfunctions::constructor"
)
;
VEC6
coefs
=
R1
*
function
;
// Rotation 1
// std::cout << "gamma = " << gamma << " -- function = " << function ;
function
=
R1
*
function
;
// Rotation 1
// std::cout << " -- function after R1 = " << function << std::endl ;
// std::cout << "R1 = " << R1 << std::endl ;
b
[
col
]
=
R2_b
*
function
;
// Vector b : integral + rotation on 1 vector
c
[
col
]
=
function
*
(
R2_c
*
function
)
;
// Scalar c : integral + rotation on 2 vectors
...
...
@@ -100,12 +103,12 @@ bool QuadricRGBfunctions<REAL>::findOptimizedRGBfunctions(RGBFUNCTIONS& cf) cons
REAL
det
=
A
.
invert
(
Ainv
)
;
// Invert matrix
if
(
det
>
-
1e-8
&&
det
<
1e-8
)
return
false
;
// invert failed
Ainv
.
transpose
()
;
for
(
unsigned
col
=
RED
;
col
<
BLUE
+
1
;
++
col
)
{
VEC6
function
=
Ainv
*
b
[
col
];
// function = A^(-1) * b
VEC6
coefs
=
Ainv
*
b
[
col
];
// function = A^(-1) * b
if
(
!
cf
.
setSubVectorH
(
col
,
0
,
coefs
))
// save in argument cf
if
(
!
cf
.
setSubVectorH
(
col
,
0
,
function
))
// save in argument cf
assert
(
!
"QuadricRGBfunctions::findOptimizedRGBfunctions(cf) setSubVector failed"
)
;
}
...
...
@@ -122,6 +125,8 @@ void QuadricRGBfunctions<REAL>::buildIntegralMatrix_A(MATRIX66 &M, const REAL al
const
REAL
pi
=
3.141592
;
const
REAL
cosinus
=
cos
(
alpha
);
const
REAL
cos2
=
cosinus
*
cosinus
;
const
REAL
cos3
=
cos2
*
cosinus
;
const
REAL
sinus
=
sin
(
alpha
);
const
REAL
sinAbs
=
sin
(
alphaAbs
);
// = - sin(alpha) si alpha < 0
...
...
@@ -141,13 +146,13 @@ void QuadricRGBfunctions<REAL>::buildIntegralMatrix_A(MATRIX66 &M, const REAL al
// Line 2
M
(
1
,
0
)
=
M
(
0
,
1
);
M
(
1
,
1
)
=
(
-
4.0
*
sinAbs
*
cos
inus
*
cosinus
*
cosinus
+
6.0
*
(
pi
-
cosinus
*
sinAbs
-
alphaAbs
))
/
15.0
;
M
(
1
,
1
)
=
(
-
4.0
*
sinAbs
*
cos
3
+
6.0
*
(
pi
-
cosinus
*
sinAbs
-
alphaAbs
))
/
15.0
;
M
(
1
,
2
)
=
REAL
(
0
);
M
(
1
,
3
)
=
REAL
(
0
);
M
(
1
,
4
)
=
(
sinus
*
cos
inus
*
cosinus
*
pi
+
2
*
sinus
*
pi
)
/
8.0
;
M
(
1
,
4
)
=
(
sinus
*
cos
2
*
pi
+
2
*
sinus
*
pi
)
/
8.0
;
M
(
1
,
5
)
=
2.0
*
(
pi
-
cosinus
*
sinAbs
-
alphaAbs
)
/
3.0
;
...
...
@@ -524,7 +529,7 @@ void QuadricRGBfunctions<REAL>::buildRotateMatrix(MATRIX66 &N, const REAL gamma)
N
(
5
,
2
)
=
REAL
(
0
);
N
(
5
,
3
)
=
REAL
(
0
);
N
(
5
,
4
)
=
REAL
(
0
);
N
(
5
,
5
)
=
REAL
(
1
.0
);
N
(
5
,
5
)
=
REAL
(
1
);
}
...
...
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