That is terrific, Ingo! I’m afraid I’m just too busy to take responsibility for another module at the moment, but I’d be glad to help test if you want to check this into github and/or register it with PAUSE/CPAN.
The bpp parameter controls lossy compression. The wavelet transform is only the first step in Vollmer’s code, which is a wavelet-based lossy compressor. The idea is to wavelet transform an image, then throw away both precision and also entire coefficients in the wavelet space, to achieve an approximate representation of the original image with much less storage space. The library does that by sorting the coefficients in a heuristic “importance” order, and keeping coefficients and precision until it reaches a certain number of bits per pixel of the original image. Everything else gets tossed from the compressed image. But I think you’re primarily interested in wavelet-transforming data, which involves writing a new binding to just the wavelet transform call in that library. Best, Craig > On Nov 2, 2015, at 12:41 PM, Ingo Schmid <[email protected]> wrote: > > > Hi Craig, > > I've added bindings to wavelet_transform and inverse_wavelet_transform and > thrown it into a rudimentary module. It was a fairly straight forward task. I > don't understand the bpp parameter, what does it mean? 0 or 1 seems to work > fine, most of the time. > > I think some of the variables in the c code need to be changed to the PDL > index type, to be safe, although a cast of int should always work, I guess. > Looking at the compiler output, there are a lot of warnings about that. I > haven't tried threading at all, yet. Just for testing purposes, there is a > wv_identity, that can be safely removed, if you like. > > make test ensures that the module loads, nothing more. > > Feel free to throw me off the authors list if you want to upload eventually, > I don't know if the Author field supports multiple names, but then it's just > a string. > > Thanks for the .pm file. > > Ingo > > On 10/27/2015 07:07 PM, Craig DeForest wrote: >> Here you go. It’s only 125k or so. I was mainly interested in wavelet >> compression, so those are the routines that are explicitly bound. >> But it’s a pretty short task to add the lines to get at the wavelet >> transform itself. Vollmer’s C code is included in the .pm file. >> >> Enjoy! >> >> >> >> >> >>> On Oct 27, 2015, at 11:40 AM, Craig DeForest <[email protected] >>> <mailto:[email protected]>> wrote: >>> >>> The FFTW3 library has DCTs in it, but the current PDL module PDL::FFTW3 >>> does not bind to them. You could add the bindings yourself (with either >>> my or Dima’s help if you want), or just use the FFT >>> itself. The latter is simple since you can just Fourier transform a padded >>> version of your data with the correct boundary conditions. >>> >>> If you want wavelet stuff, I have a binding to Daniel Vollmer’s wavelet >>> compression library that I could send you. That has a wavelet transform in >>> it, and you can choose >>> your mother wavelet (I think it implements Haar and Morlet mother >>> wavelets). I used the library for some stuff, but never got around to >>> making it publication quality. >>> >>> Cheers, >>> Craig >>> >>> >>> >>> >>> >>> http://www.fftw.org/doc/1d-Real_002deven-DFTs-_0028DCTs_0029.html >>> <http://www.fftw.org/doc/1d-Real_002deven-DFTs-_0028DCTs_0029.html> >>> >>> >>>> On Oct 27, 2015, at 10:37 AM, Ingo Schmid <[email protected] >>>> <mailto:[email protected]>> wrote: >>>> >>>> Hi, >>>> >>>> I'd like to experiment with either discrete cosine transforms or wavelet >>>> transforms. Are there any implementations in PDL? >>>> >>>> Ingo >>>> ------------------------------------------------------------------------------ >>>> _______________________________________________ >>>> pdl-general mailing list >>>> [email protected] >>>> <mailto:[email protected]> >>>> https://lists.sourceforge.net/lists/listinfo/pdl-general >>>> <https://lists.sourceforge.net/lists/listinfo/pdl-general> >>> >> > > <PDL-Wavelet-0.001.tar.gz>
------------------------------------------------------------------------------
_______________________________________________ pdl-general mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/pdl-general
