✨
This commit is contained in:
@ -36,8 +36,6 @@ class Robot(object):
|
||||
while not self.serial_read.isOpen():
|
||||
sleep(1)
|
||||
|
||||
self._init_camera()
|
||||
|
||||
print("Waiting for serial port connection ...")
|
||||
sleep(2)
|
||||
|
||||
@ -73,13 +71,13 @@ class Robot(object):
|
||||
)
|
||||
)
|
||||
|
||||
self.cam = cv2.VideoCapture(
|
||||
return cv2.VideoCapture(
|
||||
gstreamer_pipeline(),
|
||||
apiPreference=cv2.CAP_GSTREAMER
|
||||
)
|
||||
|
||||
def take_photo(self):
|
||||
cap = cv2.VideoCapture(0)
|
||||
cap = self._init_camera()
|
||||
_, photo = cap.read()
|
||||
cap.release()
|
||||
return photo
|
||||
|
Reference in New Issue
Block a user