Genetic Algorithm Approximating Images with Polygons - Fitness Calculating

89 Views Asked by At

So I'm implementing GA. And I've got an array of polygons for a generation. Every polygon has a color and some points. I'm calculating the fitness right now like this:

Paint the polygons onto a 200x200 view -> Get a snapshot of the view -> Get 40000 pixel data from the snapshot -> Compare the 40000 pixel data with the target image pixel data and returns the fitness

This is actually a very bad implement because UI rendering takes a lot of time. What better method can I use for the fitness calculating? How do I get 40000 pixel data from an a array of polygons? Because you know, I cant get an exact RGBA pixel data at an exact coordinate from that array.

0

There are 0 best solutions below