Sunteți pe pagina 1din 8

Applying Image Processing Techniques to motivate

students in Linear Algebra Classes

C.M.R. Caridade
Instituto superior de Engenharia de
Coimbra

Rua Pedro Nunes - Quinta da Nora


+351 239 790 200
caridade@isec.pt

ABSTRACT
Linear Algebra is one of the mathematical fields taught in the first
2. MOTIVATION
year of university study. In this paper, I describe the efforts to 2.1 Electromechanical Engineering
change the students interest and motivation in Linear Algebra The degree in Electromechanical Engineering of the Instituto
classes. I present some activities using Image Processing to Superior de Engenharia de Coimbra (ISEC) aims to train
explore a different methodology strategy to teach Linear Algebra. Electromechanical Engineers to exercise their profession with a
The students can discover the Algebra Linear subjects themselves high level of technical and scientific competence. It also aims to
exploring image processing applications. provide its graduates with an education so they can continue their
studies at Masters and PhD. In this course, the students are
formed to be professionals with expertise in technological areas,
Keywords developing their sense and providing knowledge in the basic
Teaching and learning Linear Algebra; teaching strategies; student
sciences of engineering, focusing on areas of mechanical and
interest and motivation; Image Processing,
electrical engineering, in order to give the graduate a multifaceted
intervention capacity [9].
1. INTRODUCTION
Within the European Higher Education Area, one of the key
issues is to discuss how teaching, the learning activities and the 2.2 Linear Algebra
diagnostic evaluation can be arranged to enable students to In 1990 the study group of Linear Algebra teachers from various
acquire knowledge and skills outlined for each course. The universities recommended a core curriculum for basic courses in
passage of a teaching process based on knowledge, to a learning Linear Algebra. In 1999 another group of Park City Mathematics
process based on competence development is easy to describe but Institute tried to update the curriculum of Linear Algebra,
it is a very difficult task to accomplish. From teaching process concluding that there isnt a single linear algebra curriculum that
based on contents and teacher-centered, to a learning student- serves the needs of different approaches [3]. Thus, each Faculty or
centered process, there is a long way to go. The protagonists of Department must decide which model to Linear Algebra
this paradigm shift are inevitably the teachers. The teacher has the curriculum according to topics that wishes students to study.
task of developing strategies that allow students to use to Linear algebra is one of the core subjects of mathematics
advantage of the available resources. In this scenario, the teacher curriculum in higher education, so, Linear Algebra is present in
is seen as a mentor, a tutor who must be easily accessible, one that first year of the degree in Electromechanical and Mechanics
helps students build their projects and to seek ways to achieve Engineering curriculum common to many other undergraduate. At
them. In this context, I describe some examples that can be the ISEC all degrees have training in undergraduate Linear
applied in students learning process using different Algebra course by a specific unit or a unit integrated into a
methodological strategies used so far. This approach aims to broader curriculum.
stimulate students participation, as well as promote the interest I taught Linear Algebra in ISEC since 2000, initially to the
and motivation to development knowledge in the learning process. Bachelor of Electromechanical Engineering, later to the Diploma
Thus, I have intended to improve teaching and learning of Linear in Mechanical Engineering and Electromechanical Engineering.
Algebra in the degree in Electromechanical Engineering at During 11 years I have encountered some problems:
Instituto Superior de Engenharia de Coimbra (ISEC).
the number of students has increased,
many students not acquired a taste for mathematics,
the mathematical basis that students bring from secondary
education are insufficient.
How to overcome these problems? In this paper I intend to
describe my plans to solve this problem or at least to improve it.

WEE2011, September 27-30, 2011, Lisbon, Portugal.


Editors: Jorge Bernardino and Jos Carlos Quadrado.

