Print

发布时间: 2020-01-16
摘要点击次数:
全文下载次数:
DOI: 10.11834/jig.190162
2020 | Volume 25 | Number 1




    图像处理和编码    




  <<上一篇 




  下一篇>> 





嵌入广义树分类器的集合划分编码
expand article info 王卓1, 周生龙2, 田原1, 帅云开1, 李秋富3
1. 北京机电工程总体设计部, 北京 100854;
2. 火箭军驻航天科工307厂军代室, 南京 210006;
3. 北京理工大学, 北京 100081

摘要

目的 针对现有小波域图像集合划分编码(SPC)方法存在无损编码性能较弱的问题,设计广义树分类器,构建嵌入广义树分类器的集合划分编码方法(SPACS_C)。方法 针对已有SPC方法对坐标集合直接进行"先检测后划分"编码,存在当位平面降低导致数据之间相关性降低后位置比特和不必要比特数量急剧增大问题,SPACS_C对编码过程中产生的坐标集合分类处理,减少对坐标集合的显著性检测次数,从而降低位置比特的输出。SPACS_C对广义树分类处理利用图像小波系数的稀疏度随位平面降低而迅速降低的数据特点,对"先划分后检测"和"先检测后划分"两种方式所需的比特开销进行预测,选用比特开销较少的方式编码坐标集合,减少SPACS_C输出的位置比特数量。结果 采用不同统计特性和不同大小的可见光图像(8 bit)和红外图像(16 bit)测试SPACS_C,结果表明SPACS_C的无损编码性能优于JPEG 2000,特别是对红外图像的无损编码平均节省了3.1%的数据空间;性能接近或超过图像无损压缩标准JPEG-LS。结论 SPACS_C对坐标集合的分类处理利用小波域图像低层位平面稀疏度差的数据特点,有效减少位置比特输出,进而提高编码性能。与JPEG2000一样,SPACS_C可以实现图像质量的渐进式压缩。SPACS_C的编码不受图像数据动态范围的影响,可以对任意位深度的图像进行压缩编码。

关键词

集合划分编码; 分类器; 无损编码; 位置比特; 不必要比特

Set partition coding for embedding a generalized tree classifier
expand article info Wang Zhuo1, Zhou Shenglong2, Tian Yuan1, Shuai Yunkai1, Li Qiufu3
1. Beijing Mechanical & Electrical Overall Design Department, Beijing 100854, China;
2. The PLA Rocket Force Agency of 307 Factory, Nanjing 210006, China;
3. Beijing Institute of Technology, Beijing 100081, China

Abstract

Objective As a powerful image compression method, set partition coding (SPC) method effectively uses the correlation between the wavelet coefficients to obtain a higher data compression ratio, and it has been widely used for all types of image compression. The SPC method uses the idea of successive quantization approximation of the wavelet coefficient set, such as set partition coding system (SPACS), which partitions the coefficient set step-by-step to find significant coefficients and code them. A significance map was used to decide whether a set is significant, based on which set will be partitioned. If a set is significant, then SPC will output a location bit "1" and the set will be partitioned into 4 subsets; otherwise, the set is prepared for the next set coding operation. If set partition operations are conformable to the distribution of the insignificant coefficients, then location bits and unnecessary bits will be decreased. When the coefficient set is sparse, the SPC method can use fewer bits to encode the image. However, with the decrease of the bit plane, the sparseness of the coefficient set decreases, and the SPC method will waste many location and unnecessary bits, especially for lossless compression. To increase the lossless encoding performance of the set SPC method, we construct a set partition coding method that embeds a generalized tree classifier named SPACS_C. Method The previous SPC methods process all coordinate sets with "test before partition, " thereby increasing the number of location and unnecessary bits when the correlation between data decreases. SPACS_C calculates the bit costs of two different coding ways called "test before partition" and "partition before test" for each coordinate set. Then, it chooses the one with lower bit cost to process the set. The process method used in SPACS_C takes advantage of the data characteristics in which the sparseness of bottom bit-planes decrease rapidly in wavelet transformed images. SPACS_C performs the coding process in the domain of the wavelet transform of the image. Daubechies (4, 4) integer wavelet transform is used in this study. The level of wavelet transform is determined by the image size. For instance, a level of 5 is recommended for an image with a spatial size of 512×512. Similar to SPACS, a general tree (GT) is used to simultaneously represent the tree and square sets in the wavelet domain. The processing flow of SPACS_C is as follows:1)Initialization. Let the threshold n be most significant digit of the maximum of the wavelet coefficient and the list of significant points (LSP) be an empty list. Add all GTs into the list of insignificant points (LIP), where all GTs that have descendants are added into the list of insignificant sets (LIS). 2)Sorting pass. Perform the significant test for every entry ($i,j$) in LIP. If the result is positive, bit=1, add GT ($i,j$; 1) into LSP to output the sign of the root node coefficient, and then remove ($i,j$) from LIP. For every entry in LIS, conduct prediction to calculate the bit costs of the two different coding ways called "test before partition" and "partition before test". The bit costs are the mathematical expectation of the bits used in coding using the two methods. If "test before partition" uses less bits than "partition before test", then do "test before partition". Otherwise do "partition before test". If the result of the "test before partition" is positive, then the out location bit "1" moves to the corresponding GT from LIP to LSP and outputs the sign of the root node coefficient. For "partition before test", the executed partition is removed from LIS. Let List1 be the partition result of a GT in LIS. Perform a significant test for every entry in List1. If the result is positive, partition the list to obtain a new set List2, and then place all entries at the end of LIS. Otherwise, place the entries at LIS. 3)Refinement pass. For every entry in LSP, if type=0, output the $n$th most significant bit, whereas if type=1, update type=0.4)Threshold update. Let $n$=$n$-1 and return to sorting pass until n is equal to 0 to achieve a lossless compression. In SPACS_C, the significant test is performed by a significant test function, where for any element $c$ in a set $\mathit{\boldsymbol{c}}$, if $c$${2^n}$ and $c$ < ${2^{n + 1}}$, then $c$ is significantly relative to the threshold value ${2^n}$. Result Various visible and infrared images with different sizes, statistical properties, and bit depths were used to evaluate SPACS_C, and JPEG2000 and JPEG-LS were used for comparison. For SPACS_C, a 5-level Daubechies (4, 4) integer wavelet transform was used for decomposition. In addition, the wavelet coefficients were encoded. For infrared images with bit depths of 16 and 8 bits, the lossless encoding performance of SPACS_C was improved and became superior to that of JPEG 2000; an average of 3.1% less bits were used by the former. Notably, JPEG-LS can only be used for 8-bit image compression. For visible images with 8-bit depth, SPACS_C was superior to that of JPEG2000 and comparable with JPEG-LS. Unlike JPEG-LS, SPACS_C can provide a quality progressive code flow, which means that SPACS_C can also be used in loss compression and can stop coding when a limited bit rate is satisfied. SPACS_C can use part of the code stream to reconstruct the entire image, whereas JPEG-LS can only reconstruct part of the image. Conclusion The proposed method enhances the coding performance of SPC for lossless image compression by decreasing the output of location bit "1". Extensive experiment results show that the lossless compression performance of SPACS_C is better than that of JPEG2000 and comparable with JPEG-LS. The process mode used in SPACS_C suits the low sparseness in the bottom bit planes of wavelet-transformed images. Moreover, SPACS_C can progressively compress images such as JPEG2000. Unlike JPEG-LS, which can only compress images with 8-bit depth, SPACS_C can be used for images with any bit depth.

