###### # # ###### #### ##### # ###### # # # # # # # # # ###### ##### # # # # # ##### # # # # ##### # # # # # # # # # # ###### #### # ###### ###### ####### # # # # ##### # # ## # # # ##### # # # # # # # # # # # # # # # # ## # # # # # # ##### Programming Contest #3 So, you fancy yourself quite the ====================== hacker, eh? But, class assignments leave you feeling unmotivated. There's no real room to shine. Who cares if your grader thinks you're a hot coder? You want to show off for your peers. Well, here's your chance. If you win this competition, everyone will know who's da dude. Simple Description Your program will get two image files taken from the same webcam. The first one will contain no people. The second will contain some number of people. Your program's job is to output the coordinates of a pixel inside each person. The winner will be the program that finds the most people. Mailing List You can subscribe to the mailing list for this programming contest by sending an e-mail message to majordomo@csh.rit.edu with the line: subscribe ppc in the body of the message. Detailed Description When your program is executed, I will pass it the filenames on the command line. In practice, you can ignore these because I promise you that the first filename will be: ``base.ppm'' and the second filename will be: ``find.ppm''. Both files will be in the current directory. I will also give your program the ``find.ppm'' file on standard input. So, you've got quite a few options about reading these files. The input files will be ppm(6) format images. They will be 320 pixels by 200 scanlines. They will be pulled from this URL: http://www.eatgoodstuff.com/strandcam/0sav.jpg P6 The images will be converted to ppm using the 320 200 djpeg program. It outputs ppm files in a nice 255 format. At the left is an example ppm header from one of these cam images. It is ``P6'' on a line by itself followed by ``320 200'' on a line by itself followed by ``255'' on a line by itself. The picture data starts immediately after that. The picture data is unsigned bytes in pixel interleave format. The first byte of image data is the red value of the pixel in the upper-left corner of the image. The second byte of image data is the green value of the pixel in the upper-left corner of the image. The third byte of image data is the blue value of the pixel in the upper-left corner of the image. The fourth byte of image data is the red value of the pixel immediately to the right of the upper-left corner of the image. You get the idea. The red value of the first pixel on the second line of the image is in the byte immediately following the blue value of the rightmost pixel of the first line of the image. On fury, there is a man-page for libppm(3). I couldn't find it myself, so I built it. It's in: ~pat/src/pc/pf/libppm/. If you want it yourself, you can get the netpbm package here: http://wuarchive.wustl.edu/graphics/graphics/packages/NetPBM If you prefer something tinier, Jerry has a library that reads and writes ppm files. Your program's output should be a list of pixel coordinates that are inside people. Your output should be written to standard output. You should output one set of coordinates per line with no extra garbage on the line. The coordinates should be written with the horizontal coordinate first and the vertical coordinate second. The coordinates of the upper-left pixel are ``0 0''. The coordinates of the lower-right pixel are ``319 199''. You start with a base score of zero. For each coordinate you output you will receive: +10 points if this is the first coordinate you have emitted for this particular person. +5 extra points if this coordinate is inside the person's head. -8 points if you have already emitted a coordinate for this particular person. -5 points if this coordinate is not inside a person at all. I will manually determine person and head boundaries in each test image. I am storing example images here: http://www.csh.rit.edu/~pat/hack/pc/pc3/testImages If you're on the CSH systems, you can get to them here: ~pat/src/pc/pf/testImages Submission Details Because this is a hard problem, I'm giving lots of time for it. All submissions must be received by 9:00am Monday 2001-01-08. All submissions are considered public domain. I will open world read access to them at the time of the deadline. Obviously, I'm not going to show off your code before the deadline. All programs will be run on fury.csh.rit.edu by me. Any program that runs for more than 15 minutes will be summarily disqualified. Your program's output will be truncated at 2MB. I don't care what programming language you use. I just need to compile/run it on fury.csh.rit.edu. Your submission should be a tar-file (or tell me the directory on the CSH systems). In the submission, there should be a README file listing your name, e-mail address, and text about any special hacks you'd like the judges to consider in your code. Also in the submission, there should be the source needed to compile your code and a gmake-compatible Makefile (if needed). Your program should be called ``pc3''. To make your program, I will type ``gmake''. To run your program, I will type ``pc3 base.ppm find.ppm''. I will not set any special environment variables or pass any special flags to gmake or your program. This is fury: % uname -a SunOS fury.csh.rit.edu 5.7 Generic_106541-09 sun4u sparc SUNW,Ultra-Enterprise I have in my path on fury (/usr/bin:/bin:/usr/local/bin): gmake 3.76.1 gcc egcs-2.91.66 19990314 (egcs-1.1.2 release) g++ egcs-2.91.66 19990314 (egcs-1.1.2 release) perl 5.005_03 awk nawk python You can either e-mail me your submission or e-mail the pathname (on the csh systems) to your submission. Prizes Prizes will be awarded in the following categories: Highest Score Slickest Code Most Maintainable Code There will also be a prize for ``highest score by a beginner''. So, if you're not a programmer, include some text in your README to tell us why this program was a really big step for you and we'll consider it.