Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
Monado
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
44
Issues
44
List
Boards
Labels
Service Desk
Milestones
Merge Requests
10
Merge Requests
10
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Monado
Monado
Commits
c0083be8
Commit
c0083be8
authored
Oct 01, 2019
by
Pete Black
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
remove full frame undistort and rectifies - needs testing
parent
51f3fac1
Pipeline
#67600
passed with stages
in 1 minute and 47 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
53 additions
and
28 deletions
+53
-28
src/xrt/auxiliary/tracking/t_tracker_psmv.cpp
src/xrt/auxiliary/tracking/t_tracker_psmv.cpp
+53
-28
No files found.
src/xrt/auxiliary/tracking/t_tracker_psmv.cpp
View file @
c0083be8
...
...
@@ -116,42 +116,62 @@ static void
do_view
(
TrackerPSMV
&
t
,
View
&
view
,
cv
::
Mat
&
grey
,
cv
::
Mat
&
rgb
)
{
// Undistort the whole image.
cv
::
remap
(
grey
,
// src
view
.
frame_undist
,
// dst
view
.
undistort_map_x
,
// map1
view
.
undistort_map_y
,
// map2
cv
::
INTER_LINEAR
,
// interpolation
cv
::
BORDER_CONSTANT
,
// borderMode
cv
::
Scalar
(
0
,
0
,
0
));
// borderValue
// Rectify the whole image.
cv
::
remap
(
view
.
frame_undist
,
// src
view
.
frame_rectified
,
// dst
view
.
rectify_map_x
,
// map1
view
.
rectify_map_y
,
// map2
cv
::
INTER_LINEAR
,
// interpolation
cv
::
BORDER_CONSTANT
,
// borderMode
cv
::
Scalar
(
0
,
0
,
0
));
// borderValue
cv
::
threshold
(
view
.
frame_rectified
,
// src
view
.
frame_rectified
,
// dst
32.0
,
// thresh
255.0
,
// maxval
0
);
// type
/*
cv::remap(grey, // src
view.frame_undist, // dst
view.undistort_map_x, // map1
view.undistort_map_y, // map2
cv::INTER_LINEAR, // interpolation
cv::BORDER_CONSTANT, // borderMode
cv::Scalar(0, 0, 0)); // borderValue
// Rectify the whole image.
cv::remap(view.frame_undist, // src
view.frame_rectified, // dst
view.rectify_map_x, // map1
view.rectify_map_y, // map2
cv::INTER_LINEAR, // interpolation
cv::BORDER_CONSTANT, // borderMode
cv::Scalar(0, 0, 0)); // borderValue
cv::threshold(grey
, // src
grey
, // dst
32.0, // thresh
255.0, // maxval
0); // type
*/
// tracker_measurement_t m = {};
// Do blob detection with our masks.
//! @todo Re-enable masks.
t
.
sbd
->
detect
(
view
.
frame_rectified
,
// image
view
.
keypoints
,
// keypoints
cv
::
noArray
());
// mask
t
.
sbd
->
detect
(
grey
,
// image
view
.
keypoints
,
// keypoints
cv
::
noArray
());
// mask
// undistort and rectify the blob centers using our maps
// TODO: interpolation
for
(
uint32_t
i
=
0
;
i
<
view
.
keypoints
.
size
();
i
++
)
{
cv
::
KeyPoint
*
kp
=
&
view
.
keypoints
.
at
(
i
);
int
ux
=
int
(
kp
->
pt
.
x
);
int
uy
=
int
(
kp
->
pt
.
y
);
// clamp to bounds
if
(
ux
>=
grey
.
cols
)
{
ux
=
grey
.
cols
-
1
;
}
if
(
uy
>=
grey
.
rows
)
{
uy
=
grey
.
rows
-
1
;
}
kp
->
pt
.
x
=
view
.
undistort_map_x
.
at
<
float
>
(
uy
,
ux
);
kp
->
pt
.
y
=
view
.
undistort_map_y
.
at
<
float
>
(
uy
,
ux
);
int
rx
=
int
(
kp
->
pt
.
x
);
int
ry
=
int
(
kp
->
pt
.
y
);
kp
->
pt
.
x
=
view
.
rectify_map_x
.
at
<
float
>
(
ry
,
rx
);
kp
->
pt
.
y
=
view
.
rectify_map_y
.
at
<
float
>
(
ry
,
rx
);
}
// Debug is wanted, draw the keypoints.
if
(
rgb
.
cols
>
0
)
{
cv
::
drawKeypoints
(
view
.
frame_rectified
,
// image
grey
,
// image
view
.
keypoints
,
// keypoints
rgb
,
// outImage
cv
::
Scalar
(
255
,
0
,
0
),
// color
...
...
@@ -217,6 +237,11 @@ procces(TrackerPSMV &t, struct xrt_frame *xf)
std
::
vector
<
cv
::
KeyPoint
>
l_blobs
,
r_blobs
;
for
(
uint32_t
i
=
0
;
i
<
t
.
view
[
0
].
keypoints
.
size
();
i
++
)
{
cv
::
KeyPoint
l_blob
=
t
.
view
[
0
].
keypoints
[
i
];
if
(
l_blob
.
pt
.
x
<
0
||
l_blob
.
pt
.
x
>
l_grey
.
cols
||
l_blob
.
pt
.
y
<
0
||
l_blob
.
pt
.
y
>
l_grey
.
rows
)
{
return
;
}
int
l_index
=
-
1
;
int
r_index
=
-
1
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment