Image Processing To Manipulate RGB Values Using Verilog.
Image Processing To Manipulate RGB Values Using Verilog.
Verilog.
Abstract—Image processing is a widely used application in a hardware structure, timing information about a
today’s world. Be it a photo taken from phone or camera. hypothetical hardware implementation is also available,
There is a process that goes into it to make the image allowing for specialised speed enhancements.
stabilized. Python is mostly used for image processing because
of its easy coding and libraries used for different operations.
We have implemented the image processing in the Verilog code.
In this paper we have showed how we converted an image in a
hex file using MATLAB and then used the hex file in Verilog
coding to perform some image processing operations. We have
Xilinx to write our code and perform the operations. There will
be an output image after the code is compiled and run. We will
be performing basic three operation for an image that will be
in a hex file as an input. The Three basic operations are
inverting of the image, threshold operation of the image, image Fig 1: Image Processing Block Diagram.
brightness reduction. This paper also aims to show how to
process an image using Verilog from reading an input bitmap II. MATLAB CODING FOR HEX FILE.
image in Verilog, processing and writing the processed result to
Images cannot be read directly by Verilog. The
an output bitmap image in Verilog.
image must be transformed from bitmap to hexadecimal
Keywords—Image Processing, Verilog HDL, FPGA, RGB format before it can be read in Verilog. To convert a
Values. bitmap image to a.hex file, we use MATLAB the input
image needs to be converted into 768x512 pixels, and
I. INTRODUCTION the image.hex file contains the bitmap image's R, G, and
Image processing is a technique for applying operations on B data. Below is the photo of code used for converting
an image in order to improve it or extract relevant bitmap image into a hex file.
information from it. It's a sort of signal processing in which
the input is an image and the output is either that image or
its characteristics/features. Image processing basically
includes the following three steps:
● Importing Image hex file via image acquisition
tool.
● Analysing and manipulating the image.
● Output in which image can be a altered image or
report that is based on image analysis.
By using Verilog hardware descriptive language we can
directly code at hardware level and enjoy its hardware
portability advantage. Verilog allows us to read hex file for
manipulation of image easily. By using Verilog hardware Fig 2: MATLAB hex file code.
engineer can easily analyse the circuit synthesis by using
one of the Xilinx’s property to create circuit with use of The image is named as input for MATLAB code to
identify it in the same folder. The image is send through
Verilog code. Because Verilog syntax is constantly linked to
some iterations in for loop. Notice the loop is from 512 to
Fig 3: Parameters file from where operations will be Fig 5: Brightness addition Verilog Code.
defined.
When sign variable is declared one in image read module
To read the image hexadecimal data file, Verilog uses the operation performed on the image is brightness addition.
the command $readmemh. After reading the image.hex file, The temp variables perform an calculations using the above
the RGB picture data is kept in memory and read out for formulas and check of the value exceeds the limit of 255, if
processing. Below is the image of image read module. yes then it assigns the RGB data the value of 255.
V. RESULTS.
Here are the simulation results produced by applying the
operations outlined in Verilog HDL to an input image. The Fig 15: Inverted Image output.
image given as an input is of the size 768x512. This image
will first be given as an input to MATLAB. Then its hex file For inverting operation the value must have been subtracted
is generated which will be given as an input to the Verilog from 255 to reach this contrast level for the output image.
coding in Xilinx.