add readme
							
								
								
									
										41
									
								
								README.md
									
									
									
									
									
								
							
							
						
						@ -0,0 +1,41 @@
 | 
			
		||||
## libfastimagehash
 | 
			
		||||
 | 
			
		||||
[](https://www.codefactor.io/repository/github/simon987/fastimagehash/overview/master)
 | 
			
		||||
[](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++.
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
<p align="center">
 | 
			
		||||
  <img src="bench/results/phash_large.png"/>
 | 
			
		||||
</p>
 | 
			
		||||
 | 
			
		||||
*[\*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. 
 | 
			
		||||
							
								
								
									
										31
									
								
								bench/README.md
									
									
									
									
									
										Normal file
									
								
							
							
						
						@ -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**
 | 
			
		||||

 | 
			
		||||

 | 
			
		||||
 | 
			
		||||
**dhash**
 | 
			
		||||

 | 
			
		||||

 | 
			
		||||
 | 
			
		||||
**whash**
 | 
			
		||||

 | 
			
		||||

 | 
			
		||||
 | 
			
		||||
**ahash**
 | 
			
		||||

 | 
			
		||||

 | 
			
		||||
							
								
								
									
										
											BIN
										
									
								
								bench/results/ahash_large.png
									
									
									
									
									
										Normal file
									
								
							
							
						
						| 
		 After Width: | Height: | Size: 12 KiB  | 
							
								
								
									
										
											BIN
										
									
								
								bench/results/ahash_small.png
									
									
									
									
									
										Normal file
									
								
							
							
						
						| 
		 After Width: | Height: | Size: 14 KiB  | 
							
								
								
									
										
											BIN
										
									
								
								bench/results/dhash_large.png
									
									
									
									
									
										Normal file
									
								
							
							
						
						| 
		 After Width: | Height: | Size: 14 KiB  | 
							
								
								
									
										
											BIN
										
									
								
								bench/results/dhash_small.png
									
									
									
									
									
										Normal file
									
								
							
							
						
						| 
		 After Width: | Height: | Size: 11 KiB  | 
							
								
								
									
										
											BIN
										
									
								
								bench/results/phash_large.png
									
									
									
									
									
										Normal file
									
								
							
							
						
						| 
		 After Width: | Height: | Size: 14 KiB  | 
							
								
								
									
										
											BIN
										
									
								
								bench/results/phash_small.png
									
									
									
									
									
										Normal file
									
								
							
							
						
						| 
		 After Width: | Height: | Size: 12 KiB  | 
							
								
								
									
										
											BIN
										
									
								
								bench/results/whash_large.png
									
									
									
									
									
										Normal file
									
								
							
							
						
						| 
		 After Width: | Height: | Size: 15 KiB  | 
							
								
								
									
										
											BIN
										
									
								
								bench/results/whash_small.png
									
									
									
									
									
										Normal file
									
								
							
							
						
						| 
		 After Width: | Height: | Size: 13 KiB  |