This programs implements image processing techniques using OpenMP, CUDA, and OpenCL and then compares their performance.
Specifically, there are two supported operations: image blur and image inversion. The image blur operation is a simple averaging of all bordering pixels, and the image inversion inverts each individual pixel. Both of these operations are implemented in OpenMP, CUDA, and OpenCL.
To build and run:
make
./gpu-image-processing
To use the program:
File
->Open
and select an image. The selected image will be placed on the left.- Select the desired image processing operation from the dropdown menu.
- Click the
Modify
button. This will process the image with each implementation (i.e., OpenMP, CUDA, and OpenCL), place the result on the right, and then add text at the bottom of the screen indicating the execution time of each implementation.
In addition, the following controls are implemented:
Ctrl
+F
- Fit image to windowCtrl
++
- Zoom in (only possible when not fit to window)Ctrl
+-
- Zoom out (only possible when not fit to window)
For convenience, there are three images included in the images
directory: lowres-image.jpg
, medres-image.jpg
, and highres-image.jpg
.
The different resolutions are convenient for showing how execution time scales with image resolution. In addition,
images with low resolution are optimal for viewing the effects of the blur operation.
- The Image Viewer Example from Qt was used as the basis point for the Qt application. This was extended to support two images, the process effect dropdown, and the modify button; in addition, certain functionality was modified to support the new purpose of the application.
- Example code from this course was consulted for the usage of CUDA and OpenCL.