Image segmentation using a genetic algorithm