victorprad / InfiniTAM

A Framework for the Volumetric Integration of Depth Images
http://www.infinitam.org
Other
918 stars 351 forks source link

Wrong computation in buildHashAllocAndVisibleTypePP: scaling a Vector4f #47

Closed Masterxilo closed 8 years ago

Masterxilo commented 8 years ago

The lines

point = TO_VECTOR3(invM_d * (pt_camera_f * (1.0f - mu / norm))) * oneOverVoxelSize;
point_e = TO_VECTOR3(invM_d * (pt_camera_f * (1.0f + mu / norm))) * oneOverVoxelSize;

in buildHashAllocAndVisibleTypePP are wrong, the fourth component of pt_camera_f should not be scaled prior to applying the transformation, it should be 1.

I wonder why things didn't mess up too badly despite this. Probably because its only for the block allocation and because the translation is not that big in most example data.

olafkaehler commented 8 years ago

Well spotted. I've just committed a fix.

Keep in mind that mu/norm is typically a very small number, so the fourth component wasn't off by much anyway. And, as you say, for translation within a few metres from the starting point, it shouldn't matter much either.