[SOLVED] CS314 Lab 5

25.00 $

Category:

Description

Rate

Write a simple image processing application in C/C++.

The input to the application should be a ​ppm​ image file. There are many free utilities to convert from ​jpeg​ images to ​ppm​ ones.
Your application must read this file and store the pixel information in a matrix.
Then, it must perform two transformations to the image, ​one after the other​. Choose some simple transformations such as “RGB to grayscale”, “edge detection”, “image blur”, etc. Let us call the two transformations ​T1​ and ​T2​.

Write the resultant pixel matrix to a new ​ppm​ file.
Usage: ./a.out <path-to-original-image> <path-to-transformed-image>

Now suppose you have a processor with two cores. You want your application to finish faster. You can do this by having the file read and ​T1​ done on the first core, passing the transformed pixels to the other core, where ​T2​ is performed on them, and then written to the output image file. Do this in the following ways:

  1. T1​ and ​T2​ are performed by 2 different threads of the same process. They communicate through the process’ address space itself.
    1. Synchronization using atomic operations
    2. Synchronization using semaphores
  2. T1​ and ​T2​ are performed by 2 different processes that communicate via shared memory.Synchronization using semaphores.
  3. T1​ and ​T2​ are performed by 2 different processes that communicate via pipes.
  • ●  Briefly describe the chosen image transformations in your report.
  • ●  Devise a method to prove in each case that the pixels were received as sent, in the sentorder. Describe the method in your report.
  • ●  Study the run-time and speed-up of each of the approaches and discuss.
  • ●  Discuss the relative ease/ difficulty of implementing/ debugging each approach.