You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Such as func FindCoverageRate(bitmap, source_bitmap robotgo.CBitmap, tolerance float64, rate float64) (int, int)
bitmap => Needle 2x3
source_bitmap => Haystack 5x4
tolerance => 0.1
rate => 0.5, same as 50%
From the first w violent match, Until match four b, 4/6 > 50%, return (3, 1)
/* TODO: The above commented out code fails at certain edge cases, e.g.: * Needle: [B, b * b, b, * B, b] * Haystack: [w, w, w, w, w * w, w, w, w, b * w, w, w, b, b * w, w, w, w, b] * The previous algorithm noticed that the first 3 x 3 block had nothing * in common with the image, and thus, after scanning the first row, * skipped three blocks downward to scan the next (which didn't exist, * so the loop ended). However, the needle was hidden IN-BETWEEN this * jump -- skipping was appropriate for scanning the column but not * the row. * * I need to figure out a more optimal solution; temporarily I am just * scanning every single y coordinate, only skipping on x's. This * always works, but is probably not optimal. */
Such as
func FindCoverageRate(bitmap, source_bitmap robotgo.CBitmap, tolerance float64, rate float64) (int, int)
bitmap => Needle 2x3
source_bitmap => Haystack 5x4
tolerance => 0.1
rate => 0.5, same as 50%
From the first w violent match, Until match four b, 4/6 > 50%, return (3, 1)
/* TODO: The above commented out code fails at certain edge cases, e.g.:
The text was updated successfully, but these errors were encountered: