The assessment is split into 3 separate parts which create a pipeline, thus some stages will rely on previous work. All 3 parts will require you to implement code in a sequential way (without parallelism/multithreading) at first. Later you will need to implement a C++ multithreading or TBB (Threading Building Block) parallelism code to some parts. These a shown below:
Part 1 - Sequential and C++ Threading
Part 2 - Sequential and TBB
Part 3 - Sequential and TBB
Part1:
Load the two image pairs provided that are located in theImages folder:
(pair 1: render_top_1 & render_top_2, pair 2: render_bottom_1 & render_bottom_2) Note: You can use the example load function given in lectures and tutorials to load images For each pair compare their pixels and if the pixels are the same make them black, if they are not make them white. Save the resulting images as "stage1_top.png" for the top pair and "stage1_bottom.png" for the bottom pair.
You will need then to combine both of the images "stage1_top" and "stage1_bottom" into a single image. The combination should be an equal split taking 50% of the pixel value from each of the images. Save resulting combined image as "stage1_combined.png" Once you have completed the code in a sequential way, write a second version but use the C++11 multithreading code to make it more efficient.
Part2:
Load the image "stage1_combined.png" and using the stencil pattern, implement a function to blur the image using a Gaussian kernel. The function should be fully adjustable by allowing the change of sigma and kernel size values. Save resulting image after blurring as "stage2_blurred.png" Using the data from the blurred image apply a binary threshold operation to the image that makes any pixels that are not black into white. Save resulting image as "stage2_threshold.png" Once you have completed the code in a sequential way, write a second version but use the TBB code to parallelise the code.
Part3:
Load images "render_top_1.png" and "stage2_threshold.png". Once loaded you will need to count the number of white pixels in the "stage2_threshold.png" image and work out the percentage of total white pixels in final image.
Using the "stage2_threshold.png" as a filter mask invert the pixel colour in "render_top_1.png" at the pixel locations where a white pixel would be on the image "stage2_threshold.png" Once you have completed the code in a sequential way, write a second version but use the TBB code to parallelise the code.
You will also be required to explain your implementation in a short 5-minute code demo which will take place in the tutorial sessions after the assignment has been submitted. As part of the code demo you will be required to discuss the techniques used to implement your TBB solution and the results you obtained.
The code demo is mandatory. The above sections will also be marked according to how well you demonstrate your understanding of them in the code demo. If you fail to do code demo this will result in failed coursework submission.
You may use the tutorial or lecture demo code as a starting point for your implementation. If you wish, you can also implement your solution in the OS of your choice Linux, macOS or Windows. If you choose not to implement the assignment in Linux please be aware that it is your responsibility to demonstrate the code in the code demo sessions (on your own laptop for example) and it is your responsibility to make sure that the TBB and OpenCL support is present. Also be aware of version differences as the examples discussed in lectures may be based on a different version of OpenCL Deliverables:
A report documenting your test plan, results, code snippets and discussion also containing the source code of your implementation as an appendix. This is to be submitted to Unilearn (Blackboard) no later than the submission date shown on the assignment front sheet.
Please do not submit zipped up files
A 5-minute code demo discussing your implementation, the results obtained and the problems you faced in implementing the assignment. The above sections will also be marked according to how well you demonstrate your understanding of them in the code demo