Download SE EM-Bo tany
Transcript
5. Implemented Solution
axes ( handles.original );
imagesc ( IMG );
colormap ( gray );
set ( handles.original , 'HandleVisibility' , 'OFF' );
set ( handles.original , 'XTickLabel' , '' , 'YTickLabel' , '' );
Next the processed image, initially similar to the original image, is displayed on the
large window, using the following code:
set ( handles.processed , 'HandleVisibility' , 'ON' );
axes ( handles.processed );
imagesc ( IMG );
colormap ( gray );
set ( handles.processed , 'HandleVisibility' , 'OFF' );
set ( handles.processed , 'XTickLabel' , '' , 'YTickLabel' , '' );
In this process the image data is stored in the variable IMG that is defined as global
variable, being available to the others callback functions.
Open
This is the activated function when the objective is to open a stored image, which
could be stored in any directory.
In order to help in this process, the uigetfile function is used, which displays a dialog
box that enables the user to select a file to be opened [6].
However, it is necessary to load the image information and for this is used another
toolbox, the Image Processing Toolbox.
The Image Processing Toolbox provides a set of algorithms and graphical tools for
image processing, analysis, visualization, and algorithm development [7]. Between them it
can be found the imread function, which is capable of reading a grayscale or color image
from a specified file [8]. The cd function is used to change working directory, which is
necessary to prevent a general exception.
The following code is responsible for opening images:
[filename,pathname]=uigetfile({'*.format’},'Choose Image.');
cd ( pathname );
IMG = imread ( filename );
cd ( current_pathname );
SEM-Botany
50