114
2.3 Algebra Linear in ISEC programs (MATLAB, Mathematica, Derive, Linalg) have been
The linear algebra is taught to a large and diverse group of used in teaching Linear Algebra. MATLAB (Matrix LABoratory
students [3]. Who are the studentss in the Linear Algebra course? acronym) is a computer software known worldwide as an
What are their goals? Why are they studding linear algebra? excellent tool for solutions of mathematical problems [8]. It is one
of the packages more natural for the application of Linear
Students in my classes are engineering students, who often do not Algebra, since it is designed especially for matrix operations.
like math and in particular Linear Algebra. Some of the reasons
are:
3.2 Matlab
the concepts taught to students are abstract and entirely MATLAB developed by "The Mathworks, Inc ", is a system of
new, computer algebra, numerical and graphical, designed for
professional use in solving problems that require mathematical
the students dont recognize the practical application of methods. In the beginning MATLAB was just software for
concepts acquired. mathematical operations on matrix, but over the years turned into
The main aims of Linear Algebra for Electromechanical and a computer system able to develop flexible essentially any
Mechanical Engineering are perform matrix operations, compute technical problem. MATLAB is very easy to use, the language is
matrix determinants, eigenvalues and eigenvectors, understanding ideal for educational use and to quickly develop prototypes of
and apply concepts related to vector spaces and linear new programs. MATLAB also has packages of tools (toolbox)
transformations, solve and interpret linear systems using matrix that are sets of specially developed algorithms to specific
theory. But there are other expected outcomes like understand the applications such as: elementary mathematics, elementary
importance of linear algebra and analytic geometry in matrices, special matrices, matrix factorization and
Electromechanical/Mechanical Engineering, recognize the decomposition.
importance of the algorithms in linear algebra and solve real
problems which are modelled by matrices and systems. 3.3 Image Processing
Since 1990, the Digital Image Processing has been integrated into
3. METODOLOGY all sectors of industrial production. The technology offers the
ability to manipulate images and extract features and properties
Investigations on methodologies for the teaching strategy focus on
that previously were difficult or impossible to detect. The image
identifying different types of learning and motivation of students
processing facilitates the manipulation of visual information and
learning [2, 13].
revolutionizes the way of perception, analysis, communication,
The use of technology and examples of applicability of Linear storage and use of such data. The Image Processing combines
Algebra facilitate and encourage the learning of students [4]. The high technology with theory and cognitive information, so it is a
combination of learning with more exploratory activities enables natural area that can and should be used for teaching and learning.
students to acquire concepts, and terminology while developing
The digital image processing is a highly relevant area, extremely
self confidence in using mathematics. The students can discover
rich in mathematical ideas and potential activities for learning
the Algebra Linear subjects themselves exploring image
Linear Algebra in a way completely different from the standard
processing applications. Some experiments have been made like:
form. There are already some works as "The Image Processing for
the development of multimedia applications laboratory activities
Teaching project (IPT)" developed at the University of Arizona
to develop concepts of trigonometry and pre-calculus [17], the
that aims to attract students to study science and math. The project
ATLAS project to encourage and facilitate the use of software in
offers the opportunity to explore and discover an attractive way to
teaching Linear Algebra [16], and the program of research on
learn mathematical concepts [10].
teaching and learning of Linear Algebra in the first year of
university science courses in France [5].
4. EXPERIENCE IN CLASSES
3.1 Technology A digital image is a two-dimensional discrete function, f ( x, y)
In society, the use of computers is increasing, given the diversity with ( x, y) Z , where each pair of coordinates is called a
2

of its applications and the ability to store, organize and process


pixel. The word pixel derived from English "picture element"
information. In education, the use of computers is common
determines the smallest logical unit of visual information used to
increasingly, either by teachers or students. For example, in the
construct an image. Without loss of generality one image can be
U.S., there are many researches specifically for development of
software to be used in some courses. The work of Professor John represented by a matrix where each element aij corresponds to
R. Anderson (Department of Psychology at Carnegie Mellon the value of the pixel image position (i, j ) . In Figure 1 a digital
University), uses artificial intelligence software to teach concepts
of Algebra and Geometry to the students. The results are image is represented of size 5 12 .
surprising because, according to reports from the research of
Professor Anderson, there are major improvements by students in
these topics of mathematics and also in optimizing the time of
study [15].
There are some software systems on the market that can be used to
support teaching and learning. In the last decade the software

115
4.1 Matrix Operations
One of the first concepts that students get exposed to in a Linear
Algebra course is matrix operations.

