⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 belowpolyfit.asv

📁 车道检测中弯道的检测
💻 ASV
字号:
function st=BelowPolyfit(BelowL,belowLabel)
for(iLabel=1:belowLabel)
    [r,c] = find(BelowL==iLabel);
    cNum=numel(c);
    cMax=0;
    cMin=300;
    for(iSort=1:cNum)
       if(c(iSort)>cMax)
           cMax=c(iSort);
       end
       if(c(iSort)<cMin)
           cMin=c(iSort);
       end
    end
    LineStruct(iLabel).fn = Polyfit(r,c,1); 
    y1=LineStruct(iLabel).fn(1)*cMin + LineStruct(iLabel).fn(2);
    y2=LineStruct(iLabel).fn(1)*cMax + LineStruct(iLabel).fn(2);
    if(y1>y2)
        LineStruct(iLabel).top.y=y2;
        LineStruct(iLabel).top.x=cMax;
        LineStruct(iLabel).low.y=y1;
        LineStruct(iLabel).low.x=cMin;
    else
        LineStruct(iLabel).top.y=y1;
        LineStruct(iLabel).top.x=cMin;
        LineStruct(iLabel).low.y=y2;
        LineStruct(iLabel).low.x=cMax;
    end
    yDelt=LineStruct(iLabel).top.y-LineStruct(iLabel).low.y;
    xDelt=LineStruct(iLabel).top.x-LineStruct(iLabel).low.x;
    LineStruct(iLabel).length = yDelt*yDelt+xDelt*xDelt;
    LineStruct(iLabel).StyleFlag=1;
    LineStruct(iLabel).Flag=1;
end
st = LineStruct;
stNum = cNum;

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -