EE435
In-Class Activities:
01/23/2012:
Pattern Recognition
The purpose of this is to demonstrate to you how scatter plots can be used to distinguish between two classes. Both 2-dimensional and 3-dimensional scatter plots are displayed.
Each of
the four programs below displays how scatter plots can be used to determine if
good features have been chosen for recognition. The data for each is simply 200
random Gaussian samples from 2-different distributions (i.e., different means,
standard deviations)
1. Download the m-file called patternrecog1.m from the course website and run it. This will
produce a 2-class, 2-feature pattern recognition scatter plot, which is fairly
separable (easy to distinguish between the two classes accurately).
2. Download the m-file called patternrecog2.m from the course website and run
it. This will produce a 2-class, 2-feature pattern recognition scatter plot,
which is not easily separable with these two features
3. Download the m-file called patternrecog3.m from the course website and run
it. This will produce a 2-class, 3-feature pattern recognition scatter plot which is fairly separable. Use the “rotate 3D” button
on the figure window to rotate this in three dimensions so you can observe the separability from different viewing angles.
4. Download the m-file called patternrecog4.m from the course website and run
it. This will produce a 2-class, 3-feature pattern recognition scatter plot which is not separable. Use the “rotate 3D” button on
the figure window to rotate this in three dimensions so you can observe that
the classes are not separable from different viewing angles.
02/01/2012:
Intro to Image Processing
The purpose of this is to introduce you to some basic MATLAB image processing functions.
1. Download your
favorite mugshot from http://www.thesmokinggun.com/mugshots/.
Recall the comment I made in class about how law enforcement face recognition
works better when the face is looking dead-on at the camera, with a normal
facial expression.
2. Using imread, read it into MATLAB and display
it in a figure window.
Show your professor the picture.
3. Using imfinfo, display its information.
4. Using imwrite, write the image out as a
different type of image file and display it in a new figure window
–
e.g., if the original was a JPEG file, write a
bitmap file (.bmp). Double-click on the image file in Windows to ensure you
wrote out what you think you wrote out.
5. Download a different image from the Internet
6. Using imread, read the image into MATLAB…use
the variable “a” to represent this array of values
7. Use imshow to display the image:
–
>>figure(1),imshow(a), title(‘Original Image’)
8. Now divide all the values in the image by 4; note this should
darken the image, since the shades of each color can only range from 0 to 64
instead of 0 to 255.
–
>>b=a/4;,
figure(2),imshow(b),title(‘Darkened Image’)
9. Write this image out as a “png” file, then in Windows, double-click the image
file…does it look like it should?
–
>>imwrite(b,‘Darkened Image.png’)
10. If the image is a color image, convert the image to grayscale:
–
>> b=rgb2gray(b);,figure(3),imshow(b),title(‘Grayscale Darkened Image’)
11. imshow can be used to
improve the viewed image. It will scale the min and max values of an input
array to range from 0 to 255.
–
>>figure(4),imshow(b,[]);,title(‘Darkened Image-Now Rescaled’)
12.
Continue working on Project # 3.
02/06/2012:
Spatial Image Processing
The purpose of this is to give you some programming experience with how images are processed in the spatial domain in MATLAB.
1.
If you haven’t finished the in-class from 2/1, you should do that now.
Otherwise…
2. Download the seal_bw.png
image from the course website, bring it into MATLAB as variable a
and view the image in figure (1).
3. Now create a new image as variable b using this
command:
>> b = imadjust(a,[0
1],[1 0]);
View
this image in figure(2)…how does it compare with the
original image?
Now
display 255-a
in figure(3). Is there any difference between this
image and image a?
4. Download the Eminem-1_bw.png
image and bring it into MATLAB and display it in figure (1). This image appears
too bright in the face…try to histogram equalize it and display the result in figure(2). Is this an improvement?
5. President Mahmood Ahmadinejad of Iran is not feeling well. Download the IranianPresident_sick.png image
and try to make him feel better using the medfilt2 function.
6.
Continue working on the project due tomorrow, or on the homework due this week.
02/08/2012:
Color Image Processing
The purpose of this is to give you some exposure to how color images can be processed in MATLAB.
1. If you haven’t finished the in-class from 2/06, you should do
that now. Otherwise…
2. Download the sample_pseudocolor.m
file and the herndon.jpg
image file from the course website.
3. Run this m-file to display a pseudocolored
image. In the m-file, adjust the two thresholds a few times, run the program
again and see the results.
02/15/2012:
Binary Morphology
The purpose of this is to give you some exposure to how to apply morphology to binary images in MATLAB.
1. If you haven’t finished the in-class from 2/08, you should do
that now. Otherwise…
Do this activity from the command line, ONE STEP AT A TIME and
view the intermediate results.
2. Download the Marilyn
Manson-gray.jpg image from the course website and
read it into MATLAB as variable a.
3. Try to extract the face from the rest of the image as follows:
--Threshold the image
at a pixel value of 170 to create a binary image and call the resulting array
“b”
--Create a
disk-shaped structuring element:
>>se=strel(‘disk’,3); % disk has a radius of 3
--Erode the image to
remove the noise:
>>e=imerode(b,se);,figure(1),imshow(e,[ ])
--Dilate the face mask with a large structuring element to fill in the
gaps:
>>se=strel(‘disk’,17); % disk has a radius of 17
>>e=imdilate(e,se); ,figure(2),imshow(e,[ ]);
--Erode the face
mask to return it to it’s approximately original size
>>se=strel(‘disk’,11); % disk has a radius of 11
>>e=imerode(e,se);,figure(3),imshow(e,[ ]);
--Now extract the
face from the original image
>> figure(4),imshow(uint8(e).*a)
02/17/2012:
Binary Morphology
The purpose of this is to give you some more practice using binary morphology as it may apply to biometric signal processing.
1. If you haven’t finished the in-class from 2/15, you should do
that now. Otherwise…
2. Work your way
through the Morphology Example handout, step-by-step. The following iris images
are needed:
02/22/2012:
Segmentation
The purpose of this is to explore using edge detection in MATLAB.
1. If you haven’t finished the in-class from 2/17, you should do
that now. Otherwise…
Experiment with thresholding and edge
detection:
2. Download the finger.bmp
image from the course website and read it into MATLAB
3. Thresholding:
•
Use the graythresh function to determine a
suitable threshold to convert this to a binary image, use your threshold
function to perform the thresholding and look at the
result. NOTE: graythresh returns a value [0.0-1.0], so to use your threshold function on it you should
multiply the graythresh output by 255.0.
•
Try using your own threshold to see if you can make the ridges
stand out better.
4. Edge detection
•
Take a look at the edge detection result on this image using MATLAB’s edge function. Try the Canny method, the Sobel method and the Prewitt method, and view the results
after each one. Do the edges of the fingerprint image make sense?
02/24/2012:
Motion Segmentation
The purpose of this is to expose you to motion detection using simple frame subtraction.
1. If you haven’t finished the in-class from 2/22, you should do
that now. Otherwise…
2. Download the welch1.png, welch2.png and welch3.png image
files from the course website. Read them into MATLAB as arrays m1, m2 and m3.
3. Compute and display the result of double(m3)-double(m2).
Note: you must use the [ ] option with imshow.
4. Choose a threshold value for this difference and threshold to
create a binary image that makes CDR Welch stand out.
5. Compute and display the result of double(m2)-double(m3).
Why is this one so much different than m3-m2?
6. Redo the motion detection by using the absolute difference
between the frames, rather than the difference, then threshold and view the
resulting binary image. Does this detect the motion any better?
02/27/2012:
Face Segmentation
The purpose of this is to give you additional practice in binary region processing, using morphology and regionprops to extract a face from a mugshot. It also exposes you to several other color representations besides RGB.
1. If you haven’t finished the in-class from 2/24, you should do
that now. Otherwise…
2. Work through the Face Segmentation
using Color Information worksheet.
03/05/2012:
Fingerprint Recognition
The
purpose of this is to give you an introduction to a fingerprint scanner and a
fingerprint recognition program. Capture an image of one of your fingers using
a SecuGen Hamster III fingerprint scanner, then determine its features using the Verifinger
2.4 Demo program as follows.
1. Ensure that a SecuGen Hamster III fingerprint scanner is inserted into a USB port on your computer.
2. Start up the VeriFinger Algorithm Demo program on your computer, which will use the Hamster fingerprint sensor (there should be an icon on your desktop). When this program is running, the fingerprint scanner should start flashing red lights.
3. Place one of your fingers on the fingerprint sensor. This program will automatically process the fingerprint as described in class: binarizing, skeletonizing, determine core/deltas, and finding minutiae. The minutiae will be indicated with small red circles and a direction. Use the View -- Zoom In to zoom in enough so you can see the detected cores/deltas, which will appear in red boxes. An example of what this screen will look like is shown here.
4. Try some of your other fingers. Determine if you have a
loop, arch or whorl.
03/09/2012:
Fingerprint Recognition
The
purpose of this is to have you determine your Henry System classification,
using the Hamster fingerprint sensor and the Verifinger
program.
1. Ensure that a SecuGen Hamster III fingerprint scanner is inserted into a USB port on your computer.
2. Start up the VeriFinger Algorithm Demo program on your computer, which will use the Hamster fingerprint sensor (there should be an icon on your desktop). When this program is running, the fingerprint scanner should start flashing red lights.
3. Cycle through each of your fingers, noting whether they are a loop, arch or whorl, and indicate the pattern type in the table passed out in class (Henry System Exercise.pdf).
4. Using the handout, determine your Henry System
classification and report it to the professor.
5. Happy spring break!!!
03/19/2012:
Fingerprint Recognition
View some
fingerprint websites.
1. Go to http://dermatoglyphics.com/
to see some famous fingerprints/handprints
2. Go to http://onin.com/fp/fphistory.html and see some
of the history of fingerprints
03/23/2012:
3D Face Recognition
1. Demonstration of A4-Vision 3D Face
System
2. Enroll
in and experiment with this system
04/02/2012: Iris Recognition
1. Go to http://www.cl.cam.ac.uk/users/jgd1000/uses.html
and click on the links that describe applications of iris recognition to learn
more about current uses.
2.
Go to the following website and read how iris recognition was used to
identify the “lost” Afghan girl from National Geographic Magazine
http://www.cl.cam.ac.uk/users/jgd1000/afghan.html . Be sure to view the links that this web page contains to
view other photos.