4.1.1 Addition

Let A aij and B bij be two matrices (images) with the
same dimension, i.e. with the same number of rows and columns,
say m n matrices. The matrix obtained by adding the previous
Figure 1. Digital image with 5x12 pixels. matrices A and B , called A B is shown in equation 4.1 [1,
11].
In the binary image f ( x, y) each pixel is 0 or 1, i.e., the matrix
. a11 a12 a1n b11 b12 b1n
that defines the image is a matrix with entries 0 or 1. In this case a a22 a2 n b21 b22 b2 n
the image is set to white (1) and black (0). Figure 2(a) represents a A B 21
binary image. A grayscale image also called monochrome only
measures the light intensity (brightness). In this case, the value of
m1
a a m2 amn bm1 bm 2 bmn
f ( x, y) for each pixel is an integer that measures the brightness
of that pixel. The grayscale images vary in a range between [0, a
11 11 b a12 b12 a1n b1n
NC-1], where NC is the number of gray levels or intensity levels. a b a22 b22 a2 n b2 n
The most common grayscale image using 8 or 16-bit per pixel, 21 21

resulting in NC = 2 256 or NC = 2 65536 distinct gray
8 16

m1 bm1
a am 2 bm 2 amn bmn
levels. Figure 2(b) represents a grayscale image with 8 bits. In a
color image the value of f ( x, y) for each pixel measures the (4.1)
intensity of the color at each pixel and it is represented by a vector
Figure 3(c) depicts the addition of two color images (a) and (b). In
with color components. The most common color spaces are RGB
image of Figure 3(c) it can be observed the overlap of the two
(Red, Green and Blue), HSV Hue, Saturation and Value) and
images.
CMYK (Cyan, Magenta, Yellow and black). In this paper the
color images are defined in RGB space. The three parameters of
the RGB, which represent the intensities of the three primary
colors of the model, define a three-dimensional space with three
orthogonal directions (R, G, and B). Traditionally, the
implementations of the model in the RGB graphics systems use
integer values between 0 and 255 (8-bit). Figure 2(c) represents a
color image.

(a) (b)

(a) (b)

(c)

Figure 3. Add two images.

4.1.2 Subtraction
(c) .
The subtraction of two matrices A and B with the same size
Figure 2. Representation of a binary, grayscale and (m n) can be defined by the equation 4.2 [1, 11].
color image.

116
A B A (1 B) a11 a12 a1 p b11 b12 b1n
a a 2 p b21 b22 b2 n
a11 a12 a1n b11 b12 b1n a 22
A B
21
a a 22 a 2 n b21 b22 b2 n
21
a m1 a m 2 a mp b p1 b p 2 b pn

a m1 am2 a mn bm1 bm 2 bmn c11 c12 c1n
c c 2 n
a11 b11 a12 b12 a1n b1n c 22
a b 21
a 22 b22 a 2 n b2 n
21 21
m1
c c m2 c mn

a m1 bm1 a m 2 bm 2 a mn bmn
(4.3)
(4.2) where cij , i 1,, m, j 1,, n is defined by equation 4.4.
The subtraction of one image with another image can be used to
p
eliminate the background. For example, the subtraction of the
image (b) to the image (a) in Figure 4 correspond to image (c) cij ai1b1 j ai 2 b2 j aip b pj aik bkj (4.4)
k 1
without background.
With matrix multiplication it was possible to invert an image. In
Figure 6 the original image (a) was multiplied by I represented
in equation 4.5.

0 0 1
0 1 0
I (4.5)
0 0

(a) (b) (c) 1 0 0
Figure 4. Subtraction the background to the image. In (b) the matrix I was multiplied at right of A , and in (c) at
left.
.
In Figure 5 the subtraction of grayscale image (a) to the 255 I
( 255 identity image) produces a negative image represented in
(b).

(a) (b)

(a) (b)

Figure 5. Negative image.


(c)
4.1.2.1 Multiplication
. Figure 6. Multiply two images.
Let A and B be matrices such that the number of columns of A
is equal to the number of rows of B , say A is a m p matrix
and B is a p n matrix. Then the product of the matrix A with 4.1.2.2 Element by element
. Multiplication
Sometimes it is useful applying multiplication element by
the matrix B , called A B is a m n matrix whose ij element element, i.e., multiply each element of A with the corresponding
is obtained by multiplying i-th row ( Ai ) of A by j-th column element of the matrix B . Thus, if A and B are two matrices of
( B j ) of B [2, 10]. The product of two matrices is represented in dimension m n then the element by element multiplication

equations 4.3
A. B is defined by equation 4.6 [12].

117
a11 a12 a1n b11 b12 b1n
a a 22 a 2 n b21 b22 b2 n
A . B 21


m1
a a m2 a mn bm1 bm 2 bmn
a11 b11 a12 b12 a1n b1n
a b a 22 b22 a 2 n b2 n
21 21



m1 bm1
a a m 2 bm 2 a mn bmn

(4.6)
(a) (b)
A mask is a black image with the same size of the initial image
where only the region of interest is set to white. This mask is
applied to the initial image as a filter to only operate in the region
of interest image, defined by the mask. A mask function is applied
to the image using a multiplication element by element. The
application of the mask (b) of Figure 7 to the original image (a)
produces the image (c).

(c) (d)
Figure 8. Images rotation.

4.2.1.2 Geometric transformation


. to an arbitrary
(a) (b) (c)
point
Figure 7. Apply a mask to an image. Transformation matrices can be applied consecutively to make
4.2 Geometric Transformations compound movements and rotations to one image.
The students explore the geometric applications with different
values and they can analyze the. use of geometric transformation To scale an object to an arbitrary point p ( x1 , y1 ) it was
using matrix notation. necessary to perform the following elementary transformations
[6]:
4.2.1.1 Rotation
The rotation of an object from a positive theta angle 1. move the pixel p ( x1 , y1 ) to the origin of the coordinate
(counterclockwise) around the origin is a geometric system, applying a translation T ( x1 , y1 ) to all the
transformation that does not deform the object. To rotate an object
pixels of the object;
it was necessary to turn all the pixels. The matrix homogeneous
coordinates notation for the pixel rotation p ( x, y) with theta 2. change the dimensions of the object by applying a scaling
angle is defined in polar coordinates by equation 4.7. S (sx , s y ) ;

cos sin 0 3. move the pixel p ( x1 , y1 ) to its original position, giving


sin cos 0

(4.7) thus a back translation T ( x1 , y1 ) to all pixels of the

0 0 1 object;

In Figure 8 the rotations were made to correct the images. The The matrix of the composite transformation TC can be calculated
by the equation 4.8 [6].
image (a) was rotated radians to produce the image (b)
16

and image (c) was rotated radians to produce the image (d).
16

118
TC T ( x1 , y1 ) S ( s x , s y ) T ( x1 , y1 )
In Figure 10 the London Tower Bridge (a) was rotated by

1 0 x1 s x 0 0 1 0 x1 20
0 1 y1 0 0 0 1 y1
about the point (304,49) to produce the image (b).
sy
0 0 1 0 0 1 0 0 1
s x 0 x1 (1 s x )
0 sy y1 (1 s y )
0 0 1
(4.8)
In Figure 9, the original image of the opera house in Sydney (a)
was scaled by S (0.5,1) to the point (36,30) to produce the
image (b).
(a) (b)
Figure 10. Rotation to an arbitrary point.

.
4.3 Edge detection
Students can study and explore the application of the gradient
vector to the images.
Edges detection in digital images is an important task used in
many applications of image processing. An edge in the image
represents a region where there is a sharp contrast, i.e. a rapid
change of intensity [14]. The main idea of the techniques for edge
detection is the computation of the gradient of the image. The
gradient of a function f ( x, y) is defined by equation 4.10 whose
(a) (b) amplitude is given by equation 4.11 [7].
Figure 9. Scaling to an arbitrary point. f
Gx x
f f (4.10)
.
To rotate an object about an arbitrary point p ( x1 , y1 ) , by G y
theta, it was necessary to perform the same elementary y
transformations used to scale factor but change item 2 for:
f Gx G y
2 2
(4.11)
2. rotate the object through a rotation theta;

