Learning Outcomes
This assessment is designed to demonstrate a student’s completion of the following Learning Outcomes:
Edge
The Cardiff Met EDGE supports students in graduating with the knowledge, skills, and attributes that allow them to contribute positively and effectively to the communities in which they live and work.
This module assessment provides opportunities for students to demonstrate development of the following EDGE Competencies:
ETHICAL |
|
DIGITAL |
Demonstrate understanding of how modern parallel programming technologies can be applied to a given problem. |
GLOBAL |
|
ENTREPRENEURIAL |
Assessment Requirements / Tasks (include all guidance notes)
You are required to apply the techniques discussed in lectures/seminars to implement a number of image processing operations using Intel’s Threading Building Blocks (TBB) library.
The tasks are broken down as follows:
a. Using the map pattern, implement a TBB kernel to convert an image, where each pixel is stored with red, green and blue components (an RGB colour space) into an image where each pixel is stored with chromaticity (x, y) and luminance (Y).
Note: You can use the FreeImage to load different image formats to test, which we looked at in lectures. The loaded image is stored in a 2D array where each pixel is made up of RGB values (stored as 3 floats) values. The conversion to the xyY colour space is done in two steps:
(i). Convert the RGB values into intermediate XYZ values:
X = 0.4124 * R + 0.3576 * G + 0.1805 * B
Y = 0.2126 * R + 0.7152 * G + 0.0722 * B
Z = 0.0193 * R + 0.1192 * G + 0.9505 * B
(ii). Calculate the chromaticity and luminance xyY values as;
x = X / (X + Y + Z)
y = Y / (X + Y + Z)
Y = Y
The output of this stage will be a new image where each pixel is stored in the xyY colour space instead of the RGB colour space.
b. Write a second kernel to take the output image from step 1 and set the luminance of each pixel to be 20% of its original value.
c. Write a third kernel to convert the xyY image you modified in step 2 back into the RGB colour space and save the resulting image to disk. This is done in 2 steps…
(i). Convert the xyY values back into intermediate XYZ values:
X = x * (Y / y)
Y = Y
Z = (1- x- y) * (Y/ y)
(ii). Convert the intermediate XYZ values into RGB values:
R = 3.2405 * X + -1.5371 * Y + -0.4985 * Z
G = -0.9693 * X + 1.8760 * Y + 0.0416 * Z
B = 0.0556 * X + -0.2040 * Y + 1.0572 * Z
d. Implement steps 1, 2 and 3 but in a for-loop running serially.
e. Develop a plan outlining a number of experiments to test each kernel (RGB-to-xyY conversion, luminance change and xyY-to-RGB conversion) looking at different sized images for each test case.
Run each experiment multiple times - since you cannot guarantee one test will be fair when run in a pre-emptive multi-tasking environment - and document your test plan and results in a word processed report.
As part of the report discuss how a concurrent / parallel programming library such as TBB lends itself to data parallel problems such as this.