I'm trying to optimize an image reconstruction algorithm using genetic algorithm.I took initial population size as 10.I have an input image an 10 reconstructed image.fitness function is the difference between these two.That is
fitness_1 = inputimage - reconstructedimage_1;
fitness_2 = inputimage - reconstructedimage_2;
:
:
fitness_10 = inputimage - reconstructedimage_10;
I want to chose the best fitness population among them.But my fitness result is an image(matrix with intensity values).So how can I get a single fitness value for each population for doing crossover in the next stage. Please help.Thanks in advance
You need to define a function which measures the quality of the match as a single scalar value. Actually you have a choice here - anything which could measure the closeness in a more-or-less-continuous manner would work. However, probably the simplest is mean squared error of each pixel value in the image.
Here's how I might do this for your first reconstruction:
fitness_1 = abs(inputimage - reconstructedimage_1).^2;
fitness_1 = sum( fitness_1(:) ) / numel( fitness_1 );