前提・実現したいこと
pywtで離散ウェーブレット変換をしたい
発生している問題・エラーメッセージ
AttributeError Traceback (most recent call last) <ipython-input-15-34947a943c9a> in <module>() 14 titles = ['Approximation', ' Horizontal detail', 15 'Vertical detail', 'Diagonal detail'] ---> 16 coeffs2 = pywt.dwt2(original, 'bior1.3') 17 LL, (LH, HL, HH) = coeffs2 18 fig = plt.figure(figsize=(12, 3)) AttributeError: module 'pywt' has no attribute 'dwt2'
該当のソースコード
import numpy as np
import matplotlib.pyplot as plt
import pywt
import pywt.data
original = pywt.data.camera()
titles = ['Approximation', ' Horizontal detail',
'Vertical detail', 'Diagonal detail']
titles = ['Approximation', ' Horizontal detail',
'Vertical detail', 'Diagonal detail']
coeffs2 = pywt.dwt2(original, 'bior1.3')
LL, (LH, HL, HH) = coeffs2
fig = plt.figure(figsize=(12, 3))
for i, a in enumerate([LL, LH, HL, HH]):
ax = fig.add_subplot(1, 4, i + 1)
ax.imshow(a, interpolation="nearest", cmap=plt.cm.gray)
ax.set_title(titles[i], fontsize=10)
ax.set_xticks([])
ax.set_yticks([])
fig.tight_layout()
plt.show()
試したこと
DWTを行うときにエラーがでるのですが、実行にCコンパイラが必要ということでwindowsでvisualstudioをインストールしましたがうまくいきませんでした。
ネットで調べてもよく分からなかったのでどなたか詳しい解決策を教えていただけないでしょうか。
補足情報(FW/ツールのバージョンなど)
ここにより詳細な情報を記載してください。
回答1件
あなたの回答
tips
プレビュー