Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
E
eos
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Richard Torenvliet
eos
Commits
7aa30194
Commit
7aa30194
authored
Dec 04, 2016
by
Patrik Huber
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added viewport matrix to Matlab fitting output
parent
50e78983
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
0 deletions
+14
-0
matlab/include/mexplus_eos_types.hpp
matlab/include/mexplus_eos_types.hpp
+14
-0
No files found.
matlab/include/mexplus_eos_types.hpp
View file @
7aa30194
...
@@ -158,10 +158,24 @@ mxArray* MxArray::from(const eos::fitting::RenderingParameters& rendering_parame
...
@@ -158,10 +158,24 @@ mxArray* MxArray::from(const eos::fitting::RenderingParameters& rendering_parame
return
"unknown"
;
return
"unknown"
;
}
}
}();
}();
// Since we don't expose get_opencv_viewport(), and Matlab doesn't have glm::project()
// anyway, we'll make a 4x4 viewport matrix available. Matlab seems to have the same
// convention than OpenCV (top-left is the image origin).
auto
viewport
=
eos
::
fitting
::
get_opencv_viewport
(
rendering_parameters
.
get_screen_width
(),
rendering_parameters
.
get_screen_height
());
glm
::
mat4x4
viewport_matrix
;
// Identity matrix
viewport_matrix
[
0
][
0
]
=
0.5
f
*
viewport
[
2
];
viewport_matrix
[
3
][
0
]
=
0.5
f
*
viewport
[
2
]
+
viewport
[
0
];
viewport_matrix
[
1
][
1
]
=
0.5
f
*
viewport
[
3
];
viewport_matrix
[
3
][
1
]
=
0.5
f
*
viewport
[
3
]
+
viewport
[
1
];
viewport_matrix
[
2
][
2
]
=
0.5
f
;
viewport_matrix
[
3
][
2
]
=
0.5
f
;
out_array
.
set
(
"camera_type"
,
camera_type
);
out_array
.
set
(
"camera_type"
,
camera_type
);
out_array
.
set
(
"rotation_quaternion"
,
rendering_parameters
.
get_rotation
());
out_array
.
set
(
"rotation_quaternion"
,
rendering_parameters
.
get_rotation
());
out_array
.
set
(
"modelview"
,
rendering_parameters
.
get_modelview
());
out_array
.
set
(
"modelview"
,
rendering_parameters
.
get_modelview
());
out_array
.
set
(
"projection"
,
rendering_parameters
.
get_projection
());
out_array
.
set
(
"projection"
,
rendering_parameters
.
get_projection
());
out_array
.
set
(
"viewport"
,
viewport_matrix
);
out_array
.
set
(
"screen_width"
,
rendering_parameters
.
get_screen_width
());
out_array
.
set
(
"screen_width"
,
rendering_parameters
.
get_screen_width
());
out_array
.
set
(
"screen_height"
,
rendering_parameters
.
get_screen_height
());
out_array
.
set
(
"screen_height"
,
rendering_parameters
.
get_screen_height
());
...
...
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