How to write a Mosaic image generator

The task is as follows: how to create the selected image mosaic from a large number of images. My first shot will use an evolutionary algorithm. Where the genotype is a mapping of the source images to positions in the mosaic grid, and the individual is evaluated in accordance with the similarity of the original picture. In fact, in the basic approach, each tile can be processed separately, so repeating through the grid and matching the best image will be sufficient. But I still do not know how to define the similarity functions. Naive pixel comparisons (r, g, b) would probably be too strict. I think that some image processing algorithms should be used as histogram balancing to optimize the similarity between sub-image and the region where we are trying to find it.

It will be similar to the genetic algorithm that Mona Lisa creates .

An example of a mosaic can be found here .

+3
source share
1 answer

Ok, I did it (but I stopped somewhere) Look: GetAMosaic It was a testproject to do some C again :-) So don't look at every detail there.

+3
source

Source: https://habr.com/ru/post/1758456/


All Articles