Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
miyako committed Sep 8, 2019
1 parent 488636b commit b365f69
Showing 1 changed file with 10 additions and 54 deletions.
64 changes: 10 additions & 54 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,66 +1,22 @@
4d-plugin-phash
===============

This plugin is a 4D implementation of the [pHash] (http://www.phash.org/) open source perceptual hash library.
It can compute and compare the perceptual hashes of PNG, BMP and JPEG files.
You can use it, for example, to search similar images of different file types stored in your database.
Image hash based on [pHash](http://www.phash.org/).

##Platform
### Platform

| carbon | cocoa | win32 | win64 |
|:------:|:-----:|:---------:|:---------:|
|🆗|🚫|🆗|🆗|
||<img src="https://cloud.githubusercontent.com/assets/1725068/22371562/1b091f0a-e4db-11e6-8458-8653954a7cce.png" width="24" height="24" />|<img src="https://cloud.githubusercontent.com/assets/1725068/22371562/1b091f0a-e4db-11e6-8458-8653954a7cce.png" width="24" height="24" />|<img src="https://cloud.githubusercontent.com/assets/1725068/22371562/1b091f0a-e4db-11e6-8458-8653954a7cce.png" width="24" height="24" />|

Commands
---
### Version

```c
// --- Compute
PH_Compute_DCT
<img src="https://user-images.githubusercontent.com/1725068/41266195-ddf767b2-6e30-11e8-9d6b-2adf6a9f57a5.png" width="32" height="32" />

// --- Compare
PH_Compare_MH
PH_Compare_RADISH
PH_Compare_DCT
```
![preemption xx](https://user-images.githubusercontent.com/1725068/41327179-4e839948-6efd-11e8-982b-a670d511e04f.png)

__Note__: Audio and Video files are not supported.
#### Supported image formats

__Note__: If you create the PNG on Mac OS, make sure the "simple file" option is NOT used. Otherwise the hash value will be zero.

Examples
-------
```
$fileA:=Get 4D folder(Current Resources folder)+"2004Cogs.jpg"
$fileB:=Get 4D folder(Current Resources folder)+"2004Cogs.bmp"
$fileC:=Get 4D folder(Current Resources folder)+"2004Cogs.png"
$statusA:=PH Compute DCT ($fileA;$hashA)//3726390674172847513
$statusB:=PH Compute DCT ($fileB;$hashB)//3726390674172847513
$statusC:=PH Compute DCT ($fileC;$hashC)//3726390674172847513
$fileD:=Get 4D folder(Current Resources folder)+"4D-main.jpg"
$statusD:=PH Compute DCT ($fileD;$hashD)//2732728107267830226
$fileE:=Get 4D folder(Current Resources folder)+"4D-main.png"
$statusE:=PH Compute DCT ($fileE;$hashE)//2732728107267830226
$distance1:=PH Compare DCT ($hashA;$hashB)//0
$distance2:=PH Compare DCT ($hashA;$hashD)//26
$sigma:=1
$gamma:=1
$N:=180
$pcc:=0//peak of cross correlation
$pcc1:=PH Compare RADISH ($fileA;$fileB;$sigma;$gamma;$N)//0.9999931960446829526
$pcc2:=PH Compare RADISH ($fileA;$fileC;$sigma;$gamma;$N)//0.9999931960446829526
$pcc3:=PH Compare RADISH ($fileB;$fileC;$sigma;$gamma;$N)//1
$alpha:=2
$lvl:=1
$hamming_distance:=0
$hamming_distance1:=PH Compare MH ($fileA;$fileB;$alpha;$lvl)//0.01215277777777777797
$hamming_distance2:=PH Compare MH ($fileA;$fileC;$alpha;$lvl)//0.01215277777777777797
$hamming_distance3:=PH Compare MH ($fileB;$fileC;$alpha;$lvl)//0
```
* png
* jpeg
* tiff

0 comments on commit b365f69

Please sign in to comment.