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