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
178a0802
Commit
178a0802
authored
6 years ago
by
ariotte
Browse files
Options
Downloads
Patches
Plain Diff
fixed axis in hough transform
parent
ee04bebb
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/Operations/Transforms.cpp
+2
-7
2 additions, 7 deletions
app/Operations/Transforms.cpp
with
2 additions
and
7 deletions
app/Operations/Transforms.cpp
+
2
−
7
View file @
178a0802
...
...
@@ -33,7 +33,7 @@ const double pi = 3.1415926535897932384626433832795;
const
double
pid2
=
1.57079632679489661923132169163975144209858469968755291
;
const
double
sqrt2
=
1.414213562373095048801688724209698078569671875376948
;
Image_t
<
double
>*
Transforms
::
hough
(
const
GrayscaleImage
*
image
)
{
//TODO : inverser i et j i (ligne) et j (colonne)
Image_t
<
double
>*
Transforms
::
hough
(
const
GrayscaleImage
*
image
)
{
double
diag
=
sqrt
(
image
->
getWidth
()
*
image
->
getWidth
()
+
image
->
getHeight
()
*
image
->
getHeight
());
...
...
@@ -187,7 +187,6 @@ string Transforms::hough2_inverse(const Image_t<double> *image, Image** resImgpt
//Algorithme de traitement
int
cmpt
=
0
;
for
(
unsigned
int
c
=
0
;
c
<
image
->
getNbChannels
();
++
c
)
{
for
(
unsigned
int
i
=
0
;
i
<
image
->
getHeight
();
++
i
)
{
for
(
unsigned
int
j
=
0
;
j
<
image
->
getWidth
();
++
j
)
{
...
...
@@ -195,13 +194,12 @@ string Transforms::hough2_inverse(const Image_t<double> *image, Image** resImgpt
int
n
=
image
->
getPixelAt
(
j
,
i
,
c
);
if
(
n
>=
threshold
)
{
cmpt
++
;
double
angle
=
pi
*
(
j
*
angleStep
-
90
)
/
180
;
double
rho
=
rhoStep
*
i
-
imageDiag
;
double
sinte
=
sin
(
angle
);
double
coste
=
cos
(
angle
);
//Construction de la droite d'quation rho = x*coste + y*sinte
//Construction de la droite d'
e
quation rho = x*coste + y*sinte
for
(
unsigned
int
jj
=
0
;
jj
<
height
;
++
jj
)
{
double
x
=
jj
;
double
y
=
(
rho
-
x
*
coste
)
/
sinte
;
...
...
@@ -224,9 +222,6 @@ string Transforms::hough2_inverse(const Image_t<double> *image, Image** resImgpt
}
}
// sprintf( tampon,"\nNombre de droites traces=%d",cmpt);
// strcat( buffer, tampon);
//On applique une mise à l'echelle de l'image pour mettre la valeur max a 255
std
::
cout
<<
resImg
->
max
()
<<
std
::
endl
;
Image
*
resStdImg
=
new
Image
(
resImg
->
getWidth
(),
resImg
->
getHeight
(),
resImg
->
getNbChannels
());
...
...
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