Skip to content

Issue using pywt.WaveletPacket2D #447

@HEIDIES

Description

@HEIDIES

Hello,
A coefficients size error occured on using reconstruct method of waveletpacket2d. My codes are:
original = pywt.data.camera()
wp = pywt.WaveletPacket2D(data=original, wavelet='db3', mode='smooth', maxlevel=3)
print(wp['aaa'].data.shape)
print(wp['aav'].data.shape)
print(wp['aah'].data.shape)
print(wp['aad'].data.shape)
wp.reconstruct()

And:

ValueError: coeffs must all be of equal size (or None)

Basically, since I used the coefficients of level 3 by path, these four coefficients would be the leaf nodes. The coefficients wp['aa'] would be reconstructed by wp['aaa'], wp['aav'], wp['aah'], and wp['aad'], and wp['av'], wp['ah'], wp['ad'] would still be the leaf nodes. But problem here is, the shape of wp['aa'] is not equal to either the shape of wp['av'], wp['ah'] or wp['ad'], the former one is reconstructed by its child nodes, and the latter three are directly decomposed from original image. Is there any shape conditions of using waveletpacket2d?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions