/** * @fileoverview GaussianTrainDataset — the posed-view dataset adapter for the sovereign 3DGS trainer. * * Turns real capture poses into the trainer's representation: a column-major 4x4 view matrix (the * `cam.json` / WebGPU-renderer format produced by the capture pipeline) → `SplatCamera`, plus helpers * to assemble `TrainView[]` and to downsample intrinsics for cheaper CPU training. This is the bridge * between a captured dataset (images + per-image poses) and `runGaussianTrainJob` — drop a real * multi-view capture in and it trains. * * Convention: the view matrix is column-major (m[col*4 + row]) and maps world → camera as * `camPos = viewMatrix * vec4(pos, 1)` (exactly how splat-compress.wgsl applies it). `SplatCamera` * stores the same transform as a row-major 3x3 rotation `Vrow` + translation `t`, with * `camPos = Vrow·pos + t`. cameraFromViewMatrix maps one to the other (verified by round-trip test). */ import { type SplatCamera } from './GaussianTrainer3D'; import { type TrainView } from './GaussianTrainRunner'; /** * Convert a column-major 4x4 world→camera view matrix (16 floats, the cam.json format) into a * SplatCamera. Pulls the upper-left 3x3 into row-major `Vrow` and the 4th column into `t`. * * viewMatrix[col*4 + row] → camPos.row = Σ_col viewMatrix[col*4+row] · pos[col] (+ translation col 3) * Vrow[row*3 + col] = viewMatrix[col*4 + row] ; t[row] = viewMatrix[3*4 + row] */ export declare function cameraFromViewMatrix(viewMatrix: ArrayLike, focalX: number, focalY: number, cx?: number, cy?: number): SplatCamera; /** * Scale a camera's intrinsics for training at a downsampled resolution (cheaper on CPU). Only the * focal lengths scale; the principal point defaults to the new image centre (W'/2 = (W/2)·s), so an * undefined cx/cy stays consistent — leave them unset when the capture is centre-principal. */ export declare function cameraScaled(cam: SplatCamera, scale: number): SplatCamera; /** * Assemble a TrainView from a camera + a target image (W*H*3, row-major RGB in [0,1]). Throws on a * size mismatch so a mis-decoded image fails loudly rather than training against garbage. */ export declare function makeTrainView(cam: SplatCamera, W: number, H: number, target: Float64Array): TrainView; /** A posed capture frame before the image is decoded — the on-disk shape a loader produces. */ export interface PosedFrame { /** Column-major 4x4 world→camera view matrix (cam.json format). */ viewMatrix: ArrayLike; focalX: number; focalY: number; /** Decoded target image, W*H*3 RGB in [0,1]. */ target: Float64Array; width: number; height: number; cx?: number; cy?: number; } /** * Build a multi-view TrainView[] from decoded posed frames, optionally downsampling intrinsics by * `scale` (the caller downsamples the pixels to match). This is what feeds runGaussianTrainJob for a * real capture. */ export declare function viewsFromFrames(frames: readonly PosedFrame[], scale?: number): TrainView[]; //# sourceMappingURL=GaussianTrainDataset.d.ts.map