Bare-metal Sobel

Project attribution: Project done with Eric Abraham.
Source: The project’s source code is available here.
Short description: Bare-metal C program that parallelizes the Sobel algorithm.
Technologies: C
What I did: I designed and implemented parts of the custom FIFO, the data-parallel version, and parts of the hybrid version.

The code was written for a CompSoC platform developed at TU Eindhoven. The CompSoC platform is highly configurable, and can be set to have multiple RISC-V processor tiles, each managing a number of partitions. For this project we had 3 processor tiles, each with 3 partitions that could perform computations in parallel.

The Sobel algorithm is a classical computer vision algorithm that is used to detect edges of objects in images. It consists of 4 phases:

  1. Greyscale - transform the image to black & white
  2. Convolution - apply smoothing kernels to reduce noise in the image
  3. Sobel - apply the Sobel kernel to detect edges
  4. Overlay - apply the detected edges over the original image
Data parallel implementation. The image is split in two halves: upper and lower. We apply all steps of the Sobel algorithm on each half separetely, and then we merge them.
Function parallel implementation. Each step of the algorithm is executed on a different partition for a full image. This allows us to process different images in parallel for different steps of the algorithm. E.g. when we apply convolution on one image, we can apply greyscale on the next image at the same time.
Hybrid parallel implementation. We combine data and function parallel techniques to apply different parts of the Sobel algorithm on halves of images.