项目作者: mdouchement

项目描述 :
A Fast Bilateral image filter for Golang
高级语言: Go
项目地址: git://github.com/mdouchement/bilateral.git
创建时间: 2018-02-27T18:50:56Z
项目社区:https://github.com/mdouchement/bilateral

开源协议:MIT License

下载


Fast Bilateral filter for Golang

GoDoc
Go Report Card
License

A FastBilateral filter is a non-linear, edge-preserving and noise-reducing
smoothing filter for images. The intensity value at each pixel in an image is
replaced by a weighted average of intensity values from nearby pixels.

Algorithm and implementation is based on http://people.csail.mit.edu/sparis/bf/

Please cite above paper for research purpose.

Original Filtered Luminance Filtered
original



filtered
SigmaSpace: 16
SigmaRange: 0.076 (auto)
Execution time 1.22s
luminance
SigmaSpace: 16
SigmaRange: 0.76 (auto)
Execution time 348.56ms
original



filtered
SigmaSpace: 16
SigmaRange: 0.092 (auto)
Execution time 21.66s
luminance
SigmaSpace: 16
SigmaRange: 0.76 (auto)
Execution time 347.69ms
  1. // Fast Bilateral
  2. bilateral.Auto(m)
  3. // Luminance Fast Bilateral
  4. luminance.Auto(m)

Requirements

  • Golang 1.7.x

Installation

  1. $ go get -u github.com/mdouchement/bilateral

Usage

  1. fi, _ := os.Open("input_path")
  2. defer fi.Close()
  3. m, _, _ := image.Decode(fi)
  4. start := time.Now()
  5. fbl := bilateral.New(m, 16, 0.1)
  6. fbl.Execute()
  7. m2 := fbl.ResultImage() // Or use `At(x, y)` func or just use `fbl` as an image.Image for chained treatments.
  8. fo, _ := os.Create("output_path")
  9. defer fo.Close()
  10. jpeg.Encode(fo, m2, &jpeg.Options{Quality: 100})

Full example

Licence

MIT. See the LICENSE for more details.

Contributing

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Launch linter (gometalinter --config=gometalinter.json ./...)
  4. Commit your changes (git commit -am 'Add some feature')
  5. Push to the branch (git push origin my-new-feature)
  6. Create new Pull Request