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
3a39a178
Commit
3a39a178
authored
Aug 11, 2015
by
Patrik Huber
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Renamed CameraParameters to RenderingParameters, improved documentation
parent
fb556283
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
10 deletions
+12
-10
include/eos/fitting/nonlinear_camera_estimation.hpp
include/eos/fitting/nonlinear_camera_estimation.hpp
+12
-10
No files found.
include/eos/fitting/nonlinear_camera_estimation.hpp
View file @
3a39a178
...
@@ -51,10 +51,12 @@ struct Frustum
...
@@ -51,10 +51,12 @@ struct Frustum
* @brief Represents a set of estimated model parameters (rotation, translation) and
* @brief Represents a set of estimated model parameters (rotation, translation) and
* camera parameters (viewing frustum).
* camera parameters (viewing frustum).
*
*
* Strictly speaking, the estimated rotation and translation are not camera parameters, they
* The estimated rotation and translation transform the model from model-space to camera-space,
* are the values that transform the model from model-space to camera-space, so they are the
* and, if one wishes to use OpenGL, can be used to build the model-view matrix.
* inverse of the camera position.
* The parameters are the inverse of the camera position in 3D space.
* The camera frustum describes the size of the viewing plane of the camera.
*
* The camera frustum describes the size of the viewing plane of the camera, and
* can be used to build an OpenGL-conformant orthographic projection matrix.
*
*
* Together, these parameters fully describe the imaging process of a given model instance
* Together, these parameters fully describe the imaging process of a given model instance
* (under an orthographic projection).
* (under an orthographic projection).
...
@@ -62,11 +64,11 @@ struct Frustum
...
@@ -62,11 +64,11 @@ struct Frustum
* The rotation values are given in radians and estimated using the RPY convention.
* The rotation values are given in radians and estimated using the RPY convention.
* Yaw is applied first to the model, then pitch, then roll (R * P * Y * vertex).
* Yaw is applied first to the model, then pitch, then roll (R * P * Y * vertex).
*/
*/
struct
Camera
Parameters
struct
Rendering
Parameters
{
{
float
r_x
;
//
pitch
float
r_x
;
//
Pitch.
float
r_y
;
//
yaw. positive means subject is looking left (we see his/
her right cheek).
float
r_y
;
//
Yaw. Positive means subject is looking left (we see
her right cheek).
float
r_z
;
//
roll
float
r_z
;
//
Roll. Positive means the subject's right eye is further down than the other one (he tilts his head to the right).
float
t_x
;
float
t_x
;
float
t_y
;
float
t_y
;
Frustum
frustum
;
Frustum
frustum
;
...
@@ -97,7 +99,7 @@ struct CameraParameters
...
@@ -97,7 +99,7 @@ struct CameraParameters
* @param[in] height Height of the image (or viewport).
* @param[in] height Height of the image (or viewport).
* @return The estimated model and camera parameters.
* @return The estimated model and camera parameters.
*/
*/
Camera
Parameters
estimate_orthographic_camera
(
std
::
vector
<
cv
::
Vec2f
>
image_points
,
std
::
vector
<
cv
::
Vec4f
>
model_points
,
int
width
,
int
height
)
Rendering
Parameters
estimate_orthographic_camera
(
std
::
vector
<
cv
::
Vec2f
>
image_points
,
std
::
vector
<
cv
::
Vec4f
>
model_points
,
int
width
,
int
height
)
{
{
using
cv
::
Mat
;
using
cv
::
Mat
;
assert
(
image_points
.
size
()
==
model_points
.
size
());
assert
(
image_points
.
size
()
==
model_points
.
size
());
...
@@ -121,7 +123,7 @@ CameraParameters estimate_orthographic_camera(std::vector<cv::Vec2f> image_point
...
@@ -121,7 +123,7 @@ CameraParameters estimate_orthographic_camera(std::vector<cv::Vec2f> image_point
// 'parameters' contains the solution now.
// 'parameters' contains the solution now.
Frustum
camera_frustum
{
-
1.0
f
*
aspect
*
parameters
[
5
],
1.0
f
*
aspect
*
parameters
[
5
],
-
1.0
f
*
parameters
[
5
],
1.0
f
*
parameters
[
5
]
};
Frustum
camera_frustum
{
-
1.0
f
*
aspect
*
parameters
[
5
],
1.0
f
*
aspect
*
parameters
[
5
],
-
1.0
f
*
parameters
[
5
],
1.0
f
*
parameters
[
5
]
};
return
Camera
Parameters
{
static_cast
<
float
>
(
parameters
[
0
]),
static_cast
<
float
>
(
parameters
[
1
]),
static_cast
<
float
>
(
parameters
[
2
]),
static_cast
<
float
>
(
parameters
[
3
]),
static_cast
<
float
>
(
parameters
[
4
]),
camera_frustum
};
return
Rendering
Parameters
{
static_cast
<
float
>
(
parameters
[
0
]),
static_cast
<
float
>
(
parameters
[
1
]),
static_cast
<
float
>
(
parameters
[
2
]),
static_cast
<
float
>
(
parameters
[
3
]),
static_cast
<
float
>
(
parameters
[
4
]),
camera_frustum
};
};
};
}
/* namespace fitting */
}
/* namespace fitting */
...
...
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