noise tuning
This commit is contained in:
parent
db37d3c179
commit
d8c9f8e11a
2 changed files with 16 additions and 10 deletions
|
|
@ -167,8 +167,8 @@ public class WorldMap : IDisposable
|
|||
var matchX = sx0 + maxLoc.X + frameSize / 2.0;
|
||||
var matchY = sy0 + maxLoc.Y + frameSize / 2.0;
|
||||
|
||||
Log.Debug("Map match: ({X:F1}, {Y:F1}) conf={Conf:F3} canvas={CanvasWalls} frame={FrameWalls}",
|
||||
matchX, matchY, maxVal, canvasWallCount, frameWallCount);
|
||||
Log.Information("Match OK: conf={Conf:F3} pos=({X:F1},{Y:F1}) canvas={CanvasWalls} frame={FrameWalls}",
|
||||
maxVal, matchX, matchY, canvasWallCount, frameWallCount);
|
||||
|
||||
return new MapPosition(matchX, matchY);
|
||||
}
|
||||
|
|
@ -229,9 +229,15 @@ public class WorldMap : IDisposable
|
|||
|
||||
confRoi.Set(row, col, conf);
|
||||
|
||||
if (conf >= confThreshold)
|
||||
var current = dstRoi.At<byte>(row, col);
|
||||
// Explored→Wall needs double evidence (protects already-walked areas from noise)
|
||||
var needed = current == (byte)MapCell.Explored
|
||||
? (short)(confThreshold * 2)
|
||||
: confThreshold;
|
||||
|
||||
if (conf >= needed)
|
||||
dstRoi.Set(row, col, (byte)MapCell.Wall);
|
||||
else if (dstRoi.At<byte>(row, col) == (byte)MapCell.Wall)
|
||||
else if (current == (byte)MapCell.Wall && conf < confThreshold)
|
||||
dstRoi.Set(row, col, (byte)MapCell.Explored); // lost confidence → demote
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue