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

Non-exist object appears in the rendered image in Front3D. #1144

Open
wzcai99 opened this issue Aug 14, 2024 · 1 comment
Open

Non-exist object appears in the rendered image in Front3D. #1144

wzcai99 opened this issue Aug 14, 2024 · 1 comment
Labels
first answer provided question Question, not yet a bug ;)

Comments

@wzcai99
Copy link

wzcai99 commented Aug 14, 2024

Describe the issue

Hi, I am following the examples rendering the front-3d dataset. But when I set a camera trajectory, I find a non-exist object shown in the pointcloud of the scene. I don't know what is happening here. I use the scene ""e29c9cea-a331-4062-8d95-17f3f7ed8813.json" and visualize the pointcloud by translate every object of loaded_objects into a Trimesh() and use open3d to visualize the point cloud.
image
And when I follow this trajectory to get the rendered image, I found a sofa, which is not appeared on the point cloud.
image
That cause the observed image become black like this.
image

Minimal code example

scene_pcd = o3d.geometry.PointCloud()
floor_heights = []
for obj in loaded_objects:
    if not isinstance(obj,bproc.types.MeshObject):
        continue
    category = mapping.label_from_id(obj.get_cp('category_id'))
    obj_mesh = obj.mesh_as_trimesh().apply_transform(obj.get_local2world_mat())
    new_mesh = o3d.geometry.TriangleMesh()
    new_mesh.vertices = o3d.utility.Vector3dVector(obj_mesh.vertices)
    new_mesh.triangles = o3d.utility.Vector3iVector(obj_mesh.faces)
    new_mesh.vertex_normals = o3d.utility.Vector3dVector(obj_mesh.vertex_normals)
    new_pcd = new_mesh.sample_points_uniformly(1000000)
    new_pcd = new_pcd.voxel_down_sample(0.05)
    new_pcd.colors = o3d.utility.Vector3dVector(np.ones_like(np.array(new_pcd.points)) * 0.4)
    scene_pcd = scene_pcd + new_pcd
    scene_pcd = scene_pcd.voxel_down_sample(0.05)
    if 'floor' in category:
        if len(floor_heights) == 0:
            floor_heights.append(np.array(new_pcd.points)[:,2].mean())
        else:
            distance = np.array(floor_heights) - np.array(new_pcd.points)[:,2].mean()
            if np.min(distance) > 1.0:
                floor_heights.append(np.array(new_pcd.points)[:,2].mean())

Files required to run the code

No response

Expected behavior

How does this happen?

BlenderProc version

Github main branch

@wzcai99 wzcai99 added the question Question, not yet a bug ;) label Aug 14, 2024
@cornerfarmer
Copy link
Member

Sorry for the late response. Have you tried looking at the scene in blenderprocs debug mode? Maybe there is an object which is marked hidden.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
first answer provided question Question, not yet a bug ;)
Projects
None yet
Development

No branches or pull requests

2 participants