Haar

This project provides a Golang implementation of the Haar 2D transform, following an approach similar to imgSeek. The library can generate image hashes for indexing and similarity search in iqdb.
[!WARNING]
Output from the Go package shows small deviations compared to the C reference.
This does not affect the final result, and all images are successfully found. Refer to tests for specifics.
Installation
go get github.com/ezh0v/haar
Quick Start
Create your .go file. For example: main.go.
package main
import (
"fmt"
"log"
"os"
"github.com/ezh0v/haar"
)
func main() {
image, err := os.ReadFile("your_image_file.jpg")
if err != nil {
log.Fatal(err)
}
signature, err := haar.SignatureFromBlob(image)
if err != nil {
log.Fatal(err)
}
fmt.Println(signature)
}
Run your program:
go run main.go
Motivation
Most booru sites need an image file to search. Danbooru can use an image's hash instead, which is much faster.