建立四叉树

本文介绍了如何使用四叉树来表示一个布尔值网络。网络中的每个单元格都有真或假的值,从根节点开始,不断分裂为四个子节点,直到区域内的值相同。每个节点有两个布尔属性,表示是否为叶子节点及其代表区域的值。给定一个网络示例,通过一系列分割操作,构建出对应的四叉树结构,并强调非叶子节点的值不重要,可以用任意值表示。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

我们想要使用一棵四叉树来储存一个 N x N 的布尔值网络。网络中每一格的值只会是真或假。树的根结点代表整个网络。对于每个结点, 它将被分等成四个孩子结点直到这个区域内的值都是相同的.

每个结点还有另外两个布尔变量: isLeaf 和 valisLeaf 当这个节点是一个叶子结点时为真。val 变量储存叶子结点所代表的区域的值。

你的任务是使用一个四叉树表示给定的网络。下面的例子将有助于你理解这个问题:

给定下面这个8 x 8 网络,我们将这样建立一个对应的四叉树:

由上文的定义,它能被这样分割:

 

对应的四叉树应该像下面这样,每个结点由一对 (isLeaf, val) 所代表.

对于非叶子结点,val 可以是任意的,所以使用 * 代替。

提示:

  1. N 将小于&nbs
文章作者写的matlab源代码,该文章2017年发表在Signal Processing: Image Communication: Hui Liu, Ke-Kun Huang*, Chuan-Xian Ren, Yu-Feng Yu and Zhao-Rong Lai. Quadtree Coding with Adaptive Scanning Order for Space-borne Image Compression. Signal Processing: Image Communication, vol. 55, no. 7, pp. 1-9, 2017. (http://dx.doi.org/10.1016/j.image.2017.03.011) 星载设备产生非常大的图像,而存储、计算和传输的能力有限,因此需要低复杂度的图像压缩算法。在本文中,我们开发了一种基于四叉树的高效图像压缩算法。首先,我们提出了一种自适应扫描顺序,它从先前有效节点的邻居遍历四叉树,从而指定的比特率下对更多的有效系数进行编码。其次,我们将整个小波图像划分成几个块,并对它们进行单独编码。因为失真率通常随着树节点的层次的增加而减小,我们选择在四叉树的每个层次编码后的点作为候选截断点。提出的方法可以提供质量、位置和分辨率的可扩展性,简单快速,无需任何熵编码,因此非常适合于星载设备。实验结果表明,与一些最先进的算法相比,它具有更好的性能。 Space-borne equipments produce very big images while their capacities of storage, calculation and transmission are limited, so low-complexity image compression algorithms are necessary. In this paper, we develop an efficient image compression algorithm based on quadtree in wavelet domain for this mission. First, we propose an adaptive scanning order for quadtree, which traverses prior the neighbors of previous significant nodes from bottom to the top of quadtree, so that more significant coefficients are encoded at a specified bit rate. Second, we divide the entire wavelet image to several blocks and encode them individually. Because the distortion-rate usually decreases as the level of the quadtree increases with the adaptive scanning order, to control bit rate for each block, we set the points exactly after coding each level of the quadtree as the candidate truncation points. The proposed method can provide quality, position and resolution scalability, which is simple and fast without any entropy coding, so it is very suitable for space-borne equipments. Experimental results show that it attains better performance compared with some state-of-the-art algorithms.
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值