Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/octu0/wavelet
a simple wavelet
https://github.com/octu0/wavelet
golang haar-wavelet-tranforms wavelet-transform
Last synced: 5 days ago
JSON representation
a simple wavelet
- Host: GitHub
- URL: https://github.com/octu0/wavelet
- Owner: octu0
- License: mit
- Created: 2023-03-12T09:27:03.000Z (almost 2 years ago)
- Default Branch: master
- Last Pushed: 2023-04-28T09:56:50.000Z (over 1 year ago)
- Last Synced: 2024-11-08T00:44:44.701Z (about 2 months ago)
- Topics: golang, haar-wavelet-tranforms, wavelet-transform
- Language: Go
- Homepage:
- Size: 1.22 MB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# `wavelet`
simple wavelet implementation.
### Example
```go
package mainimport (
"math""github.com/octu0/wavelet"
)func main() {
high, low := wavelet.Haar([]float64{1.0, 2.0, 3.0, 4.0, 5.0, 8.0})
println(high) // => [2.12.., 4.94.., 9.19]
println(low) // => [-0.707.., -0.707.., -2.12..]out := wavelet.InverseHaar(high, low)
println(out) // => [0.999, 1.999, 3.000, 3.999, 5.000, 7.999]for i, v := range out {
out[i] = math.Ceil(v)
}
println(out) // => [1, 2, 3, 5, 8]
}
```### Example RGBA
An example of converting an image to an intermediate format is implemented in [_example](https://github.com/octu0/wavelet/tree/master/_example)
source image
| original | |
| :-----------: | :---------------------------------: |
| source | ![img](_example/src.png) |
| intermediate | ![img](_example/intermediate.png) |
| substract 55% | ![img](_example/substract_0.55.png) |
| substract 75% | ![img](_example/substract_0.75.png) |
| substract 85% | ![img](_example/substract_0.85.png) |
| substract 95% | ![img](_example/substract_0.95.png) |
| inverse | ![img](_example/inverse.png) |
| runlength-enc | 104KB |
| runlength-dec | ![img](_example/decoded.png) |# License
MIT, see LICENSE file for details.