It is necessary to place as closely as possible (without intersection) various shapes of different sizes on the image.

This is what happened with random numbers.

enter image description here

In addition to the obvious problem, the selection of coordinates takes a long time.

Tell me what algorithm to use to solve this problem. Perhaps some kind of library, like OpenCV.

Thank!

  • This is not a question of programming, but of the theory of algorithms. Ask your supervisor better. - VladD
  • This is not a scientific work. There is no need to find the most optimal algorithm. It is necessary that the visual area seems to be filled evenly. It should turn out like this https://prnt.sc/hq2b7r only with different figures. - Sveta Zakharchuk
  • Hm There, I think, the algorithm first threw large pieces, and then smaller ones (and then smaller ones, etc.). The question in determining the overlap - well, it can be a pixel-by-pixel. - VladD

0