57 bool Init(
const Eigen::Matrix3d &homography_im2car,
61 const Eigen::Affine3d &world2camera,
64 std::string
Name()
const override;
67 bool DetermineCipv(
const std::vector<base::LaneLine> &lane_objects,
69 const Eigen::Affine3d &world2camera,
70 std::vector<std::shared_ptr<base::Object>> *objects);
74 const Eigen::Affine3d &world2camera,
75 std::vector<std::shared_ptr<base::Object>> *objects);
78 const float velocity,
const float time_unit,
81 const float velocity,
const float time_unit,
82 const float vehicle_half_width,
float *center_x,
83 float *ceneter_y,
float *left_x,
float *left_y,
84 float *right_x,
float *right_y);
88 const float offset_distance,
94 bool DistanceFromPointToLineSegment(
const Point2Df &point,
95 const Point2Df &line_seg_start_point,
100 bool GetEgoLane(
const std::vector<base::LaneLine> &lane_objects,
102 bool *b_left_valid,
bool *b_right_valid);
105 bool ElongateEgoLane(
const std::vector<base::LaneLine> &lane_objects,
106 const bool b_left_valid,
const bool b_right_valid,
107 const float yaw_rate,
const float velocity,
109 bool CreateVirtualEgoLane(
const float yaw_rate,
const float velocity,
113 bool FindClosestObjectImage(
const std::shared_ptr<base::Object> &
object,
119 bool FindClosestObjectGround(
const std::shared_ptr<base::Object> &
object,
121 const Eigen::Affine3d &world2camera,
126 bool AreDistancesSane(
const float distance_start_point_to_right_lane,
127 const float distance_start_point_to_left_lane,
128 const float distance_end_point_to_right_lane,
129 const float distance_end_point_to_left_lane);
132 bool IsObjectInTheLaneImage(
const std::shared_ptr<base::Object> &
object,
133 const EgoLane &egolane_image,
float *distance);
142 bool IsObjectInTheLaneGround(
const std::shared_ptr<base::Object> &
object,
144 const Eigen::Affine3d &world2camera,
145 const bool b_virtual,
float *distance);
148 bool IsObjectInTheLane(
const std::shared_ptr<base::Object> &
object,
151 const Eigen::Affine3d &world2camera,
152 const bool b_virtual,
float *distance);
155 bool IsPointLeftOfLine(
const Point2Df &point,
156 const Point2Df &line_seg_start_point,
157 const Point2Df &line_seg_end_point);
162 const float yaw_rate,
const float offset_distance,
166 bool TranformPoint(
const Eigen::VectorXf &in,
167 const Eigen::Matrix4f &motion_matrix,
168 Eigen::Vector3d *out);
170 bool image2ground(
const float image_x,
const float image_y,
float *ground_x,
172 bool ground2image(
const float ground_x,
const float ground_y,
float *image_x,
176 bool b_image_based_cipv_ =
false;
177 int32_t debug_level_ = 0;
178 float time_unit_ = kAverageFrameRate;
183 float margin_vehicle_to_lane_ =
185 float single_virtual_egolane_width_in_meter_ =
187 float half_virtual_egolane_width_in_meter_ =
188 single_virtual_egolane_width_in_meter_ * 0.5f;
191 float max_dist_object_to_virtual_lane_in_meter_ =
194 float MAX_VEHICLE_WIDTH_METER = 5.0f;
195 float EPSILON = 1.0e-6f;
200 std::map<int, size_t> object_id_skip_count_;
201 std::map<int, boost::circular_buffer<std::pair<float, float>>>
202 object_trackjectories_;
203 std::map<int, std::vector<double>> object_timestamps_;
204 Eigen::Matrix3d homography_im2car_ = Eigen::Matrix3d::Identity();
205 Eigen::Matrix3d homography_car2im_ = Eigen::Matrix3d::Identity();
206 int32_t old_cipv_track_id_ = -2;