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
acca22a9
Commit
acca22a9
authored
Jun 02, 2015
by
Davis King
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Made the camera_transform output the point's distance.
parent
1294d6d3
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
6 deletions
+11
-6
point_transforms.h
dlib/geometry/point_transforms.h
+6
-5
point_transforms_abstract.h
dlib/geometry/point_transforms_abstract.h
+5
-1
No files found.
dlib/geometry/point_transforms.h
View file @
acca22a9
...
...
@@ -853,13 +853,14 @@ namespace dlib
inline
dpoint
operator
()
(
const
vector
<
double
>&
p
,
double
&
scale
double
&
scale
,
double
&
distance
)
const
{
vector
<
double
>
temp
=
p
-
camera_pos
;
temp
=
proj
*
temp
;
const
double
distance
=
temp
.
z
()
>
0
?
temp
.
z
()
:
1e-9
;
scale
=
dist_scale
/
distance
;
distance
=
temp
.
z
()
;
scale
=
dist_scale
/
(
temp
.
z
()
>
0
?
temp
.
z
()
:
1e-9
)
;
temp
.
x
()
=
temp
.
x
()
*
scale
+
width
;
temp
.
y
()
=
temp
.
y
()
*
scale
+
width
;
return
temp
;
...
...
@@ -869,8 +870,8 @@ namespace dlib
const
vector
<
double
>&
p
)
const
{
double
scale
;
return
(
*
this
)(
p
,
scale
);
double
scale
,
distance
;
return
(
*
this
)(
p
,
scale
,
distance
);
}
inline
friend
void
serialize
(
const
camera_transform
&
item
,
std
::
ostream
&
out
)
...
...
dlib/geometry/point_transforms_abstract.h
View file @
acca22a9
...
...
@@ -644,7 +644,8 @@ namespace dlib
dpoint
operator
()
(
const
vector
<
double
>&
p
,
double
&
scale
double
&
scale
,
double
&
distance
)
const
;
/*!
ensures
...
...
@@ -654,6 +655,9 @@ namespace dlib
- #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.
- #distance == how far away the point is from the image plane. Objects in
front of the camera will have a positive distance and those behind a
negative distance.
!*/
vector
<
double
>
get_camera_pos
(
...
...
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