You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

寻求适用于16位多光谱图像的高压缩率无损压缩算法(Python)

16位无符号整数多光谱图像矩阵无损压缩需求

我需要对存储在numpy文件中的16位无符号整数多光谱图像矩阵进行无损压缩,现状及需求如下:

  • 已尝试Zip、Rar、Gzip、Deflate等经典压缩算法,压缩率仅约1.2,未达预期
  • 当前效果最优的是Jpeg2000,但希望找到压缩率至少为1.5的专用算法
  • 要求算法支持Python实现,无法自行定制开发算法

数据信息

  • 数据最小值:0,最大值:65536(疑似笔误,16位无符号整数理论最大值为65535)
  • 提供.npy和.txt格式的数据示例

当前Jpeg2000实现代码

import numpy as np 
from imagecodecs import (
    jpeg2k_encode, jpeg2k_decode, jpeg2k_check, jpeg2k_version, JPEG2K
)

array = np.load("data.npy")
compressed_channels = []

for channel in array:
    compressed_channel = jpeg2k_encode(channel, level=0)
    compressed_channels.append(compressed_channel)

np.save("data"+"_compressed.npy", compressed_channels)

compressed_channels = np.load("data"+"_compressed.npy")

decompressed_channels = []
for compressed_channel in compressed_channels:
    decompressed_channel = jpeg2k_decode(compressed_channel)
    decompressed_channels.append(decompressed_channel)

decoded = np.array(decompressed_channels)

compression_ratio = array.nbytes / sum(len(c) for c in compressed_channels)

print(np.array_equal(decoded, array))
print("Original array size (bytes):", array.nbytes)
print("Compressed array size (bytes):", sum(len(c) for c in compressed_channels))
print("Compression ratio:", compression_ratio)

np.save("data"+"_decompressed.npy", decoded)

内容的提问来源于stack exchange,提问作者Marco Lo Bartolo

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.07.27 06:32:06