Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
I
ImageINSA_Tanguy
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Tanguy.Raufflet
ImageINSA_Tanguy
Commits
2657bf1c
Commit
2657bf1c
authored
6 years ago
by
ariotte
Browse files
Options
Downloads
Patches
Plain Diff
fixed qmf pyramid decomposition
parent
1913c69c
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
app/Algorithms/Pyramid.cpp
+14
-13
14 additions, 13 deletions
app/Algorithms/Pyramid.cpp
with
14 additions
and
13 deletions
app/Algorithms/Pyramid.cpp
+
14
−
13
View file @
2657bf1c
...
...
@@ -27,7 +27,7 @@ using namespace std;
using
namespace
imagein
;
using
namespace
Pyramid
;
const
uint8_t
tp6_filter_file_data
[]
=
{
0x74
,
0x72
,
0x69
,
0x61
,
0x6e
,
0x67
,
0x75
,
0x6c
,
0x61
,
0x69
,
0x72
,
0x65
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x3f
,
0x00
,
0x00
,
0x80
,
0x3e
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x01
,
0x00
,
0x00
,
0x00
,
0x67
,
0x61
,
0x75
,
0x73
,
0x73
,
0x69
,
0x65
,
0x6e
,
0x00
,
0x00
,
0xf8
,
0x45
,
0x26
,
0x00
,
0xf8
,
0x45
,
0x26
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0xcd
,
0xcc
,
0xcc
,
0x3e
,
0x00
,
0x00
,
0x80
,
0x3e
,
0xcd
,
0xcc
,
0x4c
,
0x3d
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x02
,
0x00
,
0x00
,
0x00
,
0x74
,
0x72
,
0x69
,
0x6d
,
0x6f
,
0x64
,
0x61
,
0x6c
,
0x00
,
0x00
,
0x00
,
0x45
,
0x26
,
0x00
,
0xf8
,
0x45
,
0x26
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x9a
,
0x99
,
0x19
,
0x3f
,
0x00
,
0x00
,
0x80
,
0x3e
,
0xcd
,
0xcc
,
0x4c
,
0xbd
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x02
,
0x00
,
0x00
,
0x00
,
0x72
,
0x65
,
0x63
,
0x74
,
0x61
,
0x6e
,
0x67
,
0x75
,
0x6c
,
0x61
,
0x69
,
0x72
,
0x65
,
0x00
,
0x00
,
0x00
,
0xf8
,
0x45
,
0x26
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0xae
,
0x47
,
0xe1
,
0x3d
,
0xae
,
0x47
,
0xe1
,
0x3d
,
0xae
,
0x47
,
0xe1
,
0x3d
,
0xae
,
0x47
,
0xe1
,
0x3d
,
0xae
,
0x47
,
0xe1
,
0x3d
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x04
,
0x00
,
0x00
,
0x00
,
0x71
,
0x6d
,
0x66
,
0x00
,
0x58
,
0xec
,
0x00
,
0x00
,
0xf8
,
0x45
,
0x26
,
0x00
,
0x00
,
0x00
,
0xf8
,
0x45
,
0x26
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x51
,
0x88
,
0x10
,
0x3f
,
0x16
,
0xde
,
0x95
,
0x3e
,
0x9c
,
0xf9
,
0x55
,
0xbd
,
0xae
,
0xf0
,
0x2e
,
0xbd
,
0x2f
,
0x6e
,
0xa3
,
0x3c
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x04
,
0x00
,
0x00
};
const
uint8_t
tp6_filter_file_data
[]
=
{
0x74
,
0x72
,
0x69
,
0x61
,
0x6e
,
0x67
,
0x75
,
0x6c
,
0x61
,
0x69
,
0x72
,
0x65
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x3f
,
0x00
,
0x00
,
0x80
,
0x3e
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x01
,
0x00
,
0x00
,
0x00
,
0x67
,
0x61
,
0x75
,
0x73
,
0x73
,
0x69
,
0x65
,
0x6e
,
0x00
,
0x00
,
0xf8
,
0x45
,
0x26
,
0x00
,
0xf8
,
0x45
,
0x26
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0xcd
,
0xcc
,
0xcc
,
0x3e
,
0x00
,
0x00
,
0x80
,
0x3e
,
0xcd
,
0xcc
,
0x4c
,
0x3d
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x02
,
0x00
,
0x00
,
0x00
,
0x74
,
0x72
,
0x69
,
0x6d
,
0x6f
,
0x64
,
0x61
,
0x6c
,
0x00
,
0x00
,
0x00
,
0x45
,
0x26
,
0x00
,
0xf8
,
0x45
,
0x26
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x9a
,
0x99
,
0x19
,
0x3f
,
0x00
,
0x00
,
0x80
,
0x3e
,
0xcd
,
0xcc
,
0x4c
,
0xbd
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x02
,
0x00
,
0x00
,
0x00
,
0x72
,
0x65
,
0x63
,
0x74
,
0x61
,
0x6e
,
0x67
,
0x75
,
0x6c
,
0x61
,
0x69
,
0x72
,
0x65
,
0x00
,
0x00
,
0x00
,
0xf8
,
0x45
,
0x26
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0xae
,
0x47
,
0xe1
,
0x3d
,
0xae
,
0x47
,
0xe1
,
0x3d
,
0xae
,
0x47
,
0xe1
,
0x3d
,
0xae
,
0x47
,
0xe1
,
0x3d
,
0xae
,
0x47
,
0xe1
,
0x3d
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x04
,
0x00
,
0x00
,
0x00
,
0x71
,
0x6d
,
0x66
,
0x00
,
0x58
,
0xec
,
0x00
,
0x00
,
0xf8
,
0x45
,
0x26
,
0x00
,
0x00
,
0x00
,
0xf8
,
0x45
,
0x26
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x51
,
0x88
,
0x10
,
0x3f
,
0x16
,
0xde
,
0x95
,
0x3e
,
0x9c
,
0xf9
,
0x55
,
0xbd
,
0xae
,
0xf0
,
0x2e
,
0xbd
,
0x2f
,
0x6e
,
0xa3
,
0x3c
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x04
,
0x00
,
0x00
,
0x00
};
Pyramid
::
Filters
::
Filters
()
{
...
...
@@ -43,24 +43,23 @@ Pyramid::Filters::~Filters()
}
bool
Pyramid
::
Filters
::
getFromPos
(
int
pos
,
filtre
&
to_fill
)
{
bool
found
=
false
;
bool
found
=
false
;
if
(
pos
>=
0
&&
pos
<
num_filters
)
{
found
=
true
;
found
=
true
;
copy_filter
(
filters
[
pos
],
to_fill
);
}
return
found
;
}
bool
Filters
::
getFromName
(
const
char
*
name
,
filtre
&
to_fill
)
{
bool
found
=
false
;
bool
found
=
false
;
if
(
strcmp
(
name
,
"default - gaussien"
)
==
0
)
{
found
=
true
;
getDefault
(
to_fill
);
}
else
{
int
counter
=
0
;
for
(
counter
=
0
;
counter
<
num_filters
&&
!
found
;
counter
++
)
{
if
(
strcmp
(
name
,
filters
[
counter
].
nom_f
)
==
0
)
{
for
(
int
counter
=
0
;
counter
<
num_filters
&&
!
found
;
counter
++
)
{
if
(
strcmp
(
name
,
filters
[
counter
].
nom_f
)
==
0
)
{
found
=
true
;
copy_filter
(
filters
[
counter
],
to_fill
);
}
...
...
@@ -145,7 +144,7 @@ void Pyramid::pyram_g_n(uint8_t *rep, int nStage, long nbc, long nbl, const uint
}
/*---------------------------------------------------------------------------
Cration d'une pyramide Laplacienne jusqu'au nime tage
Cr
e
ation d'une pyramide Laplacienne jusqu'au nime tage
---------------------------------------------------------------------------*/
void
Pyramid
::
pyram_l_n
(
uint8_t
*
rep
,
int
n
,
long
nbc
,
long
nbl
,
const
uint8_t
*
itab
,
filtre
&
utile
)
{
...
...
@@ -210,13 +209,15 @@ Image *Pyramid::pyram_g(const GrayscaleImage *im, int etage_f, filtre &utile, st
GrayscaleImage
*
resImg
=
new
GrayscaleImage
(
im
->
getWidth
(),
im
->
getHeight
()
*
2
);
uint8_t
*
rep
=
resImg
->
begin
();
cout
<<
"rep = "
<<
(
uintptr_t
)
rep
<<
endl
;
int
temp_etage_max
=
etage_max
(
im
);
int
temp_etage_max
=
etage_max
(
im
);
if
(
etage_f
>
temp_etage_max
)
etage_f
=
temp_etage_max
;
if
(
etage_f
<
1
)
etage_f
=
1
;
pyram_g_n
(
rep
,
etage_f
,
nbc
,
nbl
,
itab
,
utile
);
to_print
=
entropie_p
(
rep
,
etage_f
,
nbc
,
nbl
);
reconstruction
(
rep
,
etage_f
,
nbc
,
nbl
);
pyram_g_n
(
rep
,
etage_f
,
nbc
,
nbl
,
itab
,
utile
);
to_print
=
entropie_p
(
rep
,
etage_f
,
nbc
,
nbl
);
reconstruction
(
rep
,
etage_f
,
nbc
,
nbl
);
return
resImg
;
}
...
...
@@ -553,7 +554,7 @@ int Pyramid::etage_max(const Image *im)
int
i
;
int
taille_c
=
im
->
getWidth
();
int
taille_l
=
im
->
getHeight
();
for
(
i
=
0
;
taille_c
||
taille_l
>
1
;
i
++
)
for
(
i
=
0
;
taille_c
>
1
&&
taille_l
>
1
;
i
++
)
{
taille_c
=
taille_c
/
2
;
taille_l
=
taille_l
/
2
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment