halcon多條線合併為一條問題

2021-09-29 22:45:22 字數 1509 閱讀 9298

如這樣的多條線合成一條線

通過斜率(垂直和平行不需要)來計算;x或y基本不變,通過求平均值得到一條線;選取最長得,注意判斷誤差,

部分**,在我得專案裡是可以得

*去除誤差

kh1:=0

for i:

=0 to lengths-

1 by 1

k:=0

for j:

=0 to lengths-

1 by 1

if(i!=j)

if(rowbeginh[i]

>rowbeginh[j]-30

and rowbeginh[i]

) k:

=k+1

endif

endif

endfor

if(lengths>5)

if(k<

(lengths)/3

) rowbeginh[i]:=

0 kh1:

=kh1+

1 endif

endif

endfor

*選擇水平直線,下面4個是線的兩點

rbh1:=0

cbh1:

=10000

reh1:=0

ceh1:=0

for i:

=0 to lengths-

1 by 1

if(rowbeginh[i]

>0)

if(colbeginh[i]

)

rbh1:

=rbh1+rowbeginh[i]

reh1:

=reh1+rowendh[i]

if(cbh1>colbeginh[i]

) cbh1:

=colbeginh[i]

endif

if(ceh1

) ceh1:

=colendh[i]

endif

else

rbh1:

=rbh1+rowendh[i]

reh1:

=reh1+rowbeginh[i]

if(cbh1>colendh[i]

) cbh1:

=colendh[i]

endif

if(ceh1

) ceh1:

=colbeginh[i]

endif

endif

endif

endfor

if(rbh1>

1and reh1>1)

rbh1:

=rbh1/

(lengths-kh1)

reh1:

=reh1/

(lengths-kh1)

endif

ECharts 多條座標軸軸線,合併為一條線

2條y軸,y軸的座標軸軸線axisline太多,擾人視線,如圖 剛開始用分割線 yaxis.splitline 做出來的這個效果。後期,改為兩條線合併為一條。網上找乙個沒有關於splitline的設定,查詢echarts,發現一種方法 通過yaxis.axisline軸線,及yaxis.max ya...

mssql FOR XML方法多行合併為一條資料

實驗室表 laboratoryroom 標籤表 tag 關係表 lab tag select lab.name,stuff select isnull tagname,from tagwhere id in select tagid from lab tag where labid lab.id f...

SQL合併多條資料為一條

今天在做專案的時候,涉及到從資料庫中將多條記錄合併為一條的記錄的問題,解決方案如下 問題描述 資料庫表a中按照專案區分存放了各個月份的交易資料,也就是說乙個月的資料是按照專案區分分成了多條來儲存,現在我想 按照月份將多個專案區分的資料合併為一條。解決方案 select sum 專案1 sum 專案2...