Key words

set partition coding(SPC); classifier; lossless encoding; location bit; unnecessary bit

0 引言

集合划分编码(SPC) (Pearlman和Said,2008aPearlman和Said,2008b)通过对坐标集合的循环检测划分,有效利用小波域图像的子带间相关性和子带内相关性,实现图像数据的高效压缩(李凤怡,2017)。

现有的SPC方法包含EZW(embedded zerotree wavelet)、SPIHT(set partitioning in hierarchical tree)(Said和Pearlman,1996方炫苏等,2018)、SPECK(set partitioning embedded block)(Pearlman等,2004)、SPACS(set partition coding system)(Li等,2016)等一系列重要方法。EZW、SPIHT等树形SPC(T-SPC)方法侧重于利用小波域图像的子带间相关性(Kim等,2018),SPIHT(Said和Pearlman,1996)是其中的典型代表,已广泛应用于高光谱图像(Christophe等,2008陈玉玲等,2018)、医学图像(Ntsama等,2016)等数据的压缩(Lee和Hung,2019Boukaache等,2018),以及数据加密技术领域(Yeh等,2013Lahdir等,2019)。SPECK等块状SPC(B-SPC)方法更侧重于利用小波域图像的子带内相关性,同样有着广泛的应用(Sudha和Sudhakar,2014Kidwai等,2016)。

为综合利用两种相关性,进一步提高编码效率,Li等人(2016)建立集合划分编码系统(SPACS),SPIHT和SPECK可视为SPACS的两个特例。Li等人(2016)还提出了位置比特、幅值比特、不必要比特的概念。对于同一图像的编码,不同SPC方法所需的幅值比特总相同,不同编码效率体现在所需位置比特和不必要比特的不同数量上。对同一图像的编码,SPACS相比于SPIHT和SPECK,以位置比特的较少增加为代价减少了更多的不必要比特。

根据Li等人(2016)的数值结果,由于小波域图像高层位平面表现出较强的子带间相关性和子带内相关性,因此在SPACS编码的初始阶段只需输出较少的位置比特和不必要比特。随着位平面降低,数据间相关性减弱,SPACS所需的位置比特和不必要比特的数量急剧增大。这使得SPACS对图像有损编码的高效性并未完全延伸到对图像的无损编码。

针对SPACS无损编码性能略弱的问题,本文设计广义树分类器,构建嵌入广义树分类器的集合划分编码方法SPACS_C。对数据进行分类处理也是图像压缩中的常用工具(李秋富等,2015孙鹏浩等,2017),SPACS_C对编码过程中产生的坐标集合分类处理,减少对坐标集合的显著性检测次数,从而降低位置比特的输出。文中采用不同图像测试SPACS_C,结果表明其无损编码性能不仅优于JPEG2000(刘敏慧,2018),且接近或超过图像无损压缩标准JPEG-LS(陈聪等,2018)。

1 算法构造

本节首先回顾Li等人(2016)的集合划分编码系统SPACS,然后为减少其比特输出,设计坐标集合分类器并将其嵌入SPACS,构建嵌入广义树分类器的集合划分编码方法SPACS_C。

1.1 SPACS

对于原图像$\mathit{\boldsymbol{X}}$,经${n_d}$层小波变换后,记其小波域图像矩阵为$\mathit{\boldsymbol{C}}$,这里$\mathit{\boldsymbol{X}}, \mathit{\boldsymbol{C}} \in {{\bf{R}}^{r \times l}}$,且设$r = l = {2^q}$。矩阵$\mathit{\boldsymbol{C}}$是低频子带$\mathit{\boldsymbol{LL}}$${n_d}$个高频子带${\mathit{\boldsymbol{B}}_{{n_d}}}, \cdots, {\mathit{\boldsymbol{B}}_2}, {\mathit{\boldsymbol{B}}_1}$的集合。对低频子带$\mathit{\boldsymbol{LL}}$进行坐标拆分,可得$q - {n_d} + 1$个虚拟子带(李秋富等,2015),即$\mathit{\boldsymbol{LL}} = \left\{ {{\mathit{\boldsymbol{B}}_{q + 1}}, {\mathit{\boldsymbol{B}}_q}, \cdots, {\mathit{\boldsymbol{B}}_{{n_d} + 1}}} \right\}$。在Li等人(2016)方法及本文中,$\mathit{\boldsymbol{C}}$的同一层上不同方向的3个子带,被视为1个子带,这与其他文献有所不同。

广义树是SPACS用到的特殊坐标集合。若$\mathit{\boldsymbol{Tree}}(i, j)$$\mathit{\boldsymbol{C}}$中以坐标$(i, j)$为根节点的四叉树形坐标集合,则广义树$\mathit{\boldsymbol{GT}}\left({i, j;{n_1}, {n_2}, {n_3}} \right)$$\mathit{\boldsymbol{Tree}}(i, j)$与子带${\mathit{\boldsymbol{B}}_{{n_3}}}, \cdots, {\mathit{\boldsymbol{B}}_{{n_2}}}$的交集,即

$ \mathit{\boldsymbol{GT}}\left({i, j;{n_1}, {n_2}, {n_3}} \right) = \mathit{\boldsymbol{Tree}}(i, j) \cap \left({\bigcup\limits_{n = {n_3}}^{{n_2}} {{\mathit{\boldsymbol{B}}_n}} } \right) $ (1)

式中,${n_1} = {n_{ij}}$表示坐标$(i, j)$所处的子带编号,而${n_1} - {n_2}$表示广义树的级数,且有${n_1} \ge {n_2} \ge {n_3}$

SPACS中有两个参数$k$$p$,它也记为SPACS$(k, p)$,其过程可分为初始化阶段(initialization)、分类排序阶段(sorting pass)和细化阶段(refinement pass)。

在初始化阶段,SPACS将$\mathit{\boldsymbol{C}}$的低频子带$\mathit{\boldsymbol{LL}}$拆分为${2^{2\left({q - {n_d}} \right)}}$个单点,并将其放入LIP列表;而将所有高频子带划分为$3 \times {2^{2\left({q - {n_d} - p} \right)}}$$p$级广义树为$\mathit{\boldsymbol{GT}}\left({i, j;{n_d} + p, {n_d}, 1} \right), (i, j) \in {\mathit{\boldsymbol{B}}_{{n_d} + p}}$并将它们放入LIS列表。单点和广义树均是系数集合。

初始化结束后,进入对LIP和LIS的分类排序阶段。这个阶段是对LIP中的单点集和LIS中的广义树集合进行显著性检测。对于某个坐标集合$\mathit{\boldsymbol{T}}$,其显著性检测函数为

$ {\mathit{\Gamma }_n}(\mathit{\boldsymbol{T}}) = \left\{ {\begin{array}{*{20}{l}} 1&{{2^n} \le \mathop {\max }\limits_{_{(i, j) \in T}} \left\{ {\left| {{c_{ij}}} \right|} \right\} < {2^{n + 1}}}\\ 0&其他 \end{array}} \right. $ (2)

若该函数输出1则称集合$\mathit{\boldsymbol{T}}$相对于阈值${2^n}$是显著的,否则是非显著的。显著性检测函数事实上是在确定小波域图像索引号为$n$的位平面在坐标集合$\mathit{\boldsymbol{T}}$确定的区域中是否包含1。

对LIS的分类排序过程中,若某个$\mathit{\boldsymbol{GT}}$是显著的,则划分该广义树,以细化其中显著系数的坐标位置。SPACS对显著广义树$\mathit{\boldsymbol{GT}}$有两种划分方式:Extract和Divide。Extract方法将$\mathit{\boldsymbol{GT}}\left({i, j;{n_1}, {n_2}, {n_3}} \right)$划分为

$ \begin{array}{l} \;\;\;\;\;\;\left\{ {\begin{array}{*{20}{l}} {\mathit{\boldsymbol{GT}}\left({{i^\prime }, {j^\prime };{n_1} - 1, {n_2}, {n_2}} \right)}\\ {\mathit{\boldsymbol{GT}}\left({i, j;{n_1}, {n_2} - 1, {n_3}} \right)} \end{array}} \right.\\ \left({{i^\prime }, {j^\prime }} \right) \in \mathit{\boldsymbol{GT}}\left({i, j;{n_1}, {n_1} - 1, {n_1} - 1} \right) \end{array} $ (3)

Divide方法将$\mathit{\boldsymbol{GT}}\left({i, j;{n_1}, {n_2}, {n_3}} \right)$划分为

$ \begin{array}{l} \;\;\;\;\;\;\mathit{\boldsymbol{GT}}\left({{i^\prime }, {j^\prime };{n_1} - 1, {n_2}, {n_3}} \right)\\ \left({{i^\prime }, {j^\prime }} \right) \in \mathit{\boldsymbol{GT}}\left({i, j;{n_1}, {n_1} - 1, {n_1} - 1} \right) \end{array} $ (4)

式中,当${n_2} = {n_3}$时,式(3)中的$\mathit{\boldsymbol{GT}}\left({i, j;{n_1}, {n_2} - 1} \right., \left. {{n_3}} \right)$不存在,此时Extract和Divide相同。

SPACS的另一个参数$k$控制对显著广义树使用哪种划分方式:若${n_1} - {n_2} < k$,则Extract,否则Divide。

在分类排序阶段过程中,会生成一些显著单点,SPACS将这些显著单点放入LSP列表。当SPACS确认LIS中的所有广义树都是非显著时,转入对LSP的细化阶段。细化阶段结束后,若还没达到SPACS算法停止条件,则将阈值减半,重复分类排序阶段和细化阶段过程。

1.2 算法分析

根据李秋富等人(2015)的定义,编码多元集显著性的比特称为位置比特,而编码显著单点和非显著单点的比特,分别称为幅值比特和不必要比特。

对于同一图像$\mathit{\boldsymbol{X}}$,相对于阈值${2^n}$,其小波域图像$\mathit{\boldsymbol{C}}$中的显著系数的个数是确定的,这意味着任何SPC方法对其编码所需的幅值比特的个数都是一样的。由于使用不同的集合类型和划分方式,不同SPC方法编码$\mathit{\boldsymbol{C}}$所需位置比特和不必要比特的个数是不同的。李秋富等人(2015)的数值结果显示,相比于经典的SPIHT和SPECK,SPACS以位置比特的较少增加为代价更大程度减少了不必要比特的输出。本文试图进一步降低SPACS编码时所需的位置比特个数。

位置比特是对LIS列表中广义树的显著性检测结果。对于$\mathit{\boldsymbol{GT}}\left({i, j;{n_1}, {n_2}, {n_3}} \right)$,位置比特为0表示它是不显著的,即$\mathit{\boldsymbol{GT}}$中不含显著单点。位置比特为1表示$\mathit{\boldsymbol{GT}}$中包含显著单点,需要将其划分以确定其中显著单点的具体位置。要在SPACS编码过程减少位置比特的消耗,就要避免对某些广义树进行显著性检测。为此,首先对广义树进行分类。

在同一阈值下,广义树被自然地分为非显著的和显著的两类,将这两类广义树构成的集合分别记为${\mathit{\boldsymbol{s}}_0}$${\mathit{\boldsymbol{s}}_1}$。本文在SPACS的编码过程中设置一个分类器$C$,在不使用检测函数(2)的条件下预测广义树的显著性,并依据预测结果将广义树归类于${{\mathit{\boldsymbol{\hat s}}}_0}$${{\mathit{\boldsymbol{\hat s}}}_1}$。将嵌入了广义树分类器的SPACS记为SPACS_C。

由于不使用检测函数式(2),分类器$C$的预测很可能存在错误。若$C$$\mathit{\boldsymbol{GT}}$预测为非显著的($\mathit{\boldsymbol{GT}} \in {{\mathit{\boldsymbol{\hat s}}}_0}$),SPACS_C无法确定$\mathit{\boldsymbol{GT}}$的真实显著性。为避免编码错误,对被归类于${{\mathit{\boldsymbol{\hat s}}}_0}$$\mathit{\boldsymbol{GT}}$仍使用式(2)确定其真实显著性,若显著则将其划分。即对被归类于${{\mathit{\boldsymbol{\hat s}}}_0}$的广义树,SPACS_C使用与SPACS相同的处理方式,称之为“先检测后划分”。

对于被分类器$C$预测为显著的广义树$\mathit{\boldsymbol{GT}}(\mathit{\boldsymbol{GT}} \in {{\mathit{\boldsymbol{\hat s}}}_1})$,可将其直接划分后检测其各子树的显著性。若$\mathit{\boldsymbol{GT}} \in {{\mathit{\boldsymbol{\hat s}}}_1} \cap {\mathit{\boldsymbol{s}}_1}$,则相比于SPACS,SPACS_C节省了一个位置比特1;若$\mathit{\boldsymbol{GT}} \in {{\mathit{\boldsymbol{\hat s}}}_1} \cap {\mathit{\boldsymbol{s}}_0}$,根据划分方式的不同,SPACS_C需要用4个或5个位置比特0,而SPACS只需要1个。将SPACS_C对${{\mathit{\boldsymbol{\hat s}}}_1}$中的广义树的处理方式称为“先划分后检测”。

1.3 分类器设计

SPACS_C的分类器应最大可能地减少比特开销。这要求SPACS_C在其编码进程中估计广义树$\mathit{\boldsymbol{GT}}$属于${\mathit{\boldsymbol{s}}_0}$${\mathit{\boldsymbol{s}}_1}$的概率,本文令$P\left({{\mathit{\boldsymbol{s}}_i}|\mathit{\boldsymbol{GT}}} \right)$表示$\mathit{\boldsymbol{GT}}$属于类${\mathit{\boldsymbol{s}}_i}$的概率。同时也需要考虑对$\mathit{\boldsymbol{GT}}$进行不同处理所需的比特开销。若$\mathit{\boldsymbol{GT}}$属于${\mathit{\boldsymbol{s}}_i}$,但分类器$C$将其归类于${{\mathit{\boldsymbol{\hat s}}}_j}$,记SPACS_C对$\mathit{\boldsymbol{GT}}$编码的比特开销为${L_{ij}}$,这里$i, j \in \{ 0, 1\} $。那么若将$\mathit{\boldsymbol{GT}}$归类为${{\mathit{\boldsymbol{\hat s}}}_j}$,SPACS_C对$\mathit{\boldsymbol{GT}}$编码所需的平均比特开销为

$ \begin{array}{l} \;\;\;\;\;\;\;\;\;\;\;\;\;\;\;\;\;\;\;\;\;{r_j}(\mathit{\boldsymbol{GT}}) = \\ {L_{0j}}P\left({{\mathit{\boldsymbol{s}}_0}|\mathit{\boldsymbol{GT}}} \right) + {L_{1j}}P\left({{\mathit{\boldsymbol{s}}_1}|\mathit{\boldsymbol{GT}}} \right), j \in \{ 0, 1\} \end{array} $ (5)

自然地,为了节省比特开销,若

$ {r_j}(\mathit{\boldsymbol{GT}}) = \min \left\{ {{r_0}(\mathit{\boldsymbol{GT}}), {r_1}(\mathit{\boldsymbol{GT}})} \right\} $ (6)

分类器$\mathit{\boldsymbol{C}}$$\mathit{\boldsymbol{GT}}$归类于${{\mathit{\boldsymbol{\hat s}}}_j}$。对于某个$\mathit{\boldsymbol{GT}}$,要使用式(6)对其归类,还需知道$P\left({{\mathit{\boldsymbol{s}}_i}|\mathit{\boldsymbol{GT}}} \right)$。记$\left({{n_1}, {n_2}, } \right.{\left. {{n_3}} \right)^{\rm{T}}}$为广义树$\mathit{\boldsymbol{GT}}\left({i, j;{n_1}, {n_2}, {n_3}} \right)$的环境向量,并将具有环境向量${\left({{n_1}, {n_2}, {n_3}} \right)^{\rm{T}}}$的所有广义树构成的集合记为$\mathit{\boldsymbol{S}}\left({{n_1}, {n_2}, {n_3}} \right)$。本文使用概率$P\left({{\mathit{\boldsymbol{s}}_i}|\mathit{\boldsymbol{S}}\left({{n_1}} \right.} \right., \left. {{n_2}, {n_3}} \right)$作为$P\left({{\mathit{\boldsymbol{s}}_i}|\mathit{\boldsymbol{GT}}} \right)$的估计值。

式(5)中还有4个参数${L_{ij}}, i, j = 0, 1$。对于${{\mathit{\boldsymbol{\hat s}}}_0}$中的广义树,SPACS_C对其“先检测后划分”。若$\mathit{\boldsymbol{GT}} \in {\mathit{\boldsymbol{s}}_0} \cap {{\mathit{\boldsymbol{\hat s}}}_0}$,SPACS_C只需检测其显著性,此时只输出一个位置比特0,即

$ {L_{00}} = 1 $ (7)

$\mathit{\boldsymbol{GT}} \in {\mathit{\boldsymbol{s}}_1} \cap {{\mathit{\boldsymbol{\hat s}}}_0}$,SPACS_C先检测并输出$\mathit{\boldsymbol{GT}}$的显著性,然后将$\mathit{\boldsymbol{GT}}$划分并逐个检测其子树的显著性;根据Extract和Divide的不同划分结果,即

$ {L_{10}} = \left\{ {\begin{array}{*{20}{l}} 6&{{n_1} - {n_2} < k且{n_3} > {n_2}}\\ 5&其他 \end{array}} \right. $ (8)

对于${{\mathit{\boldsymbol{\hat s}}}_1}$中的广义树,SPACS_C对其“先划分后检测”。即,若$\mathit{\boldsymbol{GT}} \in \left({{\mathit{\boldsymbol{s}}_0} \cup {\mathit{\boldsymbol{s}}_1}} \right) \cap {{\mathit{\boldsymbol{\hat s}}}_1}$,则SPACS_C直接将$\mathit{\boldsymbol{GT}}$划分为若干子树,并检测这些子树的显著性,即

$ {L_{01}} = {L_{11}} = \left\{ {\begin{array}{*{20}{l}} 5&{{n_1} - {n_2} < k且{n_3} > {n_2}}\\ 4&其他 \end{array}} \right. $ (9)

1.4 SPACS_C

将本节设计的广义树分类器嵌入李秋富等人(2015)的SPACS,构造SPACS_C。

SPACS_C($k$, $p$)

1) 初始化:输出$n = \left| {{{\log }_2}{{\max }_{(i, j)}}\left| {{c_{ij}}} \right|} \right|$;置LSP为空列表;对$\forall (i, j) \in \mathit{\boldsymbol{LL}}$,将$(i, j)$加入LIP;对$\forall (i, j) \in {\mathit{\boldsymbol{B}}_{q + 1}}$,将$\left({i, j;{n_d} + p, {n_d}, 1} \right)$加入LIS。

2) 排序阶段:

(1) 对LIP中每个$(i, j)$

输出$bit = {\mathit{\Gamma }_n}(i, j)$

$bit = 1$,将$(i, j, 1)$放入LSP,并输出${c_{ij}}$的正负号,且将$(i, j)$从LIP移除

(2) 对LIS中的每个$\left({i, j;{n_1}, {n_2}, {n_3}} \right)$,它对应广义树$\mathit{\boldsymbol{GT}}\left({i, j;{n_1}, {n_2}, {n_3}} \right)$

按式(5)计算${r_0}(\mathit{\boldsymbol{GT}}), {r_1}(\mathit{\boldsymbol{GT}})$

${r_0}(\mathit{\boldsymbol{GT}}) \le {r_1}(\mathit{\boldsymbol{GT}})$

Test & Partition $\left({i, j;{n_1}, {n_2}, {n_3}} \right)$

${r_0}(\mathit{\boldsymbol{GT}}) > {r_1}(\mathit{\boldsymbol{GT}})$

Partition & Test $\left({i, j;{n_1}, {n_2}, {n_3}} \right)$

3) 细化阶段:对LSP中的每个条目$(i, j, type)$

(1) 若$\mathit{type }{\rm{ = 0}}$,输出$\left| {{c_{ij}}} \right|$的第$n$个最高显著位

(2) 若$\mathit{type }{\rm{ = 1}}$,置$\mathit{type }{\rm{ = 0}}$

4) 阈值更新:置$n = n - 1$,返回步骤2)。

