diff --git a/README.md b/README.md index e69de29..52450ae 100644 --- a/README.md +++ b/README.md @@ -0,0 +1,41 @@ +## libfastimagehash + +[![CodeFactor](https://www.codefactor.io/repository/github/simon987/fastimagehash/badge/master)](https://www.codefactor.io/repository/github/simon987/fastimagehash/overview/master) +[![GitHub license](https://img.shields.io/github/license/simon987/fastimagehash)](https://github.com/simon987/fastimagehash/blob/master/LICENSE) + +*WIP: Not ready for production use!* + +`libfastimagehash` is a [imagehash](https://github.com/JohannesBuchner/imagehash/) +replacement for C/C++. + + +

+ +

+ +*[\*benchmarks](bench/)* + +### Example usage + +```C++ +#include "fastimagehash.h" + +int main() { + // TODO +} +``` + +### Build from source + +// TODO + +**Built with** +* [opencv](https://github.com/opencv) for image decoding & resizing +* [wavelib](https://github.com/rafat/wavelib) for wavelet decomposition in `whash` (With [additional CFLAGS](https://github.com/simon987/wavelib/commit/8d05b0b7321271b05365d3e89bfb0fd5a26d68a6)) +* [fftw3](http://fftw.org/) for DCT in `phash` +* [google/benchmark](https://github.com/google/benchmark) to measure performance + +**Disclaimer**: The methods used to compute the image hashes +are identical to the `imagehash` python library, however, due to +some slight differences in the way OpenCV vs Pillow images are resized, +the final image hashes are not always exactly the same. diff --git a/bench/README.md b/bench/README.md new file mode 100644 index 0000000..52e78ad --- /dev/null +++ b/bench/README.md @@ -0,0 +1,31 @@ + +To run the benchmarks: +```bash +python run.py +``` + +All benchmarks were ran with +``` +i7-7500U CPU @ 2.70GHz x 4 +gcc version 9.2.0 +Python 3.8.0 +imagehash 4.0 +fastimagehash v0.1 +``` + +### Results +**phash** +![phash_s](results/phash_small.png) +![phash_l](results/phash_large.png) + +**dhash** +![dhash_s](results/dhash_small.png) +![dhash_l](results/dhash_large.png) + +**whash** +![whash_s](results/whash_small.png) +![whash_l](results/whash_large.png) + +**ahash** +![ahash_s](results/ahash_small.png) +![ahash_l](results/ahash_large.png) diff --git a/bench/results/ahash_large.png b/bench/results/ahash_large.png new file mode 100644 index 0000000..7265a02 Binary files /dev/null and b/bench/results/ahash_large.png differ diff --git a/bench/results/ahash_small.png b/bench/results/ahash_small.png new file mode 100644 index 0000000..2799c31 Binary files /dev/null and b/bench/results/ahash_small.png differ diff --git a/bench/results/dhash_large.png b/bench/results/dhash_large.png new file mode 100644 index 0000000..2bacd25 Binary files /dev/null and b/bench/results/dhash_large.png differ diff --git a/bench/results/dhash_small.png b/bench/results/dhash_small.png new file mode 100644 index 0000000..1b1b173 Binary files /dev/null and b/bench/results/dhash_small.png differ diff --git a/bench/results/phash_large.png b/bench/results/phash_large.png new file mode 100644 index 0000000..6b546d8 Binary files /dev/null and b/bench/results/phash_large.png differ diff --git a/bench/results/phash_small.png b/bench/results/phash_small.png new file mode 100644 index 0000000..ec02dab Binary files /dev/null and b/bench/results/phash_small.png differ diff --git a/bench/results/whash_large.png b/bench/results/whash_large.png new file mode 100644 index 0000000..9e184df Binary files /dev/null and b/bench/results/whash_large.png differ diff --git a/bench/results/whash_small.png b/bench/results/whash_small.png new file mode 100644 index 0000000..f1eabc5 Binary files /dev/null and b/bench/results/whash_small.png differ