Photo Editor Project Implementation
(Helpful suggestions)

The information described below covers MATLAB commands and digital image concepts that we have not covered previously this semester. You will need to use the MATLAB help system extensively to research more details about the commands listed below. If you are confused about any of these topics after investigating the MATLAB Help command,  please ask your instructor for additional help.

Each photo editor project will hopefully be unique. The information below is provided as generic help to all students. You are not required to use all of the commands listed below. Use only the ones appropriate for your photo editor implementation.

Digital Images (a short primer)

A digital image is a sampling of light intensities -- typically over a very short period of time . A camera's "shutter speed" determines the length of time light is allowed to hit the camera's photo sensors. The number of samples taken of the incoming light determines a digital image's resolution. If a camera contains 600 rows of sensors, where each row contains 800 individual sensors, then the camera has 600x800 = 480,000 sensors and the resulting image contains 480,000 picture elements (pixels).

If you sample light you get a set of intensity values. These intensity values can be used to create a "gray scale" (i.e., black and white) image. If you take light and pass it through special prisms, you can separate the light into its various wavelengths. By separating light into its red, green, and blue wavelengths, and sampling the intensities of each component, you can create "full color" images.

Most camera images are created using CCD (charged-coupled devices). A good description of CCD's can be found at http://www.ghg.net/akelly/ccdbasic.htm.

Image Data

Displaying images

MATLAB displays images in axes GUI components. Note the following:

You may (or may not) need to use color maps. (You will need color maps if you want to display only a single color component of an image, e.g., only the red intensity values.) Note that MATLAB only allows one active color map for each figure window. You can change the color map at any time, but you can only have one active color map.

User Interactions

To capture the pressing and releasing of mouse buttons and the movement of your mouse, you must set callback functions for your GUI figure window. It is best to do this in your *_OpeningFcn() function. The following commands register callback functions for mouse events. (Change the variable names appropriately for your program.)

set(handles.Main_figure_handle, 'WindowButtonDownFcn',   {@Window_button_pressed,  handles} );
set(handles.Main_figure_handle, 'WindowButtonMotionFcn', {@Window_button_motion,   handles} );
set(handles.Main_figure_handle, 'WindowButtonUpFcn',     {@Window_button_released, handles} );

For each callback function that you set, you have to write a callback function to process the corresponding event. For example, given the commands above, you would implement the following function:

function Window_button_pressed(hObject, eventdata, handles)

...

When a mouse event callback function is called, you can use appropriate get() function calls to get information about the event. Some possible useful information includes:

Location = get(Axes_handle, 'CurrentPoint');

Location = get(Figure_handle, 'CurrentPoint');

MouseButtonType = get(Figure_handle, 'SelectionType');

Key = get(Figure_handle, 'CurrentCharacter');

Currently_selected_object = gco();

IMPORTANT: If you get the location of the cursor using the figure handle, you will get the cursor location relative to the entire window. If you get the cursor location using an axes handle, you get the cursor location relative to the axes.

Functionality Suggestions

Each photo editor implementation will be unique and include unique functionality. The following discussions may (or may not) apply to your implementation. Use the following information if you are implementing any of the functionality discussed below -- and ignore it otherwise.