Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
E
eos
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
Model registry
Operate
Environments
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
Richard Torenvliet
eos
Commits
c72b0f3d
Commit
c72b0f3d
authored
8 years ago
by
Patrik Huber
Browse files
Options
Downloads
Patches
Plain Diff
Remove conversion to glm in estimate_orthographic_projection_linear() binding
parent
1c3b0113
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
python/generate-python-bindings.cpp
+2
-7
2 additions, 7 deletions
python/generate-python-bindings.cpp
with
2 additions
and
7 deletions
python/generate-python-bindings.cpp
+
2
−
7
View file @
c72b0f3d
...
...
@@ -147,14 +147,9 @@ PYBIND11_PLUGIN(eos) {
.
def
(
"get_projection"
,
&
fitting
::
RenderingParameters
::
get_projection
,
"Returns the 4x4 projection matrix."
)
;
fitting_module
.
def
(
"estimate_orthographic_projection_linear"
,
[](
std
::
vector
<
glm
::
vec2
>
image_points
,
std
::
vector
<
glm
::
vec4
>
model_points
,
bool
is_viewport_upsidedown
,
int
viewport_height
)
{
// We take glm vec's (transparent conversion in python) and convert them to OpenCV vec's for now:
std
::
vector
<
cv
::
Vec2f
>
image_points_cv
;
std
::
for_each
(
std
::
begin
(
image_points
),
std
::
end
(
image_points
),
[
&
image_points_cv
](
auto
&&
p
)
{
image_points_cv
.
push_back
({
p
.
x
,
p
.
y
});
});
std
::
vector
<
cv
::
Vec4f
>
model_points_cv
;
std
::
for_each
(
std
::
begin
(
model_points
),
std
::
end
(
model_points
),
[
&
model_points_cv
](
auto
&&
p
)
{
model_points_cv
.
push_back
({
p
.
x
,
p
.
y
,
p
.
z
,
p
.
w
});
});
fitting_module
.
def
(
"estimate_orthographic_projection_linear"
,
[](
std
::
vector
<
cv
::
Vec2f
>
image_points
,
std
::
vector
<
cv
::
Vec4f
>
model_points
,
bool
is_viewport_upsidedown
,
int
viewport_height
)
{
const
boost
::
optional
<
int
>
viewport_height_opt
=
viewport_height
==
0
?
boost
::
none
:
boost
::
optional
<
int
>
(
viewport_height
);
return
fitting
::
estimate_orthographic_projection_linear
(
image_points
_cv
,
model_points
_cv
,
is_viewport_upsidedown
,
viewport_height_opt
);
return
fitting
::
estimate_orthographic_projection_linear
(
image_points
,
model_points
,
is_viewport_upsidedown
,
viewport_height_opt
);
},
"This algorithm estimates the parameters of a scaled orthographic projection, given a set of corresponding 2D-3D points."
,
py
::
arg
(
"image_points"
),
py
::
arg
(
"model_points"
),
py
::
arg
(
"is_viewport_upsidedown"
),
py
::
arg
(
"viewport_height"
)
=
0
)
;
...
...
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