非方形图像的四叉树分解
有谁知道对非方形图像执行四叉树分解的最佳方法?我不断地在使用四叉树绘制的图像上出现线条。
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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
最简单的事情可能是想象您的图像嵌入在方形图像中(放置在中央,以便较大图像的二等分对应于较小图像的二等分)。绘制它时,当然您需要避免绘制实际上不在图像矩形内的位,但我认为所需的特殊情况代码比所需的特殊情况代码更简单处理非方形图像。
如果没有更多关于您正在做什么以及出了什么问题的信息,我认为调试跨图像问题的前景不大。 (是否有可能潜在的问题是你的尺寸不是 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?)