charlesq34 / pointnet

PointNet: Deep Learning on Point Sets for 3D Classification and Segmentation
Other
4.64k stars 1.45k forks source link

Each cloud is zero-mean and normalized into an unit sphere.How is this achieved? #232

Open christinezuzart opened 4 years ago

christinezuzart commented 4 years ago

Hello ,

Any help on how to achieve zero-mean and normalization on a custom data-set is appreciated.

Thanks, Christine

Hero7749 commented 4 years ago

I found this code in pointnet/utils/pc_util.py. Maybe it can help you.

centroid = np.mean(points, axis=0)
points -= centroid
furthest_distance = np.max(np.sqrt(np.sum(abs(points)**2,axis=-1)))
points /= furthest_distance

But I got confused about the normalize algorithm. Was the method that author used be the Z-Score Normalization? There is a little difference between Z-score and author's code.

According to the Standard Deviation formula: image And the Z-Score formula: image

I think this step np.sqrt(np.sum(abs(points)**2,axis=-1)) is calculating the standard deviation of x, y, z direction respectively. And this step points /= furthest_distance is calculating the Z-score.

The above is just my thought. But I am wondering:

  1. Why there's no 1/N before doing square root in the code?
  2. Why it just need to use the maximum value of SD to do

Maybe you guys can also help me about my question.

adosar commented 2 months ago

@Hero7749 What if the size of the point cloud matters for the task at hand? Should normalization be applied in this case?