Go-ICP icon indicating copy to clipboard operation
Go-ICP copied to clipboard

Scaling of original point clouds

Open mpkuse opened this issue 5 years ago • 2 comments

I am a little confused about the scaling part:

Make sure both model and data points are normalized to fit in [-1,1]3 prior to running

I have two point clouds lets call it X (3xN) and Y (3xM). There are in general floats. What is the exact scaling I need to do? Also, do I need to scale the result of go-ICP back (inverse scaling?)

X_cap := (X - mean_colwise( X ) ) / max_colwise( X ) - min_colwise( X )

mpkuse avatar Sep 20 '19 09:09 mpkuse

Here you go:

% src == model; tgt == data
% Center to origin
src = src - mean(src, 1);
tgt = tgt - mean(tgt, 1);

% Normalize data
combo = [src; tgt];
combo = rescale(combo,[-1 -1 -1], [1 1 1]);

% Get back normalized Source and Target
src = combo(1:size(src, 1), :);
tgt = combo(size(src, 1) + 1:end, :);

vma1996 avatar May 20 '20 16:05 vma1996

The exact idea here is that your point clouds need to be within the 1x1x1 dimension bounds for the algorithm to work correctly. So find the maximum bounds of is in x, y, or z and scale it to be within 1 and other dimensions scale proportionally. I guess @vma1996 is doing the exact thing via the given code example. Close the issue of it solves our answers your problem.

Regards, #0K

aalavandhaann avatar Apr 26 '21 11:04 aalavandhaann