子程序Test & Partition和Partition & Test的功能分别是对相应的广义树进行“先检测后划分”和“先划分后检测”处理,其伪代码如下:

Test & Partition $\left({i, j;{n_1}, {n_2}, {n_3}} \right)$

输出$bit = {\mathit{\Gamma }_n}\left({\mathit{\boldsymbol{GT}}\left({i, j;{n_1}, {n_2}, {n_3}} \right)} \right)$

$bit = 1$

令List = Partition $\left({i, j;{n_1}, {n_2}, {n_3}} \right)$

对于List中的每个条目$\left({{i^\prime }, {j^\prime };n_1^\prime, n_2^\prime, n_3^\prime } \right)$,将其加入列表LIS

$\left({i, j;{n_1}, {n_2}, {n_3}} \right)$从LIS移除。

Partition & Test$\left({i, j;{n_1}, {n_2}, {n_3}} \right)$

令List1 = Partition$\left({i, j;{n_1}, {n_2}, {n_3}} \right)$

对于List1中的每个条目$\left({{i^\prime }, {j^\prime };n_1^\prime, n_2^\prime, n_3^\prime } \right)$

输出$bit = {\mathit{\Gamma }_n}\left({\mathit{\boldsymbol{GT}}\left({{i^\prime }, {j^\prime };n_1^\prime, n_2^\prime, n_3^\prime } \right)} \right)$

