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

Point Cloud Registration #374

Open
Martines1 opened this issue Feb 28, 2024 · 0 comments
Open

Point Cloud Registration #374

Martines1 opened this issue Feb 28, 2024 · 0 comments

Comments

@Martines1
Copy link

Hi,
I have a point cloud of 10 frames in ply format and png images from a 3D camera at different angles without calibration pattern, thus my point clouds are not in the common space. I have tried your method to merge point clouds; however, it's missing a lot of pixels (data points) comparing the points3D bin file with my original point cloud.
I have also created a transformation matrix from image quaternions and positions and then transformed my original point cloud, but it does not align the original point clouds at all. 
Have I done something wrong, or is it not possible to align the original point cloud with the output values (cameras.bin, images.bin, points3D.bin)?

Code to get transformation matrix as numpy array:

from hloc.utils.read_write_model import read_model
import numpy as np
from scipy.spatial.transform import Rotation as R

cameras, images, points3D = read_model("outputs/demo/sfm/", ext='.bin')

ids = list(images.keys())
for i in range(len(ids)):
    quat = np.array(list(images[ids[i]].qvec))
    R_mat = R.from_quat(quat).as_matrix()
    pos = np.array(list(images[ids[i]].tvec))
    T_mat = np.eye(4)
    T_mat[:3, :3] = R_mat
    T_mat[:3,3] = pos
    np.save(f'transformation_matrix{i}', T_mat)
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

1 participant