0

I am trying to rewrite a matlab code to cpp and I still blocked with this line :

[c, l]=wavedec(S,4,'Dmey');

Is there something like that in opencv ? if someone have an idea about it try to share it with and thanks in advance.

toto01
  • 153
  • 1
  • 4
  • 12
  • 1
    Does this answer your question? [Wavelet transform in openCV](https://stackoverflow.com/questions/20071854/wavelet-transform-in-opencv) – pptaszni Jul 28 '20 at 15:33

1 Answers1

0

Maybe if you would integrate your codes with Python, then PyWavelet might be an option.

I'm seeing the function that you're looking for is in there. That function is called Discrete Meyer (Dmey). Not sure what you're planning to do with that though, maybe you're processing some images or something, but Dmey is OK, not very widely used. You might want to just find some GitHub codes and integrate to whatever you're doing to see if it would work first, and based on those you can also change the details of your currently posted function (might find something more efficient).


1-D wavelet decomposition (wavedec)

In your code, c and l stand for coefficients and level. You're passing level four with a Dmey function. If you'd have one dimensional data, the following map is how your decomposition would look like, roughly I guess:

enter image description here

There are usually two types of decomposition models that are being used in Wavelets, one is called packet which is similar to a Full Binary Tree, from architecture standpoint:

enter image description here

The other one, which is the one you're most likely using, is less computationally expensive, because it does not decompose both branches of a tree, if you will. It'd just do the mathematical decomposition in one branch of the tree. Maybe, these images would shed some lights:

1 D

enter image description here

2 D

enter image description here

Notes:

If you have a working model in MatLab, you might want to see the C/C++ Code Generation in MatLab, will automatically convert MatLab codes to C++.

References:

Images are from Wikipedia or mathworks.com

Emma
  • 27,428
  • 11
  • 44
  • 69