Lattice ICE40 UltraPlus FPGA (Image Processing Gaussian Blur Demo Part 3)

This the third part in a series of articles related to a demo that will perform classical image processing in the Lattice ICE40 UltraPlus FPGA. The system that will be used is the Lattice ICE40 FPGA UltraPlus Breakout Board.

image

Please refer to the previous articles part 1 and part 2 of this series before continuing with this article.

This image processing demo uses gaussian blur transformation called test_gaussian_blur(image_input, image_output, img_proc). The following functionality will be used in this image processing demo,

void test_gaussian_blur(uint8_t *image_input, uint8_t *image_output, Image_processing *img_proc){
   img_proc->send_params(image_width, image_height);
   img_proc->send_image(image_input);

   //gaussian blur kernel
   uint8_t conv_kernel[9] = {(1)<<0, (1)<<1, (1)<<0, (1)<<1, ((1)<<2), (1)<<1,  (1)<<0, (1)<<1, (1)<<0};

   img_proc->send_convolution(conv_kernel, true, true, false);

   printf("wait end busy\n");

   img_proc->wait_end_busy();

   printf("switch buffers\n");

   img_proc->switch_buffers();

   img_proc->read_image(image_output);
}

The following Gaussian blur kernel is used,

  //gaussian blur kernel
   uint8_t conv_kernel[9] = {(1)<<0, (1)<<1, (1)<<0, (1)<<1, ((1)<<2), (1)<<1,  (1)<<0, (1)<<1, (1)<<0};

The following image processing demo with convolution using the gaussian blur kernel previously depicted is shown in the following result,

Here is closeup of the output image after being post processed by gnuplot,

The image transformation results from the img_proc->send_convolution(conv_kernel, true, true, false) function parameters.

In the next article we will be describing more image processing demos in this platform as well as more details, stay tuned. The Lattice ICE40 FPGA UltraPlus Breakout Board is an excellent, low cost, but powerful enough to even tackle image processing applications and is available at DigiKey.

Have a wonderful day!

This article is available in spanish here.

Este artículo está disponible en español aquí.

1 Like