Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Use diff for analyze screen shot #2

Open
potato4d opened this issue May 5, 2020 · 1 comment
Open

feat: Use diff for analyze screen shot #2

potato4d opened this issue May 5, 2020 · 1 comment
Labels
analyer enhancement New feature or request

Comments

@potato4d
Copy link
Owner

potato4d commented May 5, 2020

About

現状は Jimp の distanceFromHash を使って、画像のハッシュ同士の距離から類似度を推定しているが、これだけだと精度の面でいくつか課題があるため、指標を追加して対処したい。

現状のアプローチ

  1. 事前に png 画像として正しく完全にトリミングが終わった画像のハッシュを用意
  2. jpeg ノイズを考慮し、ある程度甘めに背景色の同一判定を行った上で、スクリーンショットを最低限のサイズでトリミング
  3. トリミングしたスクリーンショットの画像ハッシュを取得し、すべてのポケモン画像と比較
  4. 最も近似しているものを対象のポケモンとして設定

課題点

  • サニーゴとガラルサニーゴのような、完全に同じ見た目の種族違いを検出できない
    • マホイップなど、同じ種族で色が違う場合は誤検出しても本質的には問題がない

新たに行いたいアプローチ

  1. 事前に png 画像として正しく完全にトリミングが終わった画像のハッシュを用意
  2. jpeg ノイズを考慮し、ある程度甘めに背景色の同一判定を行った上で、スクリーンショットを最低限のサイズでトリミング
  3. トリミングしたスクリーンショットの画像ハッシュを取得し、すべてのポケモン画像と比較
  4. 最も近似しているものを対象のポケモンとして設定
  5. 近似しているものが複数ある場合、 Jimp の diff も合わせて行い、 percent によって最も近いポケモンを判定する。

課題点

  • 画像を bitmap 化したすべての情報が必要となるため、ファイルサイズ・実行時間ともに肥大化する
  • やるのであれば1,2,3位の類似度がどれも極端に高い場合などに限定したい
@potato4d potato4d added the enhancement New feature or request label May 5, 2020
@potato4d
Copy link
Owner Author

まずアス比を追加した。一部治ったが、まだインテレオンなど無理なやつがいる。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
analyer enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant