https://github.com/simon987/fastimagehash
C/C++ replacement for the 'imagehash' python package
https://github.com/simon987/fastimagehash
fftw opencv perceptual-hashing wavelet-decomposition
Last synced: 7 months ago
JSON representation
C/C++ replacement for the 'imagehash' python package
- Host: GitHub
- URL: https://github.com/simon987/fastimagehash
- Owner: simon987
- License: gpl-3.0
- Created: 2019-12-25T13:54:57.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2023-06-12T01:13:48.000Z (over 2 years ago)
- Last Synced: 2024-07-30T19:49:59.529Z (about 1 year ago)
- Topics: fftw, opencv, perceptual-hashing, wavelet-decomposition
- Language: C++
- Homepage:
- Size: 11 MB
- Stars: 18
- Watchers: 4
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
## 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++.**See also:**
* [go bindings](https://github.com/simon987/fastimagehash-go)
(with *cgo*).
* [imagehash-web](https://github.com/simon987/imagehash-web) (Javascript version)
![]()
*[\*See all benchmarks](bench/README.md)*
### Example usage
```C
#includeint main() {
unsigned char result[HASH_SIZE];phash_file("image.jpeg", result, HASH_SIZE, HIGHFREQ_FACTOR);
}
```### Build from source
```bash
# Download dependencies
apt install libopencv-dev libfftw3-dev cmake# Checkout source
git clone --recursive https://github.com/simon987/fastimagehash# Build
cmake .
make# Install as a system library
sudo make install
```**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.