How yashsharda2/canny_edge_detection_in_fpga- works
This repository implements a streamed Canny edge detector on an iCE40 FPGA, driven by RP2040 firmware that reads an image, clocks pixels into the FPGA, collects edge bits, and displays and saves the result. The documented FPGA stages form the principal processing path; the README also identifies line buffering, and the tools provide image-to-input and output-to-image conversions. RTL internals were not excerpted, so stage-to-stage links cite the README rather than implying uninspected module calls.
Main entry points: canny.py Frame Controller · top.v FPGA Top · png2bin.py PNG to Pixels · gaussianBlur.v Gaussian Blur
Components 15
Image Preparation
- PNG to Pixels
tools/png2bin.py
RP2040 Interface
- Frame Controller
firmware/canny.py - ST7789 Driver
firmware/canny.py
FPGA Canny Pipeline
- FPGA Top
rtl/top.v - Window Generator
rtl/imageControl.v - Line Buffer
rtl/lineBuffer.v - Gaussian Blur
rtl/gaussianBlur.v - Sobel Gradient
rtl/sobel.v - Non-Max Suppression
rtl/non_max_suppr.v - Double Threshold
rtl/double_threshold.v - Hysteresis Tracking
rtl/edge_track.v
Result Outputs
- Bits to PNG
tools/bin2png.py - Edge Bitstream
- ST7789 Display
Other components
- Image Source
Connections 14
- Image Source → PNG to Pixels: provides image
tools/png2bin.py - PNG to Pixels → Frame Controller: writes input.bin
tools/png2bin.py - Frame Controller → FPGA Top: streams pixels
README.md - FPGA Top → Window Generator: generates windows
README.md - FPGA Top → Gaussian Blur: passes pixels
README.md - Gaussian Blur → Sobel Gradient: passes pixels
README.md - Sobel Gradient → Non-Max Suppression: passes gradients
README.md - Non-Max Suppression → Double Threshold: passes ridges
README.md - Double Threshold → Hysteresis Tracking: passes classifications
README.md - Hysteresis Tracking → Frame Controller: returns edge bits
README.md - Frame Controller → Edge Bitstream: writes packed bits
firmware/canny.py - Edge Bitstream → Bits to PNG: reads bitstream
tools/bin2png.py - Frame Controller → ST7789 Driver: renders rows
firmware/canny.py - ST7789 Driver → ST7789 Display: updates screen
firmware/canny.py