From bc5569794a1663219e7c4c74dea3c6f6a11c463c Mon Sep 17 00:00:00 2001 From: jzq <1391797124@qq.com> Date: Tue, 19 Dec 2023 14:50:16 +0000 Subject: [PATCH] API definition Signed-off-by: jzq <1391797124@qq.com> --- depthProcess.cc | 18 ++++++++++++++++++ depthProcess.h | 18 ++++++++++++++++++ main.cc | 16 ++++++++++++++++ yolo.cc | 15 +++++++++++++++ yolo.h | 21 +++++++++++++++++++++ 5 files changed, 88 insertions(+) create mode 100644 depthProcess.cc create mode 100644 depthProcess.h create mode 100644 main.cc create mode 100644 yolo.cc create mode 100644 yolo.h diff --git a/depthProcess.cc b/depthProcess.cc new file mode 100644 index 0000000..cc87445 --- /dev/null +++ b/depthProcess.cc @@ -0,0 +1,18 @@ +#include"depthProcess.h" + + +DepthProcess::DepthProcess(cv::Mat mk) { + +} + +void DepthProcess::obstacleDetect(cv::Mat imgDepth) { + +} + +void DepthProcess::obstacleDetect(cv::Mat boxes) { + +} + +void DepthProcess::getObstacle() { + +} diff --git a/depthProcess.h b/depthProcess.h new file mode 100644 index 0000000..de0cecb --- /dev/null +++ b/depthProcess.h @@ -0,0 +1,18 @@ +#pragma once + +#include "opencv2/core/core.hpp" + + +class DepthProcess +{ +private: + cv::Mat imgRGB; + cv::Mat imgDepth; // or pointCloud detect by lidar + cv::Mat mK; // camera intrinsic or external parameters between camera and lidar + cv::Mat obstacle; // [dis, cls, maby size] +public: + DepthProcess(cv::Mat mk); + void obstacleDetect(cv::Mat imgDepth); + void obstacleRecognize(cv::Mat boxes); + cv::Mat getObstacle(); +}; diff --git a/main.cc b/main.cc new file mode 100644 index 0000000..ede66a6 --- /dev/null +++ b/main.cc @@ -0,0 +1,16 @@ +#include "yolo.h" +#include "depthProcess.h" + + +int main(int argc, char** argv) { + + // initialize yolo + Yolo detector = Yolo(modelPath); + // initialize depthProcessor + DepthProcess depthProcessor = DepthProcess(mk); + // read image + // read depth + // do object detection (new thread) + // do depth process + // get boxes and do obstacleRecognize +} \ No newline at end of file diff --git a/yolo.cc b/yolo.cc new file mode 100644 index 0000000..c8519f4 --- /dev/null +++ b/yolo.cc @@ -0,0 +1,15 @@ +#include"yolo.h" + + + +Yolo::Yolo(std::string modelPath) { + +} + +void Yolo::detect(cv::Mat image) { + +} + +cv::Mat Yolo::getBoxes() { + +} \ No newline at end of file diff --git a/yolo.h b/yolo.h new file mode 100644 index 0000000..1793fc3 --- /dev/null +++ b/yolo.h @@ -0,0 +1,21 @@ +#pragma once + +#include + +class Yolo +{ +private: + cv::Mat image; + cv::Mat boxes; +public: + Yolo(std::string modelPath); // initialize detector here, may need more args + // void gpuInit(/* args */); // initialize the GPU, may called by the constructor + void detect(cv::Mat image); // detect objects in the image, return the 2d mat + // which every row represents for an object + cv::Mat getBoxes(); // return infomation about the detected objects + // may called by the detect function + // void preProcess(/* args */); + // void postProcess(/* args */); +}; + +