[SOLVED] CS314 Lab 5

30.00 $

Category:
Click Category Button to View Your Next Assignment | Homework

You will receive the following solution file(s) instantly after successful payment:

zip file icon Lab-5-c6hqrh.zip (1435 KB)
Assignment Instructions Updated Recently? Submit Below and we will provide new Solution!
Submit New Instructions
đź”’ Securely Powered by:
Secure Checkout
Rate this product

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 sent

    order. 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.
  • Lab-5-c6hqrh.zip