API definition
Signed-off-by: jzq <1391797124@qq.com>
This commit is contained in:
		
							parent
							
								
									e319507481
								
							
						
					
					
						commit
						bc5569794a
					
				
							
								
								
									
										18
									
								
								depthProcess.cc
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										18
									
								
								depthProcess.cc
									
									
									
									
									
										Normal 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
									
								
							
							
						
						
									
										18
									
								
								depthProcess.h
									
									
									
									
									
										Normal 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
									
								
							
							
						
						
									
										16
									
								
								main.cc
									
									
									
									
									
										Normal 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
									
								
							
							
						
						
									
										15
									
								
								yolo.cc
									
									
									
									
									
										Normal 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
									
								
							
							
						
						
									
										21
									
								
								yolo.h
									
									
									
									
									
										Normal 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 */);
 | ||||
| }; | ||||
| 
 | ||||
| 
 | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user