test(M00): add landmark-region visual diff

This commit is contained in:
2026-07-12 03:03:59 +04:00
parent 3172f41ee5
commit a10206b797
5 changed files with 156 additions and 5 deletions
@@ -12,6 +12,7 @@ param(
[double[]]$CameraFovValues = @(),
[int]$ViewportWidth = 1280,
[int]$ViewportHeight = 900,
[int[]]$ComparisonRegion = @(),
[double]$WaitSeconds = 8.0,
[double]$MeasureSeconds = 0.1,
[switch]$PlanOnly
@@ -33,6 +34,9 @@ if (-not (Test-Path -LiteralPath $GodotPath)) {
if (-not (Test-Path -LiteralPath $ReferenceDirectory)) {
throw "Reference directory not found: $ReferenceDirectory"
}
if ($ComparisonRegion.Count -notin @(0, 4)) {
throw "ComparisonRegion requires x,y,width,height"
}
$invariantCulture = [Globalization.CultureInfo]::InvariantCulture
$isJointFovSweep = $CameraFovValues.Count -gt 0
@@ -89,6 +93,9 @@ try {
"--reference", $ReferenceDirectory, "--candidate", $candidateOutput,
"--only", $Checkpoint, "--output", $comparisonReport
)
if ($ComparisonRegion.Count -eq 4) {
$comparisonArguments += @("--region", ($ComparisonRegion -join ","))
}
$comparisonProcess = Start-Process -FilePath $GodotPath -ArgumentList $comparisonArguments -Wait -PassThru -NoNewWindow
if ($comparisonProcess.ExitCode -notin @(0, 1)) {
throw "Comparison failed for yaw=$yawText pitch=$pitchText"
@@ -131,6 +138,7 @@ try {
viewport = @($ViewportWidth, $ViewportHeight)
wait_seconds = $WaitSeconds
measure_seconds = $MeasureSeconds
comparison_region = @($ComparisonRegion)
candidates = $rankedCandidates
}
New-Item -ItemType Directory -Force -Path $absoluteOutput | Out-Null