POJ1610 quad tree(数据结构)

这篇博客探讨了如何使用四叉树来存储和编码二值图像,并介绍了如何通过层次遍历四叉树得到二进制序列,最终转换为十六进制表示。通过实例解释了如何从图像构建四叉树并生成对应的编码。
摘要由CSDN通过智能技术生成

Quad Trees

Time Limit: 1000MS   Memory Limit: 10000K
Total Submissions: 1114   Accepted: 537

Description

A binary image, such as the one shown in Figure 2(a), is usually represented as an array of binary entries, i.e., each entry of the array has value 0 or 1. Figure 2(b) shows the array that represents the binary image in Figure 2(a). To store the binary image of Figure 2(b), the so-called quad tree partition is usually used. For an N * N array,N <= 512 and N = 2i for some positive integer i, if the entries do not have the same value, then it is partitioned into four N/2 * N/2 arrays, as shown in Figure 2(c). If an N/2*N/2 array does not have the same binary value, such as the upper right and 
lower right N/2*N/2 arrays in Figure 2(c), then we can divide it into four N/4*N/4 arrays again. These N/4*N/4 arrays in turn can also, if needed, be divided into four N/8 * N/8 arrays, etc.. The quad tree partition is completed when the whole array 
is partitioned into arrays of various size in which each array contains only one binary value. Figure 2(c) contains the arrays after the quad tree partition is completed. 
Instead of storing the binary image of Figure 2(a), we only need to store the quad tree in the form as Figure 2(d) which is encoded from Figure 2(c). In Figure

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值