Math 144 - Partial Differential Equations Image Processing Project *** Objective *** The purpose of this README is to explain the .ppm image format, how to use the included image C++ class, where the students should do their PDE programming, how to compile the program, how to use user-interface, and how to debug errors. *** The Portable Pixmap Image (.ppm) Format *** For simplicity, the image processing project uses the portable pixmap image (.ppm) format. In reality, this format is rarely used. One reason is its lack of compression, making it inefficient compared to other image formats. However, it is great for learning, since reading and writing them is simple. To view .ppm images, a third-party image viewer may be needed (such as LViewPro for the Windows operating system). *** The ``image'' C++ Class *** To aid the student, the ``image'' C++ class has been created to take care of all reading and writing of .ppm images. It also takes care of dynamic memory allocation, and provides many useful functions. To view the available functions and how to use them, please see the file ``ppm.h''. For details about how the ``image'' C++ class works, please see the file, ``ppm.cpp''. Note that this level of detail is NOT necessary to complete the project successfully. *** Where to Program *** The student only needs to modify the file, ``pde.cpp''. There are many comments in it, explaining where to program. The heat equation has been included as an example for the student. However, it depends on some macros (the ``#define'' statements at the top of ``pde.cpp'') that the student must write. *** Compiling the Program *** For students using Dev-C++, a free Windows C++ compiler, add the files to a new project. For help with this, see the "Dev-C++ and Projects" link located below the link you clicked to get to this README file. For students using g++ in a Unix-based environment, a ``Makefile'' has been included. Simply type ``make'' at the command prompt to compile the program. *** Running the Program *** A user-interface has been included in ``imagepro.cpp''. Note it is NOT necessary to understand this file to complete the project successfully. When the program is run, the user-interface prompts the student with which image to use, which equation to apply, and other parameters. This will call the student's PDE functions, which were implemented in ``pde.cpp''. For more advanced students, command line arguments may be used instead of the user interface. The usage format is: [FILENAME PDE delta_t] In Windows environments, such as Dev-C++, the program window may immediately close when the program is finished. To prevent this, run the executable from the command prompt. Or, for advanced users, add a getch() function call before return and exit statements. *** Debugging *** When the program does not behave as expected, there may be an error in the program. Included in the ``image'' class is a function that saves each pixel of an image as a comma-delimited file (.csv). The function is called save_csv(), and how to use it is explained in ``ppm.h'' (along with how to use every other ``image'' function). In the comma-delimited file, each value will be separated by commas and is viewable by any text editor. However, it is recommended that the student use a spreadsheet program, such as Microsoft Excel, to view the file. The file ``imagepro.cpp'' has two lines of code near the bottom that call save_csv(). These are commented-out. To save a comma-delimited file after the PDE calls, uncomment these lines so that they can run.