MCPcopy Create free account
hub / github.com/OpenDriveLab/OpenLane / visualize

Function visualize

eval/LANE_evaluation/lane2d/src/evaluate.cpp:312–388  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

310}
311
312void visualize(string &full_im_name, vector<vector<Point2f>> &anno_lanes, vector<vector<Point2f>> &detect_lanes, vector<int> anno_match, int width_lane, string visualize_path)
313{
314 cerr<<full_im_name<<endl;
315 Mat img = imread(full_im_name, 1);
316 Mat img2 = imread(full_im_name, 1);
317 vector<Point2f> curr_lane;
318 vector<Point2f> p_interp;
319 Spline splineSolver;
320 Scalar color_B = Scalar(255, 0, 0);
321 Scalar color_G = Scalar(0, 255, 0);
322 Scalar color_R = Scalar(0, 0, 255);
323 Scalar color_P = Scalar(255, 0, 255);
324 Scalar color;
325 for (int i = 0; i < anno_lanes.size(); i++)
326 {
327 curr_lane = anno_lanes[i];
328 if (curr_lane.size() == 2)
329 {
330 p_interp = curr_lane;
331 }
332 else
333 {
334 p_interp = splineSolver.splineInterpTimes(curr_lane, 50);
335 }
336 if (anno_match[i] >= 0)
337 {
338 color = color_G;
339 }
340 else
341 {
342 color = color_G;
343 }
344 for (int n = 0; n < p_interp.size() - 1; n++)
345 {
346 line(img, p_interp[n], p_interp[n + 1], color, width_lane);
347 line(img2, p_interp[n], p_interp[n + 1], color, 2);
348 }
349 }
350 bool detected;
351 for (int i = 0; i < detect_lanes.size(); i++)
352 {
353 detected = false;
354 curr_lane = detect_lanes[i];
355 if (curr_lane.size() == 2)
356 {
357 p_interp = curr_lane;
358 }
359 else
360 {
361 p_interp = splineSolver.splineInterpTimes(curr_lane, 50);
362 }
363 for (int n = 0; n < anno_lanes.size(); n++)
364 {
365 if (anno_match[n] == i)
366 {
367 detected = true;
368 break;
369 }

Callers 1

mainFunction · 0.85

Calls 2

createDirectoryFunction · 0.85
splineInterpTimesMethod · 0.80

Tested by

no test coverage detected