API definition

Signed-off-by: jzq <1391797124@qq.com>
pull/2/head
jzq 2023-12-19 14:50:16 +00:00 committed by Gitee
parent e319507481
commit bc5569794a
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
5 changed files with 88 additions and 0 deletions

18
depthProcess.cc Normal file
View File

@ -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() {
}

18
depthProcess.h Normal file
View File

@ -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();
};

16
main.cc Normal file
View File

@ -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
}

15
yolo.cc Normal file
View File

@ -0,0 +1,15 @@
#include"yolo.h"
Yolo::Yolo(std::string modelPath) {
}
void Yolo::detect(cv::Mat image) {
}
cv::Mat Yolo::getBoxes() {
}

21
yolo.h Normal file
View File

@ -0,0 +1,21 @@
#pragma once
#include<string>
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 */);
};