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

Some functions are not working. #7109

Open
3 tasks done
dakso0124 opened this issue Dec 23, 2024 · 0 comments
Open
3 tasks done

Some functions are not working. #7109

dakso0124 opened this issue Dec 23, 2024 · 0 comments
Labels
bug Not a build issue, this is likely a bug.

Comments

@dakso0124
Copy link

dakso0124 commented Dec 23, 2024

Checklist

Describe the issue

I'm using open3d 0.18.0, python 3.11.9 version through VS code 1.96.0 in Windows 11.

Some functions exit the program without displaying an error, and when trying to use the function by running debug mode, the following message is output: 'Server[1] disconnected unexpectedly'

my code

diameter = np.linalg.norm(np.asarray(pcd.get_max_bound()) - np.asarray(pcd.get_min_bound()))

camera = [ 0 , 0 , diameter] 
radius = diameter * 100

_tmp, pt_map = pcd.hidden_point_removal(camera, radius) <--------------

and

hull_ls = o3d.geometry.LineSet.create_from_triangle_mesh(hull)
hull_ls.paint_uniform_color((1, 0, 0))  <---------

Steps to reproduce the bug

import fnmatch
import open3d as o3d
import os 
import copy 
import numpy as np 
import pandas as pd 
from PIL import Image 

def  deg2rad ( deg ): 
    return deg * np.pi/ 180 

def get_rotated_pcd(pcd, x_theta, y_theta, z_theta):
    pcd_rotated = copy.deepcopy(pcd)
    R = pcd_rotated.get_rotation_matrix_from_axis_angle([x_theta, y_theta, z_theta])
    pcd_rotated.rotate(R, center=(0, 0, 0))
    return pcd_rotated

def get_hpr_camera_radius(pcd):
    diameter = np.linalg.norm(np.asarray(pcd.get_min_bound()) - np.asarray(pcd.get_max_bound()))
    camera = [0, 0, diameter]
    radius = diameter * 100
    return camera, radius

def get_hpr_pt_map(pcd, camera, radius):
    _, pt_map = pcd.hidden_point_removal(camera, radius)    
    return pt_map


def Load_Mesh(mesh_folder_path):

    obj_path = []

    object_cnt = 0

    for file in os.listdir(mesh_folder_path) :
        if fnmatch.fnmatch(file, '*.obj') :
            obj_path.append(file)
            object_cnt += 1
    
    obj_mesh = []
    for path in obj_path:
        obj_mesh.append(o3d.io.read_triangle_mesh(os.path.join(mesh_folder_path, path)))

    generatedMesh = o3d.geometry.TriangleMesh()

    for mesh in obj_mesh:
        generatedMesh += mesh

    draw_geoms_list = [generatedMesh] 
    o3d.visualization.draw_geometries(draw_geoms_list)

    generatedMesh.compute_vertex_normals() 

    draw_geoms_list = [generatedMesh] 
    o3d.visualization.draw_geometries(draw_geoms_list)

    n_pts = 100000
    pcd = generatedMesh.sample_points_uniformly(n_pts) 

    draw_geoms_list = [ pcd] 
    o3d.visualization.draw_geometries(draw_geoms_list)

    bbox = generatedMesh.get_axis_aligned_bounding_box() 
    bbox_points = np.asarray(bbox.get_box_points()) 
    bbox_points[:, 1 ] = np.clip(bbox_points[:, 1 ], a_min= None , a_max= 0 ) 
    bbox_cropped = o3d.geometry.AxisAlignedBoundingBox.create_from_points(o3d.utility.Vector3dVector(bbox_points)) 
    mesh_cropped = generatedMesh.crop(bbox_cropped) 

    draw_geoms_list = [ mesh_cropped] 
    o3d.visualization.draw_geometries(draw_geoms_list)

    pcd_cropped = pcd.crop(bbox_cropped) 

    draw_geoms_list = [ pcd_cropped] 
    o3d.visualization.draw_geometries(draw_geoms_list)

    diameter = np.linalg.norm(np.asarray(pcd.get_max_bound()) - np.asarray(pcd.get_min_bound()))
 
    camera = [ 0 , 0 , diameter] 
    radius = diameter * 100

    _tmp, pt_map = pcd.hidden_point_removal(camera, radius)

Error message

Server[1] disconnected unexpectedly

Expected behavior

No response

Open3D, Python and System information

- Operating system: Windows 11 64-bit
- Python version: Python 3.11.9
- Open3D version: 0.18.0
- System architecture: x64 laptop
- Is this a remote workstation?: no
- How did you install Open3D?: pip
- Compiler version (if built from source): VS Code 1.96.0

Additional information

No response

@dakso0124 dakso0124 added the bug Not a build issue, this is likely a bug. label Dec 23, 2024
@dakso0124 dakso0124 changed the title Summarize the bug (e.g., "Segmentation Fault for Colored Point Cloud Registration") Some functions are not working. Dec 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Not a build issue, this is likely a bug.
Projects
None yet
Development

No branches or pull requests

1 participant