- Created by: Advik Bahadur
- Project: Implementing a Superresolution model onto a ULX3s FPGA Board developed by Radiona.org
This project implements a real-time super-resolution image processing system on an FPGA. It takes low-resolution input from a camera, processes it through a custom neural network, and outputs a higher-resolution image. The system is designed to work with the OV7670 camera module and uses SDRAM for frame buffering.
- Camera Interface (OV7670)
- SDRAM Controller
- Super-Resolution Neural Network
- VGA Output
- Real-time image capture and processing
- Custom neural network for super-resolution
- SDRAM-based frame buffering
- VGA output for displaying processed images
- Configurable image enhancement (brightness, contrast)
- FPGA development board (compatible with provided pin assignments)
- OV7670 camera module
- SDRAM module
- VGA display
- Verilog synthesis and simulation tools (e.g., Vivado, Quartus)
- Python environment for neural network training (if modifying the model)
-
Clone the repository to your local machine.
-
Connect the hardware components:
- Attach the OV7670 camera module to the appropriate FPGA pins.
- Connect the SDRAM module to the designated FPGA pins.
- Connect a VGA display to the FPGA's VGA output.
-
Open the project in your FPGA development environment.
-
Synthesize the Verilog code and generate the bitstream.
-
Program the FPGA with the generated bitstream.
-
Power on the system and connect the camera module.
-
After powering on, the system will initialize the camera and SDRAM.
-
The camera will start capturing images, which will be processed in real-time by the super-resolution neural network.
-
The processed higher-resolution image will be displayed on the connected VGA display.
-
Use the designated keys to adjust brightness and contrast:
- Key[0]: Increase brightness
- Key[1]: Decrease brightness
- Key[2]: Increase contrast
- Key[3]: Decrease contrast
Run this in the src/ folder
iverilog -o superresolution_tb \ ~/Downloads/oss-cad-suite-linux-x64-20240702/oss-cad-suite/share/yosys/ecp5/cells_sim.v \ -I ~/Downloads/oss-cad-suite-linux-x64-20240702/oss-cad-suite/share/yosys/ecp5/ \ ~/Downloads/oss-cad-suite-linux-x64-20240702/oss-cad-suite/share/yosys/ecp5/cells_bb.v \ conv_layer.v dsp.v relu.v upscaling.v weight_loader.v \ superresolution.v \ superresolutiontb.v
Followed by:
vvp superresolution_tb
gtkwave waveform.vcd
top_module: The main module that integrates all components.camera_interface: Handles communication with the OV7670 camera.sdram_interface: Manages reading and writing to the SDRAM.SuperResolutionSubTop: Coordinates the super-resolution processing.superresolution: Implements the neural network for super-resolution.vga_interface: Manages the VGA output.
To modify the neural network architecture or weights:
- Update the
superresolutionmodule in the Verilog code. - Modify the
smallmodelweights.memfile with new weight values. - Adjust the
WEIGHT_ADDR_WIDTHand other parameters as needed.
- If the image appears distorted, check the camera configuration and SDRAM timing.
- For VGA sync issues, verify the VGA module parameters match your display.
- LED indicators on the FPGA board can help diagnose various stages of the pipeline.
Contributions to improve the project are welcome. Please submit pull requests or open issues for any bugs or enhancements.
- Radiona.org
- Laidlaw Foundation.