Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Scaling of original point clouds #9

Open
mpkuse opened this issue Sep 20, 2019 · 2 comments
Open

Scaling of original point clouds #9

mpkuse opened this issue Sep 20, 2019 · 2 comments

Comments

@mpkuse
Copy link

mpkuse commented Sep 20, 2019

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 )
@vma1996
Copy link

vma1996 commented May 20, 2020

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, :);

@aalavandhaann
Copy link

aalavandhaann commented Apr 26, 2021

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants