licornea_tools
Main Page
Classes
Files
File List
File Members
src
calibration
lib
feature_point.cc
Go to the documentation of this file.
1
#include "
feature_point.h
"
2
3
namespace
tlz
{
4
5
feature_point
decode_feature_point
(
const
json
& j_pt) {
6
feature_point
pt;
7
pt.
position
[0] = j_pt[
"x"
];
8
pt.
position
[1] = j_pt[
"y"
];
9
pt.
depth
=
get_or
(j_pt,
"depth"
, 0.0);
10
pt.
weight
=
get_or
(j_pt,
"weight"
, 1.0);
11
return
pt;
12
}
13
14
15
json
encode_feature_point
(
const
feature_point
& pt) {
16
json
j_pt = json::object();
17
j_pt[
"x"
] = pt.
position
[0];
18
j_pt[
"y"
] = pt.
position
[1];
19
if
(pt.
depth
!= 0.0) j_pt[
"depth"
] = pt.
depth
;
20
if
(pt.
weight
!= 1.0) j_pt[
"weight"
] = pt.
weight
;
21
return
j_pt;
22
}
23
24
}
tlz::feature_point::weight
real weight
Definition:
feature_point.h:12
tlz::decode_feature_point
feature_point decode_feature_point(const json &j_pt)
Definition:
feature_point.cc:5
tlz::feature_point::position
vec2 position
Definition:
feature_point.h:10
tlz::feature_point
Definition:
feature_point.h:9
tlz::encode_feature_point
json encode_feature_point(const feature_point &pt)
Definition:
feature_point.cc:15
feature_point.h
tlz::json
nlohmann::json json
Definition:
json.h:11
tlz::get_or
T get_or(const json &j, const std::string &key, const T &default_value)
Definition:
json.h:28
tlz
Definition:
feature_slopes.cc:7
tlz::feature_point::depth
real depth
Definition:
feature_point.h:11
Generated by
1.8.11