Your task is to develop a digital image enhancement tool which will perform contrast adjustment
using the histogram equalisation algorithm. The algorithm uses a cumulative intensity histogram to
back-project original image intensities resulting in an image of equalised intensities. The algorithm is
described in detail in [1] with the main calculation steps summarised below and in Fig. 1:
– calculate an intensity histogram from the input image (Fig. 1b);
– calculate a cumulative histogram (Fig. 1c);
– normalise and scale the cumulative histogram (Fig. 1d): the cumulative frequencies are
normalised and scaled to represent output image intensities (e.g. from 0-255 for an 8-bit
image);
– back-projection: the normalised cumulative histogram is used as a look-up table (LUT) for
mapping of the original intensities onto the output image. For each output pixel, the algorithm
should use the original intensity level as an index into the LUT and assign the intensity value
stored at that index.
– the output should be an intensity equalised image (Fig. 1e).
Fig. 1 The individual steps of the histogram equalisation procedure.
Due to a potentially large amount of data, all image processing shall be performed on parallel
hardware and implemented by a parallel software component written in OpenCL. You should develop
your own device code (i.e. kernels) which performs the main steps of the algorithm. The steps include
several classic parallel patterns including scan, histogram and map. Your tool should also report memory transfer, kernel execution and total program execution times for performance assessment. All
host-side image I/O operations (i.e. reading, displaying of images) are not assessed and can be based
on the code provided during the workshop tutorials. You can use all the code and libraries provided
and developed during the workshop sessions, but you must not use any additional and pre-existing
libraries for this purpose.
The basic version of the tool can be based on purely atomic calculations of the intensity and
cumulative histograms, work with 8-bit intensity monochrome images and pre-determined bin size
(i.e. 256). Further credit will be given for additional functionality such as the efficient parallel
implementation of the histogram based on local memory, variable bin size, different parallel variants
of the scan and support for colour images. In such a case, your program should run and display
execution times for different variants of your algorithms. The test images of different size are
provided together with this assessment brief. During the demonstration, you might be asked to
demonstrate your code working on an “unseen” image provided by your instructor. The main
assessment criteria for this task are related to the correctness of the developed parallel algorithms and
the effectiveness of optimisation strategies. The code should be well commented and clearly
structured into functional blocks.