Skip to content

layout.json warped in a few scenes #60

@MINEKING987

Description

@MINEKING987

When I extract and overlay the layout (planes, edges, junctions) onto the perspective images, most wall-wall edges line up perfectly, but some floor–wall and ceiling–wall seams are clearly misplaced. For example, in scene_02796, room 1011, view 0, the ceiling plane is drawn against the wall.

Steps to Reproduce

  1. Clone/download the Structured3D dataset (my current root at D:\Usera\Structure3D dataset\data).
  2. Run the snippet below (ref. Run_viz_all.py)
  3. Observe that in certain views (e.g. scene_02796_1011_full_0, scene_02327_1760_full_2), the colored overlays do not match the true floor/ceiling boundaries.

Example screenshot

Consider the example of: scene_02796; room 1011; view 0. The ceiling is clearly visible yet marked as part of the wall.

Image

Expected Behavior

All plane boundaries (wall–floor, wall–ceiling, wall–wall) should align with the true scene edges in the provided rendered images.
Other examples include: scene_02327; room 1760; view 2. There are also others where the lines are present but are not aligned with the scene.

Actual Behavior

  • wall polygons are sometimes drawn on ceiling surfaces.
  • Floor-wall and Ceiling-wall seams occasionally drift off the actual floor boundary.

Is this misalignment due to an error in my extraction/visualization code, or are these particular views mislabeled in the dataset?

Thanks in advance.

Run_viz_all.py

import os
import json
import cv2
import numpy as np
import matplotlib.pyplot as plt

# ======== Configuration ========
root_dir  = 'D:\\Usera\\Structure3D dataset\\data'
#Error keys
image_key  = 'scene_02327_1760_full_2'
#'scene_02796_1011_full_0'
# 'scene_00423_311_full_3'
# 'scene_02464_369287_full_2'
# ======== get paths ========
scene_folder, render_type, _, view_id = image_key.rsplit('_', 3)
view_dir = os.path.join(
    root_dir, 'Structured3D', 'Structured3D',
    scene_folder, '2D_rendering', render_type,
    'perspective', 'full', view_id
)
layout_path = os.path.join(view_dir, 'layout.json')
image_path  = os.path.join(view_dir, 'rgb_rawlight.png')

# ======== Load image ========
img = cv2.imread(image_path)
if img is None:
    raise FileNotFoundError(f"Image not found: {image_path}")
img = cv2.cvtColor(img, cv2.COLOR_BGR2RGB)

# ======== Load layout ========
with open(layout_path, 'r') as f:
    data = json.load(f)
junctions = [tuple(j['coordinate']) for j in data['junctions']]
planes    = data['planes']

# ======== Visualization ========
color_map = {'wall': 'red', 'floor': 'green', 'ceiling': 'blue'}
fig, ax = plt.subplots(figsize=(12, 8))
ax.imshow(img)
# Draw plane polygons
for plane in planes:
    for mask in plane.get('visible_mask', []):
        coords = np.array([junctions[idx] for idx in mask])
        color = color_map.get(plane['type'], 'white')
        ax.fill(coords[:,0], coords[:,1], facecolor=color, alpha=0.3)
        closed = np.vstack([coords, coords[0]])
        ax.plot(closed[:,0], closed[:,1], color=color, linewidth=2)

# Draw junctions and edges
xs, ys = zip(*junctions)
ax.scatter(xs, ys, s=30, color='yellow', edgecolor='black', zorder=5)
for plane in planes:
    for mask in plane.get('visible_mask', []):
        for i in range(len(mask)-1):
            j0, j1 = mask[i], mask[i+1]
            x0, y0 = junctions[j0]
            x1, y1 = junctions[j1]
            ax.plot([x0, x1], [y0, y1], color='yellow', linestyle='--', linewidth=1)

ax.axis('off')
ax.set_aspect('equal')
fig.tight_layout(pad=0)
plt.show()

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions