Вы находитесь на странице: 1из 5

A “Secondary” Look at Digital Image Processing

Alasdair McAndrew Anne Venables


Alasdair.McAndrew@vu.edu.au Anne.Venables@vu.edu.au
School of Computer Science and Mathematics
Victoria University of Technology
PO Box 14428, Melbourne 8001, Victoria, Australia

ABSTRACT can be considerable: multivariate calculus, linear algebra,


For the past few years, we have run a highly successful ac- Fourier transforms, logic and set theory, to name but a
tivity teaching some elementary digital image processing to few. Dougherty [3] provides a very large list of different
students at years 9 and 10 of secondary school. The activity mathematical topics which have relevance to modern im-
involves working with a digital camera, taking, capturing age processing. Other authors [13] have stressed the need
and saving images, and exploring pixel values and their re- for mathematics in the study of image processing. However,
lationship to image brightness and colour. We also perform for explaining the fundamentals much of this mathematics is
some elementary processing tasks: thresholding, changing both unnecessary and obstructive. Since these fundamentals
spatial resolution and quantization. Students then have a can be explained using minimal, junior high school mathe-
brief introduction to spatial filtering, followed by some ex- matics [9], is it possible and/or desirable to introduce image
amples: image blurring and edge detection. The activity processing to secondary students?
finishes with some binary morphology. Given that digital Any introduction to image processing should be stimu-
image processing is usually offered only at the upper under- lating and instructive, whilst being appropriate to the skill
graduate or postgraduate level, we have demonstrated that level of the learners. An inspection of the current prescribed
it is quite possible to introduce some image processing con- government curriculum for Information Technology at upper
cepts in a friendly and supportive environment to students secondary school level, the CSF II (Curriculum Standards
in the middle years of their secondary schooling. and Framework) [19] lists amongst its examples of suitable
studies in the subject: simulations, robotics, data handling
and presentation, multimedia and web authoring. It can
Categories and Subject Descriptors be seen that although the study, for example, of computer
I.4.0 [Image Processing And Computer Vision]: Gen- programming or mathematically oriented computer science
eral—Image processing software; K.3.2 [Computers And is not prohibited by the CSF, it is not actually encouraged.
Education]: Computer and Information Science Educa- Thus a student may study Information Technology and not
tion—Computer science education, Literacy have any exposure to these areas, let alone digital image
processing.
There are good arguments [18] for image processing to
General Terms be introduced to students, much earlier in their academic
Education careers than when they eventually arrive at university. As
many students have difficulty seeing the relevance of mathe-
Keywords matics and science to everyday life, they can lose interest in
these areas long before selection of their university course is
digital image processing, secondary education, elementary made. Using image processing as the vehicle, we agree with
computer science, enquiry-based learning Raphael and Greenberg [14], that it is possible to create a
positive learning experience for secondary students. Our ac-
1. INTRODUCTION tivity would be specifically designed as an introduction to
Digital image processing courses are typically offered at computer science. This idea has already been proposed by
the upper undergraduate and postgraduate levels of elec- Tanimoto et al [18], but as far as we know, has not been
trical engineering programs, due, in part, to the mathe- implemented. Such an activity would need to be instructive
matical requirements of such courses. These requirements and stimulating, and hopefully it would spark a genuine in-
terest in the sciences amongst the participants, long before
the fateful day of university course selection.
On the premise that science should be fun and also in-
Permission to make digital or hard copies of all or part of this work for spired by the experiences of the Mathematics Experiences
personal or classroom use is granted without fee provided that copies are Through Image Processing (METIP) project at the Univer-
not made or distributed for profit or commercial advantage and that copies sity of Washington [18] and others [8, 14], the first author
bear this notice and the full citation on the first page. To copy otherwise, to set about creating a set of introductory image processing
republish, to post on servers or to redistribute to lists, requires prior specific
permission and/or a fee.
exercises targeted at mid secondary school level. These ex-
SIGCSE’05, February 23–27, 2005, St Louis, Missouri, USA ercises needed to be pedagogically sound and gender neutral.
Copyright 2005 ACM 1-58113-997-7/05/0002 ...$5.00.

337
As well the exercises needed to be fun to do since students the image capture software/webcam application as the rest
learn only if they are motivated and ready to learn [7]. Us- of the activity is done using Scion Image only.
ing a set of discovery activities, the exercises would lead
students through the seemingly difficult concepts of gray 2.2 Grayscale and Pixel values
scaling, quantization, resolution, thresholding and convolu- The next step in the activity, is to open the saved image
tion. A final consideration in the design of these activities using Scion Image. This image is usually in colour and so
was that, given the appropriate software and hardware, they one of the first tasks is the conversion of the image from
could be run anywhere and at anytime. colour to grayscale.
For a number of years, these introductory digital image The students are then asked to explore the image by run-
processing exercises have been presented as the “Fun with ning the cursor over it, and to track the resultant values in
Faces” activity for secondary schools by the School of Com- the Scion Image window: see figure 1. (For illustrative pur-
puter Science and Mathematics at Victoria University. Stu- poses an image of a bunch keys has been used throughout
dent and school feedback has been very positive and en- this paper; however in a “Fun with Faces” activity this would
couraging. As a result, the “Fun with Faces” activity has be typically a student’s self image.) The reported values are
become the school’s flagship public relations exercise. The that of the pixel under the student’s cursor. For the pur-
next section of the paper describes “Fun with Faces” activity poses of this activity, a “pixel” is just one of the coloured
in some detail. Section 3 covers some pedagogical consid- dots of which a digital image is made—see [4] for a more
erations whilst section 4 provides some student feedback. precise definition. Students are able to discover that 0 cor-
Conclusions and further work are found in section 5. responds to black, 255 to white, and that the value of the
pixel is a function of its intensity. Scion Image allows two
scales of pixel values: 0 for black to 255 for white (this is a
2. THE ACTIVITY standard scale), and 0 for white to 255 for black. In figure 1,
“Fun With Faces” requires that each student have access the Value for the pixel at the cursor is given as 116.00(139).
to a computer with the freely available software “Scion Im- The first figure of 116 represents the intensity with the stan-
age” 1 having been installed. Scion Image, originally written dard scale; the second figure of 139 Scion Image’s alternative
at the National Institutes of Health, is a freely available scale. The facilitator then sets the challenge for students to
“powerful and complete image acquisition environment” [17]
that supports color and grayscale images. It can be used “to
capture, display, analyze, enhance, measure, annotate, and
output images”.
Additionally, students need access to a digital camera or
more conveniently a webcam, commonly available in infor-
mation technology classrooms, with which to photograph
themselves. The activity also assumes that students are fa-
miliar with the basic operations of a Microsoft Windows
based computer system: that they can open and save files,
navigate through different directories, and juggle two or
more open applications. Figure 1: Scion Image “Info” window
Upon commencement, each student is supplied with a
worksheet of instructions punctuated by boxes for students find the lowest value both X and Y. Quickly, students realise
to write down their comments and answer the questions that lower values for both X and Y are achieved by placing
posed throughout the activity. Students are encouraged to the mouse cursor in the top left corner of the screen, and
work in pairs or even small groups. the highest values are in the bottom right. A comparison
is usually made to the Cartesian co-ordinates X and Y with
2.1 Image capture which students usually have experience.
Despite the acceptance of digital cameras as commonplace
in everyday life, the activity’s first step of capturing a suit- 2.3 Quantization and resolution
able image always generates much excitement amongst the These are terms are not generally introduced to the stu-
students. This image needs to be suitable for further pro- dents; however they are important concepts in image pro-
cessing: it must be recognizable (not too blurred), and must cessing and display. Fundamentally, resolution refers to the
have a good contrast. This step particularly lends itself to amount of pixels used to display the image; the more pixels,
teamwork and joint efforts and the step is usually recorded the “smoother” the image will appear; the fewer pixels the
as a “team photo” of a “group hug”. One of the great ben- “blockier” the image will appear. This blockiness is some-
efits of using a digital camera is that there is no wastage: times called “pixelization”. Quantization refers to the num-
there is no film to be consumed or paid for, and students can ber of available gray values. Again, the more values, the
snap at each other for as long as they like, or for as long as better the image will appear; the fewer values will result in
the activity facilitator will let them. Finally, the image they a less natural looking image.
decide to use must then be saved. Scion Image only allows Students are then shown how to experiment setting var-
images of type BMP (Microsoft Bitmap) or TIFF (Tagged ious gray levels used to display an image, creating images
Image File Format); see [11] for a good account of each. Af- similar to those shown on the left in figure 2. By using less
ter saving the image, students may either quit or minimize and less grayscales for their image display, students see the
effects on the appearance of the image, and in particular the
1
This is available from http://www.scioncorp.com appearance of “false contours” in the output.

338
Quantization: 8 and 4 levels Changing resolution

Figure 2: Quantization and resolution

Allied to quantization is thresholding, where an image is matrix and image neighbourhood:


turned into black and white by the application of a simple
−1 −1 −1 10 10 20
rule: choose a particular gray value n, and for all pixels in
−1 8 −1 10 20 20
the image, those with values less than n become black, and
−1 −1 −1 10 20 30
those with values greater than or equal to n become white.
Thresholding is very useful in practice, but it can be diffi- the central value in this image neighbourhood, 20, is the
cult to find an appropriate threshold value which will display current pixel value. The computed output for this position
most of the required information. In Scion Image, thresh- when applying the filter is
olding is simply done by adjusting a slider bar, so that visual
inspection can find the best threshold value. An example is (10 × −1) + (10 × −1) + (20 × −1)
shown in figure 3. Adjusting the image resolution can be + (10 × −1) + (20 × 8) + (20 × −1)
+ (10 × −1) + (20 × −1) + (30 × −1) = 30.
In the “Fun with Faces” session, the facilitator can in-
troduce the idea that the students’ images are in need of
a “facial”! This mask or “facial” treatment, will blur their
images, and smooth away the wrinkles, or acne as the case
maybe. To do the “facial”, a mask or filter will need to be
applied. Students are asked to open NotePad, or any other
small text editor and simply type in the elements of a fil-
ter and by using the appropriate commands/mouse clicks in
Scion Image, this mask or filter can be applied to the im-
age. Examples of applications of blurring filters are shown
in figure 4. By experimentation, students discover that the

Figure 3: Thresholding

done simply by resizing the image twice: first reducing it


in size, and then increasing the result. When adjusting an
image size, Scion Image allows the option of using repeat-
ing pixels, which leads to the blocky effect alluded to above.
Results are shown on the right in figure 2.

2.4 Convolution and spatial filtering Figure 4: Blurring


Although formally defined to have different meanings, con-
volution and spatial filtering are terms that are used inter- larger the filter, the greater the blurring.
changeably; the principle involved is one of the most pow- Students are introduced to filters which have the effect of
erful in image processing. Therefore, it is imperative that isolating the edges of the image, or of sharpening the image
these concepts are introduced in an easy to understand man- by enhancing the edges, including the Sobel filters, which
ner in the “Fun with Faces” activity. For the reader, we are designed to concentrate on edges in one direction only.
may consider a grayscale image as being a very large matrix Examples of the application of these filters are shown in
whose elements are the gray values of the pixels. To perform figure 5.
a spatial filter, we first create a new small matrix M , of size
say 3 × 3 or 5 × 5. The matrix M is called the filter. For 2.5 Morphology
every element in the image matrix, place the centre element “Morphology” refers to a branch of image processing algo-
of M over this image element. Pairing of elements of M rithms which take as their starting point the size and shape
with elements of the image, multiply all pairs of elements of objects in an image. For this activity, students experi-
together and add up these products. For the following filter ment with two basic operations: dilation, which enlarges or

339
Edge detection Edge enhancement Edges using Sobel filters

Figure 5: Edge detection and edge enhancement

thickens objects in an image, and erosion, which shrinks or classes [2]. In these instances, the inclusion of digital image
thins them. The image on the far left in figure 6 shows a processing was valued because it engaged students in active
binary object formed in Scion Image by taking a grayscale experimentation and concrete real world examples. Such
image and thresholding the result. inquiry-based activities encouraged students to ask “what
The results of dilation and erosion are shown in figure 6. happens when I try this?”. As Neo and Neo [12] point out
Without going into any of the theory, students can see active and contextual learning is the hallmark characteris-
that dilation really does thicken objects and erosion thins tic of the constructivist model in education. In this model,
them: the objects from the left image in figure 6 have been students learn by looking for patterns and significance in
thickened by dilation and thinned by erosion. their experiences and try to construct their own knowledge
These two images can now be subtracted to produce an by adding to what they already know [16].
edge map of the original image, as shown on the far right in Much educational research supports the notion that stu-
figure 6. dents do learn according to the constructivist model [6] and
the use of inquiry based activities to encourage active learn-
2.6 Noise ing as been advocated by many authors [6, 10]. Addition-
Noise, errors in an image, can be implemented by using ally, computer-based technologies have been seen by oth-
the spray can tool (this is available on a floating menu), ers [1, 15] as an important vehicle to achieve active engage-
over a grayscale image. The removal of this “salt & pepper” ment amongst students whilst encouraging group participa-
noise can be done with a median filter. This is a filter whose tion and exploration of real world scenarios. When image
output is the median of the pixels in the image neighbour- processing activities were introduced in a Cincinnati Pub-
hood. The affect is dramatic and figure 7 shows an example lic School at 7th grade, Lewis reports [8] that the students
of noise and its removal by this means. found the exercise fun and stimulating and also suggests that
the activity fostered a positive learning environment for a
broad variety of learners, including gifted students, minori-
ties and females. Similar experiences were also reported by
Raphael and Greenberg [14]. These views are supportive of
those advocating inquiry-based activities for improved sci-
ence and mathematics learning throughout the junior high
school curriculum [6] and also of our belief that an inquiry
based image processing exercise like “Fun with Faces” is both
appropriate and desirable for students at this level.

4. STUDENT FEEDBACK
Figure 7: Noise and its removal
We have deliberately avoided any pre-testing and post-
testing of participants, as we wanted the activity to be spon-
Students see that the median filter does indeed do a very
taneous. However, after each “Fun with Faces” session stu-
good job of removing the noise. Students can experiment
dents are invited to comment on this activity by filling out
using a larger neighbourhood (5×5 for example), or applying
an evaluation form. Without exception, all students agreed
the median filter more than once, to see how this affects
that: the activity was worthwhile and enjoyable, the in-
the noise removal. They can also experiment with adding
structions were clear, there were plenty of opportunities to
different amounts of noise: giving their image “a really good
ask questions. When asked: “What did you enjoy about to-
spray”, to investigate how the outcome of the median filter
day and why?”, many students commented on this activity,
is affected by the amount of noise.
which was only one of several offered during the day, with
enthusiasm:
3. PEDAGOGICAL CONSIDERATIONS “The computer & image thingy was fabulous. I loved it.”
While digital image processing is typically a graduate study, “Web camera work!”
the literature documents the use of digital image processing “The session with the computers.”
as a valuable learning aide in diverse cases such as in med- “Last session—computers.”
ical image processing training [5] and for the teaching of “I enjoyed the computer science.”
two dimensional arrays in undergraduate computer science “The computer stuff.”

340
A binary image Dilation Erosion Edges

Figure 6: Morphology

“Fun with photos [sic]!!” [6] D. Jarrett. Inquiry strategies for science and
The enthusiasm of the students in the laboratory was also mathematics learning. it’s just good teaching.
indicative of the fun they were having; this seems to be a Northwest Regional Educational Laboratory
very successful activity, illustrating both computer science (NWREL), 1997.
and mathematics in a positive manner. [7] M. Knowles, E. Holton, and R. Swanson. The Adult
Learner: The Definitive Classic in Adult Education
5. CONCLUSIONS and Human Resource Development.
We have shown that although image processing—as an Butterworth-Heinemann, Woburn MA, 2001.
area of academic study —is usually reserved for the upper [8] K. O. Lewis. Image processing for teaching (IPT) in
undergraduate years, it is perfectly reasonable to introduce science classrooms. Meridian, A Middle School
it in a simplified form much earlier. In the course of two Computer Technologies Journal, 5(2).
hours, students experiment with quantization and spatial http://www.ncsu.edu/meridian/sum2002/.
resolution, filtering with applications, noise and its removal, [9] A. McAndrew. Teaching image processing using
and binary morphology. And they leave with a great sense minimal mathematics. In T. Greening and R. Lister,
of mastery and satisfaction. editors, Fifth Australasian Computing Education
In comparison with previous studies, our activity is de- Conference (ACE2003), 2003.
signed as a single standalone session aimed at encouraging [10] I. Miliszewska and A. Venables. Effective delivery of
students to broaden their views of the content and practice computer science - a case study. In Proc. ICCE ’99
of computer science, long before they select undergraduate International Conference on Computers in Education,
courses. page 3, 1999.
There is probably no reason why this activity—perhaps [11] J. D. Murray and W. Ryper. Encyclopedia of Graphics
in a further simplified form—could not be offered to high- File Formats. O’Reilly and Associates, 1996.
achieving upper primary level students. However, so far we [12] K. T. K. Neo and M. Neo. A constructivist learning
have restricted our attentions to students at secondary level. experience: Reconstructing a web site using web based
multimedia authoring tools. Australian Journal of
6. ACKNOWLEDGEMENTS Educational Technology, 17(3):330–350, 2001.
The authors gratefully acknowledge the detailed comments [13] M. Petrou and P. Bosdogianni. Image Processing: The
of the referees, who made many valuable suggestions for im- Fundamentals. John Wiley & Sons, 1999.
proving the original draft of this paper. [14] J. Raphael and R. Greenberg Image Processing: A
State-of-the-Art way to learn Science. Educational
7. REFERENCES Leadership, 34–37, 1995
[1] M. Ally. Foundations of educational theory for online [15] J. M. Roschelle, R. D. Pea, C. M. Hoadley, D. N.
learning. Theory and Practice of Online Learning, Gordin, and B. M. Means. Changing how and what
2004. children learn in school with computer-based
[2] J. Chastine and J. Preston. Teaching 2d arrays using technologies. The Future of Children. CHILDREN
real-time video filters. AND COMPUTER TECHNOLOGY, 10(2):76–101,
http://cims.clayton.edu/jchastine/papers/ 2000.
Teaching2DArraysUsingRealTimeF%ilters.pdf. [16] G. Scheuerman. From behaviorist to constructivist
[3] E. R. Dougherty. Editorial. Journal of Electronic teaching. Social Education, 62(1), 1998.
Imaging, 5(1), 1196. [17] Scion Corporation. Scion image beta 4.02 http://
[4] R. C. Gonzalez and R. E. Woods. Digital Image www.scioncorp.com/frames/fr_scion_products.htm.
Processing. Prentice-Hall, 2002. [18] S. Tanimoto. Mathematics experiences through image
[5] A. Horsch, C. Natscher, M. Tobamn, T. Balbach, processing (METIP). http:
M. Danninger, S. Schulz, and D. Stapf. Interactive //cs.washington.edu/research/metip/metip.html,
image processing as learning by doing component of a 2004.
WBT application. In G. Surján, R. Engelbrecht, and [19] Victorian Curriculum and Assessment Authority.
P. McNair, editors, Health Data in the Information Information technology. http://www.vcaa.vic.edu.
Society. Proceedings of MIE2002, pages 3–7. au/vce/studies/infotech/infotechindex.html.

341

Вам также может понравиться