Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
D
dlib
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
钟尚武
dlib
Commits
73231f43
Commit
73231f43
authored
Mar 23, 2015
by
Davis King
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added an optional scale output to the camera_transform.
parent
a8055361
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
26 additions
and
3 deletions
+26
-3
point_transforms.h
dlib/geometry/point_transforms.h
+12
-3
point_transforms_abstract.h
dlib/geometry/point_transforms_abstract.h
+14
-0
No files found.
dlib/geometry/point_transforms.h
View file @
73231f43
...
...
@@ -842,19 +842,28 @@ namespace dlib
double
get_camera_field_of_view
()
const
{
return
camera_field_of_view
;
}
unsigned
long
get_num_pixels
()
const
{
return
num_pixels
;
}
dpoint
operator
()
(
const
vector
<
double
>&
p
inline
dpoint
operator
()
(
const
vector
<
double
>&
p
,
double
&
scale
)
const
{
vector
<
double
>
temp
=
p
-
camera_pos
;
temp
=
proj
*
temp
;
const
double
distance
=
temp
.
z
()
>
0
?
temp
.
z
()
:
1e-9
;
const
double
scale
=
dist_scale
/
distance
;
scale
=
dist_scale
/
distance
;
temp
.
x
()
=
temp
.
x
()
*
scale
+
width
;
temp
.
y
()
=
temp
.
y
()
*
scale
+
width
;
return
temp
;
}
dpoint
operator
()
(
const
vector
<
double
>&
p
)
const
{
double
scale
;
return
(
*
this
)(
p
,
scale
);
}
inline
friend
void
serialize
(
const
camera_transform
&
item
,
std
::
ostream
&
out
)
{
serialize
(
item
.
camera_pos
,
out
);
...
...
dlib/geometry/point_transforms_abstract.h
View file @
73231f43
...
...
@@ -632,6 +632,20 @@ namespace dlib
plane is returned.
!*/
dpoint
operator
()
(
const
vector
<
double
>&
p
,
double
&
scale
)
const
;
/*!
ensures
- Maps the given 3D point p into the 2D image plane defined by the camera
parameters given to this object's constructor. The 2D point in the image
plane is returned.
- #scale == a number that tells you how large things are at the point p.
Objects further from the camera appear smaller, in particular, they
appear #scale times their normal size.
!*/
vector
<
double
>
get_camera_pos
(
)
const
;
/*!
...
...
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