有效压缩具有多个焦平面的图像的方法

时间:2015-12-23 14:26:15

标签: image compression focus image-compression video-codecs

我正在开发一个应用程序,在这个应用程序中,不同焦平面上的图像被获取并且当前存储在多页面tif中。不幸的是,基于tif的压缩技术没有 效益 来自不同焦平面上的信号冗余。

我找到了一些有关此事的资源 这里 ZPEG 和这里 JPEG2000 Addon

不幸的是,他们都远离标准。

我想知道在这种情况下是否可能有一个视频编解码器可以实现很高的压缩率?

我也非常开放其他任何想法。

2 个答案:

答案 0 :(得分:1)

这是一种不同的方法:将跨平面冗余转换为空间冗余,然后使用标准图像压缩。

用最简单的方法,从每个平面上取出宽度为* 1像素的条带,然后叠加它们。作为一个图像,它将以一种奇怪的方式垂直涂抹。最好是与DCT块(如果适用)对齐,以避免通过块有一个尖锐的水平边缘,因此它应该通过复制一个平面填充到多个(通常)8个平面。你可以通过优化填充以获得最小能量来获得更多,但这很复杂,而重复已经非常好而且微不足道。

使用未经过滤的无损压缩显然不能很好地压缩,但是带有合适滤波器(up,average或paeth)的PNG应该可以工作。

答案 1 :(得分:1)

tiff的问题在于它不支持其基线中的组件间去相关。有一些扩展(不是非常广泛支持)允许存储其他文件压缩格式(例如完整的JPEG2000 JP2文件,扩展名0x8798),但不能保证标准解码器将正确处理它。

如果你可以使用你想要的任何工具,可以通过良好的光谱去相关变换(KLT用于有损压缩和RKLT用于无损压缩)获得接近最佳编码性能 - 请参阅http://gici.uab.cat/GiciWebPage/downloads.php#spectral以获得JAVA实现这些转换)然后是一个很好的压缩算法,如JPEG2000。另一方面,这种方法实现起来有点复杂,并且由于KLT / RKLT变换而变慢。

其他更简单的方法是简单地使用JPEG2000和DWT进行光谱去相关。例如,如果您使用Kakadu实现(kakadusoftware.com),则只需在压缩时使用适当的参数。这里有一个从http://kakadusoftware.com/wp-content/uploads/2014/06/Usage_Examples.txt

中提取的示例调用
Ai) kdu_compress -i catscan.rawl*35@524288 -o catscan.jpx -jpx_layers *
             -jpx_space sLUM Creversible=yes Sdims={512,512} Clayers=16
             Mcomponents=35  Msigned=no  Mprecision=12
             Sprecision=12,12,12,12,12,13  Ssigned=no,no,no,no,no,yes
             Mvector_size:I4=35 Mvector_coeffs:I4=2048
             Mstage_inputs:I25={0,34}  Mstage_outputs:I25={0,34}
             Mstage_collections:I25={35,35}
             Mstage_xforms:I25={DWT,1,4,3,0}
             Mnum_stages=1  Mstages=25
-- Compresses a medical volume consisting of 35 slices, each 512x512,
   represented in raw little-endian format with 12-bits per sample,
   packed into 2 bytes per sample.  This example follows example (x)
   above, but adds a multi-component transform, which is implemented
   using a 3 level DWT, based on the 5/3 reversible kernel (the kernel-id
   is 1, which is found in the second field of the `Mstage_xforms' record.

-- To decode the above parameter attributes, note that:

   a) There is only one multi-component transform stage, whose instance

      index is 25 (this is the I25 suffix found on the descriptive

      attributes for this stage).  The value 25 is entirely  arbitrary.  I

      picked it to make things interesting.  There can, in general, be

      any number of transform stages.

   b) The single transform stage consists of only one transform block,

      defined by the `Mstage_xforms:I25' attribute -- there can be

      any number of transform blocks, in general.

   c) This block takes 35 input components and produces 35 output

      components, as indicated by the `Mstage_collections:I25' attribute.

   d) The stage inputs and stage outputs are not permuted in this example;

      they are enumerated as 0-34 in each case, as given by the

      `Mstage_inputs:I25' and `Mstage_outputs:I25' attributes.

   e) The transform block itself is implemented using a DWT, whose kernel

      ID is 1 (this is the Part-1 5/3 reversible DWT kernel).  Block

      outputs are added to the offset vector whose instance index is 4

      (as given by `Mvector_size:I4' and `Mvector_coeffs:I4') and the

      DWT has 3 levels.  The final field in the `Mstage_xforms' record

      is set to 0, meaning that the canvas origin for the multi-component

      DWT is to be taken as 0.

   f) Since a multi-component transform is being used, the precision

      and signed/unsigned properties of the final decompressed (or

      original compressed) image components are given by `Mprecision'

      and `Msigned', while their number is given by `Mcomponents'.

   g) The `Sprecision' and `Ssigned' attributes record the precision

      and signed/unsigned characteristics of what we call the codestream

      components -- i.e., the components which are obtained by block

      decoding and spatial inverse wavelet transformation.  In this

      case, the first 5 are low-pass subband components, at the bottom

      of the DWT tree; the next 4 are high-pass subband components

      from level 3; then come 9 high-pass components from level 2 of

      the DWT; and finally the 17 high-pass components belonging to

      the first DWT level.  DWT normalization conventions for both

      reversible and irreversible multi-component transforms dictate

      that all high-pass subbands have a passband gain of 2, while

      low-pass subbands have a passband gain of 1.  This is why all

      but the first 5 `Sprecision' values have an extra bit -- remember

      that missing entries in the `Sprecision' and `Ssigned' arrays

      are obtained by replicating the last supplied value.