felixin
V2EX  ›  算法

最优化马赛克算法

  •  
  •   felixin · Jun 28, 2021 · 1892 views
    This topic created in 1785 days ago, the information mentioned may be changed or developed.

    假设有一个 width * height 大小的标量图片, 已经被均分成了 n 个边长为 x 的正方形格子 (x <<< n). 每个格子内部的颜色是唯一的, 并且已知整个图片上所有颜色的类型不超过 64 种 (即所有格子的颜色不超过 64 种).

    现在要将图片分割成数目为最接近 k, 且不大于 k 个的正方形格子(k < n), 并且单个格子里面的颜色一致, 新格子边长可以为 x, 2x, 3x, ...等等.

    输入是 width, height, n, x, k, 输出是 [坐标, 大小] 的格子数组.

    请问有什么思路?或者有什么类似的题目可以参考吗?

    No Comments Yet
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   937 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 28ms · UTC 21:00 · PVG 05:00 · LAX 14:00 · JFK 17:00
    ♥ Do have faith in what you're doing.