“填充”算法2D 图像中的纹理

发布于 2024-08-06 20:12:56 字数 294 浏览 1 评论 0原文

我记得不久前看到一篇论文,介绍了一种算法,该算法可以自动无缝地将纹理从图像的一部分“移植”到图像的另一部分。

该方法大致如下:

您可以根据图片中存在的部分建立一个小像素方块(可能是 8X8)的数据库。

然后,您将选择一个空像素(纹理移植的“目的地”)进行填充,并在数据库中查找与周围像素最匹配的方块之一。然后,您可以根据找到的正方形中相应像素的颜色为空像素着色。然后选择另一个空像素并重复,直到没有剩余的空像素。

当然,这只是一个模糊的描述,因为我找不到任何对该算法的参考来刷新我对细节的记忆!有人可以帮忙吗?

I recall seeing a paper a while back for an algorithm that could automatically and seamlessly "graft" texture from parts of an image onto another part of an image.

The approach was something along the lines of the following:

You'd build up a databases of small squares of pixels (perhaps 8X8) from the parts of the picture that are present.

You'd then pick an empty pixel (the "destination" for the texture graft) to fill in, and look for one of the squares in your database that most closely matches the surrounding pixels. You'd then color the empty pixel according to the color of the corresponding pixel in the square you find. Then you pick another empty pixel and repeat until there are no empty pixels remaining.

Of course, this is only a vague description because I can't find any references to this algorithm to refresh my memory of the details! Can anyone help?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文