Assignment due by 11:59 pm on Monday, November 16, 2009
Assignment submission instructions:
- Download the following C program and add your code to it.
- Rename it using your UNCW username like this: abc1234_a3.c
- Make sure to type your name in at the top of the program and read the statement that follows.
- Login to your UNCW email account
- Create an email addressed to narayans@uncw.edu with the subject:Your Name: CSC 112 Project 2 Submission
- Copy yourself on the email.
- Attach your C program file to the email.
- Send the email before the deadline.
Assignment Instructions
Write a C program that can find black rectangles against a white background in a PGM image. Here is an example image. Your program produces a report that describes each rectangle found, including its (x,y) location within the image and its width and height in pixels. Note that the image provided is merely an example. Your code must work correctly regardless of the number of rectangles and their relative positions within the image. You may assume that all images used for testing will be 640x480. Besides main(), your program must include the following functions with the specified prototypes:
- int readPGMHeader(int *width, int *height, int *maxIntensity); This function reads a PGM header and returns a 1 on success, 0 on failure.
- void writePGMHeader(int width, int height, int maxIntensity);