Skip to content
DeepForgeby svx
All problems
HardComputer Visioncv-382

Gaussian Splat Covariance

Problem

Build the 3D covariance of a Gaussian splat.

The covariance is R * diag(scale^2) * R^T, where rot is a 3x3 rotation matrix and scale holds the per-axis standard deviations. Return the 3x3 symmetric matrix with every entry rounded to 4 decimal places.

Hint

Compute M = R * diag(scale) first, then cov = M * M^T.

Test cases

case 1
in: [[[1,0,0],[0,1,0],[0,0,1]],[1,2,3]]
expected: [[1,0,0],[0,4,0],[0,0,9]]
case 2
in: [[[1,0,0],[0,1,0],[0,0,1]],[0,0,0]]
expected: [[0,0,0],[0,0,0],[0,0,0]]
case 3
in: [[[0,-1,0],[1,0,0],[0,0,1]],[1,2,3]]
expected: [[4,0,0],[0,1,0],[0,0,9]]
case 4
in: [[[1,0,0],[0,1,0],[0,0,1]],[1,1,1]]
expected: [[1,0,0],[0,1,0],[0,0,1]]
Starter codePython
def splat_covariance(rot, scale):
    # Your code here
    pass

4 test cases · run your code against them in the editor