ENGR 106 – Fall 2005

HOMEWORK 14

Due:December7 –9, 2005

Instructions for Homework Submissions:

All homework submissions, whether hard copies or files submitted electronically, must have the following items at the top of the page or file:

Your Name

Your Lab Division/Section Number

All hard copies are to be stapled together and submitted immediately at the start of Lab 15.

1.Peer Evaluation of Team Members

Note: You must use Internet Explorer to complete on-line assignments.

These online assignments are targeted for release on Friday 11/18 at 5 pm.

Your second teaming experience is entering the adjourning stage. It is now time to access your performance and that of each of your team members as well as the team overall. As you complete the evaluations, consider all of your teaming experiences with your team – in lab, in lecture, and outside of class since you last evaluation of team effectiveness (around the end of MEA 3).

You will complete two evaluations available on your online assignments. When asked for comments, please support your assessment with short justifications.

  • You will use thePeer Evaluation of Team Membersto evaluate each team member’s performance on the team.
  • You will also complete an Overall Team Effectiveness. You have seen a similar evaluation during the lab component of MEA 4. At the time, you were evaluating your team’s performance during just MEA 4. You are now using this evaluation to assess your team performance during all of your teaming experiences.

MEA 4 Computer Implementation

Lab Demonstration of MEA 4 Computer Implementation: The remaining problems are concerned with the MEA 4 Computer Implementation. You will individually demonstrate your final complete set of user-defined functions in Lab 15 using a new set of data files that will be provided in Lab 15. Your solution should run by (1) typing deshred at the MATLAB prompt and (2) providing three user inputs: the data file name prefix and extension and the total number of data files in the set.

Grading:

  • Your demonstration will constitute part of your Lab 15 CFU grade. You must be able to access all of your code during Lab 15. You will also electronically submit all of your code during this Lab.
  • Your hardcopy deliverables from this homework will constitute your Homework 14 grade. Deliverables: You must submit a full hardcopy set of all user-defined functions written to complete this task. At a minimum, these files include: appendstrip, combinestrips(modified 12/2/05), compareedge, deshred, findadjacentpieces, readdata, removestrip,and stripstartingindex.You may have created additional functions as per Problem 4 below.

2.MEA 4 Computer Implementation / User Defined Functions V

This problem is to be completed individually.

NOTE: This is the seventh in a series of lab and homework problems that will be linked. The final product will be a large MATLAB code that you will demonstrate in lab during the last week of class.

This is a design problem. Your task is to develop a user-defined function named compareedge that will deliver a single value that is a measure of how well the left edge of a strip matches with the right edge of another strip. This value will be henceforth referred to as the match rating. The design component of this task is that you may develop any quantitative match ratingsystem you choose, however a hint at a possible rating method appears below.

Hint: When comparing two strips side-by-side, the grayscale values on the left side of the right strip should be similar to the grayscale values on the right side of the left strip. In the ideal case, the grayscale values on the left strip are exactly equal to the grayscale values in the right strip. In practice, this is not always the case. If you were to plot these values as a set of (x,y) coordinates, where x are the values of the left strip and y are the values of the right strip, two strips with identical sets of values will result in a set of points falling along the line y = x. Admittedly, the majority of the points will occur at (255,255), however, the trend does still exist. Two strips that match should have a trend similar to y = x, though the trend will not be exact.

Deliverables: A hardcopy of yourcompareedgefunction in your overall code package (see the yellow box above).

3MEA 4 Computer Implementation / User Defined Functions VI

This problem is to be completed individually.

NOTE: This is the eighth in a series of lab and homework problems that will be linked. The final product will be a large MATLAB code that you will demonstrate in lab during the last week of class.

Your task is to create a user-defined function named findadjacentpieces that searches through all possible pairs of strips for the pair of strips with the best match rating and return the strip numbers of those two strips. NOTE: the “best” match rating depends on how you develop your match rating system in Problem 2 above. As an example, consider Table 1 below. If, based on your rating system, a lower match rating value indicates a more likely match, then your function should return 2 as the left strip number and 3 as the right strip number. Likewise, if under your rating system, a higher number indicates a better match, then you should return 4 as the left strip and 2 as the right strip.Notice, that you will need to loop over all possible pairs of strips, calculating a match rating for each pair.

Table 1 – Sample Match Ratings Matrix

Left Strip
Right Strip / 1 / 2 / 3 / 4
1 / - / 30.3 / 37.8 / 49.7
2 / 19.0 / - / 86.0 / 90.0
3 / 19.3 / 15.1 / - / 82.2
4 / 68.2 / 69.8 / 59.4 / -

A couple of useful notes…

  • Notice that a strip can not be both the left and the right strip at the same time. If you would like to assign a value to their rating, you could use the predefined numbers Inf and –Inf for positive or negative infinity,respectively. MATLAB will consider them accordingly if you use the max and min functions. You may want to modify your compareedge function to utilize the Inf or –Inf rating.
  • Another important area where this may be useful is if the edges you are comparing are 100% white. The left and right edges of a paper typically do not have any writing on them, meaning that the grayscale values of along those edges are completely white (255). The problem is that this also means that the extreme left and right edges of the original paper have an exact match with each other, resulting in the best match rating being assigned to them when in actuality, they should not be matched.
  • Finally, note that the rating for strip 2 being on the left and strip 1 on the right (30.3 in the example above) is different than the rating for strip 2 of the right and strip 1 on the left (19.0 in the example above). Remember that this is a comparison of the different sides of the same strip. You are comparing the right edge of the left strip with the left edge of the right strip.

Deliverable: A hardcopy of yourfindadjacentpiecesfunction in your overall code package (see the yellow box above).

4.MEA 4 Computer Implementation / Putting it all together

This problem is to be completed individually.

NOTE: This is the ninth in a series of lab and homework problems that will be linked. The final product will be a large MATLAB code that you will demonstrate in lab during the last week of class.

Your task is to modify your executive function deshred. Recall, that itstask is to manage all computations and calls to other user-defined functions to complete the task of reassembling the the document shreds into the original document. Your executive function should:

  • Load all the image data by calling your readdata function.
  • Loop an appropriate number of times. During each pass of the loop, it should:
  • Find two strips that should be combined.
  • Remove both strips from the data matrix and width vector.
  • Combine those two strips into a single new strip.
  • Append the new strip to the end of the data matrix and width vector.
  • Display the final image.

The sub-tasks above should be completed by calling the appropriate user-defined functions you’ve created over the past few weeks. You may go back and modify any of the user-defined function you have developed thus far, and you may develop additional functions if you feel they are useful or necessary. For your final demonstration, you will be given a new image set and you willbe asked to run your program, reconstructing the new image set into the original document.

Deliverables: A hardcopy of yourdeshred function in your overall code package (see the yellow box above).