Not logged in.  Login/Logout/Register | List snippets | | Create snippet | Upload image | Upload data

15
LINES

< > BotCompany Repo | #1006913 // rgbRawImageSearch_searchHereFirst

JavaX fragment (include)

// similarity = e.g. 0.99f
static FoundImg rgbRawImageSearch_searchHereFirst(RGBImage big, RGBImage pat, float similarity, Pt searchHereFirst) {
  int wp = pat.getWidth(), hp = pat.getHeight();
  int w = big.getWidth(), h = big.getHeight();
  float maxError = (1f-similarity)*wp*hp;
  if (searchHereFirst != null) {
    float diff = rgbImageSectionsSimilarity(big, pat, searchHereFirst.x, searchHereFirst.y, maxError);
    if (diff <= maxError) {
      float sim = 1-diff/(wp*hp);
      ret new FoundImg(new Rect(searchHereFirst.x, searchHereFirst.y, wp, hp), sim);
    }
  }
  
  ret first(rgbRawImageSearch_quick(big, pat, similarity, 1));
}

Author comment

Began life as a copy of #1006802

download  show line numbers  debug dex  old transpilations   

Travelled to 13 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, gwrvuhgaqvyk, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tslmcundralx, tvejysmllsmz, vouqrxazstgt

No comments. add comment

Snippet ID: #1006913
Snippet name: rgbRawImageSearch_searchHereFirst
Eternal ID of this version: #1006913/3
Text MD5: 2c77fc3bf84a5eafdf52a4c38cb0ac23
Author: stefan
Category: javax / imaging
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2017-02-15 05:57:03
Source code size: 657 bytes / 15 lines
Pitched / IR pitched: No / No
Views / Downloads: 528 / 504
Version history: 2 change(s)
Referenced in: [show references]