The matrix of the composite transformation TC can be calculated Often the magnitude of the gradient vector is approximated by the
absolute value, i.e. the equation 4.12.
by the equation 4.9 [6].
TC T ( x1 , y1 ) Rot ( ) T ( x1 , y1 ) f Gx Gy (4.12)

1 0 x1 cos sin 0 1 0 x1 A rapid change in intensity corresponds to a large value of the


0 1 y1 sin cos 0 0 1 y1 magnitude of the gradient, so the gradient of an image will have a
0 0 high value on the edges of the image. A change of the intensity
1 0 0 1 0 0 1
values is corresponding to the amplitude of the low gradient.
cos sin x1 (1 cos ) y1 sin Thus, the gradient of an image contains information on the edges
sin cos y1 (1 cos ) x1 sin in the image, and therefore it can be used to detect edges in an
image.
0 0 1
A 3 3 region of the image represents the neighborhood, where
the center point z 5 is designated by f ( x, y) and the point z1 by
(4.9)
f ( x 1, y 1) (see Figure 11).

119
0 1 2
f ( x 1, y 1) f ( x, y 1) f ( x 1, y 1)
G x ( z 2 2 z 3 z 6 ) ( z 4 2 z 7 z8 ) 1 0 1
f ( x 1, y ) f ( x, y ) f ( x 1, y ) 2 1 0
f ( x 1, y 1) f ( x, y 1) f ( x 1, y 1)
2 1 0
Figure 11. 3 3 region of an image center in ( x, y) . G y ( z 6 z8 2 z9 ) (2 z1 z 2 z 4 ) 1 0 1
0 1 2
An approach to the first derivative of the function f ( x, y) is
. (4.16)
defined by Prewitt operator with equations 4.13, where G x
represent the vertical operator and G y the horizontal one.
The application of these operators to the pixel P ( x, y) was
defined by the equation 4.17,
1 1 1 R z1 f ( x 1, y 1) z 2 f ( x, y 1) z 3 f ( x 1, y 1)
Gx ( z7 z8 z9 ) ( z1 z 2 z3 ) 0 0 0 z 4 f ( x 1, y ) z 5 f ( x, y ) z 6 f ( x 1, y )
1 1 1 z 7 f ( x 1, y 1) z8 f ( x, y 1) z 9 f ( x 1, y 1)
1 0 1 (4.17)
G y ( z3 z6 z9 ) ( z1 z 4 z7 ) 1 0 1
where zi , i 1,...,9 represent the operator Sobel or Prewitt.
1 0 1
The Figure 12 represents the edge detection of the original image
(4.13) (a). The image (b) is the horizontal edge detection, (c) the vertical
A variation of these two equations using a weight of 2 for the edge detection and (d) the both detection using the Prewitt
central coefficients, giving some smoothness by the greater operator.
importance attached to the central point is called the Sobel
operator, and it is represented in the equations 4.14.

1 2 1
G x ( z 7 2 z8 z9 ) ( z1 2 z 2 z3 ) 0 0 0
1 2 1
1 0 1
G y ( z3 2 z 6 z9 ) ( z1 2 z 4 z 7 ) 2 0 2
(a) (b)
1 0 1
(4.14)
There are also two Prewitt operators and two Sobel operators for
detecting diagonal edges, which is to detect discontinuities in the
diagonal directions. For diagonal edges using the Prewit operator,
the equations are represented in 4.15,

0 1 1
G x ( z 2 z 3 z 6 ) ( z 4 z 7 z8 ) 1 0 1 (c) (d)
1 1 0 In the Figure
Figure 13 the
12.The horizontal
edge edge
detection usingdetection
Prewitt (b), the vertical
operator.
edge detection (c) and the both detection (d) by using the Sobel
1 1 0 operator apply to the original image (a).
G y ( z 6 z8 z 9 ) ( z1 z 2 z 4 ) 1 0 1 .

0 1 1
(4.15)
and using the Sobel operator in equations 4.16.

