

Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!


A copy of this document and other required files for the assignment can be found via the course web page:
This assignment is based on the previous project in Assignment 2. But note that there are a few differences, and some new calculations required.
In this assignment, we shall simulate a situation whereby we have a client that needs to do some simple image analysis task. We shall also assume that we have available, multiple servers that can perform the required task. A client process can then send its requests to the servers, and each server will perform the required analysis and return the results to the client. For simplicity, we just assume that the client and the servers are in the same machine.
A. We are required to apply some simple transformations (median filtering and image inversion) on this noisy image negative to produce a reconstructed image I. This type of filtering is usually performed during some stages of image and video analysis.
The required transformation is performed using the following steps.
median pixel value. (This is done on overlapping blocks). The median value then becomes the value for the pixel at the center of the block. To invert the image, we apply a simple point operation on each pixel as follows: g ( x )=G-A( x ); Assume G=256.
A schematic diagram of the required mapping is shown below.
Noisy image negative A Median filter
Denoised image negative Invert image
Reconstructed image I (denoised and inverted)
Your program should produce the reconstructed version of a noisy image negative from the user. For instance, the client
the required analysis operations. The server would return the median (and other required statistics) of the input array to the client, which then organizes the final result into a de-noised image negative, and prints out the summary statistics. As part of the server’s job, it will also be able to take a given pixel in the image block, and the inverted pixel value.
children. Each child will act as an image analysis server. Assume we have p child processes, (2 ≤ p ≤ 10).
The parent will do the following: i. Read the input image (imageIn.ppm)
iii. Distribute the jobs (the image blocks) amongst the p child-processes, or p threads. iv. Wait for the children to return their results v. Arrange the returned results to form the de-noised negative image vi. Use the results from all the children to calculate and printout the following statistics of the original noisy image:
You are to decide on the specifics of how the parent and its children will communicate and how the parent will distribute the tasks to its children. For instance, since the parent and child process will have copies of the variables at the time a child is created, the parent can communicate which image parts each child will handle by modifying some variables just before the child is created. Thus, the image data will generally be accessible to the child, which will then extract its own assigned part of the image (for instance based on an index number) and then pass the data to the server. Similarly, you will need to decide on how you want the child processes to return their results to the parent, for instance via pipes, or some other mechanism.
The three simple image statistics required from the server are the median, mean and standard deviation - using the image block passed to it by the client (in this case the parent).
=
n
i
1
=
n
i
1
2 1