Skip to content
Snippets Groups Projects
Commit 7a6a97cf authored by Kinadinova Dariya's avatar Kinadinova Dariya
Browse files

is_col_close

parent 1a2b5696
Branches
No related tags found
No related merge requests found
......@@ -46,7 +46,6 @@ def avg_col(l:list) -> tuple():
avg3 = c3 // len(l)
return (avg1, avg2, avg3)
def list_col(im: Image, left_top: tuple(), right_bottom: tuple()) -> list[int]:
"""à_remplacer_par_ce_que_fait_la_fonction
......@@ -65,10 +64,20 @@ def is_col_close(color1: tuple(), color2: tuple()) -> bool:
returns False if the distance is more than 30
Précondition :
Exemple(s) :
$$$
Exemple(s) :
$$$ is_col_close((230, 210, 210), (236, 210, 211))
True
$$$ is_col_close((66, 135, 245), (103, 179, 82))
False
"""
if (abs(color1[0] - color2[0]) <= 30) and (abs(color1[1] - color2[1]) <= 30) and (abs(color1[2] - color2[2]) <= 30):
res = True
else:
res = False
return res
......
......@@ -9,4 +9,4 @@ cb1 = (0)
crop_rectangle = (0, (h//2), (w//2), h)
cropped_im = im.crop(crop_rectangle)
cropped_im.show()
\ No newline at end of file
print(cropped_im.size)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment