In this week's lab, we used parallel execution to speed up the operation of inverting the colors of an image. This week's project is quite open-ended: you are to implement two operations from the following table. You may pick any two, provided they are from different columns:
| Column 1 | Column 2 | Column 3 |
|---|---|---|
| black and white conversion | sepia conversion | lighten |
| flip horizontal | edge detection | darken |
| tint color | flip vertical | blur |
| rotate | sharpen | |
| zoom in (crop) | mirror (horizontal or vertical) | change background |
| shrink (resize smaller) | enlarge (resize bigger) | make collage from groupOfImages |
| replace color1 with color2 | emboss | find/reduce redeye |
Alternatively, you may invent and implement your own original image conversion operation for one of your two operations (e.g., an Andy Warhol effect).
For each of your operations, you are to:
You are to research sequential algorithms for your operations, implement your algorithms in C++, use TSGL to display the resulting images, and parallelize your algorithms using OpenMP. There are many online sources for such algorithms. For example, this book by Mark Guzdial and Barbara Ericson contains Java implementations of many of these algorithms, which should be fairly easy to convert to C++. Likewise, there are many tutorials available (e.g., here and here).
You should make each operation a method of class ImageConverter, using the invertImage() operation from this week's lab exercise as a model. In particular, your operation should read pixels from one image (i.e., the image pointed to by myCanvas1) and write transformed pixels to a different Canvas object, rather than transforming the pixels of the original Canvas. Also, be sure to incorporate into your operation a Timer object and sleep() calls, to slow the processing sufficiently for you to see each thread drawing its pixels.
You may find the API documentation for TSGL to be useful, as well as this page of OpenMP resources.
Create a script file in which you use ls to list all your project's files, use cat to display the contents of each file, and build+run your project to demonstrate that it works correctly. Make certain that your script file, spreadsheet, and electronic copies of your image files are all located in your project folder.
Our grader will grade your submission based on the categories given in this grade sheet, so you should make certain all of those categories are covered.
CS > 112 > Projects > 10 > Image Conversion