[go: up one dir, main page]

0% found this document useful (0 votes)
20 views10 pages

Sage 0303

This document discusses using hands-on activities and programming to effectively teach image processing concepts. It presents a system called IPLab that was designed for teaching image processing using the open-source ImageJ software. The system allows students to actively manipulate images, experiment with algorithms, and progressively develop their own image processing code with minimal programming experience.

Uploaded by

dibekaya
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
20 views10 pages

Sage 0303

This document discusses using hands-on activities and programming to effectively teach image processing concepts. It presents a system called IPLab that was designed for teaching image processing using the open-source ImageJ software. The system allows students to actively manipulate images, experiment with algorithms, and progressively develop their own image processing code with minimal programming experience.

Uploaded by

dibekaya
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 10

© IMAGESTATE

I
mage processing (IP) can be taught very effective- standard IP algorithm in Java. Next, students are asked
ly by complementing the basic lectures with com- to extend the algorithms progressively. This construc-
puter laboratories where the participants can tive approach is made possible thanks to a programmer-
actively manipulate and process images. This friendly environment and an additional software
offering can be made even more attractive by allowing interface layer that greatly facilitates the developments
the students to develop their own IP code within a rea- of plug-ins for ImageJ. Taking into account the fact
sonable time frame. After a brief review of existing soft- that our students are not experienced programmers
ware packages that can be used for teaching IP, we (they typically do not even know Java), we use a “learn
present a system that we have designed to be as “stu- by example” teaching strategy, with good success.
dent friendly” as possible. The software is built around
ImageJ, a freely available, full-featured, and user-friend- Teaching by Doing
ly program for image analysis. The computer sessions Because of the widespread use of imaging, there is an
are alternated with lectures, typically, a three-hour ses- ever-pressing need to train engineers who are proficient
sion at the end of every chapter. The sessions are in the with this new technology. This trend is likely to contin-
form of assignments that guide the students toward the ue as the cost of imaging devices (digital camera, scan-
solution of simple imaging problems. The starting ners, etc.) keeps declining and as the power of PCs
point is typically the understanding and testing of some keeps increasing, making sophisticated IP algorithms

NOVEMBER 2003 IEEE SIGNAL PROCESSING MAGAZINE 43


1053-588/03/$17.00©2003IEEE
available to a larger base of users and increasing the Hands-On IP
potential number of applications. Even when the lectures include visual demonstrations of
Many universities are meeting this demand by IP algorithms, students are often passive. Learning the
offering a basic course in IP—typically, a two-semester mathematical concepts can be facilitated with hands-on
class—that covers all the standard techniques. While experimentation. The first level of involvement is to apply
IP comes in many gradations, it is typically a topic the algorithms to real images and to see the results. The
that is perceived as being rather theoretical. IP is second is to take part in the programming itself and to
indeed a subject that lends itself quite naturally to a truly experience how formulas translate into algorithms.
rigorous, mathematical treatment. The mathematics
are not difficult but the notation can be intimidating IP by Direct Image Manipulation
because of the multiple sums and indices. On the The usual way to get the students involved is to pro-
other hand, IP is also a very practical discipline; it is vide a convivial computer environment that allows
extremely motivating for students to see that the for- them to try out different algorithms and to visualize
mulas are easily translated into algorithms, often with the results. The key points here are the following:
dramatic visual effects. ▲ basic manipulations to illustrate and reinforce the
Since engineering students are often more interested theoretical concepts treated in the course; visual experi-
in applications than in pure theory, there is a strong mentation with different sets of parameters
incentive for instructors to complement the basic lec- ▲ use of practical examples to demonstrate IP applica-
tures in IP with computer laboratories. A number of tions; chaining of simple modules
initiatives in this area have demonstrated that students ▲ need for a user-friendly interface to facilitate interac-
gain much in their understanding [1]; they develop in- tion with the computer; production of results that are
depth understanding and have a better retention of visually appealing.
theoretical material [2]. The students become motivat- Such experimentation can be achieved easily by
ed to study theory if they can experiment with algo- using standard IP software.
rithms [3] and visualize the results. Interactive software
is generally perceived as a useful tool for complement- Programming IP Algorithms
ing textbooks [4], [5]. Once the students are accustomed to manipulating
The purpose of this article is to discuss some of the images, the challenge is to have them program standard
important issues relating to the use of computer ses- IP algorithms. Our key requirements for this more
sions in IP and to present some practical and cost- ambitious level of involvement are as follows.
effective solutions for implementing these ideas in the ▲ The best way to truly understand an algorithm is
classroom. In the first part, we discuss the advantages obviously to code it and to test it. Students should get
of hands-on experimentation with IP and identify the the opportunity to implement the most representative
key points that need to be taken into account to make algorithms.
such an approach successful. We then briefly review ▲ The exercises should be accessible to inexperienced
the software solutions (both commercial and freeware) programmers (very basic knowledge in one language,
that are currently available for teaching IP. In the sec- e.g., C). The assignment should concentrate on IP
ond part, we get more specific and describe a system issues alone. To facilitate programming, we propose a
(IPLab), which we developed at the Swiss Federal “learning by example” approach: students receive the
Institute of Technology in Lausanne (EPFL), that is source code of a basic IP task and are asked to extend
made freely available to the academic community. and/or complete the algorithm.
While our initial motivation was to provide a system ▲ The students should not have to worry about data
where the participants would actively manipulate and types. The code should be as generic as possible.
process images, we took the challenge further so that ▲ The programming should be simple and robust. The
we would have the students write their own IP code graphical user interface and input/output task should
down to the pixel level. Of course, we also wanted to be provided to avoid spending time on what is
give them the benefit of a user-friendly interface and of nonessential to our purpose (i.e., teaching IP).
a software platform that they may extend to perform ▲ The edit-compile-execute programming cycle should
sophisticated IP tasks. Even though a rudimentary be short to see immediate effects on the images when
knowledge of the Java syntax is required (which can be modifying the code.
acquired in a one-hour lesson), we should emphasize The two traditional ways to practice IP are through
that this knowledge comes at essentially no effort from the use of a low-level language (such as C) or a high-
the part of the student and that the laboratories level language (such as MATLAB). The low-level lan-
require little programming skills. There is no need to guage offers the advantage of computational speed, an
teach the students how build a complete object-orient- important factor when dealing with images, but stu-
ed applications [6]. Rather, they are invited to under- dents waste much time with basic input–output opera-
stand some example code, which they then modify to tions (reading files, data types, memory allocation,
achieve their goals. accessing pixels, and displaying images) and rapidly lose

44 IEEE SIGNAL PROCESSING MAGAZINE NOVEMBER 2003


their enthusiasm. A high-level language, on the other IP laboratories have also been developed with other
hand, offers a rich functionality with a large palette of commercial software, including Mathematica [19] of
imaging routines, but tends to hide many important Wolfram Research Inc [20], LabView [21] of National
aspects of the algorithm. Instruments Corp. [22], and AVS Express [23] of
Advanced Visual Systems Inc. [24].
Overview of Available Packages The disadvantage of these commercial products is
We now give a brief review of the software solutions that they are often expensive and require the sustained
available to instructors. There has been a substantial availability of a campus-wide license. In many cases,
effort by members of this community to create didactic students are not authorized to use the software at
tools for teaching IP; a number of systems have been home. For these and other reasons, voices have been
described in the literature and part of them are avail- raised against the use of commercial software, which
able on the Internet (cf. the links we are providing in may conflict with the aims of academic institutions
our reference list). Special sessions at conferences and [25]. In addition, many of the packages are platform
workshops have been organized on this topic [7], [8]; dependent and the IP operators are often provided as
a recent review on computer vision education is also black-box (built-in) routines [23]. Hence, the students
available [9]. do not have access to the core part of the code and
The choices of the instructor are usually oriented by cannot visualize intermediate results; this also implies
the following considerations: that they cannot easily compare different implementa-
▲ Scope of the course: digital signal and IP, mathematical tions of an algorithm.
imaging, computer vision, multimedia.
▲ Background of the students: electrical engineering or Noncommercial C-Based Solutions
computer science? How proficient are they with pro- Chronologically, the first group of noncommercial
gramming? offerings is based on the C language (later on also
▲ Level of the course: undergraduate or graduate level? C++) [3], [2]. In [6], the authors argue that the C
Note that there are even attempts to introduce IP at language is the closest to being universal—it is the
the high-school level [10]. choice of many IP and numerical-analysis libraries.
▲ Goals of the interactive tools: demos for complement- Some libraries have been developed in academia specifi-
ing the lectures, practical experimentation with images, cally to provide support for IP teaching [26], [27]. The
or/and programming of algorithms. C language gives fast execution code and the students
▲ Commercial or freeware: this is an important considera- really need to worry about the “hard-core” part of the
tion both from the ethical and economical point of view. algorithms. According to [2], students should
Most teachers want a plug-and-play system that does absolutely know how to handle pointers, which can
not have a steep initial learning curve; they also want an represent a time-consuming and frustrating task. An
immediate visual feedback of the effect of IP operators [6]. interesting class library for IP (CLIP) [6] was devel-
An ideal tool should also be able to solve realistic problems oped to handle memory management tasks—with a
and be relevant for real-world applications [1], [3]. small overhead time—and to do other technical and
common operations through a small user interface
Commercial Packages which is easy to learn. Of course, there are also other
Several commercial software packages can be used for proposals based on less common programming lan-
setting up IP computer laboratories. The most promi- guages such as Python [28], Lisp [29] (which uses an
nent one is MATLAB of The MathWork Inc. [11], a unfamiliar syntax and is less adapted to teaching), and
high-level programming language that is ideally suited Tcl/Tk (the CVIPTools frameworks [30]).
for manipulating vectors and matrices. It is widely used
in the scientific community for fast prototyping and has Noncommercial Java-Based Solutions
been adopted by many universities [12], [13]. MAT- Recently, more and more programmers are turning to
LAB with its accompanying Image Processing Toolbox Java for writing IP software that is platform independ-
is an attractive framework for teaching IP [14]. The ent. Java has also other advantages that are discussed
interactive nature of MATLAB also encourages “learn- in the next section. Below, we give an overview of
ing by discovery” [15]. available Java packages that can be used for pedagogical
Khoros Pro 2001 of Khoral Inc. [16] is an integrat- purposes, even though not all of them were developed
ed development environment for IP with a special with that specific goal in mind. All these packages are
module for teaching known as the “Digital Image freely available on the Internet.
Processing Course” [17]. Khoros has earned its place ▲ NeatVision provides an image-analysis and software
as a pedagogical platform for IP [1], [5] mainly development environment [31]. Many of its algorithms
because it offers a visual programming environment are based on a reference book [32]. It has a nice user
coupled with an easy way to link C functions. It also interface. It is strongly oriented towards computer
has a large base of users who are willing to exchange vision as opposed to signal processing.
their knowledge [18]. ▲ Java Vision Toolkit (JVT) is a software library for

