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
89393f73
Commit
89393f73
authored
6 years ago
by
ariotte
Browse files
Options
Downloads
Patches
Plain Diff
added entropy print for one step pyramide
parent
9026d613
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
app/Algorithms/Pyramid.cpp
+24
-4
24 additions, 4 deletions
app/Algorithms/Pyramid.cpp
app/Algorithms/Pyramid.h
+16
-4
16 additions, 4 deletions
app/Algorithms/Pyramid.h
with
40 additions
and
8 deletions
app/Algorithms/Pyramid.cpp
+
24
−
4
View file @
89393f73
...
...
@@ -257,7 +257,7 @@ Image *Pyramid::pyram_g(const GrayscaleImage *im, int etage_f, Filtre &utile, st
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
);
to_print
=
entropie_p
(
rep
,
etage_f
,
nbc
,
nbl
);
reconstruction
(
rep
,
etage_f
,
nbc
,
nbl
);
return
resImg
;
...
...
@@ -265,7 +265,7 @@ Image *Pyramid::pyram_g(const GrayscaleImage *im, int etage_f, Filtre &utile, st
/*---------------------------------------------------------------------------
Cration d'un tage de la pyramide Gaussienne
---------------------------------------------------------------------------*/
Image
*
Pyramid
::
n_pyram_g
(
const
Image
*
im
,
int
etage_f
,
Filtre
&
utile
)
Image
*
Pyramid
::
n_pyram_g
(
const
Image
*
im
,
int
etage_f
,
Filtre
&
utile
,
std
::
string
&
to_print
)
{
if
(
!
(
im
!=
NULL
))
{
throw
"Error in Pyramid::pyram_g:
\n
im = NULL"
;
...
...
@@ -305,6 +305,7 @@ Image *Pyramid::n_pyram_g(const Image *im, int etage_f, Filtre &utile )
rep
[
i
]
=
tab
[
i
+
k
];
}
delete
[]
tab
;
to_print
=
n_entropie_p
(
rep
,
etage_f
,
nbc
,
nbl
);
return
resImg
;
}
/*---------------------------------------------------------------------------
...
...
@@ -334,7 +335,7 @@ Image *Pyramid::pyram_l (const Image *im, int etage_f, Filtre &utile, string &to
if
(
etage_f
<
1
)
etage_f
=
1
;
pyram_l_n
(
rep
,
etage_f
,
nbc
,
nbl
,
itab
,
utile
);
to_print
=
entropie_p
(
rep
,
etage_f
,
nbc
,
nbl
);
to_print
=
entropie_p
(
rep
,
etage_f
,
nbc
,
nbl
);
reconstruction
(
rep
,
etage_f
,
nbc
,
nbl
);
return
resImg
;
...
...
@@ -343,7 +344,7 @@ Image *Pyramid::pyram_l (const Image *im, int etage_f, Filtre &utile, string &to
/*---------------------------------------------------------------------------
Cration d'un tage de la pyramide Laplacienne
---------------------------------------------------------------------------*/
Image
*
Pyramid
::
n_pyram_l
(
const
Image
*
im
,
int
etage_f
,
Filtre
&
utile
)
Image
*
Pyramid
::
n_pyram_l
(
const
Image
*
im
,
int
etage_f
,
Filtre
&
utile
,
std
::
string
&
to_print
)
{
if
(
!
(
im
!=
NULL
))
{
throw
"Error in Pyramid::pyram_g:
\n
im = NULL"
;
...
...
@@ -383,6 +384,7 @@ Image *Pyramid::n_pyram_l(const Image *im, int etage_f, Filtre &utile)
{
rep
[
i
]
=
tab
[
i
+
k
];
}
to_print
=
n_entropie_p
(
rep
,
etage_f
,
nbc
,
nbl
);
delete
[]
tab
;
return
resImg
;
}
...
...
@@ -665,6 +667,24 @@ string Pyramid::entropie_p(const uint8_t *pyra,int etage_f,int nbc,int nbl)
return
returnval
;
}
string
Pyramid
::
n_entropie_p
(
const
uint8_t
*
pyra
,
int
etage_f
,
int
nbc
,
int
nbl
)
{
int
i
;
float
h
;
int
taille_c
=
nbc
;
int
taille_l
=
nbl
;
for
(
i
=
0
;
i
<
etage_f
;
i
++
)
{
taille_c
=
taille_c
/
2
;
taille_l
=
taille_l
/
2
;
}
char
buffer
[
255
];
string
returnval
;
h
=
entropie2
(
pyra
,
taille_c
,
taille_l
);
sprintf
(
buffer
,
QString
(
qApp
->
translate
(
"Operations"
,
"L'entropie de l'etage %d est %1f
\n
"
)).
toUtf8
(),
i
,
h
);
returnval
=
returnval
+
buffer
;
return
returnval
;
}
Image
*
Pyramid
::
rebuild_interface
(
const
Image
*
pyramid
,
int
etage_f
,
int
pyramid_to
,
Filtre
&
utile
)
{
// rebuilds from an image that was saved
...
...
This diff is collapsed.
Click to expand it.
app/Algorithms/Pyramid.h
+
16
−
4
View file @
89393f73
...
...
@@ -61,8 +61,7 @@ namespace Pyramid
* \Class Filters
* \Brief A class used for pyramid operation
*
* This class regroup all the operation needed for pyramid operation
* This also contain all the filters possible in a tab
* This class regroup all all the filters possible in a tab
*/
class
Filters
{
...
...
@@ -166,7 +165,7 @@ namespace Pyramid
* @param utile filter to use
* @return imagein::Image* the image of the new pyramid
*/
imagein
::
Image
*
n_pyram_g
(
const
imagein
::
Image
*
im
,
int
etage_f
,
Filtre
&
utile
);
imagein
::
Image
*
n_pyram_g
(
const
imagein
::
Image
*
im
,
int
etage_f
,
Filtre
&
utile
,
std
::
string
&
to_print
);
/**
* @brief Create a Laplacian pyramid and return an image of it
...
...
@@ -187,7 +186,7 @@ namespace Pyramid
* @param utile filter to use
* @return imagein::Image* the image of the new pyramid
*/
imagein
::
Image
*
n_pyram_l
(
const
imagein
::
Image
*
im
,
int
etage_f
,
Filtre
&
utile
);
imagein
::
Image
*
n_pyram_l
(
const
imagein
::
Image
*
im
,
int
etage_f
,
Filtre
&
utile
,
std
::
string
&
to_print
);
/**
* @brief Proccess the value by applying filter on lign
...
...
@@ -279,6 +278,19 @@ namespace Pyramid
* @return std::string the printable entropy
*/
std
::
string
entropie_p
(
const
uint8_t
*
pyra
,
int
etage_f
,
int
nbc
,
int
nbl
);
/**
* @brief Return a directly printable string of the entropy for only one level
*
* @param pyra data to proccess entropy
* @param etage_f the level of entropy
* @param nbc number of column
* @param nbl number of lign
* @return std::string the printable entropy
*/
std
::
string
n_entropie_p
(
const
uint8_t
*
pyra
,
int
etage_f
,
int
nbc
,
int
nbl
);
/**
* @brief Return the image reconstructed from a pyramide
*
...
...
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