Given rooftop imagery and height/elevation data, automatically identify usable rooftop areas and obstacles, and generate an optimized grid-based solar panel placement layout under real-world engineering constraints.
This project explores the application of Computer Vision + Geometric Modeling + Grid-based Representation + Search / Optimization Algorithms to practical rooftop solar panel deployment problems.
In real residential or commercial rooftops, solar panel placement faces multiple challenges:
- Irregular rooftop shapes (non-rectangular geometries)
- Various obstacles (chimneys, vents, equipment, shaded areas)
- Engineering constraints such as installation spacing, safety buffers, and orientation
- Manual design is costly, inefficient, and difficult to scale
The goal of this project is to build an automated, modular, and extensible solar panel layout system that progressively transforms raw rooftop data into executable placement plans.
Rooftop Images / Height Data ↓ Rooftop & Obstacle Detection (CV / Height Map) ↓ Rooftop Discretization (Grid Representation) ↓ Available / Unavailable Grid Labeling ↓ Layout & Path Search (Greedy / DP / Backtracking) ↓ Solar Panel Placement Result (Visualization)
sol_dt_auto_modules/ ├── data/ # Input data (examples / experiments) │ ├── image/ # Rooftop images │ ├── height_data/ # Elevation / height data │ └── pdf/ # Reference documents │ ├── models/ # Core algorithm modules │ ├── obstacle_detection/ # Obstacle detection │ ├── image_segmentation/ # Image segmentation approaches │ ├── image_segmentation_2/ # Improved segmentation experiments │ ├── height_map_obstacle_analyzer/ │ │ # Height-based obstacle analysis │ ├── rooftop_obstacle_grid_processor.py │ │ # Rooftop → grid core module │ ├── greedy_and_backtrace/ # Greedy + backtracking strategies │ ├── segment_and_dp/ # Segmentation + dynamic programming │ ├── solar_grid_path/ # Grid-based path planning methods │ └── chatgpt/ │ └── gpt_4_vision_preview/ # GPT-4 Vision assisted experiments │ ├── PanelsPlacement/ # Geospatial data / Google Solar API experiments │ ├── google-solar-data/ │ ├── GEO-Polygons.ipynb │ └── GoogleSolarAPI.ipynb │ ├── utils/ # Utility functions ├── main.py # Project entry point ├── tests/ # Test code └── README.md
- Region segmentation based on rooftop imagery
- Height map analysis to assist obstacle identification
- Supports diverse rooftop and obstacle configurations
Objective: Generate usable rooftop masks and obstacle masks.
Core file:
rooftop_obstacle_grid_processor.py
Main responsibilities:
- Discretize continuous rooftop surfaces into regular grids
- Define grid resolution based on panel size and installation spacing
- Label grids as:
- Available
- Unavailable
- Safety buffer zones
This step transforms the problem from continuous geometry into a discrete combinatorial optimization problem, enabling efficient search and optimization.
Multiple algorithmic strategies are explored:
-
Greedy + Backtracking
- Quickly generate initial layouts
- Resolve conflicts via backtracking
-
Segment + Dynamic Programming
- Partition rooftops into subregions
- Optimize panel combinations within each region
-
Grid Path Planning
- Treat panel placement as a coverage/path planning problem
Optimization goals:
- Maximize the number of installable panels
- Improve rooftop utilization
- Reduce fragmentation and wasted space
- Explore GPT-4 Vision’s ability to interpret rooftop imagery
- Used for:
- Obstacle interpretation
- Layout suggestion analysis
This component serves as an auxiliary analysis tool and is not part of the primary decision-making pipeline.
Within PanelsPlacement/:
- Experiments with Google Solar API
- Use of geographic polygons to represent real rooftops
- Exploration of the pipeline from imagery → geospatial coordinates → panel layout
Completed:
- ✅ End-to-end problem modeling (CV → Grid → Optimization)
- ✅ Support for multiple rooftop and obstacle scenarios
- ✅ Exploration of multiple layout strategies
- ✅ Visualization of intermediate and final results
Ongoing / Future Extensions:
- ⏳ Unified objective functions (area / energy yield / installation cost)
- ⏳ Electrical constraints (series/parallel connections)
- ⏳ Shadow modeling and energy estimation
- ⏳ Fully automated end-to-end demo
This project primarily focuses on:
- Algorithm engineering / search & optimization
- Smart infrastructure systems
- Energy + AI automation
Rather than being a pure image segmentation or CV demo.
- Automated rooftop solar design
- Smart building and energy planning
- Engineering research combining CV and optimization
This repository is intended to showcase system design, algorithmic thinking, and engineering approaches.
Due to security and compliance considerations, the full implementation code is not publicly released.
If you are interested in the source code or detailed implementation, please feel free to contact the author: Yibo Li.
This project is an algorithmic and engineering exploration. The modular structure is designed to support algorithm replacement, constraint expansion, and integration with real-world data sources.