91av视频/亚洲h视频/操亚洲美女/外国一级黄色毛片 - 国产三级三级三级三级

  • 大小: 9KB
    文件類型: .cpp
    金幣: 1
    下載: 0 次
    發布日期: 2021-06-05
  • 語言: C/C++
  • 標簽: opencv??

資源簡介

源碼為簡單的車道線是別的源碼,可做到簡易低干擾效果的濾波,得到二值化后車道線的圖像

資源截圖

代碼片段和文件信息

??#include?
#include?
#include?“opencv2/imgproc.hpp“
#include?
#include?
#include?
#include?
#include?
#include?
#include?


using?namespace?std;
using?namespace?cv;
clock_t?start?stop;

class?LaneDetect
{
public:
????Mat?currframe;?//stores?the?upcoming?frame
????Mat?temp;??????//stores?intermediate?results
????Mat?temp2;?????//stores?the?final?lane?segments

????int?diff?diffL?diffR;
????int?laneWidth;
????int?diffThreshTop;
????int?diffThreshLow;
????int?ROIrows;
????int?vertical_left;
????int?vertical_right;
????int?vertical_top;
????int?smallLaneArea;
????int?longLane;
????int??vanishingPt;
????float?maxLaneWidth;

????//to?store?various?blob?properties
????Mat?binary_image;?//used?for?blob?removal
????int?minSize;
????int?ratio;
????float??contour_area;
????float?blob_angle_deg;
????float?bounding_width;
????float?bounding_length;
????Size2f?sz;
????vector?>?contours;
????vector?hierarchy;
????RotatedRect?rotated_rect;


????LaneDetect(Mat?startframe)
????{
????????//currframe?=?startframe;????????????????????????????????????//if?image?has?to?be?processed?at?original?size

????????currframe?=?Mat(320480CV_8UC10.0);????????????????????????//initialised?the?image?size?to?320x480
????????resize(startframe?currframe?currframe.size());?????????????//?resize?the?input?to?required?size

????????temp??????=?Mat(currframe.rows?currframe.cols?CV_8UC10.0);//stores?possible?lane?markings
????????temp2?????=?Mat(currframe.rows?currframe.cols?CV_8UC10.0);//stores?finally?selected?lane?marks

????????vanishingPt????=?currframe.rows/2;???????????????????????????//for?simplicity?right?now
????????ROIrows????????=?currframe.rows?-?vanishingPt;???????????????//rows?in?region?of?interest
????????minSize????????=?0.00015?*?(currframe.cols*currframe.rows);??//min?size?of?any?region?to?be?selected?as?lane
????????maxLaneWidth???=?0.025?*?currframe.cols;?????????????????????//approximate?max?lane?width?based?on?image?size
????????smallLaneArea??=?7?*?minSize;
????????longLane???????=?0.3?*?currframe.rows;
????????ratio??????????=?4;

????????//these?mark?the?possible?ROI?for?vertical?lane?segments?and?to?filter?vehicle?glare
????????vertical_left??=?2*currframe.cols/5;
????????vertical_right?=?3*currframe.cols/5;
????????vertical_top???=?2*currframe.rows/3;

????????namedWindow(“lane“2);
????????namedWindow(“midstep“?2);
????????namedWindow(“currframe“?2);
????????namedWindow(“laneBlobs“2);

????????getLane();
????}

????void?updateSensitivity()
????{
????????int?total=0?average?=0;
????????for(int?i=?vanishingPt;?iame.rows;?i++)
????????????for(int?j=?0?;?jame.cols;?j++)
????????????????total?+=?currframe.at(ij);
????????average?=?total/(ROIrows*currframe.cols);
????????cout<<“average?:?“<????}

????void?getLane()
????{
????????//medianBlur(currframe?currframe5?);
????????

評論

共有 條評論