$bit = 1$

令List2 = Partition$\left({{i^\prime }, {j^\prime };n_1^\prime, n_2^\prime, n_3^\prime } \right)$

对于L ist2中的每个条目$\left({{i^n}, {j^{\prime \prime }};n_1^{\prime \prime }, n_2^{\prime \prime }} \right., \left. {n_3^{\prime \prime }} \right)$,将其放到LIS末尾

$bit = 0$,将$\left({{i^\prime }, {j^\prime };n_1^\prime, n_2^\prime, n_3^\prime } \right)$插入LIS

$\left({i, j;{n_1}, {n_2}, {n_3}} \right)$从LIS移除。

子程序Partition的调用格式为List = Partition$\left({i, j;{n_1}, {n_2}, {n_3}} \right)$。Partition与李秋富等人(2015)在SPACS中用到的Process功能相似,它们均是将广义树$\mathit{\boldsymbol{GT}}\left({i, j;{n_1}, {n_2}, {n_3}} \right)$进行划分,不同的是Process将这些子树直接放入LIS,而Partition将它们放入临时列表List中。

2 实验仿真

为验证本文算法的有效性,使用SPACS_C对标准测试图像Lena、Barbara以及分别源自美国国家航空航天局、陆军夜视和电子传感局、Sandia实验室的可见光、红外、SAR图像进行无损编码仿真;标准测试图像大小为512×512像素,可见光、红外、SAR图像在实验仿真之前也均被转换为512×512像素,部分图像如图 1所示。除了红外图像数据为16位外,其他图像数据均为8位。实验仿真流程为:

图 1 部分测试图像
Fig. 1 Testing images((a) visible images; (b) infrared images; (c) SAR images)

1) 对原图像$\mathit{\boldsymbol{X}}$进行5层小波变换, 得到小波域图像$\mathit{\boldsymbol{C}}$,本文使用Daubechies(4, 4)整数小波;

2) 使用SPACS_C$(k, p)$对小波域图像$\mathit{\boldsymbol{C}}$进行编码,输出码流,记码流长度为$L$

3) 计算无损编码比特率$\mathit{rate} = \frac{L}{{512 \times 512}}$

根据论文约定,此时有$q = 9, {n_d} = 5$。SPACS_C中的参数$k, p$与SPACS中的这两个参数有相同的取值范围,那么根据Li等人(2016)的研究,此时参数$k, p$的取值范围分别为$k \in \{ p, p + 1, \cdots, p + 4\}, p \in \{ 1, 2, \cdots, 5\} $,即此时SPACS_C事实上对应着25个编码方法。在SPACS_C对小波域图像$\mathit{\boldsymbol{C}}$进行无损编码时,对输出码流进行了二次熵编码,熵编码方式与Sudha和Sudhakar(2014)的描述一致。

