CS7321 Winter 1998

PS0 Solution by Gabriel J. Brostow: MatLab exercises...



 
Input Image Operations Output Image
  (279x384, color)  Scaled and cropped down using xv.  
(180x230
 Convert from RGB to GRAYSCALE: 

 A = imread('/net/hc283/brostow/7321/matlab/citeCover.jpg');
imwrite(A, 'original', 'jpg');
Agray = rgb2gray(A);

gray.jpg
gray.jpg  Agray_subimage = Agray( 20:125, 100:180);
imshow(Agray_subimage);
imwrite((edge( Agray_subimage, 'roberts', 0.1) ), 'gray_sub_edge_roberts.jpg', 'jpg');
 
imshow(Agray_subimage>40);

imshow(dilate(Agray_subimage>40));
imshow(erode(Agray_subimage>40));

NOTE: erosion is operation of AND, and black = 0.

Afft_blurred = fft2(Agray_subimage>40);
 
(2Df.t. and mask) imshow( ifft2( Afft_blurred .* mask) );