本文主要是介绍简单的基于小波变换的图像压缩(Python),希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
2023 沃尔夫数学奖得主,给了杜克大学的Ingrid Daubechies(多贝西)教授
以色列沃尔夫基金会理事会成员 Michael Lin 教授在周二宣布: “Ingrid Daubechies is awarded the Wolf Prize for her work in the creation and development of wavelet theory and modern time frequency analysis。"
多贝西教授在小波理论和调和分析领域做出了重大贡献,她的研究彻底改变了图像和信号的数字处理方式,为数据压缩提供了标准和灵活的算法。多贝西的研究成果带来了多个领域技术的创新,包括医学成像、无线通信,和数字电影,比如:她早期的研究成果被用于图像压缩,JPEG 2000格式图片就是通过Daubechies小波压缩而成,它们也被用于将声音序列压缩成 MP3 文件;在更近的一些应用领域中,它们被用于增强和重建哈勃望远镜早期的图像,检测伪造的文件和指纹等等。
import numpy as np
import matplotlib.pyplot as plt
import os
import cv2
import pywt
import pywt.data
from skimage.data import camera
from skimage.util import random_noise
from skimage import img_as_ubyte
from skimage.metrics import peak_signal_noise_ratio as psnr
print(pywt.wavelist())
['bior1.1', 'bior1.3', 'bior1.5', 'bior2.2', 'bior2.4', 'bior2.6', 'bior2.8', 'bior3.1', 'bior3.3', 'bior3.5', 'bior3.7', 'bior3.9', 'bior4.4', 'bior5.5', 'bior6.8', 'cgau1', 'cgau2', 'cgau3', 'cgau4', 'cgau5', 'cgau6', 'cgau7', 'cgau8', 'cmor', 'coif1', 'coif2', 'coif3', 'coif4', 'coif5', 'coif6', 'coif7', 'coif8', 'coif9', 'coif10', 'coif11', 'coif12', 'coif13', 'coif14', 'coif15', 'coif16', 'coif17', 'db1', 'db2', 'db3', 'db4', 'db5', 'db6', 'db7', 'db8', 'db9', 'db10', 'db11', 'db12', 'db13', 'db14', 'db15', 'db16', 'db17', 'db18', 'db19', 'db20', 'db21', 'db22', 'db23', 'db24', 'db25', 'db26', 'db27', 'db28', 'db29', 'db30', 'db31', 'db32', 'db33', 'db34', 'db35', 'db36', 'db37', 'db38', 'dmey', 'fbsp', 'gaus1', 'gaus2', 'gaus3', 'gaus4', 'gaus5', 'gaus6', 'gaus7', 'gaus8', 'haar', 'mexh', 'morl', 'rbio1.1', 'rbio1.3', 'rbio1.5', 'rbio2.2', 'rbio2.4', 'rbio2.6', 'rbio2.8', 'rbio3.1', 'rbio3.3', 'rbio3.5', 'rbio3.7', 'rbio3.9', 'rbio4.4', 'rbio5.5', 'rbio6.8', 'shan', 'sym2', 'sym3', 'sym4', 'sym5', 'sym6', 'sym7', 'sym8', 'sym9', 'sym10', 'sym11', 'sym12', 'sym13', 'sym14', 'sym15', 'sym16', 'sym17', 'sym18', 'sym19', 'sym20']
path = {'compressed_haar': 'wavelet_compression/compressed_haar.jpg', 'compressed_db1': 'C:/romena/unige/wavelet_compression/compressed_db1.jpg', 'compressed_db2': 'C:/romena/unige/wavelet_compression/compressed_db2.jpg', 'compressed_bior1.3': 'C:/romena/unige/wavelet_compression/compressed_bior1.3.jpg', 'noisy': 'C:/romena/unige/wavelet_compression/noisy.jpeg'}
for i in path:size_img= os.path.getsize(path[i])size_img= size_img/1024print(i +'='+ str(size_img) + 'KB')size_img= 0
Wavelet: haar, Threshold: 5, PSNR: 4.72 dB, CR: 1.16, Size: 71.64 KB
Wavelet: haar, Threshold: 10, PSNR: 4.72 dB, CR: 1.16, Size: 71.64 KB
Wavelet: haar, Threshold: 20, PSNR: 4.72 dB, CR: 1.16, Size: 71.64 KB
Wavelet: db1, Threshold: 5, PSNR: 4.72 dB, CR: 1.16, Size: 71.64 KB
Wavelet: db1, Threshold: 10, PSNR: 4.72 dB, CR: 1.16, Size: 71.64 KB
Wavelet: db1, Threshold: 20, PSNR: 4.72 dB, CR: 1.16, Size: 71.64 KB
Wavelet: db2, Threshold: 5, PSNR: 4.72 dB, CR: 1.05, Size: 78.92 KB
Wavelet: db2, Threshold: 10, PSNR: 4.72 dB, CR: 1.05, Size: 78.92 KB
Wavelet: db2, Threshold: 20, PSNR: 4.72 dB, CR: 1.05, Size: 78.92 KB
Wavelet: coif2, Threshold: 5, PSNR: 4.72 dB, CR: 1.22, Size: 67.99 KB
Wavelet: coif2, Threshold: 10, PSNR: 4.72 dB, CR: 1.22, Size: 67.99 KB
Wavelet: coif2, Threshold: 20, PSNR: 4.72 dB, CR: 1.22, Size: 67.99 KB
Wavelet: custom, Threshold: 5, PSNR: 4.69 dB, CR: 1.31, Size: 63.16 KB
Wavelet: custom, Threshold: 10, PSNR: 4.69 dB, CR: 1.31, Size: 63.16 KB
Wavelet: custom, Threshold: 20, PSNR: 4.69 dB, CR: 1.31, Size: 63.16 KB
担任《Mechanical System and Signal Processing》《中国电机工程学报》《控制与决策》等期刊审稿专家,擅长领域:现代信号处理,机器学习,深度学习,数字孪生,时间序列分析,设备缺陷检测、设备异常检测、设备智能故障诊断与健康管理PHM等。
这篇关于简单的基于小波变换的图像压缩(Python)的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!