|
| 1 | +# Image similarity estimation |
| 2 | + |
| 3 | +  |
| 4 | + |
| 5 | +本仓库提供基于ORB特征点的图像相似度估计。 |
| 6 | + |
| 7 | +English|[中文](./README.md) |
| 8 | + |
| 9 | +## Roadmap |
| 10 | + |
| 11 | + |
| 12 | + |
| 13 | +## Dependency |
| 14 | + |
| 15 | ++ python 3.7.16 |
| 16 | + |
| 17 | ++ numpy 1.21.6 |
| 18 | + |
| 19 | ++ opencv-python 4.7.0.72 |
| 20 | + |
| 21 | ++ matplotlib 3.5.3 |
| 22 | + |
| 23 | ++ pyinstaller 5.9.0 |
| 24 | + |
| 25 | +> test platform:Window10 x86_64 |
| 26 | +
|
| 27 | +## Results |
| 28 | + |
| 29 | +### sample image |
| 30 | + |
| 31 | +|sample1|sample2|sample3|sample4| |
| 32 | +|---|---|---|---| |
| 33 | +|<img src="./data/sample/sample1.png" height="150"/>|<img src="./data/sample/sample2.png" height="150"/>|<img src="./data/sample/sample3.png" height="150"/>|<img src="./data/sample/sample4.png" height="150"/>| |
| 34 | + |
| 35 | +### query image |
| 36 | + |
| 37 | +|col1|col2|col3|col4 |
| 38 | +|---|---|---|---| |
| 39 | +|<img src="./data/query/painting1.png" height="150"/>|<img src="./data/query/painting2.png" height="150"/>|<img src="./data/query/painting3.png" height="150"/>|<img src="./data/query/painting4.png" height="150"/>| |
| 40 | +|<img src="./data/query/painting5.png" height="150"/>|<img src="./data/query/painting6.png" height="150"/>|<img src="./data/query/painting7.png" height="150"/>|<img src="./data/query/painting8.png" height="150"/>| |
| 41 | +|<img src="./data/query/painting9.png" height="150"/>|<img src="./data/query/painting10.png" height="150"/>|<img src="./data/query/painting11.png" height="150"/>|<img src="./data/query/painting12.png" height="150"/>| |
| 42 | + |
| 43 | +### 结果与保存 |
| 44 | + |
| 45 | +> Take sample4 as an example |
| 46 | +
|
| 47 | ++ matches |
| 48 | + |
| 49 | + |
| 50 | + |
| 51 | ++ keypoints |
| 52 | + |
| 53 | + |
| 54 | + |
| 55 | ++ best match |
| 56 | + |
| 57 | +|sample|query|simlarity(%)| |
| 58 | +|---|---|---| |
| 59 | +|<img src="./data/sample/sample4.png" height="150"/>|<img src="./data/query/painting1.png" height="150"/>|27.00| |
| 60 | + |
| 61 | ++ The result is saved in the specified output path with the following structure: |
| 62 | + |
| 63 | +```text |
| 64 | +├─descriptors |
| 65 | +├─keypoints |
| 66 | +└─resize |
| 67 | +``` |
| 68 | + |
| 69 | +## Usage |
| 70 | + |
| 71 | +If you already have python enviroment, run by `py script` is recommended,otherwise run by `exe` is recommend. |
| 72 | + |
| 73 | +### using py scripts |
| 74 | + |
| 75 | ++ terminal/cmd navigate into project directory, then execute: |
| 76 | + |
| 77 | +```bat |
| 78 | +python .\main.py -s .\data\sample\sample4.png -q .\data\query\ -o .\output\ |
| 79 | +``` |
| 80 | + |
| 81 | ++ check help: |
| 82 | + |
| 83 | +```bat |
| 84 | +.\main.py -h |
| 85 | +``` |
| 86 | + |
| 87 | +### using exe |
| 88 | + |
| 89 | ++ terminal/cmd navigate into `app` and execute: |
| 90 | + |
| 91 | +```bat |
| 92 | +.\imageSim.exe -s ..\data\sample\sample4.png -q ..\data\query\ -o ..\output\ |
| 93 | +``` |
| 94 | + |
| 95 | +or directly run `run.bat` in terminal/cmd |
| 96 | + |
| 97 | +```bat |
| 98 | +.\run.bat |
| 99 | +``` |
| 100 | + |
| 101 | +## Package py scripts using pyinstaller(optional) |
| 102 | + |
| 103 | +If you need to modify the py script file, you need to use the pyinstaller package when packaging it again. |
| 104 | + |
| 105 | +[pyinstaller docs](https://pyinstaller.org/en/stable/index.html) |
| 106 | + |
| 107 | +After modification, run the 'createEXE.bat' file directly to generate the 'app' folder in the directory where the py script is located. The exe file is stored in 'app'. |
| 108 | + |
| 109 | +## Acknowledgements |
| 110 | + |
| 111 | +Thanks to adumrewal and whoisraibolt for opening source of their excellent work [SIFTImageSimilarity](https://github.com/adumrewal/SIFTImageSimilarity)and [Feature-Detection-and-Matching](https://github.com/whoisraibolt/Feature-Detection-and-Matching). |
0 commit comments