Update scan_screen image path, and while loop
This commit is contained in:
parent
7bc8b8391d
commit
faa729d680
|
@ -53,7 +53,9 @@ class ScanScreen(Screen):
|
||||||
if platform != "android":
|
if platform != "android":
|
||||||
import cv2
|
import cv2
|
||||||
cap = cv2.VideoCapture(0)
|
cap = cv2.VideoCapture(0)
|
||||||
while(cap.isOpened()):
|
# import pdb; pdb.set_trace()
|
||||||
|
is_cam_open = cap.isOpened()
|
||||||
|
while is_cam_open:
|
||||||
print('Camera is available!')
|
print('Camera is available!')
|
||||||
self.camera_avaialbe = True
|
self.camera_avaialbe = True
|
||||||
break
|
break
|
||||||
|
@ -77,7 +79,7 @@ class ScanScreen(Screen):
|
||||||
if not self.children:
|
if not self.children:
|
||||||
tmp = Builder.load_file(
|
tmp = Builder.load_file(
|
||||||
os.path.join(
|
os.path.join(
|
||||||
os.path.dirname(os.path.dirname(__file__)), "kv/{}.kv").format("scanner")
|
os.path.dirname(os.path.dirname(__file__)), "kv", "{}.kv").format("scanner")
|
||||||
)
|
)
|
||||||
self.add_widget(tmp)
|
self.add_widget(tmp)
|
||||||
if platform == "android":
|
if platform == "android":
|
||||||
|
@ -103,7 +105,6 @@ class ScanScreen(Screen):
|
||||||
self.xcam = self.children[0].ids.zbarcam.ids.xcamera
|
self.xcam = self.children[0].ids.zbarcam.ids.xcamera
|
||||||
if platform == "android":
|
if platform == "android":
|
||||||
self.xcam.play = True
|
self.xcam.play = True
|
||||||
|
|
||||||
else:
|
else:
|
||||||
Clock.schedule_once(self.open_cam, 0)
|
Clock.schedule_once(self.open_cam, 0)
|
||||||
|
|
||||||
|
|
Reference in New Issue
Block a user