card-recog-demo/README.md
2026-07-14 22:51:07 -07:00

27 lines
812 B
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# Card Scan Demo
拍照 / 选图 → **预览页** ML Kit 边框锁定 → 裁剪纠偏 → **rgb-phash-v1 本地比对** → 看结果。
拍照页只显示引导框不做实时检测。pHash 使用 vendored C++`native/phash`)经 `dart:ffi` 调用,图库为 `data/hashes.json`
完整说明(对照集换社反编译分析):[docs/demo说明.md](docs/demo说明.md)
## 运行
```bash
export PATH="$HOME/flutter/bin:$PATH"
cd /Users/a1518/Desktop/project/card-dex-demo
flutter pub get
flutter run
```
## 本地 pHash 脚本
```bash
export PATH="$HOME/flutter/bin:$PATH" # dart 随 Flutter SDK 提供
cmake -S native/phash -B native/phash/build -DPHASH_BUILD_SHARED=ON
cmake --build native/phash/build
dart run tool/hashgen.dart
dart run tool/match.dart --image test_assets/30892.jpg
```