Python Image Processing (17): pyWavelet, pythonpywavelet
Happy shrimp
Http://blog.csdn.net/lights_joy/
Reprinted, but keep the author information
Next, I will try python to complete wavelet-related operations. This process can be completed through the pyWavelet library.
Main features of pyWavelet:
-1D, 2D Positive and Negative discrete wavelet transform (DWT, IDWT)
-1D, 2d steady-state wavelet Transform (SWT, StationaryWavelet Transform)
-1D, 2D wavelet packet decomposition and reconstruction
-Approximate wavelet functions and scale functions
-Over 70 built-in wavelet filters support custom wavelet filters
-Single and Double Precision support
-Usage similar to Matlab Wavelet Toolbox
PyWavelet can be installed directly by using the pip command.
Write a simple script and try 1D DWT:
# -*- coding: utf-8 -*- import numpy as npimport pywtimport matplotlib.pyplot as plt# dwtx = np.linspace(-5,5,100)y = np.sin(x)(cA, cD) = pywt.dwt(y, 'db1')plt.subplot(311)plt.plot(y)plt.subplot(312)plt.plot(cA)plt.subplot(313)plt.plot(cD)plt.show()
Check the running result:
Everything works.
Copyright Disclaimer: This article is an original article by the blogger and cannot be reproduced without the permission of the blogger.