非方形图像的四叉树分解

发布于 2024-10-18 07:11:30 字数 51 浏览 7 评论 0原文

有谁知道对非方形图像执行四叉树分解的最佳方法?我不断地在使用四叉树绘制的图像上出现线条。

Does anyone know the best way to perform Quadtree decomposition on a non square image? I keep getting lines appearing across my image which is drawn using a Quadtree.

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

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

发布评论

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

评论(1

白昼 2024-10-25 07:11:30

最简单的事情可能是想象您的图像嵌入在方形图像中(放置在中央,以便较大图像的二等分对应于较小图像的二等分)。绘制它时,当然您需要避免绘制实际上不在图像矩形内的位,但我认为所需的特殊情况代码比所需的特殊情况代码更简单处理非方形图像。

如果没有更多关于您正在做什么以及出了什么问题的信息,我认为调试跨图像问题的前景不大。 (是否有可能潜在的问题是你的尺寸不是 2 的幂,而不是它不是平方?换句话说,当平分图像时,某些事情没有做得很正确,会产生“一半”不同尺寸?)

The simplest thing would probably be to imagine that your image is embedded in a square image (placed centrally, so that bisection of the larger image corresponds to bisection of the smaller one). When drawing it, of course you'd then need to avoid drawing bits that aren't actually within the image rectangle, but I'd have thought the special-case code needed for that would be simpler than the special-case code needed to handle non-square images.

Without more information about just what you're doing and just what's going wrong, I don't think there's much prospect of debugging your lines-appearing-across-the-image problem. (Is it possible that the underlying problem there is that your size isn't a power of 2, rather than that it's not square? In other words, that something isn't being done quite right when bisecting the image produces "halves" of different sizes?)

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