Download cs470 writeup
Transcript
4.2 System Architecture
The architecure is event driven. When the system is first started it will bring up the
GAWavelet form (with no images loaded). From here the load image, save image,
settings, and transform image options will be accessible.
•
Load image will pull up the load image dialog allowing an image to be loaded –
once selected and loaded it will be displayed in the GAWavelet form. Loading
another image will create a new tab to be created to hold the new image (up to a
maximum of 5.)
•
Save image will pull up the Save image dialog only if an image is already loaded.
(else it will display a warning message and abort that operation). On completion it
return control to main display window.
•
Settings will bring up change settings dialog and on completion return control to
GAWavelet form.
•
Transform image can only be used if an image is already loaded. (else will display
a warning message and abort that operation). Once transform image has started
the following sequence occurs before control is ceded o Run genetic algorithm according to settings specified in Settings dialog.
o Display Transforming progress bar for duration of transformation.
o Show results dialog for best solution found
o Update display window with the image resulting from forward
transform/quantization/dequantization/reverse transform operations of best
found solution.
o Return control GAWavelet form.
4.3 Algorithms
The most important algorithm the application uses is itsgenetic algorithm. Without going
into too much detail it has the following basic form:
G = 0;
{Start at Generation 0}
initpop(P);
{create a population P of random solutions}
while not (G == max) do(
G++;
{increment to next Generation}
eval(P);
{evaluate the fitness of all solutions in P}
P' = select(P);
{randomly select members of P but
weighted in proportion to their fitness}
crossOver(P');
{swap random portions of the
solutions in P' with other solutions}
mutate(P');
{mutate solutions}
P = P';)
9