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
Allows you to manually select an image area using OpenCV. It is recommended to use this function if your project is on your computer, otherwise use select_area_with_ipywidget().
36
+
Allows you to manually select an image area using OpenCV.
37
+
It is recommended to use this function if your project is on your computer,
38
+
otherwise use select_area_with_ipywidget().
31
39
Parameters:
32
40
image (PIL.Image): The image from which to select an area.
33
41
Returns:
34
42
A tuple containing the LEFT, TOP, RIGHT, and BOTTOM coordinates of the selected area.
35
43
"""
36
44
37
-
importcv2ascv
38
-
importnumpyasnp
39
-
40
45
fullscreen_screenshot=ImageGrab.grab()
41
46
dw, dh=fullscreen_screenshot.size
42
47
@@ -100,7 +105,9 @@ def draw_selection_rectanlge(event, x, y, flags, param):
100
105
101
106
defselect_area_with_ipywidget(image):
102
107
"""
103
-
Allows you to manually select an image area using ipywidgets. It is recommended to use this function if your project is in Google Colab, Kaggle or other similar platform, otherwise use select_area_with_opencv().
108
+
Allows you to manually select an image area using ipywidgets.
109
+
It is recommended to use this function if your project is in Google Colab,
110
+
Kaggle or other similar platform, otherwise use select_area_with_opencv().
0 commit comments