表 1列出了SPACS_C对Lena和Barbara的无损编码比特率结果,表 2给出了可见光图像Aerial、Washington DC,红外图像Cegr-hongwai和SAR图像MilitaryVehicles的数值结果;作为对比,表中也列出了图像压缩标准JPEG2000和图像无损压缩标准JPEG-LS的相应结果。

表 1 SPACS_C、JPEG2000、JPEG-LS对标准测试图像的无损编码性能比较
Table 1 Comparison of lossless coding performance of SPACS_C, JPEG2000 and JPEG-LS for standard test images

下载CSV
编码方法 Lena Barbara
$k$ $p$ $p$
1 2 3 4 5 1 2 3 4 5
SPACS_C 1 4.366 7 4.901 8
2 4.328 8 4.331 4 4.833 4 4.832 8
3 4.298 1 4.297 5 4.296 7 4.769 5 4.763 3 4.765 5
4 4.293 3 4.290 2 4.290 6 4.289 6 4.757 8 4.755 3 4.754 4 4.753 9
5 4.290 7 4.285 6 4.285 5 4.285 6 4.285 6 4.754 9 4.750 2 4.749 6 4.750 2 4.750 2
6 4.280 5 4.284 7 4.283 6 4.283 7 4.749 8 4.746 5 4.747 2 4.747 4
7 4.284 0 4.282 7 4.282 8 4.747 4 4.746 5 4.746 5
8 4.283 0 4.283 2 4.747 3 4.748 0
9 4.283 1 4.748 0
JPEG-LS 4.242 5 4.860 3
JPEG2000 4.317 0 4.786 4
注:加粗字体表示最优结果。

表 2 SPACS_C、JPEG2000、JPEG-LS对不同类型图像的无损编码性能比较
Table 2 Comparison of lossless coding performance of SPACS_C, JPEG2000 and JPEG-LS for different type of images

下载CSV
编码方法 Aerial Washington DC Cegr-hongwai MilitaryVehicles
SPACS_C(8, 4) 4.574 3 7.023 9 5.682 1 5.679 2
JPEG-LS 4.668 4 6.871 3 - 5.690 0
JPEG2000 4.637 4 7.144 0 5.850 1 5.750 5
注:加粗字体表示最优结果, “-”表示无数据。

表 1中可以发现,参数$k, p$取值较大时,SPACS_C能获得更好的无损编码性能。从表 1表 2可以发现,对任意类型图像的无损编码,SPACS_C的最优性能始终优于JPEG2000。本文还对500幅红外图像(16位数据)使用SPACS_C(8, 4)和JPEG2000进行无损编码仿真,二者的平均无损编码比特率分别为5.69 bit/像素和5.87 bit/像素,即SPACS(8, 4)相比于JPEG2000节省了3.1 %的数据空间。

除了图像Washington DC,SPACS_C对其他图像的无损编码性能接近或超过JPEG-LS的无损编码性能。相比于JPEG-LS,SPACS_C的优势在于它能输出质量渐进式码流,这意味着SPACS_C的编码过程可随时中止,其获得的部分码流仍能解码得到图像完整区域的数据,如图 2所示;JPEG-LS的码流是空间渐进式的,其部分码流只能解码得到图像部分区域的数据,而无法获知图像的整体结构等全局信息。此外,SPACS_C的编码不受图像数据动态范围的影响,对任意位深度的图像均能编码,而目前JPEG-LS仅能对8位图像编码。

图 2 SPACS_C渐进式压缩结果
Fig. 2 Progressive compression results of SPACS_C

3 结论

为了进一步提升小波域图像集合划分编码(SPC)方法的无损编码性能,本文在集合划分编码系统SPACS的基础上设计广义树坐标集合分类器,构建SPACS_C。分类器根据广义树显著或非显著的概率,预测“先划分后检测”和“先检测后划分”两种编码方式编码该广义树所需的比特开销,选用比特开销较少的方式。对广义树坐标集合的分类处理,能够降低SPACS_C编码所需的位置比特数量,提升了对图像的无损编码性能。对多种类型图像的无损编码仿真表明,SPACS_C的最优无损编码性能优于JPEG 2000,且对红外图像的无损编码平均节省3.1 %的数据空间。同时,对大部分图像的无损编码,SPACS_C的编码性能也接近或优于图像无损编码标准JPEG-LS。

虽然嵌入广义树分类器的SPACS_C有效提升了小波域图像的无损编码性能,但其对某些图像的无损编码相比于JPEG-LS的编码性能仍有差距,如对可见光图像Washington DC,针对此现象的改进值得进一步研究。

参考文献

  • Boukaache A, Doghmane N, Boudjehem D. 2018. New SPIHT-based algorithm for electrocardiogram signal compression. Journal of Mechanics in Medicine and Biology, 19(3): 1950005 [DOI:10.1142/S0219519419500052]
  • Chen C, Zhang X Q, Zhou S Y. 2018. Improvement and hardware implementation for bit rate control algorithm of JPEG-LS. Chinese Journal of Space Science, 38(6): 944-952 (陈聪, 张学全, 周盛雨. 2018. JPEG-LS码率控制算法改进及硬件实现. 空间科学学报, 38(6): 944-952) [DOI:10.11728/cjss2018.06.944]
  • Chen Y L, Yan J W, Ma L M. 2018. Compression method for hyperspectral images. Computer Engineering and Design, 39(3): 780-784 (陈玉玲, 闫敬文, 马丽梅. 2018. 高光谱图像压缩方法. 计算机工程与设计, 39(3): 780-784) [DOI:10.16208/j.issn1000-7024.2018.03.032]
  • Christophe E, Mailhes C, Duhamel P. 2008. Hyperspectral image compression:adapting SPIHT and EZW to anisotropic 3-D wavelet coding. IEEE Transactions on Image Processing, 17(12): 2334-2346 [DOI:10.1109/TIP.2008.2005824]
  • Fang X S, Huang Z C, Chen Y X. 2018. Research on Huffman algorithm based on PCA and SPIHT for image compression. Journal of Zhejiang University:Science Edition, 45(1): 54-59 (方炫苏, 黄樟灿, 陈亚雄. 2018. 基于主成分分析和分层树集合划分的Huffman算法图像压缩研究. 浙江大学学报:理学版, 45(1): 54-59) [DOI:10.3785/j.issn.1008-9497.2018.01-009]
  • Kidwai N R, Khan E, Reisslein M. 2016. ZM-SPECK:a fast and memoryless image coder for multimedia sensor networks. IEEE Sensors Journal, 16(8): 2575-2587 [DOI:10.1109/JSEN.2016.2519600]
  • Kim H, No A, Lee H J. 2018. SPIHT algorithm with adaptive selection of compression ratio depending on DWT coefficients. IEEE Transactions on Multimedia, 20(12): 3200-3211 [DOI:10.1109/TMM.2018.2832604]
  • Lahdir M, Hamiche H, Kassim S, Tahanout M. 2019. A novel robust compression-encryption of images based on SPIHT coding and fractional-order discrete-time chaotic system. Optics & Laser Technology, 109: 534-546 [DOI:10.1016/j.optlastec.2018.08.040]
  • Lee R C, Hung K C. 2019. New modified SPIHT algorithm for data compression system. Journal of Medical and Biological Engineering, 39(1): 18-26 [DOI:10.1007/s40846-018-0384-z]
  • Li F Y. 2017. Analysis and application of image compression technology in mobile internet. Xi'an: Xidian University (李凤怡. 2017. 移动互联网时代的图像压缩技术分析及应用探讨. 西安: 西安电子科技大学)
  • Li Q F, Chen D R, He G L, Feng H, Yang L X. 2015. Hyperspectral image compression algorithm with maximum error controlled based on clustering. Journal of Electronics & Information Technology, 37(2): 255-260 (李秋富, 谌德荣, 何光林, 冯辉, 杨柳心. 2015. 最大误差可控的高光谱图像聚类压缩算法. 电子与信息学报, 37(2): 255-260) [DOI:10.11999/JEIT140451]
  • Li Q F, Chen D R, Jiang W, Liu B T, Gong J L. 2016. Generalization of SPIHT:set partition coding system. IEEE Transactions on Image Processing, 25(2): 713-725 [DOI:10.1109/TIP.2015.2509253]
  • Liu M H. 2018. Design and implementation of the high frame rate image compression device loaded on rockets. Taiyuan: North University of China (刘敏慧. 2018. 箭载高帧频图像压缩装置设计与实现. 太原: 中北大学)
  • Ntsama E P, Colince W, Ele P. 2016. Comparison study of EMG signals compression by methods transform using vector quantization, SPIHT and arithmetic coding. SpringerPlus, 5: 444 [DOI:10.1186/s40064-016-2095-7]
  • Pearlman W A, Said A. 2008a. Image wavelet coding systems:part Ⅱ of set partition coding and image wavelet coding systems. Foundations and Trends in Signal Processing, 2(3): 181-246 [DOI:10.1561/2000000014]
  • Pearlman W A, Said A. 2008b. Set partition coding:part Ⅰ of set partition coding and image wavelet coding systems. Foundations and Trends in Signal Processing, 2(2): 95-180 [DOI:10.1561/2000000013]
  • Pearlman W A, Islam A, Nagaraj N, Said A. 2004. Efficient, low-complexity image coding with a set-partitioning embedded block coder. IEEE Transactions on Circuits and Systems for Video Technology, 14(11): 1219-1235 [DOI:10.1109/tcsvt.2004.835150]
  • Said A, Pearlman W A. 1996. A new, fast, and efficient image codec based on set partitioning in hierarchical trees. IEEE Transactions on Circuits and Systems for Video Technology, 6(3): 243-250 [DOI:10.1109/76.499834]
  • Sudha V, Sudhakar R. 2014. 3D multiwavelet based block coding algorithm for compression of volumetric medical images. International Journal of Imaging Systems and Technology, 24(2): 182-192 [DOI:10.1002/ima.22093]
  • Sun P H, Lan J L, Lu X Y, Ma T. 2017. Field-trimming compression model for rule set of packet classification. Journal of Electronics & Information Technology, 39(5): 1185-1192 (孙鹏浩, 兰巨龙, 陆肖元, 马腾. 2017. 一种基于匹配域裁剪的包分类规则集压缩方法. 电子与信息学报, 39(5): 1185-1192) [DOI:10.11999/JEIT160740]
  • Yeh H L, Gue S T, Tsai P, Shih W K. 2013. Wavelet bit-plane based data hiding for compressed images. AEU-International Journal of Electronics and Communications, 67(9): 808-815 [DOI:10.1016/j.aeue.2013.04.003]