120
(a) (b) [2] Ames, C. and Archer, J. Achievement goals in the classroom:
students learning strategies and motivation process. Journal
of education Psychology, 80, 3 (1988) 260-267.
[3] Aydin, S. The factors effecting teaching linear algebra.
Procedia Social and Behavioral sciences, 1 (2009), 1549-
1553.
[4] Day, J.M., and Kalman D., Teaching linear algebra: What are
the questions? (1999).
[5] Dorier, J.L., Robert, A., Robinet, J. and, Rogalski, M. On a
(c) (d) research programme concerning the teaching and learning
of linear algebra in the first-year of a French science
Figure 13. The edge detection using Sobel operator. university. International Journal of Mathematical education
in science and Technology, 31, 1 (2000), 27-35.
. [6] Foley, J.D., Dam, A., Feiner, S.K., and Hughes, J.F.
5. CONCLUSIONS Computer Graphics: Principles and Practice, 2nd edition,
All standard ways to manipulate images (matrix operations, Addison-Wesley Publishing Company, 1990.
geometric transformations, edge detection, etc.) may be performed [7] Gonzalez, R.C., and Woods, M.P. Digital image processing.
by applying mathematical operations to the matrix associated with Prentice Hall, 2nd edition, 2002.
each image. A natural link between Linear Algebra and Digital [8] Hill, D. Technology in teaching mathematics: history and
Image Processing, supported by contemporary technologies and current practices. (April 2011). URL
computational tools can be explored in elementary Linear Algebra http://astro.temple.edu/~dhill001.
courses. The concepts to be learned by the student must have
meaning for the students, so that they can assimilate it. This [9] Instituto Superior de Engenharia de Coimbra. Licenciatura
means that teachers must discern the meaning of the concepts to em Engenharia Electromecnica (modelo Bolonha), Maro
the student. In this sense, the use of MATLAB software and the 2011. URL http://dem.isec.pt/curso_leem_bolonha.aspx.
Image Processing can enrich teaching practice, improving student [10] Karam, L.J., and Rice, D. Teaching image processing to
learning by exploring its resources in every activity proposed by high-school students. Signal Processing Education
the teacher. The students overcome the difficulties presented in Workshop, 2000.
the study of Linear Algebra. Teachers are able to transmit the
[11] Kolman B., and Hill, D.R. Elementary Linear Algebra,
contents of Linear Algebra to students and teaching/learning
International Edition, 8th edition, 2004.
process of Linear Algebra is more stimulating and motivating.
[12] Mathworks. Using Matlab, Version 6.5. The MathWorks,
6. FUTURE WORK Inc. Natick MA. 2002.
In my plans to future, I intend to apply these ideas in the next year [13] Meece, J.L., Anderson, E.M., and Anderman, L.H.
to my students of Electromechanical and Mechanical Engineering Classroom goal structure, student motivation, and academic
in Instituto Superior de Engenharia de Coimbra. During the achievement. Annual Review Psychology, 57 (2006), 487-
laboratory classes will be explored Image Processing applications 503.
using MATLAB on the topics learned in the lectures. It will also [14] Pratt, W.K. Digital image processing. John Willey & Sons,
arrange some work group where students can discuss and interact Inc., 3rd edition, 2001.
on Linear Algebra in a creative and interesting way. The students'
evaluation will be made by analyzing their taste and interest in [15] Ritter, S., Anderson, J.R., Koedinger, K.R., and Corbett, A.
these types of examples as well as their advance in learning about Cognitive tutor: Applied research in mathematics education.
theoretical concepts of Linear Algebra. Psychonomic Bulletin & Review, 14, 2 (2007), 249-255.
[16] Roberts, L.F. Software activities for linear algebra: concepts
7. REFERENCES and caveats. Problems, Resources and Issues in Mathematics
[1] Anton, H. Elementary Linear Algebra, John Wiley & sons, Undergraduate Studies (PRIMUS). 6, 2 (1996), 140-150.
Inc, 8th edition, 2000. [17] Rosen, G., Usselman, M., and Llewellyn, D. Relating high
school mathematics through sound and images. ASEE
Southeast Section Conference, 2005.

121

S-ar putea să vă placă și