|
@@ -1003,6 +1003,8 @@ namespace o0.Project
|
|
|
float estimateGradient(LineIdentified line, float distanceRatio)
|
|
float estimateGradient(LineIdentified line, float distanceRatio)
|
|
|
{
|
|
{
|
|
|
var gM = ScreenGrad(line);
|
|
var gM = ScreenGrad(line);
|
|
|
|
|
+ if (line.Batch > 0) // 其他batch的图,梯度权重小
|
|
|
|
|
+ gM /= 3;
|
|
|
float e = (float)Math.Sqrt(Math.Ceiling(line.Line.Length / minLength)); // 长度系数,筛选时梯度更大、长度更长的线段更优
|
|
float e = (float)Math.Sqrt(Math.Ceiling(line.Line.Length / minLength)); // 长度系数,筛选时梯度更大、长度更长的线段更优
|
|
|
float d = (10f - distanceRatio * distanceRatio) / 10f; // 距离系数,距离越近,系数越大
|
|
float d = (10f - distanceRatio * distanceRatio) / 10f; // 距离系数,距离越近,系数越大
|
|
|
line.ZIMGradient = e * gM + d; // 记录一下综合梯度,新增的识别黑边功能会二次使用
|
|
line.ZIMGradient = e * gM + d; // 记录一下综合梯度,新增的识别黑边功能会二次使用
|