nianticlabs / manydepth

[CVPR 2021] Self-supervised depth estimation from short sequences
Other
618 stars 83 forks source link

Bug in intrinsics re-scaling? #49

Closed aj96 closed 2 years ago

aj96 commented 2 years ago

I noticed you are updating intrinsics like so:

K[0, :] *= self.width // (2 * scale) K[1, :] = self.height // (2 ** scale)

Aren't you supposed to multiply the intrinsics by the ratio of the new_shape / orig_shape? If you are resizing your img to be self.width // (2 * scale), then shouldn't it be K[0, :] = (self.width // (2 * scale orig_width)) where orig_width is the original width of the image before resizing?

What you are doing here seems to be just multiplying the intrinsics by the size of the new image. That cannot be. Am I mis-reading the code?

brandleyzhou commented 2 years ago

I think you are right. but please note that every element in K is normalized. namely, here k[0, :] = original_K[0, :] / original_width, so when we change the image size, we just need to multiply the new size.

daniyar-niantic commented 2 years ago

The K is normalized, so multiplying it with the size of the new image will give correct result.