| 275 | } |
| 276 | |
| 277 | void read_lane_file(const string &file_name, vector<vector<Point2f>> &lanes, vector<uint8_t> &lane_flags) |
| 278 | { |
| 279 | lanes.clear(); |
| 280 | std::ifstream fin(file_name); |
| 281 | |
| 282 | neb::CJsonObject oJson; |
| 283 | std::stringstream ssContent; |
| 284 | ssContent << fin.rdbuf(); |
| 285 | oJson.Parse(ssContent.str()); |
| 286 | |
| 287 | for (int j = 0; j < oJson["lane_lines"].GetArraySize(); j++) |
| 288 | { |
| 289 | vector<Point2f> curr_lane; |
| 290 | int category_flag; |
| 291 | if (oJson["lane_lines"][j]["uv"][0].GetArraySize() < 2) { |
| 292 | continue; |
| 293 | } |
| 294 | for (int i = 0; i < oJson["lane_lines"][j]["uv"][0].GetArraySize(); ++i) |
| 295 | { |
| 296 | double u, v; |
| 297 | oJson["lane_lines"][j]["uv"][0].Get(i, u); |
| 298 | oJson["lane_lines"][j]["uv"][1].Get(i, v); |
| 299 | curr_lane.push_back(Point2f(u, v)); |
| 300 | } |
| 301 | |
| 302 | std::sort(curr_lane.begin(), curr_lane.end(), lessmark); |
| 303 | oJson["lane_lines"][j].Get("category", category_flag); |
| 304 | |
| 305 | lane_flags.push_back(uint8_t(category_flag)); |
| 306 | lanes.push_back(curr_lane); |
| 307 | } |
| 308 | |
| 309 | fin.close(); |
| 310 | } |
| 311 | |
| 312 | void 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 | { |
no test coverage detected