https://github.com/zrafa/imgfingerprint
https://github.com/zrafa/imgfingerprint
Last synced: 9 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/zrafa/imgfingerprint
- Owner: zrafa
- License: mit
- Created: 2024-07-23T23:12:27.000Z (almost 2 years ago)
- Default Branch: master
- Last Pushed: 2025-02-19T23:08:22.000Z (over 1 year ago)
- Last Synced: 2025-02-20T00:24:07.611Z (over 1 year ago)
- Language: C++
- Size: 22.4 MB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# imgfingerprint
This project tries to use a image hash for fingerprint location in an
orchard. We use the imgsim project as root of the software, so the license
is the one which imgsim has.
# Imgsim [](https://godoc.org/github.com/Nr90/imgsim) [](https://goreportcard.com/report/github.com/Nr90/imgsim) [](http://github.com/badges/stability-badges)
#
Imgsim is a library allows you to compute a fast perceptual hashes of an image. These hashes can then be used to compare images for similarity.
Similar looking images will get similar perceptual hashes. Unlike cryptographic hashes
that would be very different for images with slight differences.
This makes them suitable to compare how similar images are.
# Average hash #
An average hash is an example of a perceptual hash.
For an introduction see: [Average hash](http://www.hackerfactor.com/blog/?/archives/432-Looks-Like-It.html)
# Difference hash #
Difference hashes are said to be more resillient to changes in the image then the Average hash.
For an introduction see: [Difference hash](http://www.hackerfactor.com/blog/index.php?/archives/529-Kind-of-Like-That.html)
# Installation #
The package is go-gettable: `go get -u github.com/Nr90/imgsim`.
# Example #
```
package main
import (
"fmt"
"image/png"
"os"
"github.com/Nr90/imgsim"
)
func main() {
imgfile, err := os.Open("assets/gopher.png")
defer imgfile.Close()
if err != nil {
panic(err)
}
img, err := png.Decode(imgfile)
if err != nil {
panic(err)
}
ahash := imgsim.AverageHash(img)
fmt.Println(ahash)
dhash := imgsim.DifferenceHash(img)
fmt.Println(dhash)
}
```