• 大小: 34.47MB
    文件类型: .zip
    金币: 1
    下载: 0 次
    发布日期: 2023-07-11
  • 语言: 其他
  • 标签: ADAS  roadline  

资源简介

ADAS道路线识别与标定,适合视觉开发及ADAS开发参考。

资源截图

代码片段和文件信息

/**
@file main.cpp
@date 2017/09/03
@author tkwoo(wtk1101@gmail.com).
@brief main file
*/

#include 
#include 
#include 
#include 
 
#include “StereoVisionForADAS.h“
#include “SurfaceNormal.h“

// #define VIZ
#ifdef VIZ
#include 
#endif

using namespace std;
using namespace cv;

int main()
{
#ifdef VIZ
viz::Viz3d plot3d(“Coordinate frame“);
plot3d.showWidget(“Coordinate Widget“ viz::WCoordinateSystem());

viz::Viz3d vizPlotVec(“vector direction“);
vizPlotVec.showWidget(“Coordinate Widget“ viz::WCoordinateSystem());
#endif

StereoCamParam_t objParam = CStereoVisionForADAS::InitStereoParam(KITTI);
CStereoVisionForADAS objStereoVision(objParam); //stixel constructor
CSuNoVeMap objSuNoVeMap(objParam); //SNV

int cntframe = 0;
char chLeftImageName[150] = {};
char chRightImageName[150] = {};
char chOxtsName[150] = {};
int nWaitTime = 0;

while (1){// (!plot3d.wasStopped()){
cout << cntframe << “ “;

sprintf(chLeftImageName “./data/left/%010d.png“ cntframe);
sprintf(chRightImageName “./data/right/%010d.png“ cntframe);

cntframe++;

/*fstream fs;
fs.open(chOxtsName);
double dTemp;
fs >> dTemp >> dTemp >> dTemp >> dTemp >> dTemp;
printf(“%.1lfdeg “ -dTemp*180/PI);*/
//cout << dTemp * 180 / PI << “deg “;

Mat imgLeft = imread(chLeftImageName 1);
Mat imgRight = imread(chRightImageName 1);
if (imgLeft.empty()) {waitKey();break;}

//imshow(“right“ imgRight);

int64 t = getTickCount();

// procesing
objStereoVision.objectness(imgLeft imgRight);

Mat imgDisp8;
objStereoVision.m_matDisp16.convertTo(imgDisp8 CV_8U 255 / (objParam.m_nNumberOfDisp*16.));

Mat imgG;
bitwise_and(objStereoVision.m_imgGround imgDisp8 imgG);
// surface normal prcessing
//objSuNoVeMap.Compute(objStereoVision.m_imgDisp8);
//objSuNoVeMap.Compute(imgG);
objSuNoVeMap.Compute(imgDisp8);
printf(“Time elapsed: %.3fms\n“ (getTickCount() - t) * 1000 / getTickFrequency());

Mat imgResult = imgLeft.clone();
Mat imgStixel = imgLeft.clone();

Mat imgDispColor;
applyColorMap(imgDisp8 imgDispColor COLORMAP_OCEAN);
//cout << objSuNoVeMap.m_objValidSNVs.size() << endl;
for (int i = 0; i < objSuNoVeMap.m_objValidSNVs.size(); i = i + 1){
Point ptEnd;
Point3d ptDir = 0.15*objSuNoVeMap.m_objValidSNVs[i].m_vec3dDirection / objSuNoVeMap.m_objValidSNVs[i].dScale;
Point3d ptEnd3D = ptDir + objSuNoVeMap.m_objValidSNVs[i].m_ptPositionRealWorld;
ptEnd.x = ptEnd3D.x * objParam.objCamParam.m_dFocalLength / ptEnd3D.z + (objParam.objCamParam.m_sizeSrc.width / 2);
ptEnd.y = ptEnd3D.y * objParam.objCamParam.m_dFocalLength / ptEnd3D.z + (objParam.objCamParam.m_sizeSrc.height / 2);
line(imgDispColor objSuNoVeMap.m_objValidSNVs[i].m_ptPositionImage ptEnd Scalar(0 255 0));
}
for (int i = 0; i < objSuNoVeMap.m_objTrashSNVs.size(); i = i + 1)

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----
     目录           0  2017-09-04 09:28  StereoVisionforADAS-master\
     文件       18046  2017-09-04 09:28  StereoVisionforADAS-master\LICENSE
     文件        1357  2017-09-04 09:28  StereoVisionforADAS-master\README.md
     文件        5110  2017-09-04 09:28  StereoVisionforADAS-master\StereoMatching.cpp
     文件        2072  2017-09-04 09:28  StereoVisionforADAS-master\StereoMatching.h
     文件       13200  2017-09-04 09:28  StereoVisionforADAS-master\StereoVisionForADAS.cpp
     文件        2659  2017-09-04 09:28  StereoVisionforADAS-master\StereoVisionForADAS.h
     文件       13084  2017-09-04 09:28  StereoVisionforADAS-master\StixelEstimation.cpp
     文件        3163  2017-09-04 09:28  StereoVisionforADAS-master\StixelEstimation.h
     文件        2170  2017-09-04 09:28  StereoVisionforADAS-master\StixelSegmenation.h
     文件        9881  2017-09-04 09:28  StereoVisionforADAS-master\StixelSegmentation.cpp
     文件        6367  2017-09-04 09:28  StereoVisionforADAS-master\SurfaceNormal.h
     文件          95  2017-09-04 09:28  StereoVisionforADAS-master\compile.sh
     目录           0  2017-09-04 09:28  StereoVisionforADAS-master\data\
     文件        6148  2017-09-04 09:28  StereoVisionforADAS-master\data\.DS_Store
     目录           0  2017-09-04 09:28  StereoVisionforADAS-master\data\left\
     文件      774707  2017-09-04 09:28  StereoVisionforADAS-master\data\left\0000000000.png
     文件      777856  2017-09-04 09:28  StereoVisionforADAS-master\data\left\0000000001.png
     文件      784156  2017-09-04 09:28  StereoVisionforADAS-master\data\left\0000000002.png
     文件      782280  2017-09-04 09:28  StereoVisionforADAS-master\data\left\0000000003.png
     文件      781158  2017-09-04 09:28  StereoVisionforADAS-master\data\left\0000000004.png
     文件      784071  2017-09-04 09:28  StereoVisionforADAS-master\data\left\0000000005.png
     文件      787353  2017-09-04 09:28  StereoVisionforADAS-master\data\left\0000000006.png
     文件      788874  2017-09-04 09:28  StereoVisionforADAS-master\data\left\0000000007.png
     文件      791845  2017-09-04 09:28  StereoVisionforADAS-master\data\left\0000000008.png
     文件      790350  2017-09-04 09:28  StereoVisionforADAS-master\data\left\0000000009.png
     文件      798813  2017-09-04 09:28  StereoVisionforADAS-master\data\left\0000000010.png
     文件      810154  2017-09-04 09:28  StereoVisionforADAS-master\data\left\0000000011.png
     文件      818863  2017-09-04 09:28  StereoVisionforADAS-master\data\left\0000000012.png
     文件      820076  2017-09-04 09:28  StereoVisionforADAS-master\data\left\0000000013.png
     文件      825234  2017-09-04 09:28  StereoVisionforADAS-master\data\left\0000000014.png
............此处省略39个文件信息

评论

共有 条评论