PRBonn / deep-point-map-compression

MIT License
94 stars 28 forks source link

Encoded Point Cloud Getting Translated #13

Closed ramandika closed 8 months ago

ramandika commented 9 months ago

Hey Louis, I get confused by the result, since the translated point cloud (after compression and decompression) get translated from the original one. I think the size is similar, the only problem is that their position differs and somehow the height is also differ from the original one by some height. Any idea about this. I attached an image showing this issue. Possibly because of this class?

class Normalizer():
    def __init__(self, data, dif=None):
        self.min = np.amin(data, axis=0, keepdims=True)
        self.max = np.amax(data, axis=0, keepdims=True)
        if dif is None:
            self.dif = self.max-self.min
        else:
            self.dif = dif

    def getScale(self):
        return self.dif

    def normalize(self, points):
        return (points - self.min)/self.dif

    def recover(self, norm_points):
        return (norm_points * self.dif)+self.min

image

louis-wiesmann commented 9 months ago

Hey @ramandika,

I checked and it the function it self should work: image

Be aware that you need to use the same normalizer. If you initialize one on the original data it will have the proper scale and offset. If you then for recovering initialize a normalizer on the normalized data it will have the wrong offset and scale.