Classical image processing usually regards the final stacked image as a purely two-dimensional end product: an arrangement of RGB pixels optimized for sharpness, noise reduction, and contrast. However, in both extreme macro photography and lunar and landscape observation, the crucial dimension is lost: spatial depth.

With the TacticalMapper and its integration into Agent Greg's retro-upgrade pipeline, the MoonEngine goes a step further. We generate topographical height profiles from seemingly flat 2D stacking results—a system we refer to as 2.5D Pseudo-LIDAR.


1. The Core Idea: Why Pseudo-LIDAR?

True LIDAR (Light Detection and Ranging) measures the time-of-flight of laser pulses to capture millimeter-accurate point clouds in 3D space. In our scenarios, this approach is impossible for two reasons:

The idea behind our Pseudo-LIDAR: When we lack active time-of-flight measurement and true stereo parallax, we utilize the physical laws of light—specifically Shape-from-Shading (SfS), local brightness gradients, and the known angle of incidence of the light source.


2. The Difference: Why 2.5D and Not Full 3D?

In computer graphics and remote sensing, it is necessary to distinguish transparently between true 3D and 2.5D (Elevation Maps):

True 3D (Point Cloud / Mesh): 2.5D Pseudo-LIDAR (Elevation Map):
 /\ /\
 / \ <-- Occlusion / \
 / /\ \ (occluded space) /____\ <-- Height per Pixel Z(x,y)
 /_/ \_\ | | (No occlusion)

Despite this physical limitation, a 2.5D height model offers enormous algorithmic advantages over a simple RGB image.


3. Application Domains: Where the Height Profile Makes the Difference

A. Lunar Photography: Crater Morphology and Sun Angle

At the day-night terminator of the Moon, crater walls, rilles, and central peaks cast long, high-contrast shadows. The TacticalMapper analyzes these shadow projections and brightness gradients. By reconstructing the relative height differences of the lunar crust based on the geometry of the light incidence, the system generates the result (Retro_*_Height.tif), which visualizes the depth of an impact crater and allows elevations to appear plastically pronounced.

B. Macro Photography: Occlusion Limits & Plane Separation

In the extreme close-up range (magnification ratio 2:1 to 5:1), planes of focus overlap extremely rapidly. Bristles of an insect obscure the chitinous exoskeleton; spore capsules protrude in front of the stem. If the MoonEngine derives a pseudo-depth map from this, artifacts at edge transitions (so-called Focus Halos) can be mathematically segmented. Thanks to the 2.5D map, the algorithm knows which structural element lies in front of which background.

C. Landscape Photography: Tactical Compensation in Focus Stacking

In wide landscapes with extreme near-far contrast (e.g., a rock block 50 cm in front of the lens, a mountain range on the horizon), topographical analysis is used for relative depth segmentation. When merging the exposure series, the 2.5D mask prevents blur transitions and ghosting at edges because the foreground and background are compensated as separate topographical planes.


4. How the TacticalMapper Works in Code

In the architecture of the MoonEngine, this process is autonomously initiated by AgentGreg as soon as it retroactively processes old archives:

# Excerpt from Agent Greg's Archive Routine:
# Automatic detection and transformation of old 2D stacks
for file in files:
 if file.endswith(".tif") and any(tag in file for tag in ["Landscape_Result", "Macro_Training", "Recon"]):
 file_path = os.path.join(root, file)
 asset_dir = os.path.join(root, "3D_Map_Assets")
 base_name = os.path.splitext(file)[0]
 expected_height = os.path.join(asset_dir, f"Retro_{base_name_Height.tif")

 if not os.path.exists(expected_height):
 # Transformation via TacticalMapper to topographical assets
 success = mapper.process_recon_or_landscape(file_path, root, prefix="Retro")
 if success:
 self.learn_from_image(file_path, "Retro_Archive")

The mathematical height extrapolation is based on the integration of brightness gradients perpendicular to the light source:

Z(x, y) = ( ∂I / ∂x · cos(θ) + ∂I / ∂y · sin(θ) Albedoest ) norm

5. Visual Memory: How L.U.N.A. Utilizes Reliefs

The generated height maps are not an end in themselves. Agent Greg registers every successful height relief along with its MD5 checksum in the visual_memory table.

L.U.N.A. Prime accesses this database:


Conclusion: The Depth Behind the Pixel

The 2.5D pseudo-LIDAR bridges the gap between pure image stacking and spatial computer vision. It transparently reveals the physical limits of what is achievable—not artificially inventing hidden backsides, but providing honest, deterministic reconstruction based on light, shadow, and gradients.

This transforms the MoonEngine from a simple image processing tool into a tactical reconnaissance system for microcosms and celestial bodies.