CS 4500 Assignment #5. Assigned: Friday, 22 February 2013 Due: Friday, 29 February 2013 Working in an instructor-approved team of four students (except for a few smaller teams approved by the instructor), develop a second rapid prototype of a preliminary version of the semester project that matches pattern images to subimages of source images. Your prototype's source code must be written entirely by your team. Your team may not use source code written by other students, source code obtained from the World-Wide Web or other sources, and it may not use software packages that are not already installed on the CCIS Linux machines. Your prototype must include a README file (which *must* be in UTF-8 plain text, and must be named README) that 1. lists all members of your team, 2. gives the preferred email address(es) for contacting your team, 3. tells the grader(s) how your team's rapid prototype can be compiled and run on any CCIS Linux machine in the main lab, 4. acknowledges any third party software used (by permission!) in your submitted software. All of the files necessary to construct and to run your prototype must be combined into a gzip'ed tar file whose name ends in tar.gz. Submit that gzip'ed tar file before noon on the date it is due using the submit script that's described at the course assignments page: http://www.ccs.neu.edu/course/cs4500wc/assignments.html Your prototype will be graded on these criteria: 1. the quality of the instructions and documentation in your README file, 2. the ease of constructing and running your prototype on CCIS Linux machines, 3. your prototype's correctness with respect to parsing correct command lines producing correct output not producing extraneous output not attempting to create files outside of /tmp 4. your prototype's accuracy with respect to matching pattern images with their original source images the location of that match within the source image 5. your prototype's robustness with respect to recognizing matches despite lossy transformations error conditions 6. your prototype's efficiency with respect to run time 7. and the readability of your source code. Your prototype's build process must result in software that can be invoked by cd'ing to the directory containing your software's executable and executing any of the following commands: ./spims -p -s ./spims -pdir -s ./spims -p -sdir ./spims -pdir -sdir where is the name of an existing file in JPEG, PNG, or GIF format without animation (the "pattern image") is the name of an existing file in JPEG, PNG, or GIF format without animation (the "source image") is the name of an existing directory that contains no subdirectories and contains only files in JPEG, PNG, or GIF format without animation (the "pattern images") is the name of an existing directory that contains no subdirectories and contains only files in JPEG, PNG, or GIF format without animation (the "source images") If your software discovers that or does not exist, is not readable, or is not in one of the allowed image formats, then your software should write a comprehensible error message to standard error and terminate with an exit code other than 0. If your software discovers that any file contained within or is not readable or is not in one of the allowed image formats, then your software should write a comprehensible error message to standard error and terminate with an exit code other than 0. If your software discovers that or contains one or more subdirectories, then your software should write a comprehensible error message to standard error and terminate with an exit code other than 0. If your software concludes that a pattern image ( or one of the files within ) matches a subimage of a a source image ( or one of the files within ) in the sense that it could have been obtained from that source image by some composition of cropping and change of image format, then your software should write one line to standard output, in one of the following formats: matches at x++ matches at x++ (with % confidence) where is the short name (without the name of its enclosing directory, et cetera) of the pattern image is the short name (without the name of its enclosing directory, et cetera) of the matching source image is the width of the subimage that matches (which should be the same as the width of the pattern image) is the height of the subimage that matches (which should be the same as the height of the pattern image) is the horizontal offset of the top left corner of that subimage from the top left corner of the source image is the vertical offset of the top left corner of that subimage from the top left corner of the source image is an integer between 1 and 100 (inclusive) stating a confidence level for the match If your software finds a match and produces the correct line of output, then it should be possible to recreate a close approximation to the image in by executing this command on one of our CCIS Linux machines: convert -crop x++ where is the name of the new file that will be created (and should resemble ). A pattern image may match more than one subimage of a source image. Your software should write one line of output for each such match, unless one of the matching subimages has more than 50% of its pixels in common with the another matching subimage. If that happens, your software should write one line of output for the best match, but should not write any lines of output for other matches that have more than 50% of their pixels in common with the best match. If your software does not find any matches, then it should terminate without producing any output whatsoever. If the inputs were acceptable, then your software should terminate with an exit code of zero regardless of whether it finds a match. ---------------------------------------------------------------- Examples. All of the examples given for assignment 4 should still work. /course/cs4500wc/Assignments/A5 contains two subdirectories, Patterns and Sources. These directories are used by some of the following examples, along with the directories found in /course/cs4500wc/Assignments/A4. ---------------- ./spims -pdir /course/cs4500wc/Assignments/A5/Patterns \ -sdir /course/cs4500wc/Assignments/A5/Sources should produce the following output (in any order): green23.png matches greenish.png at 2x3+0+0 green23.png matches greenish.png at 2x3+0+6 green23.png matches greenish.png at 2x3+1+1 green23.png matches greenish.png at 2x3+1+7 green23.png matches greenish.png at 2x3+2+2 green23.png matches greenish.png at 2x3+4+7 green23.png matches greenish.png at 2x3+5+0 green23.png matches greenish.png at 2x3+7+2 green23.png matches greenish.png at 2x3+8+0 green23.png matches greenish.png at 2x3+8+4 red1.png matches greenish.png at 1x1+0+3 red1.png matches greenish.png at 1x1+0+5 red1.png matches greenish.png at 1x1+0+9 red1.png matches greenish.png at 1x1+1+4 red1.png matches greenish.png at 1x1+2+0 red1.png matches greenish.png at 1x1+2+6 red1.png matches greenish.png at 1x1+3+1 red1.png matches greenish.png at 1x1+3+5 red1.png matches greenish.png at 1x1+3+8 red1.png matches greenish.png at 1x1+4+2 red1.png matches greenish.png at 1x1+4+4 red1.png matches greenish.png at 1x1+5+3 red1.png matches greenish.png at 1x1+5+6 red1.png matches greenish.png at 1x1+6+4 red1.png matches greenish.png at 1x1+6+8 red1.png matches greenish.png at 1x1+7+1 red1.png matches greenish.png at 1x1+7+5 red1.png matches greenish.png at 1x1+8+7 red1.png matches greenish.png at 1x1+9+3 ---------------- ./spims -pdir /course/cs4500wc/Assignments/A5/Patterns \ -s /course/cs4500wc/Assignments/A5/Sources/greenish.png should produce the same output as the example above (in any order). ---------------- ./spims -p /course/cs4500wc/Assignments/A5/Patterns/green23.png \ -sdir /course/cs4500wc/Assignments/A4/Sources should produce no output. ---------------- ./spims -pdir /course/cs4500wc/Assignments/A5/Patterns \ -sdir /course/cs4500wc/Assignments/A4/Sources should produce the following output, more or less: red1.png matches aa0018.jpg at 1x1+1165+1151 red1.png matches ad0001.jpg at 1x1+731+276 red1.png matches ae0007.jpg at 1x1+1382+471 red1.png matches af0002.jpg at 1x1+188+894 red1.png matches ag0001.jpg at 1x1+801+893 red1.png matches ag0009.jpg at 1x1+560+880 red1.png matches ai0153.jpg at 1x1+526+948 red1.png matches aj0021.jpg at 1x1+255+616 red1.png matches aj0021.jpg at 1x1+597+657 red1.png matches aj0057.jpg at 1x1+407+352 red1.png matches aj0072.jpg at 1x1+260+320 red1.png matches aj0072.jpg at 1x1+268+309 red1.png matches aj0085.jpg at 1x1+158+421 red1.png matches aj0129.jpg at 1x1+164+456 red1.png matches aj0154.jpg at 1x1+1547+879 red1.png matches aj0161.jpg at 1x1+394+246 red1.png matches ak432.png at 1x1+320+114 red1.png matches ap0201.jpg at 1x1+65+912 tree.jpg matches aa0010.jpg at 405x296+604+708 (If your prototype accepts less exact matches than the instructor's prototype, then your prototype may produce more output than shown above. If your prototype's criteria are more stringent than the criteria used by the instructor's prototype, then your prototype may produce less output than shown above.) ----------------------------------------------------------------