CE 261: Lab #1
Spring 1998


Digital Image Fundamentals

Instructor: Dr. Craig M. Wittenbrink

Office: Applied Science Bldg. #309

HP Phone: (415) 857 2329
UCSC Phone: (408) 459 4099

Due: Thursday April 16. Labs are due at the beginning of class.

Lab Environment: Applied Sciences 105 or Social Sciences 1. See World Wide Web URL:

http://wwwcatsic.ucsc.edu/Labs/labs.html for locations and times.

Equipment: Power Macintosh with Adobe Photoshop or PC with Adobe Photoshop.

Adobe Photoshop Overview.

Adobe Photoshop is an image processing end user application, that can be used to perform a wide variety of image processing tasks. It imports many image formats, and interfaces to acquisition devices like scanners. The purpose of this lab is to show you image processing by doing some image processing. The intent is to familiarize yourself with point, processing, and some convolution operators. And, to gain an intuitive understanding of the operations to improve your study, and accelerate your later projects. Launch Adobe Photoshop by double clicking on its icon. Remember not to save any of your changes to corrupt the images in the Tutorial's disk. Hopefully this lab report is detailed enough so manuals won't be needed. The lab is intended to be a quick way to see image processing in action. Photoshop is much more powerful in the select, composite, and blend categories, but the filtering categories are adequate to illustrate some of the important points in point processing and windowed processing. Go to the File menu and select Open, Tutorial, Hands and open the Hands image (hands.jpg). (The hands image may be in the folder higher than the Tutorial folder). Or, for a more interesting image to process, obtain the image of the class that I took with the digital camera here: http://www.cse.ucsc.edu/classes/cmpe261/Spring98/ce261_98.jpg . In the lower left, the size of the image in bytes is given. Click on the lower left, while holding down the option key. (On PC, select menu "Image->Image Size..." )

Q.1 What are the dimensions of the image? Now go to the Window menu, and select show colors. The palette of gray scales used in the image is displayed. Also, select Window->Show Info, and the popup will display information about the pixel under the cursor.

Q.2 What is the intensity of the eyes approximately? (Use someone's shirt if using the class image) (Hint, Select the drawing tool, so the point of the cursor is where the readout occurs) Now select Image->Histogram to show the distribution of pixels through the image.

Q.3 What is the mean pixel intensity? What is the median pixel intensity? (close the histogram) Now try the Image->Adjust->Levels command, and experiment with contrast enhance ment of the image. The levels command allows changing the contrast, by choosing what intensity is mapped to black, what intensity is mapped to white, and by also providing a gamma control, a nonlinear contrast adjustment where the pixels near the middle of the scale are given a higher intensity. Use the dropper tools in the Levels popup to select pixels that will set the white point (right dropper) and black point (left dropper). You can also change these values by dragging the triangles in the histogram display, and by entering values into the level boxes.

Q.4 Try one way to remove the arms in the displayed image. (You can use this for removing limbs in the class image as well!) (I would prefer if you didn't use a selection tool, but changed the intensities to dim out the arms). Explain how you did it. (Close the levels window) Some other point operations include exchanging pixel values. Try the image->flip and rotate commands. Now, zoom in on a part of the image by selecting the zoom tool. The zoom tools looks like a magnifying glass in the tools palette. Zoom in on the thumbnail of the right hand (the hand on the left) click multiple times to zoom in. (For the class image zoom in on a particular person).

Q.5 How many pixels long is the thumbnail's highlight? (How many pixels high is the face of the person you zoomed in on?) Option Zoom/Click will back you out. (on PC use the right mouse button to zoom out). You can see the pixel resolution, and see how the intensities vary across the image. When an image is resampled from an existing one, there are various ways to perform reconstruction. One way is by picking the nearest pixel, and using that value. This is called, not surprisingly, nearest neighbor interpolation. By select ing File->Preferences->General, you will find a selector for interpolation. Try Image->rotate->arbitrary with each of the three choices for interpolation. You may use edit->undo after each of the rotations.

Q.6 How many zooms does it take with near neighbor, bilinear, and cubic from the 1:1 display before the jaggies are quite apparent with an arbitrary rotation? The cropping tool or the zooming tool can be used to select part of the image and resample it to a larger size. The resampling will use the reconstruction method which has been chosen in the preferences. The geometric distortion tool can be used to warp the image, which will also use resampling of the image values. The menu "Layer->Free Transform" provides a popup for performing a variety of geometric warps. Area, or window commands consider adjacent pixels and perform a transformation based on them. For example, histogram equalization performs a redistribution of intensities to try to automatically perform contrast enhancement of the image. Select an area of the image with the lasso, or the selection box. Then select Image->Map->Equalize, (Image->Adjust->Equalize and radio button for selection only on Photoshop 4.0) (selected area), and experiment with histogram equalization with parts of the body. (Or members of the class body) Keep only a portion of the image selected (say the eyes) and do a Filter->Other->Custom option. The values shown are the values in a convolution mask. Each of the other filters uses a convolution mask as well. Undo the operation, and try the following mask:

-1 2 -1
-1 2 -1
-1 2 -1

Q.7 What happens with this mask? What type of features does it select? Can you try a custom mask of your own to select another feature? Try Filter->Stylize->Find Edges. Can you replicate such a result with the custom filter?

Q.8 put down a filter of yours, (record the filter values here) and the effect that it achieves. Now try the unsharp mask filter. Filter->Sharpen->Unsharp mask. You can enter the radius of the influence of the filter. Experiment with the radius.

Q.9 What radius is effective to drastically offset the eye socket? (For the class image what radius is effective to offset the stripes on someone's shirt?) Now try the Blurring filter. ("Filter->Blur->Gaussian Blur"). The Gaussian blur filter allows a radius of effect to be chosen as well. (Try smoothing out the blinds at the background features of the room in the class image).

Q.10 At what radius of blurring using the Gaussian Blur filter do the eyelids just disappear without completely blurring away the eye? (At what radius of blurring, does the wall texture disappear?) For some more sophisticed edge detection, try the Filter->Stylize->Trace Contour. Different levels to look for the contour can be used. Experiment with looking at some of the other images in the Tutorial folder, especially the color ones.

craig_wittenbrink@hpl.hp.com
Last modified Friday, 10-Apr-1998 11:12:02 PDT.

Back to the CE / CS Class Home Pages.
Back to the CE / CS Home Page.