forked from tkwoo/StereoVisionforADAS
-
Notifications
You must be signed in to change notification settings - Fork 0
/
StixelEstimation.h
87 lines (67 loc) · 3.09 KB
/
StixelEstimation.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
/**
@file StixelEstimation.cpp
@date 2017/09/03
@author tkwoo(wtk1101@gmail.com)
@brief stixel creation
*/
#pragma once
#include <iostream>
#include "./include/DefStruct.h"
using namespace std;
using namespace cv;
typedef enum stixel_error { OK, SIZE_ERR, GND_ERR, VDISP_ERR, GNDRANSAC_ERR } STIXEL_ERROR;
/**
@class CStixelEstimation
@brief stixel ������ ���� class
*/
class CStixelEstimation{
private:
//----------------input-------------------
Mat m_matDisp16;
Mat m_imgDisp8;
//----------------param-------------------
StereoCamParam_t m_objStereoParam;
int m_nStixelWidth;
double m_dGroundVdispSlope; ///< The ground line slope in v-disparity
double m_dGroundVdispOrig; ///< The ground line origin in v-disparity
int m_nVdispGroundThreshold; ///< Ground plane threshold value in Vdisparity map
int m_nStixelGroundMargin; ///< Marginal compensation value for ground plane
vector<Point2f> m_vecLinePoint; ///< v-disparity point : ground point
Vec4f m_vec4fLine; ///< ground line
//-------------member image---------------
Mat m_imgVdisp;
Mat m_imgTopView;
//---------------function------------------
public:
//----------------output-------------------
vector<stixel_t> m_vecobjStixels; ///< stixel output
vector<stixel_t> m_vecobjStixelInROI; ///< stixel output in 3D ROI
Mat m_imgGround; ///< ground
//---------------function------------------
CStixelEstimation(StereoCamParam_t& objStereoParam);
STIXEL_ERROR SetDispImage(Mat& matDisp16);
STIXEL_ERROR SetDispImage(Mat& matDisp16, Mat& imgDisp8);
STIXEL_ERROR SetDisp8Image(Mat& imgDisp8);
//============processing part==============
//wrapping function
STIXEL_ERROR EstimateStixels(Mat& matDisp16);
STIXEL_ERROR EstimateStixels(Mat& matDisp16, Mat& imgDisp8, bool flgUseMultiLayer=true);
STIXEL_ERROR EstimateStixels_only8bitDisp(Mat& imgDisp8, bool flgUseMultiLayer=true);
//Ground Estimation
STIXEL_ERROR GroundEstimation(Mat& imgDisp8);
STIXEL_ERROR ComputeVDisparity(Mat& imgDisp8);
STIXEL_ERROR RmVDisparityNoise(Mat& imgVdisp);
STIXEL_ERROR ExtractGroundPoint(Mat& imgVdisp, vector<Point2f>& vecLinePoint);
STIXEL_ERROR FitLineRansac(vector<Point2f>& vecLinePoint, Vec4f& vec4fLine);
STIXEL_ERROR RmGround(Vec4f vec4fLine, Mat& imgDisp8);
//Sky Estimation
STIXEL_ERROR RmSky(Mat& imgDisp8);
//Stixel distance estimation
STIXEL_ERROR StixelDistanceEstimation(Mat& imgDisp8, vector<stixel_t>& vecStixels, bool flgUseMultiLayer=true);
STIXEL_ERROR StixelDisparityEstimation_col_SL(Mat& imgDisp8, int col, stixel_t& objStixel); ///< column single layer
STIXEL_ERROR StixelDisparityEstimation_col_ML(Mat& imgDisp8, int col, vector<stixel_t>& vecStixels); ///< column multi layer
STIXEL_ERROR StixelDisparityToDistance(vector<stixel_t>& vecStixels);
//Stixel Optimization
//STIXEL_ERROR StixelROIConstraint(vector<stixel_t>& vecStixelsInput, vector<stixel_t>& vecStixelsOutput);
STIXEL_ERROR StixelROIConstraint_Lane(vector<stixel_t>& vecStixelsInput, vector<stixel_t>& vecStixelsOutput, float fLaneInterval, int nCenterPointX);
};