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

12
LINES

< > BotCompany Repo | #1007101 // rgbRawImageSearch_searchHereOnly

JavaX fragment (include)

1  
// similarity = e.g. 0.99f
2  
static FoundImg rgbRawImageSearch_searchHereOnly(RGBImage big, RGBImage pat, float similarity, Pt searchHereOnly) {
3  
  int wp = pat.getWidth(), hp = pat.getHeight();
4  
  int w = big.getWidth(), h = big.getHeight();
5  
  float maxError = (1f-similarity)*wp*hp;
6  
  float diff = rgbImageSectionsSimilarity(big, pat, searchHereOnly.x, searchHereOnly.y, maxError);
7  
  if (diff <= maxError) {
8  
    float sim = 1-diff/(wp*hp);
9  
    ret new FoundImg(new Rect(searchHereOnly.x, searchHereOnly.y, wp, hp), sim);
10  
  }
11  
  null;
12  
}

Author comment

Began life as a copy of #1006913

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: #1007101
Snippet name: rgbRawImageSearch_searchHereOnly
Eternal ID of this version: #1007101/3
Text MD5: 15eec31de72e03ea16ea78a365e18088
Author: stefan
Category: javax / imaging
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2017-03-03 01:17:35
Source code size: 543 bytes / 12 lines
Pitched / IR pitched: No / No
Views / Downloads: 440 / 486
Version history: 2 change(s)
Referenced in: [show references]