use rgb for distance
This commit is contained in:
parent
e9ffb9f594
commit
0f482ac8c4
1 changed files with 1 additions and 1 deletions
|
@ -334,7 +334,7 @@ def average_volume(prefix, start=0, end=0):
|
|||
return 0
|
||||
|
||||
def get_distance(rgb0, rgb1):
|
||||
dst = math.sqrt(pow(rgb0[0] - rgb1[0], 2) + pow(rgb0[0] - rgb1[0], 2) + pow(rgb0[0] - rgb1[0], 2))
|
||||
dst = math.sqrt(pow(rgb0[0] - rgb1[0], 2) + pow(rgb0[1] - rgb1[1], 2) + pow(rgb0[2] - rgb1[2], 2))
|
||||
return dst / math.sqrt(3 * pow(255, 2))
|
||||
|
||||
|
||||
|
|
Loading…
Reference in a new issue