Scene vision analyzer

From IvanYangYangXi/artclaw_bridge · View interactive version

Scene vision analyzer is an AI agent skill from the GitHub repository IvanYangYangXi/artclaw_bridge. Analyze game scene concept art / screenshots into structured JSON for 3D reconstruction. Extracts objects, spatial layout, camera parameters, lighting, perspective lines, and depth layers. Use when: (1) user provides a scene image and wants structured analysis for 3D scene building, (2) converting 2

How to use this skill

Skill file

Scene Vision Analyzer

Analyze game scene concept art into structured JSON — the data foundation for 2D→3D reconstruction pipeline.

Workflow

Step 1: Prepare

  1. Load the image (user provides path or URL)
  2. Read references/output-schema.json for the full JSON schema
  3. Read references/analysis-prompts.md for prompt templates

Step 2: Run Analysis (Round 1 — Required)

Send the image to a multimodal AI with:

Parse the AI response as JSON. If the response is wrapped in markdown code blocks, strip them.

Step 3: Refinement (Round 2 — Recommended)

Send the Round 1 result back with the refinement prompt from analysis-prompts.md § 第二轮细化 Prompt.

Focus: missed objects, bbox precision, ground_contact accuracy.

Step 4: Consistency Validation (Round 3 — Optional)

Send the Round 2 result with the validation prompt from analysis-prompts.md § 第三轮一致性校验 Prompt.

Focus: size consistency, depth consistency, occlusion logic, shadow direction, group coherence.

Step 5: Save Results

Use scripts/scene_analyze.py helper functions:

from scene_analyze import save_result, generate_summary
# save_result(output_dir, json_string) → saves analysis_result.json + analysis_summary.txt

Or save manually:

Default output dir: <image_dir>/scene_analysis_<timestamp>/

Quick Reference: Key Schema Fields

| Field | Purpose | Used by downstream |

|-------|---------|-------------------|

| objects[].ground_contact_pct | Where object touches ground | Step 3 (perspective → 3D coords) |

| objects[].estimated_size_m | Real-world size in meters | Step 3 (scale calibration) |

| objects[].bbox_pct | 2D bounding box (%) | Step 2 (annotation drawing) |

| camera.pitch_angle_deg/yaw_angle_deg | View angles | Step 3 (camera matrix) |

| camera.horizon_position_pct | Horizon line position | Step 3 (vanishing point) |

| spatial_references.perspective_lines | Depth cue lines | Step 3 (homography) |

| spatial_references.vanishing_points_pct | Convergence points | Step 3 (focal length est.) |

| ground_plane.polygon_pct | Ground area outline | Step 3 (ground plane fit) |

| groups | Repeated object patterns | Step 5 (batch placement) |

Output Validation Checklist

Before passing results to the next pipeline step, verify:

CLI Usage (Dry Run / Prompt Generation)

python scripts/scene_analyze.py <image_path> --dry-run          # print prompts
python scripts/scene_analyze.py <image_path> -o ./output -r 3   # prep 3-round prompts

Tips

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.