How to use opencv to realize Lane Detection
Most people don't understand the knowledge points of this article "how to use opencv to realize lane line detection", so Xiaobian summarizes the following contents for everyone. The contents are detailed, the steps are clear, and they have certain reference value. I hope everyone can gain something after reading this article. Let's take a look at this article "how to use opencv to realize lane line detection".
effect
void lane_detection(cv::Mat &src, cv::Mat &dst) { dst = cv::Mat::zeros(src.size(),src.type()); cv::Mat grid =cv::Mat::zeros(src.size(),src.type()); int iStep = 25; int iNUmsX = src.cols / iStep; int inUmsY = src.rows / iStep; for(int i = 1; i iDiffTh) || (iValueY - iValueYPre > iDiffTh && iValueY - iValueYNext > iDiffTh)) { add.at(i, j) = 255; } } } qDebug()