NOVEMBER 2003 IEEE SIGNAL PROCESSING MAGAZINE 45


The IPLAB/ImageJ Combination
Table 1. Comparison of the computation times for a 3 × 3 filter:
built-in ImageJ routines versus ours (ImageAccess). Our goal in developing IPLab was to offer
Experimental conditions: 512 × 512 pixels image an environment where the students could
(byte), Java Virtual Machine JRE 1.1.8, Pentium III/500 MHz. implement the algorithms literally as they
are seen in the course [39]. It was also an
Computation time attempt to combine the advantages of low-
Built-in ImageJ smooth operator (3 × 3 filtering) 35 ms level and high-level languages by borrowing
Built-in ImageJ convolve operator (3 × 3 filtering) 200 ms the best from both philosophies.
Our separable implementation of 3 × 3 filtering
Specifically, we have chosen to base our
150 ms system on:
with mirror boundary conditions
▲ Java as the programming language
Our nonseparable implementation of 3 × 3 325 ms
filtering with mirror boundary conditions ▲ ImageJ [35], one of the most compre-
hensive IP freeware available, for a graphical
machine vision and IP applications [33], [34]. Only a user interface which provides convivial interaction with
few sessions are available, and the package is rather the full functionality of an IP application
rudimentary. ▲ ImageAccess, a “student-friendly” software layer that
▲ ImageJ, a powerful, full-featured IP program devel- we have developed to meet the requirements listed
oped at the National Institutes of Health [35], is used earlier; it simplifies and robustifies the access to pixel
routinely by biologists worldwide to assist them with data without having to worry about technicalities and
the processing and analysis their images. ImageJ also the interfacing with ImageJ
has an extensive library of plug-ins developed by users. ▲ sample source code to enable students to extend the
▲ Hypertext Image Processing Reference (HIPR) is a algorithm progressively and make them learn by example.
collection of IP resources to illustrate and try-out stan-
dard IP operators using interactive applets [36], [37]. Java
▲ Java Image and Graphics Library (JIGL) is an IP We have chosen to develop our pedagogical tool in
library, but without a graphical user interface [38]. Java. The main arguments in favor of using this lan-
▲ IPlab with ImageAccess is a collection of document- guage are: 1) Java is platform neutral, hence well adapt-
ed IP laboratories (downloadable sessions including ed to the diversity of the students community; 2) Java
handouts for the student and software) that was is free; and 3) Java is network ready. This makes it pos-
designed by us to take advantage of the features of sible to develop remote teaching and virtual laborato-
ImageJ. An important addition is the “ImageAccess” ries [40], even though this is not the way we work—we
software layer that greatly facilitates the programming prefer to maintain contact with our students.
of plug-ins, making it accessible to students. Some authors claim that Java is a natural language
Many of these IP frameworks may be used equiva- for interactive teaching [41] and that it is ready for sig-
lently as a foundation for creating interesting IP labora- nal and image processing applications [42]. Java is an
tories. According to us, the availability of a graphical object-oriented language which is desirable for IP pro-
user interface is an important prerequisite to make the gramming [43].
software attractive and easy to use for the students. In For our part, we add the following arguments:
these packages, especially the most comprehensive ones, ▲ Java is robust with a good handling of errors and
the programming environment offered to the user is garbage collection; this eliminates the main source of
often rather general and technical. This is the reason bugs and crashes.
why we developed a “student-friendly” intermediate ▲ Java is syntactically close to C and easy to learn if we
interface layer, called ImageAccess, to be described in provide examples and templates for the methods.
the section “ImageAccess: The Interface Layer.” Even ▲ Java is reasonably fast: applying a 3 × 3 convolution
though it was originally designed for ImageJ, it can be filter takes only a fraction of a second on a 512 × 512
ported to other frameworks as well. Presently, in addi- pixel image; this means that the students get almost
tion to ImageJ, it supports applets for the Web and can immediate feedback.
cooperate with the Java Virtual Machine integrated into Another argument not to be neglected is the “hype”
MATLAB. It is thus also possible to call Java IP rou- factor: students are attracted by Java, a modern and fash-
tines directly as MATLAB functions. ionable language that plays a major role on the Web.
We believe that making the tools and student ses-
sions available to the community through the Internet ImageJ and Plug-Ins
not only assists and inspires others to design and share Our IP system is based on a public-domain software:
their own classes but also provides the authors with ImageJ. As a result, it can run on any platform with a
valuable feedback for further enhancements. We will Java Virtual Machine (Mac, Windows, and various flavors
now give a more detailed description of the system that of Unix). The application and its source are freely avail-
we are promoting and comment on our experience in able. The author, Wayne Rasband, is with the National
using these tools for teaching IP. Institutes of Health, Bethesda, Maryland, USA [35].

46 IEEE SIGNAL PROCESSING MAGAZINE NOVEMBER 2003


ImageJ has an open architecture
that allows extensibility by the addi- Table 2. Cost of the overhead of the access (due to ImageAccess) compared
tion of Java plug-ins, and we take to the cost of the IP algorithm itself for the separable and the nonseparable
advantage of this functionality for implementation of an averaging filter. The access time includes data
conversion, the copy of pixel values, and implementation of the boundary
adding our educational modules. conditions. Experimental conditions: 512 × 512 pixels image (byte), Java
Java also provides a mechanism for Virtual Machine JRE 1.1.8, Processor Pentium III/500 MHz.
loading the plug-ins dynamically
without having to restart the appli- Separable implementation Nonseparable implementation
cation after each modification of Kernel Size Algorithm Access Algorithm Access
the code; this functionality offers a 3 × 3 averaging 75 ms 75 ms 75 ms 250 ms
fast and comfortable way to edit- 5 × 5 averaging 150 ms 75 ms 175 ms 405 ms
compile-execute a program.
7 × 7 averaging 200 ms 75 ms 250 ms 640 ms
Since the programming of ImageJ
9 × 9 averaging 235 ms 75 ms 375 ms 910 ms
plug-ins was not originally meant for
novice programmers, we have made 11 × 11 averaging 250 ms 75 ms 500 ms 1,280 ms
this process much more transparent 13 × 13 averaging 295 ms 75 ms 655 ms 1,690 ms
and robust for the student. We pro-
vide the function templates and their corresponding example, when a student wants to retrieve a 3 × 3
commands under the “plug-ins” menu. The templates block of an image centered on the upper left corner (0,
typically take the form of a dialog box, enabling the user 0), the interface layer provides a full block with “out-
to change the parameters of his algorithm. The other side” pixel values that are correctly extrapolated. This
key component is our “student-friendly” software layer frees the student from having to worry about what
called ImageAccess (see below), which greatly facilitates happens at the boundaries and results in more pleasant
the programming of IP algorithms. results (no border artifacts in the output). The aim of
applying abstraction is to let the source code express
Sample Source Code to Enable the original algorithm more clearly. The full documen-
“Learning by Example” tation of the class is available at: http://bigwww.
The students who participate in the IP laboratories do epfl.ch/teaching/iplabsite/Docs/index.html.
not necessarily know Java. Hence, we always provide ▲ Encapsulation. The fact of working with
them with an example of a Java method that does an ImageAccess objects prevents the students from having
operation similar to the assignment. In particular, we to worry about implementation details. The typical way
make sure that the example uses the same type of syntax to program is to retrieve an image block by using a
(loops, assignments, mathematical functions) as required method that begins with get...(). The block is
for the solution. In addition, we structure their code by processed and the result is written in the image using a
providing empty templates that need to be filled in. This put...() method. The block can be a single pixel, a row,
means that a good portion of the assignment can usually a column, a 3 × 3 or a 5 × 5 neighborhood window.
be implemented by simple modifications of the example. Conceptually, there is a clear pedagogical advantage
A sample two-hour session on morphological filtering in separating the IP code (algorithm) as much as possi-
(handout + software listing) can be viewed at ble from the access to the pixels. For our purpose, the
http://bigwww.epfl.ch/teaching/iplabsite/trial.html; latter is a technical part that depends on the language,
the solution can also be run on the Web. the platform, or the frame grabber. However, this is
not the approach taken in ImageJ because is has a com-
ImageAccess: The Interface Layer putational cost associated with it. As a result, the typi-
cal IP routines in ImageJ are faster than ours but also
Simplified Image Data Access significantly more complicated. Our additional layer
The key component of our system is the Java class, leads to an overhead, as illustrated in Tables 1 and 2.
ImageAccess, that provides a high-level and foolproof Note that in the case of a separable algorithm where
interface that lets students safely manipulate images. rows and columns are processed in succession, the cost
We have designed it by applying two well-known prin- of the access is fixed (e.g., 75 ms), irrespective of the
ciples of software development. type of processing. For nonseparable processing, the
▲ Abstraction. For the user, an image is simply an access cost is more important: it increases proportional-
instance of the ImageAccess class. The pixel data is ly to the number of pixels in the local neighborhood.
always retrieved and stored in “double” format, inde- We consider the overhead an acceptable price to pay for
pendently of the underlying ImageJ image type. In this the substantial simplifications in algorithm transcrip-
way, students do not have to worry about rounding, tion. Thanks to this layer, an algorithm can be translat-
truncation, or conversion of pixel data. Moreover, pixel ed into Java almost literally. This is in contrast with
data can be accessed “anywhere” through the use of ImageJ’s own operators, which need to be implement-
consistent mirror symmetric boundary conditions. For ed for each data type (e.g., byte, 32 bits).

NOVEMBER 2003 IEEE SIGNAL PROCESSING MAGAZINE 47


