2
2
3
3
"""More documentation coming soon !"""
4
4
5
- import tkinter as tk
6
5
import numpy as np
7
6
from .cameraConfig import Camera_config
8
7
from .._global import OptionalModule
18
17
except (ModuleNotFoundError , ImportError ):
19
18
cv2 = OptionalModule ("opencv-python" )
20
19
20
+ try :
21
+ import tkinter as tk
22
+ except (ModuleNotFoundError , ImportError ):
23
+ tk = OptionalModule ("tkinter" )
24
+
21
25
22
26
class VE_config (Camera_config ):
23
27
def __init__ (self , camera , ve ):
@@ -54,7 +58,7 @@ def update_box(self, event):
54
58
def stop_select (self , event ):
55
59
self .ve .detect_spots (self .img [self .select_box [0 ]:self .select_box [2 ],
56
60
self .select_box [1 ]:self .select_box [3 ]],
57
- self .select_box [0 ], self .select_box [1 ])
61
+ self .select_box [0 ], self .select_box [1 ])
58
62
self .select_box = (- 1 , - 1 , - 1 , - 1 )
59
63
if hasattr (self .ve , "spot_list" ) and len (self .ve .spot_list ) > 0 :
60
64
self .boxes = [x ['bbox' ] for x in self .ve .spot_list ]
@@ -78,7 +82,7 @@ def draw_box(self, box, img):
78
82
79
83
def resize_img (self , sl ):
80
84
rimg = cv2 .resize (self .img8 [sl [1 ], sl [0 ]], tuple (reversed (self .img_shape )),
81
- interpolation = 0 )
85
+ interpolation = 0 )
82
86
if self .select_box [0 ] > 0 :
83
87
lbox = [0 ] * 4
84
88
for i in range (4 ):
0 commit comments