提交 a1ac6069 编写于 作者: Z zhujun08 提交者: Liangliang Zhang

fix bug in type.h for lane post-processing

上级 7ffea8ed
...@@ -22,6 +22,7 @@ cc_library( ...@@ -22,6 +22,7 @@ cc_library(
"//modules/perception/lib/base", "//modules/perception/lib/base",
"//modules/perception/lib/pcl_util", "//modules/perception/lib/pcl_util",
"//modules/perception/proto:perception_proto", "//modules/perception/proto:perception_proto",
"//modules/perception/obstacle/camera/lane_post_process/common:perception_obstacle_camera_lane_post_process_common_type",
"@eigen", "@eigen",
"@opencv2//:core", "@opencv2//:core",
], ],
......
...@@ -30,6 +30,7 @@ ...@@ -30,6 +30,7 @@
#include "modules/perception/lib/pcl_util/pcl_types.h" #include "modules/perception/lib/pcl_util/pcl_types.h"
#include "modules/perception/obstacle/base/object_supplement.h" #include "modules/perception/obstacle/base/object_supplement.h"
#include "modules/perception/obstacle/base/types.h" #include "modules/perception/obstacle/base/types.h"
#include "modules/perception/obstacle/camera/lane_post_process/common/type.h"
namespace apollo { namespace apollo {
namespace perception { namespace perception {
...@@ -113,6 +114,7 @@ struct SensorObjects { ...@@ -113,6 +114,7 @@ struct SensorObjects {
SeqId seq_num = 0; SeqId seq_num = 0;
std::vector<ObjectPtr> objects; std::vector<ObjectPtr> objects;
Eigen::Matrix4d sensor2world_pose; Eigen::Matrix4d sensor2world_pose;
LaneObjectsPtr lane_objects;
}; };
} // namespace perception } // namespace perception
......
...@@ -3,7 +3,7 @@ load("//tools:cpplint.bzl", "cpplint") ...@@ -3,7 +3,7 @@ load("//tools:cpplint.bzl", "cpplint")
package(default_visibility = ["//visibility:public"]) package(default_visibility = ["//visibility:public"])
cc_library( cc_library(
name = "lane_type", name = "perception_obstacle_camera_lane_post_process_common_type",
hdrs = ["type.h"], hdrs = ["type.h"],
deps = [ deps = [
"//modules/common:log", "//modules/common:log",
...@@ -13,11 +13,23 @@ cc_library( ...@@ -13,11 +13,23 @@ cc_library(
) )
cc_library( cc_library(
name = "lane_util", name = "perception_obstacle_camera_lane_post_process_common_util",
hdrs = ["util.h"], hdrs = ["util.h"],
deps = [ deps = [
"//modules/common:log", "//modules/common:log",
"//modules/perception/obstacle/camera/lane_post_process/common:lane_type", "//modules/perception/obstacle/camera/lane_post_process/common:perception_obstacle_camera_lane_post_process_common_type",
],
)
cc_library(
name = "perception_obstacle_camera_lane_post_process_common_connected_component_analysis",
srcs = ["connected_component.cc"],
hdrs = ["connected_component.h"],
deps = [
"//modules/common:log",
"//modules/perception/obstacle/camera/lane_post_process/common:perception_obstacle_camera_lane_post_process_common_type",
"@eigen//:eigen",
"@opencv2//:core",
], ],
) )
......
/****************************************************************************** /******************************************************************************
* Copyright 2017 The Apollo Authors. All Rights Reserved. * Copyright 2018 The Apollo Authors. All Rights Reserved.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
...@@ -14,8 +14,6 @@ ...@@ -14,8 +14,6 @@
* limitations under the License. * limitations under the License.
*****************************************************************************/ *****************************************************************************/
// @brief: connected component analysis for lane detection
#ifndef MODULES_PERCEPTION_OBSTACLE_CAMERA_LANE_POST_PROCESS_COMMON_CONNECTED_COMPONENT_H_ #ifndef MODULES_PERCEPTION_OBSTACLE_CAMERA_LANE_POST_PROCESS_COMMON_CONNECTED_COMPONENT_H_
#define MODULES_PERCEPTION_OBSTACLE_CAMERA_LANE_POST_PROCESS_COMMON_CONNECTED_COMPONENT_H_ #define MODULES_PERCEPTION_OBSTACLE_CAMERA_LANE_POST_PROCESS_COMMON_CONNECTED_COMPONENT_H_
...@@ -27,8 +25,8 @@ ...@@ -27,8 +25,8 @@
#include <Eigen/Core> #include <Eigen/Core>
#include <opencv2/core/core.hpp> #include <opencv2/core/core.hpp>
//#include <cuda.h> // #include <cuda.h>
//#include <cuda_runtime.h> // #include <cuda_runtime.h>
#include "modules/common/log.h" #include "modules/common/log.h"
#include "modules/perception/obstacle/camera/lane_post_process/common/type.h" #include "modules/perception/obstacle/camera/lane_post_process/common/type.h"
...@@ -346,7 +344,8 @@ class ConnectedComponentGenerator { ...@@ -346,7 +344,8 @@ class ConnectedComponentGenerator {
#endif #endif
} }
bool FindCC(const cv::Mat& lane_map, bool FindConnectedComponents(
const cv::Mat& lane_map,
std::vector<std::shared_ptr<ConnectedComponent>>& cc); std::vector<std::shared_ptr<ConnectedComponent>>& cc);
private: private:
...@@ -368,13 +367,13 @@ class ConnectedComponentGenerator { ...@@ -368,13 +367,13 @@ class ConnectedComponentGenerator {
#if CUDA_CC #if CUDA_CC
int* labels_; int* labels_;
cudaArray* img_array_;
int* label_array_;
#else #else
DisjointSet labels_; DisjointSet labels_;
std::vector<int> frame_label_; std::vector<int> frame_label_;
#endif #endif
std::vector<int> root_map_; std::vector<int> root_map_;
cudaArray* img_array_;
int* label_array_;
}; };
} // namespace perception } // namespace perception
......
/****************************************************************************** /******************************************************************************
* Copyright 2017 The Apollo Authors. All Rights Reserved. * Copyright 2018 The Apollo Authors. All Rights Reserved.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
...@@ -477,7 +477,7 @@ struct LaneObject { ...@@ -477,7 +477,7 @@ struct LaneObject {
new_lane_object->semantic = semantic; new_lane_object->semantic = semantic;
new_lane_object->is_compensated = is_compensated; new_lane_object->is_compensated = is_compensated;
for (size_t i = 0; i < new_lane_object.point_num; ++i) { for (size_t i = 0; i < new_lane_object->point_num; ++i) {
new_lane_object->pos.push_back(pos[i]); new_lane_object->pos.push_back(pos[i]);
new_lane_object->orie.push_back(orie[i]); new_lane_object->orie.push_back(orie[i]);
new_lane_object->image_pos.push_back(image_pos[i]); new_lane_object->image_pos.push_back(image_pos[i]);
......
/****************************************************************************** /******************************************************************************
* Copyright 2017 The Apollo Authors. All Rights Reserved. * Copyright 2018 The Apollo Authors. All Rights Reserved.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册