https://github.com/hideack/phash-study
https://github.com/hideack/phash-study
Last synced: about 1 year ago
JSON representation
- Host: GitHub
- URL: https://github.com/hideack/phash-study
- Owner: hideack
- Created: 2015-03-12T23:22:38.000Z (over 11 years ago)
- Default Branch: master
- Last Pushed: 2017-05-07T02:48:58.000Z (about 9 years ago)
- Last Synced: 2025-03-30T19:51:18.583Z (over 1 year ago)
- Language: JavaScript
- Size: 1.39 MB
- Stars: 0
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# phash-study
## 実験1 同一画像の加工時の比較
- いくつかサンプル画像を用意して試してみる。利用した画像は ```samples``` 以下に置いてある。
- サンプル
- おなじみのlena画像を各種加工してみる
### 結果
| No | 画像 | ハッシュ値 | No.0とのハミング距離 |
|----|------|------------|----------------------|
|0 |  | c91cb262775a9800 | - |
|1 |  | c91cb262775a9800 | 0 |
|2 |  | c914b262775a9800 | 2 |
|3 |  | c98cb022375ad800 | 8 |
|4 |  | c9acb866635a9800 | 8 |
|5 |  | cb8cba66535a9800 | 8 |
|6 |  | dc69f7330287e000 | 34 |
### サンプルプログラム
```javascript
var pHash = require("phash");
var samples = [
"samples/lena.jpg",
"samples/lena-small.jpg",
"samples/lena-sepia.jpg",
"samples/lena-mosaic.jpg",
"samples/lena-cut.jpg",
"samples/lena-cut2.jpg",
"samples/lena-horizonal-flip.jpg"
];
var hash = [];
samples.forEach(function(sample) {
hash.push(pHash.imageHashSync(sample));
});
for(var i=0; i