26 |
|
|
27 |
def checkAvgColor(x, y, w, h, color, delta=10): |
def checkAvgColor(x, y, w, h, color, delta=10): |
28 |
real = getAvgColor(x, y, w, h) |
real = getAvgColor(x, y, w, h) |
29 |
msg = str((color, real)) |
msg = str((color, real, ":", x, y, w, h)) |
30 |
|
|
31 |
for i in range(0,3): |
for i in range(0,3): |
32 |
if abs(color[i]-real[i]) > delta: |
if abs(color[i]-real[i]) > delta: |
35 |
|
|
36 |
def checkNotAvgColor(x, y, w, h, color, delta=10): |
def checkNotAvgColor(x, y, w, h, color, delta=10): |
37 |
real = getAvgColor(x, y, w, h) |
real = getAvgColor(x, y, w, h) |
38 |
msg = str((color, real)) |
msg = str((color, real, ":", x, y, w, h)) |
39 |
|
|
40 |
for i in range(0,3): |
for i in range(0,3): |
41 |
if abs(color[i]-real[i]) > delta: |
if abs(color[i]-real[i]) > delta: |