SkyScan is a Python-based computer vision pipeline designed to simulate the visual navigation requirements of autonomous landing systems. It processes aerial cockpit imagery to detect, isolate, and extract runway coordinates and orientation data in real-time.
By focusing strictly on algorithmic efficiency and spatial filtering, the pipeline is optimized for the low-latency constraints typical of embedded aerospace systems.
- Noise Reduction: Implements Gaussian Blurring to minimize atmospheric interference, sensor noise, and high-frequency visual artifacts.
- Gradient-Based Edge Extraction: Utilizes the Canny algorithm to identify high-contrast boundaries between the landing strip and surrounding terrain.
- Geometric Filtering: Employs Probabilistic Hough Line Transforms to extract structural runway markings and convert pixel clusters into mathematical line vectors.
- ROI Optimization: Focuses processing power strictly on a targeted "Region of Interest" (ROI) trapezoid, drastically reducing computational overhead.
- Language: Python 3.x
- Computer Vision: OpenCV (
cv2) - Matrix Operations / Math: NumPy
- Domain: Autonomous Navigation & Image Processing
To ensure maximum performance, the image data is passed through a strict sequential filter:
- Grayscale Conversion: Reduces the input tensor from 3 channels (RGB) to 1 channel, cutting the processing payload by 66% while preserving necessary intensity gradients.
-
Gaussian Blur (Smoothing): A
$5 \times 5$ convolution kernel is applied to prevent the edge detector from triggering on minor terrain details (like grass textures or tarmac cracks). - Canny Edge Detection: Computes the gradient magnitude and direction to find strong edges based on defined hysteresis thresholds.
- Spatial Masking: A polygonal mask is applied to isolate the bottom-center of the frame, completely ignoring the sky, horizon, and peripheral terrain.
-
Hough Transform: The isolated edge pixels are mapped into Hough Space (using polar coordinates
$r$ and$\theta$ ) to find overlapping intersecting curves, which translate back to straight lines ($y = mx + b$ ) representing the runway borders.
Follow these steps to set up the pipeline locally:
-
Clone the repository:
git clone https://github.com/prxcode/skyscan.git cd skyscan -
Create a Virtual Environment:
python -m venv venv
-
Activate the Environment:
- Windows:
venv\Scripts\activate - macOS/Linux:
source venv/bin/activate
- Windows:
-
Install Dependencies:
pip install opencv-python numpy
- Place a sample aerial image (e.g.,
test_runway.jpg) in the root directory. - Run the processing script:
python skyscan.py
- The script will output two windows:
- Debug View: Showing the raw Canny edges isolated within the Region of Interest.
- Final Output: The original image with the extracted runway features overlaid in high-contrast green.
- Press any key while the image window is active to close the program safely.
- Video Stream Processing: Adapting the static frame logic to process
.mp4flight recordings in real-time (aiming for 30+ FPS). - Kalman Filtering: Implementing a predictive tracker to smooth the line detection across consecutive video frames and handle momentary visual dropouts (e.g., passing through a cloud).
- Deep Learning Validation: Integrating a lightweight object detection model (like YOLOv8) to verify airport infrastructure alongside the geometric extraction.
