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

Unaligned point clouds #8

Open
LogWell opened this issue Sep 6, 2021 · 1 comment
Open

Unaligned point clouds #8

LogWell opened this issue Sep 6, 2021 · 1 comment

Comments

@LogWell
Copy link

LogWell commented Sep 6, 2021

Hi @kv2000 , in the data provided, why are feature line and scan not aligned? How to solve this problem?

Generally speaking, it is only necessary to record the corresponding vertex index on the scanning data. Why is the absolute point cloud of feature lines provided here?

Selection_002
Selection_001

@LogWell
Copy link
Author

LogWell commented Sep 17, 2021

1-1

The above preview image is generated by the following code, which can be used to quickly check the problem data.

if 1:
    from glob import glob
    from natsort import natsorted

    from vedo import *
    # settings.screenshotTransparentBackground = True
    # settings.screeshotScale = 2

    vp = Plotter(axes=0, size=(800, 800), offscreen=1)

    path_dataset = "/media/[...]/dataset@DeepFashion3D"
    path_pfx_pc = path_dataset + "/deep_fashion_3d_point_cloud/point_cloud"
    path_pfx_FL = path_dataset + "/DF3D_Featurelines"

    path_mesh_ALL = natsorted(glob(path_pfx_pc + "/*/*.ply"), key=lambda y: y.lower())

    for path_mesh in path_mesh_ALL:
        print(path_mesh)
        path_render = path_mesh[:-4] + ".jpg"

        mesh1 = load(path_mesh).ps(2)
        mesh2 = mesh1.clone().rotateY(180).x(0.5).ps(2)
        mesh3 = mesh1.clone().y(-0.5).ps(2)
        mesh1.renderPointsAsSpheres(False)
        mesh2.renderPointsAsSpheres(False)
        mesh3.renderPointsAsSpheres(False)
        vp += mesh1
        vp += mesh2
        vp += mesh3
        
        string = path_mesh.rsplit("/", 1)[1] + ": " +  "#v=" + str(mesh1.NPoints())
        vp += Text2D(string, font='Courier', s=1.2)

        str_index = "/".join(path_mesh.rsplit("/", 2)[1:])[:-4]
        path_mesh_FL = natsorted(glob(path_pfx_FL + "/" + str_index + "/*.ply"), key=lambda y: y.lower())

        for i, path_mesh in enumerate(path_mesh_FL):
            mesh_i1 = load(path_mesh).c(i).y(-0.5).ps(3)
            mesh_i2 = mesh_i1.clone().c(i).x(0.5).y(-0.5).ps(3)
            mesh_i1.renderPointsAsSpheres(False)
            mesh_i2.renderPointsAsSpheres(False)    
            vp += mesh_i1
            vp += mesh_i2

        vp.show(zoom=1.2)
        screenshot(path_render)
        vp.clear()

        # exit()

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