Teaching Digital Image Processing with Mathematica
| General project description Pedagogical objective Pedagogical evaluation Computational problem Computational implementation Acknowledgment |
General Project Description: Digital Image Processing (ELE489) is a senior-level elective that, in spite of the relatively complex mathematics involved, attracts a lot of student interest (maybe because of those many pictures in the textbook?!). Typically, however very little image "processing" actually occurs, since the traditional computational tools are not suitable for the classroom, especially in the context of interactive lectures. It is well known that code development in high-level languages such as Fortran or C detracts from the desired goal of teaching the basic concepts of the discipline. This leads to dissapointment and eventual loss of interest on the part of the student. At the same time, the many interesting computational problems in digital image processing are an excellent vehicle for teaching digital signal fundamentals. By introducing the computer into the classroom in a significant way, the promise of an interesting and challenging hands-on learning experience can be fulfilled. Following several years of experimentation with a variety of different computational tools (C, Basic, PVwave, Mathcad and spreadsheets) the department of Electrical Engineering has begun a process of integrating Mathematica into the curriculum. This year's ELE489 class was the first to use Mathematica (Wolfram Research, Inc.) in a computer classroom during lectures. Over half of the 28, 1 1/4 hour class sessions were held in this classroom, the remaining being more or less traditional, instructor led lectures. The course is an introduction to the basic concepts and methodologies for digital image
processing. The textbook "Digital Image Processing" by Gonzalez and Woods (1993)
was supplemented with 12 Mathematica notebooks,
written by the instructor, covering the major topics of the course. Each of the notebooks
was used in one or more of the lecture sessions held in the computer-equipped classroom.
The notebooks contain many course and application specific new functions that extend Mathematica's
built-in functionality. In their present form, they are a combination of lecture notes,
laboratory manual pages and homework assignments. They are simple prototypes for the
electronic textbooks of the future, interactive, animated and available via remote links.
The notebooks are available online and can be viewed as static documents with WWW browsers
or downloaded and executed on computers running Mathematica. In many foundational courses in the electrical engineering discipline, a student's lack of adequate mathematical skills is one of the primary barriers to effective learning. To compound the problem many courses are taught using the format of a traditional lecture in which students are mostly passive listeners. To overcome these problems, we are integrating state-of-the-art software for mathematical computing into the classroom in order to facilitate and foster an active learning environment. The project's primary goal is to influence and improve how our students perceive and learn electrical engineering by fundamentally changing the way we teach. The plan is to replace the typical "chalkboard" lecture with a closely supervised, interactive, hands-on exploration of the subject matter in a computer equipped classroom. The key features are:
This approach forces the student to be an active participant in the lecture.
Ultimately, the goal is to enhance understanding of fundamental theoretical concepts
within the discipline. We believe this can be accomplished through the increased use of
computation and visualization. ELE489 was implemented as an alternating sequence of traditional and Mathematica-based lectures. Traditional lectures were used to lay the theoretical foundations, while the laboratory sessions revealed implementation details and provided opportunities for visualization and testing. The latter were typically organized into a series of supervised problem sessions mixed with instructor led discussions. The two forms of instruction complement each other well. Theory and implementation reinforce each other building a deeper understanding of the subject matter. An important component of the course were two group projects, scheduled at the middle and end of the semester. Evaluation of project results was based on formal oral presentations. The projects were in-depth explorations of two interesting topics in image processing: two-dimensional unitary transforms, their properties and implementation, and selected image compression techniques. Student evaluations of the course, based on a questionaire and informal discussions,
indicate guarded acceptance of the new format. There was strong satisfaction with the
ability to visualize image processing operations, but concern with the difficulty of
learning Mathematica. ELE489 was organized as a sequence of numerical computational problems typically categorized as "low-level" processing tasks, ending in an extended project/application. This past semester, the project required the students to implement, fully annotate and give an oral presentation of a chosen image compression technique. Three techniques were investigated: linear predictive coding, block-DCT coding and wavelet coding. Compressed image quality was judged by visual comparison during the presentation and with numerical figures of merit, such as the mean squared error and the peak error. The "error" was defined as the difference between the original and reconstructed signals. In block-transform coding the original image is divided into N non-overlapping subimages which are transformed using a selected unitary transformation. The resulting coefficients are quantized and a subset selected. An approximation to the original can be reconstructed by reversing these processing steps, assuming zero values for the discarded coefficients. Block-DCT coding forms a core component of an international continuous-tone, still-frame compression standard, called the JPEG standard. Image compression is an important and interesting computational problem that brought together many of the topics discussed earlier in the semester, including unitary transforms, image pixel statistics and quantization. Selected unitary transforms, their properties and implementation were the topic of a
mid-semester project, which similarly required the development of a Mathematica
notebook and an in-class oral presentation. The Discrete Cosine Transform (DCT), the
family of Walsh/Hadamard transforms and the Haar transform were presented. Of special
interest were, the fast algorithm for the DCT, and the 2D Haar transform decomposition,
which introduced the concept of multiresolution analysis of signals. Mathematica was chosen as the computational tool for the course, since within one program it successfully integrates visualization, computation and presentation features. Mathematica excels in symbolic and graphical computation, but also has a very powerful suite of numerical functions. Combined with a programming language that supports both procedural and functional programming styles and an interpretative environment for algorithm development, it has all the necessary features for easy, natural prototyping of computational tasks, from simple to complex. In addition, the "Notebook" interface provides an environment for combining Mathematica commands, text, graphics and sound, resulting in a superior documentation medium. These features are available at a price of computational speed and substantial demands on system memory. However, present day desktop PCs have adequate system resources for moderately sized images ( approximately 300x300 pixels). The following list gives execution times for representative operations on a 128x128 image and a 90MHz Pentium (WFW3.11) + 16MB RAM system: |
| 2D fft: | 3 seconds |
| 2D convolution via fft: | 4 seconds |
| histogram calculation: | 20 seconds |
| 2D convolution with 3x3 kernel: | 30 seconds |
Extensive timing data for various kinds of Mathematica functions
can be found at the Mathematica Benchmark
Site
Acknowledgment
The author would like to thank Wolfram Research for their assistance in developing the
course materials provided through their 1996 Wolfram Research Visiting Scholar Program.
Special thanks to John Novak and Bruce Carpenter for their time and expertise, and fellow
Visiting Scholar Chikara Miyaji for helping with a few difficult programming problems.
GO BACK to "Integrating Mathematica
into the ..." project overview.