walkterrain op• Data kinds: depth × pose × matrix → depth
• Call: import fullseye as fs; fs.ledger.heightmap_depth_camera(heights, pose, K, cell: 'float' = 0.05, origin=(0.0, 0.0), *, width=None, height=None, step=None, near: 'float' = 0.1, max_range: 'float' = 10.0, disparity_sigma: 'float' = 0.0, baseline: 'float' = 0.05, seed: 'int' = 0) (implementation को सीधे call करना हो तो import terrain; terrain.heightmap_depth_camera(heights, pose, K, cell: 'float' = 0.05, origin=(0.0, 0.0), *, width=None, height=None, step=None, near: 'float' = 0.1, max_range: 'float' = 10.0, disparity_sigma: 'float' = 0.0, baseline: 'float' = 0.05, seed: 'int' = 0), registry से लेना हो तो opsdrive.get("heightmap_depth_camera"))
• GPU: नहीं (केवल CPU reference implementation)
height map (elevation map / DEM) को सीधे pinhole depth camera से लेना (किरणों को स्थिर step में ऊँचाई की सतह के ऊपर आगे बढ़ाकर)।
> नीचे का विस्तृत विवरण मूल text में है — सारांश और headings का अनुवाद हो चुका है।
画素ごとに光線を step 刻みで進め、光線が高さの面の下へ入った刻みで、前の刻みとの間を一次で補間して交点を取り、光軸方向の深度 z(camera.depth_to_points が受ける量)を返す。高さはセルの中心の値の双一次補間(terrain.elevation_map と同じ並び: heights[i, j] はセルの中心(origin[0] + (j + ½)·cell, origin[1] + (i + ½)·cell))。セルの中心が張る範囲の外と、nan のセル(観測していない)に触れる所には面が無い。
• カメラの向きの決まりは 1 つ: camera と同じ OpenCV の軸(x 右・y 下・z 前)。pose は world→camera の (R, t)(X_cam = R·X_world + t、camera.project_points と同じ)か 4×4。画素の中心は整数の座標(u = c, v = r)。返した深度を camera.depth_to_points に渡し、Rᵀ (X_cam − t) で世界へ戻せば元の面の上に乗る(往復)。render3d / world_camera の OpenGL の軸(y 上・−z 前)とは (x, y, z)_here = (x, −y, −z)_render3d。
• 刻み: step は既定 cell/2、cell より大きい値は断る。刻みより短い弦で光線が横切る細い突起(1 セル幅の壁を浅い角度でかすめる所など)は飛び越しうる。交点の補間の誤差は刻みの 2 乗で縮む(平面では 0)。
• 雑音: ステレオ・構造化光の誤差の伝播と同じ形 σ_z = z²·σ_d / (f·b)(acceptance_scan の triangulation と同じ則。f = K[0, 0] [px]、baseline b [m]、disparity_sigma σ_d [px])。既定 σ_d = 0(雑音なし = 厳密)。seed で決定的。
• 当たらない画素・面の下から始まる光線・深度が [near, max_range] の外の画素は nan(両端は含み、範囲は雑音を足す前の深度で判定する)。最初の標本 near が面上なら深度 near の当たりにする。面の下から始まる光線(カメラが地面の中)と、地図の外から面の高さより下で入ってくる光線(地図の側面)も nan(側面は面ではない)。
heights : (ny, nx) array
高さ図 [m] (nan = 観測していない穴、Inf は ValueError)。
pose : (R, t) or (4, 4)
world→camera。4×4 は ndarray でも入れ子の list でもよい(最後の行は (0, 0, 0, 1))。
K : (3, 3)
内部行列(camera.intrinsic_matrix)。形は [[fx, s, cx], [0, fy, cy], [0, 0, 1]]。
cell, origin
セルの大きさと、格子の左下の角 (xmin, ymin)(elevation_map の extent の (xmin, ymin))。
width, height : int or None
画像の大きさ(整数の画素。10.7 のような値は断る)。None なら主点から (2·cx + 1, 2·cy + 1)(整数でなければ断る)。
depth : (height, width) float64
光軸方向の深度 [m]、当たらない所は nan。
Raises ValueError: 形・値の誤り(高さに Inf、pose が回転でない、K が pinhole の形でない、step > cell、near ≥ max_range、画像が 4e6 画素を超える 等)。
空の入力(heights が 0 要素)は ValueError で拒否する。
English: renders a height map / DEM directly with a pinhole depth camera by marching each pixel ray at a fixed step over the bilinear height surface and refining the crossing linearly; returns depth along the optical axis (OpenCV axes, world->camera pose as in camera.project_points), NaN where nothing is hit. Optional stereo noise sigma_z = z^2 sigma_d / (f b). The inverse of depth_to_points -> elevation_map.
呼び出し例::
import numpy as np
import terrain
R = np.array([[1.0, 0.0, 0.0], [0.0, -1.0, 0.0], [0.0, 0.0, -1.0]]) # 真下を向く(z 前 = 世界の −z)
C = np.array([1.0, 1.0, 2.0]) # 高さ 2 m のカメラ
K = np.array([[100.0, 0.0, 31.5], [0.0, 100.0, 23.5], [0.0, 0.0, 1.0]])
d = terrain.heightmap_depth_camera(np.zeros((40, 40)), (R, -R @ C), K) # 2 m 四方の平らな床
assert d.shape == (48, 64) and np.allclose(d, 2.0)
• Sample data catalog (DL URL / license) — 2-D के लिए skimage.data (BSD/public) + synthetic, 3-D के लिए real data sources (Stanford/PDS आदि) के DL URL।
• Operators का स्रोत और संदर्भ — इस op family के मूल research/methods के स्रोत।
• Algorithm का मानक स्रोत (लेखक, वर्ष) और उपयोग ऊपर की family usage guide में दिए गए हैं।
• heightmap_depth_camera_tour — py -3.11 examples/heightmap_depth_camera_tour.py
depth को input के रूप में लेते हैं)spin_from_marker_sequence · carla_transform_matrix · carla_pose_to_world · carla_camera_pose · carla_xy_yaw · carla_scene_load · town_chain · osm_parse
walkterrain)elevation_map · fill_gaps · elevation_traversability · foothold_score · ground_surface · ground_plane · detect_obstacles · fuse_elevation
*Provenance: terrain.py — DRIVE operator registry. यह per-op note tools/opdocs.py md से अपने-आप generate होता है (हाथ से edit न करें)।*
© 2026 Kazufumi Furuse — Fullseye operator documentation. Licensed under Apache-2.0.