Skip to content

Understanding the code

Alex edited this page Dec 5, 2022 · 3 revisions

Understanding matrix.py

Matrix.py contains a few functions to reduce the amount of images post-SFM. This is to save time on the tensorRF code.

Understanding the data: SFM gives each image an extrinsic matrix and a translation vector, which can be used to find the “location” of each camera. This location is stored in a np.array [x,y,z]. All locations are stored in a list called tmc (transposition matrix container).

There are a few different options available that can be instated:

Simple comparison: This computes the difference between one camera and the other as (x1-x2, y1-y2, and z1-z2). The average is found of all these differences. Then, if a camera and another camera have a distance (x1-x2, y1-y2, z1-z2) found to be below average, we remove one of the two images. Simple comparison is the current option being used.

Simple comparison stricter: This works like the simple comparison, but instead of using the average, uses 1 standard deviation away from that average.

Euclidean distance: Computes the difference between one camera and the other as one number: simply, the sqrt( (x1-x2)^2 + (y1-y2)^2 + (z1-z2)^2))

To change any of the distance-based sampling, edit the isSimple function.

Clone this wiki locally