Interfacing with MATLAB
ImageJ Applets MATLAB
Recent versions of MATLAB integrate a Java Virtual
Machine. Therefore, it becomes possible to run Java IP
Plug-Ins on the Web Functions routines directly from the MATLAB command window
or from a MATLAB function. The level of integration
is surprisingly high so that Java objects, such as
ImageAccess ones, can be handled in a transparent way.
ImageAccess Class Listing 1 illustrates the call of IPlab commands (here, a
two-dimensional (2-D) filter followed by an image dis-
play) from MATLAB; the data is transferred through
the object “im,” which contains a copy of the image
Image-Processing Routines array used in MATLAB.

▲ 1. The same IP routines are used to create a plug-in for ImageJ,


Examples
In this section, we present two examples that illustrate
to interface with MATLAB, or to build a demonstration applet.
the ease with which IP algorithms can be programmed
using our interface layer. The code is relatively straight-
Interfacing with the Web forward; it is essentially a literal translation of the text-
Programming in Java offers the interesting opportunity book versions of the algorithm.
to easily port applications to the Web, through the
mechanism of applets. To easily create stand-alone Digital Filter
applets based on the same IP source code, our interface We compare two implementations of a digital filter
layer also comes in an “ImageAccess for Applets” fla- using a nonseparable (cf. Listing 2) and a separable
vor, which can be used exactly the same way by the algorithm (cf. Listing 3).
programmer but does not make use of ImageJ internal- The separable implementation offers many advantages
ly anymore. In this way, we can easily generate and dis- in terms of computation time and modularity. The code
tribute IP demonstration applets at a ver y low in Listing 3, which is generic for the most of part, clearly
development cost. The same IP code can therefore be shows the two loops, the first one that scans the rows
reused in a plug-in or in an applet (see Figure 1). Note and the second one that scans the columns. The only
that such applets are also used to provide on-line exam- specific parts are the one-dimensional (1-D) routines dif-
ples for the students (some on-line examples can be ference3() and average3(), which can be modified easily
found at http://bigwww.epfl.ch/demo/). to yield other separable filters.

Listing 1. JAVA processing and display of an image from MATLAB.


>> array = 255*rand(100,200); % creates an array of random variables
>> im = ImageAccess(array); % copies the array into an ImageAccess object
>> out = Filter.apply(im); % applies a 2D filtering method
>> out.show(‘filtered image’); % displays the ImageAccess object

Listing 2. Example of a nonseparable filtering template (vertical edge detector) given to the students.
public ImageAccess filter2D_NonSeparable(ImageAccess input) {
int nx = input.getWidth();
int ny = input.getHeight();
ImageAccess output = new ImageAccess(nx, ny);
double block[][] = new double[3][3];
double value = 0.0;
for (int x=0; x<nx; x++) {
for (int y=0; y<ny; y++) {
input.getNeighborhood(x, y, block);
value = (block[2][0] - block[0][0] + block[2][1] -
block[0][1] + block[2][2] - block[0][2]) / 6.0;
output.putPixel(x, y, value);
}
}
return output;
}

48 IEEE SIGNAL PROCESSING MAGAZINE NOVEMBER 2003


Listing 3. Example of a separable filtering template (vertical edge detector) given to the students.
public ImageAccess filter2D_Separable(ImageAccess input) {
int nx = input.getWidth();
int ny = input.getHeight();
ImageAccess output = new ImageAccess(nx, ny);
double rowin[] = new double[nx];
double rowout[] = new double[nx];
for (int y=0; y<ny; y++) {
input.getRow(y, rowin);
difference3(rowin, rowout);
output.putRow(y, rowout);
}
double colin[] = new double[ny];
double colout[] = new double[ny];
for (int x=0; x<nx; x++) {
output.getColumn(x, colin);
average3(colin, colout);
output.putColumn(x, colout);
}
return output;
}
private void average3(double in[], double out[]) {
int n = in.length;
out[0] = (2.0 * in[1] + in[0]) / 3.0;
for (int k=1; k<n-1; k++) {
out[k] = (in[k-1] + in[k] + in[k+1]) / 3.0;
}
out[n-1] = (2.0 * in[n-2] + in[n-1]) / 3.0;
}
private void difference3(double in[], double out[]) {
int n = in.length;
out[0] = 0.0;
for (int k=1; k<n-1; k++) {
out[k] = (in[k+1] - in[k-1])/2.0;
}
out[n-1] = 0.0;
}

In practice, we give these two templates as examples thresholding). To simplify their task, we give the tem-
to the students and ask them to program other digital plates of separable routines for the analysis part (Listing
filters such as a horizontal edge detector and a 5*5 mov- 4); we ask them to code the 1-D Haar transform and
ing-average filter (nonseparable and to write the synthesis part (both 1-D
separable implementation). By master- and 2-D) from scratch.
ing those examples, they get a rather As far as the students are con-
complete exposure to the topic of lin- cerned, this is perhaps one of the most
ear filtering. impressive sessions they go through.
The great majority of them are capa-
Wavelet Transforms ble of completing the full assignment;
Another interesting example is the the 1-D routines split_1D and
implementation of a separable merge_1D for the Haar transform are
wavelet transform in 2-D (c.f. Figure rather easy—two liners—and the
2). The students have three hours to wavelet synthesis is the same as the
program the transform and to apply it analysis, but the other way around.
to various IP tasks (simple coding by
zeroing out nonsignificant coeffi- ▲ 2. Haar wavelet transform of Lena Classroom
cients and noise reduction by soft- (three iterations across scale). A three-hour laborator y session is

NOVEMBER 2003 IEEE SIGNAL PROCESSING MAGAZINE 49


Listing 4. Code for the analysis part of the wavelet transform.
The high-level, data-handling routines analysis() and split() are given to the students. Their assignment is to write the code
(also shown here) for split_1D() (Haar decomposition) and to implement the 2-D inverse transform completely.
public ImageAccess analysis(ImageAccess input, int nbScale) {
int nx = input.getWidth();
int ny = input.getHeight();
ImageAccess output = input.duplicate();
ImageAccess buffer;
for (int i=0; i<nbScale; i++) { // From fine to coarse loop
buffer = new ImageAccess(nx, ny); // Create the buffer
ouput.getSubImage(0, 0, buffer); // Get the buffer
buffer = split(buffer); // Split the buffer
output.putSubImage(0, 0, buffer); // Put the buffer
nx = nx / 2;
ny = ny / 2;
}
return output;
}

private ImageAccess split(ImageAccess input) {


int nx = input.getWidth();
int ny = input.getHeight();
ImageAccess output= new ImageAccess(nx, ny);
double rowin[] = new double[nx];
double rowout[] = new double[nx];
for (int y=0; y<ny; y++) {
input.getRow(y, rowin);
split_1D(rowin, rowout);
output.putRow(y,rowout);
}
double colin[] = new double[ny];
double colout[] = new double[ny];
for (int x=0; x<nx; x++) {
output.getColumn(x, colin);
split_1D(colin, colout);
output.putColumn(x,colout);
}
return output;
}

private void split_1D(double in[], double out[]) {


int n = in.length / 2;
double sqrt2 = Math.sqrt(2.0);
int k1;
for (int k=0; k<n; k++) {
k1 = 2 * k;
out[k] = (in[k1] + in[k1+1]) / sqrt2;
out[k+n] = (in[k1] - in[k1+1]) / sqrt2;
}
}

typically devoted to one chapter of the course. The all students can undertake the experimental part of the
assignment is given one week in advance. It contains a assignment under equal conditions; of course, they are
programming part and an experimental part, where the greatly encouraged to run their own code and make
desired results are processed images. As backup, we sure that they get the same results. The sessions take
usually provide reference versions of the assigned algo- place in two computer rooms with 30 Windows 2000
rithms as executable code (bytecode) to make sure that machines in each. There are typically three teaching

50 IEEE SIGNAL PROCESSING MAGAZINE NOVEMBER 2003


assistants per room for technical assistance. At the end
of the session, the students submit their results (source
code and processed images) on the Web. The images
are checked automatically, and the assistants proofread
the source code. The students get back their corrected
assignments the next week.
The sessions that are currently available are:
▲ Introduction—Understanding of the Fourier trans-
form
▲ Digital filtering and applications
▲ Morphological operators and applications
▲ Edge detection and applications
▲ Wavelet transforms
▲ Geometric transformation and interpolation
▲ Tomography and filtered backprojection
▲ Deconvolution
▲ Texture.
These session assignments are also available on the
Web: http://bigwww.epfl.ch/teaching/iplabsite/.
Some examples of results with user interfaces are shown
in Figure 3.
Before the introduction of the laboratories, our
optional IP course normally attracted 15 to 20 stu-
dents. With the third edition of the laboratories (term
2002/2003), the number of students went up to 45, a
good indication of success. The feedback from the stu-
dents has also been extremely positive.
The combination of “ImageJ” and our interface layer is ▲ 3. Examples of user interface and results for sessions 3 and 7.
also used by the students who choose to complete a practi-
cal semester or diploma project in our laboratory, which is The laboratories are entirely based on ImageJ. The
fully equipped with Macintosh computers. Here, the stu- students can walk away from the course with an IP sys-
dents develop their new IP algorithms using ImageJ and a tem that is operational. Using the ImageAccess interface
user-friendly Java integrated development environment layer, they can easily program both ImageJ plug-ins or
(IDE); at the end, they can easily produce a demonstration Internet applets. The system that we have described
applet, which is then made available on the Internet. may also appeal to practitioners as it offers a simple, full-
The students value the fact that the software tools proof way of developing professional level IP software.
are all freely available on the Web. After downloading
ImageJ and a Java development kit (JDK), they are Acknowledgments
ready to work at home. We would like to thank Dimitri Van De Ville for the edito-
rial advice and Wayne Rasband for his helpful and valuable
Discussion and Conclusion remarks and for his generosity in making ImageJ freely
The proposed computer laboratories are a perfect com- available to the community. We are also thankful to EPFL
plement to a theoretical course on IP. Students get students and assistants who have tested the system and
active, hands-on practice in IP that will be valuable to have given us feedback to improve it.
them later in the workplace. They also learn how to
implement IP algorithms. The computer sessions Daniel Sage received the master of sciences (DEA) and
increase their interest in the course; students like to Ph.D. degrees in control and signal processing in 1986
interact with images and become much more involved as and 1989, respectively, from the INPG, Grenoble, France.
soon as they see some practical relevance. The program- From 1989 to 1998, he was a consulting engineer devel-
ming experience raises their curiosity and often stimu- oping vision systems for quality control. He was head of
lates them to do their own experiments. The overall the Industrial Vision Department at Attexor S.A. In 1998,
reaction of our students has always been very positive. he joined the Biomedical Imaging Group at the Swiss
As designers of IPLab, we are still astonished by the Federal Institute of Technology Lausanne (EPFL) as the
robustness of Java and ImageJ. The system is quite stable head of software development. He is also involved in the
and appears to be robust against the student’s program- development of methods for computer-assisted teaching.
ming errors—much more so than any other language or
system that we have tested before. Up to now, we have Michael Unser received the M.S. (summa cum laude)
not yet experienced a single crash due to bugs in plug-ins. and Ph.D. degrees in electrical engineering in 1981

NOVEMBER 2003 IEEE SIGNAL PROCESSING MAGAZINE 51


1199–1202.
and 1984, respectively, from the Swiss Federal Institute
[19] M. Jankowski, Digital image processing with Mathematica [Online].
of Technology (EPFL) in Lausanne, Switzerland. From Available: http://www.usm.maine.edu/~mjkcc/docs/dip/
1985 to 1997, he was with the Biomedical Engineering [20] Mathematica, Wolfram Research, Inc, Champaign, IL [Online]. Available:
and Instrumentation Program, National Institutes of http://www.wolfram.com/
Health, Bethesda, Maryland. He is now a professor and [21] U. Rajashekar, G.C. Panayi, F.P. Baumgartner, and A.C. Bovik, “The SIVA
director of the Biomedical Imaging Group at the demonstration gallery for signal, image, and video processing education,”
IEEE Trans. Educ., vol. 45, pp. 323–335, Nov. 2002.
EPFL. His main research area is biomedical image pro-
[22] LabVIEW, National Instruments Corp., Austin, TX [Online]. Available:
cessing. He has a strong interest in sampling theories, http://www.ni.com/
multiresolution algorithms, wavelets, and the use of [23] D.S. Sohi and S.S. Devgan, “Application to enhance the teaching and under-
splines for image processing. He is the author of over standing of basic image processing techniques,” in Proc. IEEE Southeastcon
100 published journal papers in these areas. He is 2000, Nashville, TN, 2000, pp. 413–416.
involved in various editorial activities; these include [24] Advanced Visual Systems Inc. (AVS/Express), Waltham, MA [Online].
Available: http://www.avs.com/software/soft_t/avsxps.html
associate editor-in-chief of IEEE Transactions on
Medical Imaging and editor-in-chief of the Wavelet [25] M. Jackson, D.I. Laurenson, and B. Mulgrew, “Supporting DSP education
using Java,” in Proc. IEE Symp. Engineering Education: Innovations in
Digest. He received the 1995 Best Paper Award and Teaching, Learning and Assessment, London, UK, 2001, pp. 1–6.
the 2000 Magazine Award from the IEEE Signal [26] A. Jacot-Descombes, M. Rupp, and T. Pun, “LaboImage 4.0: Portable win-
Processing Society. He is a Fellow of the IEEE. dow based environment for research in image processing and analysis,” in Proc.
SPIE Symp. Electronic Imaging Science and Technology, Image Processing:
Implementation and Systems, San Jose, CA, 1992.
[27] F. DePiero, “SIPTool: The signal and image processing tool—An engaging
References learning environment,” in Proc. IEEE Frontiers in Education Conf. (FIE’01),
[1] M. Sonka, E.L. Dove, and S.M. Collins, “Image systems engineering educa- 2001, vol. 3, pp. F4C–1–5.
tion in an electronic classroom,” IEEE Trans. Educ., vol. 41, no. 4, pp.
[28] A. Goncalves Silva, R. De Alencar Lotufo, and R. Campos Machado,
263–272, 1998.
“Toolbox of image processing for numerical Python,” in Proc. IEEE Brazilian
[2] E. Fink and M. Heath, “Image-processing projects for an algorithms course,” Symp. Computer Graphics and Image Processing, Florianopolis, Brazil, 2001,
Int. J. Pattern Recognition Artificial Intell., vol. 15, no. 5, pp. 859–868, pp. 402.
2001.
[29] S.L. Tanimoto and J.W. Baer, “Programming at the end of the learning
[3] A. Sanchez, J.F. Velez, and A.B. Moreno, “Introducing algorithm design tech- curve: Lisp scripting for image processing,” in Proc. IEEE Symp. Human-
niques in undergraduate digital image processing courses,” Int. J. Pattern Centric Computing Languages and Environments, Stresa, Italy, 2001, pp.
Recognition Artificial Intell., vol. 15, no. 5, pp. 789–803, 2001. 238–239.
[4] K. Bowyer, G. Stockman, and L. Stark, “Themes for improved teaching of [30] S.E. Umbaugh, Computer Vision and Image Processing: A Practical Approach
image computation,” IEEE Trans. Educ., vol. 43, no. 2, pp. 221–223, 2000. Using CVIPtools. Englewood Cliffs, NJ: Prentice-Hall, 1998.
[5] G.W. Donohoe and P.F. Valdez, “Teaching digital image processing with [31] P.F. Whelan, NeatVision, Vision Systems Group at Dublin City University,
Khoros,” IEEE Trans. Educ., vol. 39, no. 2, pp. 137–142, 1996. Dublin, Ireland. Available: http://www.neatvision.com/
[6] J.A. Robinson, “A software system for laboratory experiments in image pro- [32] P.F. Whelan and D. Molloy, Machine Vision Algorithms in Java: Techniques
cessing,” IEEE Trans. Educ., vol. 43, no. 4, pp. 455–459, 2000. and Implementation. New York: Springer-Verlag, 2001.
[7] “Curriculum advances in digital imaging systems,” in Proc. IEEE Int. Conf. [33] M.W. Powell and D. Goldgof, “Software toolkit for teaching image process-
Image Processing (ICIP’96), Lausanne, Switzerland, 1996. ing,” Int. J. Pattern Recognition and Artificial Intell., vol. 15, no. 5, pp.
[8] “Undergraduate education and image computation,” in Proc. IEEE Computer 833–844, 2001.
Vision and Pattern Recognition (CVPR’00), Hilton Head Island, SC, 2000. [34] M.W. Powell, Java Vision Toolkit (JVT), Univ. of South Florida, FL.
[9] G. Bebis, D. Egbert, and M. Shah, “Review of computer vision education,” Available: http://marathon.csee.usf.edu/~mpowell/jvt/
IEEE Trans. Educ., vol. 46, no. 1, pp. 2–21, 2003. [35] W. Rasband, ImageJ, National Institutes of Health, Bethesda, MD. Available:
[10] Center for Image Processing in Education (CIPE) [Online}. Available: http://rsb.info.nih.gov/ij/
http://www.cipe.com/ [36] R.B. Fisher and K. Koryllos, “Interactive textbooks: Embedding image pro-
[11] The MathWorks Inc. (MATLAB), Natwick, MA {Online]. Available: cessing operator demonstrations in text,” Int. J. Pattern Recognition and
http://www.mathworks.com/ Artificial Intell., vol. 12, no. 8, pp. 1095–1123, 1998.

[12] B.M. Dawant, “MATLAB-supported undergraduate image processing [37] R. Fisher, S. Perkins, A. Walker, and E. Wolfart, Hypermedia Image
instruction,” in Proc. SPIE Medical Imaging 1998, vol. 3338, 1998, pp. Processing Reference (HIPR). Available: http://www.dai.ed.ac.uk/HIPR2/
276–284. [38] B. Morse, Java Image and Graphics Library (JIGL), Brigham Young
[13] H.J. Trussell and M.J. Vrhel, “Image display in teaching image processing. I. University, Provo, UT. Available: http://rivit.cs.byu.edu/jigl/
Monochrome images,” in Proc. IEEE Int. Conf. Acoustics, Speech, and Signal [39] D. Sage and M. Unser, “Easy Java programming for teaching image-process-
Processing (ICASSP’00), Istanbul, Turkey, 2000, vol. 6, pp. 3518–3521. ing,” in Proc. IEEE Int. Conf. Image Processing (ICIP’01), Thessaloniki,
[14] C.S. Zuria, J.M. Ramirez, D. Baez-Lopez, and G.E. Flores-Verdad, “MAT- Greece, 2001, vol. 3, pp. 298–301.
LAB based image processing lab experiments,” in Proc. IEEE Frontiers in [40] D.Y. Wang, B. Lin, and J. Zhang, “JIP: Java image processing on the
Education Conf. (FIE’98), Tempe, AZ, 1998, pp. 1255–1258. Internet,” Proc. SPIE Color Imaging: Device-Independent Color, Color
[15] S.L. Eddins and M.T. Orchard, “Using MATLAB and C in an image process- Hardcopy, and Graphic Arts, vol. 3648, pp. 354–364, Dec. 1998.
ing lab course,” in Proc. IEEE Int. Conf. Image Processing (ICIP’94), Austin,
TX, 1994, vol. 1, pp. 515–519. [41] Y. Cheneval, L. Balmelli, P. Prandoni, J. Kovacevic, and M. Vetterli,
“Interactive DSP education using Java,” in Proc. IEEE Int. Conf. Acoustics,
[16] Khoros Pro 2001 Integrated Development Environment, Khoral Inc., Speech and Signal Processing (ICASSP’98), Seattle, WA, 1998, vol. 3, pp.
Albuquerque, NM [Online]. Available: http://www.khoral.com/ 1905–1908.
[17] R. Jordan and R. Lotufo, Digital Image Processing (DIP) with Khoros Pro [42] D.A. Lyon, Image Processing in Java. Upper Saddle River, NJ: Prentice-Hall,
2001, visited in February 2001. 1999.
[18] R. Lotufo and R. Jordan, “Hands-on digital image processing,” in IEEE Proc. [43] D. Roman, M. Fischer, and J. Cubillo, “Digital image processing—An object-
Frontiers in Education Conf. (FIE’96), Salt Lake City, UT, 1996, pp. oriented approach,” IEEE Trans. Educ., vol. 41, no. 4, pp. 331–333, 1998.

52 IEEE SIGNAL PROCESSING MAGAZINE NOVEMBER 2003

You might also like