Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
wolf
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
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
mobile_robotics
wolf_projects
wolf_lib
wolf
Commits
10728286
Commit
10728286
authored
6 years ago
by
Mederic Fourmy
Browse files
Options
Downloads
Patches
Plain Diff
Added contrast increase in test apriltag
parent
a89b0d2a
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!233
WIP: Apriltag
Pipeline
#2379
passed
6 years ago
Stage: build
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/examples/processor_tracker_landmark_apriltag.yaml
+1
-1
1 addition, 1 deletion
src/examples/processor_tracker_landmark_apriltag.yaml
src/examples/test_apriltag.cpp
+20
-12
20 additions, 12 deletions
src/examples/test_apriltag.cpp
with
21 additions
and
13 deletions
src/examples/processor_tracker_landmark_apriltag.yaml
+
1
−
1
View file @
10728286
...
@@ -14,7 +14,7 @@ detector parameters:
...
@@ -14,7 +14,7 @@ detector parameters:
tag parameters
:
tag parameters
:
tag_family
:
"
tag36h11"
tag_family
:
"
tag36h11"
tag_black_border
:
1
tag_black_border
:
1
tag_width_default
:
0.05
2
# enter -1 here if you want to provide a map of [ tagid : tag_width ], see lines just below
tag_width_default
:
0.05
5
# enter -1 here if you want to provide a map of [ tagid : tag_width ], see lines just below
tag widths
:
tag widths
:
#1 : 0.2
#1 : 0.2
...
...
This diff is collapsed.
Click to expand it.
src/examples/test_apriltag.cpp
+
20
−
12
View file @
10728286
...
@@ -24,24 +24,18 @@
...
@@ -24,24 +24,18 @@
#include
<opencv2/imgproc/imgproc.hpp>
#include
<opencv2/imgproc/imgproc.hpp>
#include
"opencv2/opencv.hpp"
#include
"opencv2/opencv.hpp"
#define CONTRAST
#define IMAGE_OUTPUT
#define IMAGE_OUTPUT
bool
str_ends_with
(
std
::
string
const
&
fullString
,
std
::
string
const
&
ending
)
{
if
(
fullString
.
length
()
>=
ending
.
length
())
{
return
(
0
==
fullString
.
compare
(
fullString
.
length
()
-
ending
.
length
(),
ending
.
length
(),
ending
));
}
else
{
return
false
;
}
}
int
main
(
int
argc
,
char
*
argv
[])
int
main
(
int
argc
,
char
*
argv
[])
{
{
/*
/*
* HOW TO USE ?
* HOW TO USE ?
* For now, just call the executable and append the list of images to be processed
* For now, just call the executable and append the list of images to be processed
.
*
For example, if you want to process only one image located at wolf/bin/images/frame1.jpg
*
The images must be placed in the root folder of your wolf project.
*
and if wolf_root is correctly set. then just run (from wolf/bin)
*
Ex:
* ./test_apriltag
/bin/images/
frame
1
.jpg
* ./test_apriltag
frame1.jpg frame2.jpg
frame
3
.jpg
*/
*/
using
namespace
wolf
;
using
namespace
wolf
;
...
@@ -89,6 +83,20 @@ int main(int argc, char *argv[])
...
@@ -89,6 +83,20 @@ int main(int argc, char *argv[])
if
(
frame
.
data
)
//if imread succeeded
if
(
frame
.
data
)
//if imread succeeded
{
{
#ifdef CONTRAST
Scalar
alpha
=
2.0
;
// to tune contrast [1-3]
int
beta
=
0
;
// to tune lightness [0-100]
// Do the operation new_image(i,j) = alpha*image(i,j) + beta
for
(
int
y
=
0
;
y
<
frame
.
rows
;
y
++
){
for
(
int
x
=
0
;
x
<
frame
.
cols
;
x
++
){
for
(
int
c
=
0
;
c
<
3
;
c
++
){
frame
.
at
<
cv
::
Vec3b
>
(
y
,
x
)[
c
]
=
cv
::
saturate_cast
<
uchar
>
(
alpha
*
(
frame
.
at
<
cv
::
Vec3b
>
(
y
,
x
)[
c
]
)
+
beta
);
}
}
}
#endif
CaptureImagePtr
cap
=
std
::
make_shared
<
CaptureImage
>
(
ts
,
sen_cam
,
frame
);
CaptureImagePtr
cap
=
std
::
make_shared
<
CaptureImage
>
(
ts
,
sen_cam
,
frame
);
// cap->setType(argv[input]); // only for problem->print() to show img filename
// cap->setType(argv[input]); // only for problem->print() to show img filename
cap
->
setName
(
argv
[
input
]);
cap
->
setName
(
argv
[
input
]);
...
@@ -125,7 +133,7 @@ int main(int argc, char *argv[])
...
@@ -125,7 +133,7 @@ int main(int argc, char *argv[])
cv
::
line
(
img
->
getImage
(),
fa
->
getTagCorners
()[
3
],
fa
->
getTagCorners
()[
0
],
cv
::
Scalar
(
0
,
255
,
0
));
cv
::
line
(
img
->
getImage
(),
fa
->
getTagCorners
()[
3
],
fa
->
getTagCorners
()[
0
],
cv
::
Scalar
(
0
,
255
,
0
));
}
}
cv
::
imshow
(
img
->
getName
(),
img
->
getImage
()
);
// display original image.
cv
::
imshow
(
img
->
getName
(),
img
->
getImage
()
);
// display original image.
cv
::
waitKey
(
1
);
cv
::
waitKey
(
0.
1
);
}
}
}
}
}
}
...
...
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