Libraryless. Click here for Pure Java version (2027L/13K).
1 | static double video_scoreRect_score(Rect expected, Rect guessed, double tolerance) { |
2 | if ((guessed == null) != (expected == null)) ret 0; |
3 | if (expected == null) ret 1; |
4 | ret clamp(1-doubleAverage( |
5 | ptDistance(rectCenter(guessed), rectCenter(expected)), |
6 | abs(guessed.w-expected.w), |
7 | abs(guessed.h-expected.h)) |
8 | /tolerance, 0, 1); |
9 | } |
Began life as a copy of #1019530
download show line numbers debug dex old transpilations
Travelled to 7 computer(s): bhatertpkbcr, cfunsshuasjs, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tvejysmllsmz, vouqrxazstgt
No comments. add comment
Snippet ID: | #1023109 |
Snippet name: | video_scoreRect_score - look at both coordinates. 0 = worst, 1 = best |
Eternal ID of this version: | #1023109/4 |
Text MD5: | 47c5fdae88ccd61115dfc609c00c45dc |
Transpilation MD5: | d51595c98c95d5d89791d9c62eed135e |
Author: | stefan |
Category: | javax / video |
Type: | JavaX fragment (include) |
Public (visible to everyone): | Yes |
Archived (hidden from active list): | No |
Created/modified: | 2019-08-25 15:51:16 |
Source code size: | 352 bytes / 9 lines |
Pitched / IR pitched: | No / No |
Views / Downloads: | 288 / 376 |
Version history: | 3 change(s) |
Referenced in: | [show references] |