go-cv icon indicating copy to clipboard operation
go-cv copied to clipboard

Computer Vision package in pure Go taking advantage of SIMD acceleration

go-cv

go-cv is a computer vision and image processing library for Go using Golang assembly. It is a works-in-progress wrapper around the Simd library. For now most work has been done on the SSE2 version.

SIMD

The Simd Library is a highly optimized image processing library. It provides many useful high performance algorithms for image processing such as:

  • pixel format conversion
  • image scaling and filtration
  • extraction of statistic information from images
  • motion detection
  • object detection (HAAR and LBP classifier cascades)
  • classification
  • neural network

The algorithms are optimized using different SIMD CPU extensions. In particular the library supports following CPU extensions:

  • x86/x64: SSE, SSE2, SSE3, SSSE3, SSE4.1, SSE4.2, AVX and AVX2
  • ARM: NEON

Installation

$ go get -u "github.com/fwessels/go-cv"

Samples

See the samples directory for various sample algorithms. For example:

$ cd samples
$ go run filtering.go

Performance compared to OpenCV 2.x

A comparison against go-opencv shows the following results:

                               OpenCV          SSE2
benchmark                   old ns/op     new ns/op      delta
BenchmarkGaussian-8             74338         18481    -75.14%
BenchmarkGaussianRGB-8         186024         57169    -69.27%
BenchmarkBlur-8                110155         16623    -84.91%
BenchmarkBlurRGB-8             293017         53716    -81.67%
BenchmarkMedian3x3-8           129268         23270    -82.00%
BenchmarkMedian3x3RGB-8        169857         65896    -61.21%
BenchmarkMedian5x5-8           883311        131812    -85.08%
BenchmarkMedian5x5RGB-8       1246845        388415    -68.85%

go-cv

See the underlying package go-cv for more information.

License

go-cv is released under the Apache License v2.0. You can find the complete text in the file LICENSE.