forked from autowarefoundation/autoware_vision_pilot
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdraw_lanes.hpp
More file actions
92 lines (81 loc) · 2.36 KB
/
draw_lanes.hpp
File metadata and controls
92 lines (81 loc) · 2.36 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
#ifndef AUTOWARE_POV_VISION_AUTOSTEER_DRAW_LANES_HPP_
#define AUTOWARE_POV_VISION_AUTOSTEER_DRAW_LANES_HPP_
#include "../inference/onnxruntime_engine.hpp"
#include "../lane_tracking/lane_tracking.hpp"
#include <opencv2/opencv.hpp>
namespace autoware_pov::vision::autosteer
{
/**
* @brief Visualize lane segmentation on input image
*
* Draws colored circles on detected lane pixels:
* - Blue: Ego left lane
* - Magenta: Ego right lane
* - Green: Other lanes
*
* @param input_image Original input image (any resolution)
* @param lanes Lane segmentation masks (typically 320x640)
* @return Annotated image (same size as input)
*/
cv::Mat drawLanes(
const cv::Mat& input_image,
const LaneSegmentation& lanes
);
/**
* @brief In-place lane visualization (modifies input image)
*
* @param image Image to annotate (modified in-place)
* @param lanes Lane segmentation masks
*/
void drawLanesInPlace(
cv::Mat& image,
const LaneSegmentation& lanes
);
/**
* @brief In-place visualization of filtered lanes
*
* @param image Image to annotate (modified in-place)
* @param lanes Filtered lane segmentation masks
*/
void drawFilteredLanesInPlace(
cv::Mat& image,
const LaneSegmentation& lanes);
/**
* @brief Draws ONLY the raw 160x80 pixel masks overlay.
* Useful for debugging the model output and RANSAC inputs.
* Later on I might add some more, like sliding windows too etc.
*/
void drawRawMasksInPlace(
cv::Mat& image,
const LaneSegmentation& lanes
);
/**
* @brief Draws ONLY the smooth polynomial fitted lines.
* This represents the final product output Insha'Allah.
*/
void drawPolyFitLanesInPlace(
cv::Mat& image,
const LaneSegmentation& lanes
);
/**
* @brief Draws BEV vis panel.
* * @param image Output img to draw on (will be resized to 640x640).
* @param orig_frame Orig perspective frame.
* @param bev_data BEV vis data from the tracker.
*/
void drawBEVVis(
cv::Mat& image,
const cv::Mat& orig_frame,
const BEVVisuals& bev_data
);
/**
* @brief Debug function to verify Pixel -> Meter conversion
* Draws the metric polynomials (projected back to pixels) on top of the BEV image.
*/
void drawMetricVerification(
cv::Mat& bev_image,
const std::vector<double>& left_metric_coeffs,
const std::vector<double>& right_metric_coeffs
);
} // namespace autoware_pov::vision::autosteer
#endif // AUTOWARE_POV_VISION_AUTOSTEER_DRAW_LANES_HPP_