Hi everyone,
I am trying to scan a pretty large dataset for using Reality Capture, since it has a rather low noise-to-signal ratio. RC cannot connect my shots all too well (11 separate videos, both ground and aerial) and produces separate components and other artifacts, like point spheres in mid-air etc. After endlessly trying to set up good control points and running the alignment over and over, I chose to first estimate the camera positions using COLMAP and a Vocabulary Tree, as this is an excellent way to get the cameras right.
I then proceeded to open the COLMAP text format in RC and to my horror, I found out that RC tries to load all the images into memory simultaneously? Why is this needed? RC already streams from the drive when doing its magic, because datasets are obviously much larger than whatever could fit in RAM.
Yet, when loading the COLMAP format, it tries to load 76GB of 4K drone shots into memory.
All I need are the camera poses, but those are inherently tied to the images.
Anyone have an idea on how to work around this? Could on-the-fly downscale and replace work? Just for opening the project - then I’d swap them for the full-res ones.
Thanks in advance
Turns out RC doesn’t load all images into memory and there’s a different problem at play. When I replaced all my pngs with a solid black, their total size dropped to 4GB. Attempting to load this dataset along with COLMAP data still produced an OutOfMemory error even when increasing my swap to 60GB
I bypassed the issue by using the Bundler fromat. But I had to adjust because RC cannot read out.list.txt and instead expects certain filenames. Powershell script courtesy of ChatGPT.
$inputFile = "bundler_model.out.list.txt"
$logFile = "processed_files.log"
$targetDir = Get-Location
# Load already processed files if the log exists
$processed = @()
if (Test-Path $logFile) {
$processed = Get-Content $logFile
}
# Load source paths and filter
$allPaths = Get-Content $inputFile | Where-Object { -not [string]::IsNullOrWhiteSpace($_) }
$toProcess = $allPaths | Where-Object { $processed -notcontains $_ }
# Counter starts at 0
$counter = $processed.Count
foreach ($sourcePath in $toProcess) {
$sourcePath = $sourcePath.Trim()
if (-not (Test-Path $sourcePath)) {
Write-Error "File not found - $sourcePath"
break
}
$newName = "{0:D5}.png" -f $counter
$destinationPath = Join-Path $targetDir $newName
#Write-Host "`nReady to copy - " -ForegroundColor Cyan
#Write-Host "From - $sourcePath"
#Write-Host "To - $destinationPath"
#Write-Host "Press any key to continue, or Ctrl+C to abort..." -ForegroundColor Yellow
#[void][System.Console]::ReadKey($true)
try {
Move-Item -Path $sourcePath -Destination $destinationPath -Force
Add-Content -Path $logFile -Value $sourcePath
$counter++
} catch {
Write-Error "Error copying $sourcePath - $_"
break
}
}