Generate CUDA Code for a Fog Rectification Algorithm
3,527 views · Published 20 November 2017 · 2:28 · Indexed 14 November 2026
Channel: MATLAB · 2017 · Science & Technology
GPU Coder™ generates optimized CUDA® code from MATLAB® code for deep learning, embedded vision, and autonomous systems. The generated code calls optimized NVIDIA® CUDA libraries and can be integrated into your project as source code, static libraries, or dynamic libraries. It can also be used for prototyping on GPUs, such as the NVIDIA Tesla® and NVIDIA Tegra®. This video shows an example of taking a foggy image as input and producing a defogged image. The image processing algorithm is a typical implementation of a fog rectification algorithm and has several stages, including dark channel estimation, anisotropic diffusion, inverse Koschmieder's law, and histogram stretching. It uses conv2, rgb2gray, and imhist functions. Once the code is generated, a MEX-file is created and is then executed back in the MATLAB environment where you will see a 5X speedup compared to running the algorithm on the CPU. At this point, you can take the generated CUDA code and run it on any NVIDIA GPU, including the embedded Tegra GPUs.
More from this channel
-
1:47
AUTOSAR for Production with Model-Based Design
-
4:31
Simulating in Real Time: Backhoe
-
5:37
Optimizing Shift Schedule to Maximize Fuel Economy
-
3:34
Importing Measured Data to Estimate Fuel Economy
-
5:16
Modeling a Ratchet Mechanism with Leadscrew
-
3:21
Running Parallel Simulations: Aileron Parameter Sweep
-
4:30
Finding Causes of Slow Simulations
-
4:58
Optimizing a Flight Control System