Skip to content
jbromley edited this page Feb 25, 2011 · 3 revisions

ga-image

Introduction

The goal of this project is to use a genetic algorithm to grow a copy of an input image using only a limited number of polygons. The application will provide a GUI that shows the current most-fit individual and write a movie with one frame per generation to show the evolution of the image.

Genotype Representation

An image will be composed of a limited number (starting around 64) of polygons. A polygon may have from three to eight sides and will have a random color and alpha. In this attempt we will not use bit-string chromosomes, but will use more descriptive structures and then will write genetic operators specific to the structured representation.

Genetic Operators

Due to the structured nature of the genotype, I will have to create specific crossover and mutation functions.

Fitness Function

The fitness function will measure how far from the target image any individual is. A first cut may use the sum of the absolute differences of all channels of all pixels between the two images in the RGB color space. A slightly more sophisticated fitness function may use the HSV color space.

Dependencies

  • cl-cairo2, ch-image, or opticl for drawing
  • cl-colors for color representation and utility functions
  • cl-opencv for interface to OpenCV