CS7321 Winter 1998


PS #0 - Solution by Ying..


Note: All generated image from Matlab is converted to JPEG using xv..


Input Image Operations Output Image
ying.rgb (320x640, color)
(saved using capture from SGI)



Converted to TIFF using imgworks
(converted to JPG using xv for display)
ying.jpg
ying.jpg
Convert to Grayscale

[R,G,B] = tiffread('ying.tif');
I = rgb2gray(R,G,B);
Gray Scaled Image of Ying
Gray Scaled Image of Ying
Rescale the image

I2 = imresize(I, .5, 'nearest');
Rescaled Image of Ying
Rescaled Image of Ying
Cropping an image..

II = imcrop(I2);

(xv wasn't particularly friendly dealing with smaller images..)
Cropped Image


Input Image
(Rescaled Grayimage)
Operations Output Image
Rescaled gray Image
Historgram Equalization

J = histeq(I2);
Historgram Eq Image
Historgram Eq Image
Grayscale Levels...

[x,map] = gray2ind(J,2);

2 levels
2 grayscale level

4 levels
4 grayscale level

8 levels
8 grayscale level

16 levels
16 grayscale level

32 levels
32 grayscale level
hist eq grayscale level A "blue" color Map

[x,map] = gray2ind(J,256);
A = hot(256);
colmap = A;
colmap(:,3) = A(:,1);
colmap(:,2) = A(:,2);
colmap(:,1) = A(:,2);
imshow(x,colmap);

Thought I should do a little
color mapping too
A blue color mapped of me

Input Image
(Rescaled Grayimage)
Some Filtering Operations Output Image
Rescaled gray Image
Average

h = fspecial('average',[5 5]);
I3 = filter2(h, I2);
Blurred image
Rescaled gray Image
Edge (Sobel)

BW = edge(I2,'sobel');
Edge(sobel)
Rescaled gray Image
or Sobel?
h = fspecial('sobel');
I3 = filter2(h, I2);
Sobel Horizontal

h = fspecial('sobel');
I3 = filter2(h', I2);
Sobel Vertical

Sum of the above two..

Added..


Input Image
(Rescaled Grayimage)
Some BW Operations Output Image

Skeleton

bwskel= bwmorph(bw,'skel',Inf);

Thin...

bwthin= bwmorph(bw,'thin',Inf);

Region of interest..
Average filter