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
3aec0646
Commit
3aec0646
authored
7 years ago
by
Bigot Quentin
Browse files
Options
Downloads
Patches
Plain Diff
modified hough2 algorithm + added detiq-t modifications
parent
95156633
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/Operations/Transforms.cpp
+8
-8
8 additions, 8 deletions
app/Operations/Transforms.cpp
lib/detiq-t
+1
-1
1 addition, 1 deletion
lib/detiq-t
with
9 additions
and
9 deletions
app/Operations/Transforms.cpp
+
8
−
8
View file @
3aec0646
...
@@ -106,7 +106,7 @@ Image_t<double>* Transforms::hough2(const Image *image, double angleStep, double
...
@@ -106,7 +106,7 @@ Image_t<double>* Transforms::hough2(const Image *image, double angleStep, double
// double imageDiag = image->getWidth() * sqrt(2.);
// double imageDiag = image->getWidth() * sqrt(2.);
double
imageDiag
=
sqrt
(
image
->
getWidth
()
*
image
->
getWidth
()
+
image
->
getHeight
()
*
image
->
getHeight
());
double
imageDiag
=
sqrt
(
image
->
getWidth
()
*
image
->
getWidth
()
+
image
->
getHeight
()
*
image
->
getHeight
());
Image_t
<
double
>*
resImg
=
new
Image_t
<
double
>
(
1.
+
imageDiag
/
rhoStep
,
180.
/
angleStep
+
0.5
,
image
->
getNbChannels
(),
0.
);
Image_t
<
double
>*
resImg
=
new
Image_t
<
double
>
(
1.
+
imageDiag
/
rhoStep
,
(
180.
+
90
)
/
angleStep
+
0.5
,
image
->
getNbChannels
(),
0.
);
for
(
unsigned
int
c
=
0
;
c
<
image
->
getNbChannels
();
++
c
)
{
for
(
unsigned
int
c
=
0
;
c
<
image
->
getNbChannels
();
++
c
)
{
...
@@ -118,12 +118,12 @@ Image_t<double>* Transforms::hough2(const Image *image, double angleStep, double
...
@@ -118,12 +118,12 @@ Image_t<double>* Transforms::hough2(const Image *image, double angleStep, double
if
(
image
->
getPixelAt
(
i
,
j
,
c
)
==
255
)
if
(
image
->
getPixelAt
(
i
,
j
,
c
)
==
255
)
{
{
//TODO : parcourir entre -180 et 90
//TODO : parcourir entre -180 et 90
for
(
double
te
=
0
;
te
<
180
;
te
+=
angleStep
)
// on parcourt la matrice
for
(
double
te
=
-
9
0
;
te
<
180
;
te
+=
angleStep
)
// on parcourt la matrice
{
{
//
const double coste = cos(te * pi / 180.);
const
double
coste
=
cos
(
te
*
pi
/
180.
);
const
double
coste
=
1
;
//
double sinte = sin(te * pi / 180.);
double
sinte
=
sin
(
te
*
pi
/
180.
);
double
sinte
=
1
;
// for(double ro = 0; ro < imageDiag; ro += rhoStep)
// for(double ro = 0; ro < imageDiag; ro += rhoStep)
// {
// {
...
@@ -133,14 +133,14 @@ Image_t<double>* Transforms::hough2(const Image *image, double angleStep, double
...
@@ -133,14 +133,14 @@ Image_t<double>* Transforms::hough2(const Image *image, double angleStep, double
// resImg->pixelAt(ro / rhoStep, te / angleStep)++;
// resImg->pixelAt(ro / rhoStep, te / angleStep)++;
// }
// }
// }
// }
const
double
rho
=
i
*
coste
+
j
*
sinte
;
const
double
rho
=
i
*
coste
+
j
*
sinte
;
//(image->getHeight()-j)
// const double start = max(0., delta);
// const double start = max(0., delta);
// const double end = min(imageDiag, delta + rhoStep);
// const double end = min(imageDiag, delta + rhoStep);
// for(double ro = start; ro < end; ro += rhoStep)
// for(double ro = start; ro < end; ro += rhoStep)
if
(
rho
>=
0.
&&
rho
<
imageDiag
)
if
(
rho
>=
0.
&&
rho
<
imageDiag
)
{
{
resImg
->
pixelAt
(
rho
/
rhoStep
+
0.5
,
te
/
angleStep
+
0.5
,
c
)
++
;
resImg
->
pixelAt
(
rho
/
rhoStep
+
0.5
,
(
te
+
90
)
/
angleStep
+
0.5
,
c
)
++
;
}
}
}
}
}
}
...
...
This diff is collapsed.
Click to expand it.
detiq-t
@
80da2710
Compare
69a111e9
...
80da2710
Subproject commit
69a111e904d12520d9c1e301b41a6debcf445711
Subproject commit
80da27102f24d1f5d018f819b590b926d34a56f3
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