Closed avesk closed 3 years ago
This feature depends on https://github.com/uvic-aero/onboard-computer/issues/38
Vision.py will capture images with the piCam in order to algorithmically determine a vector for the vehicle's trajectory.
The logic for image capturing will live within apps/Vision/Capture.py.
apps/Vision/Capture.py
Write a class method called capture() which accepts a boolean value, use_picam, for whether to use PiCam or the default camera (your webcam).
capture()
use_picam
PiCam
The method should conditionally use cv2.VideoCapture(0) or PiCam.take_picture depending on the value of use_picam.
cv2.VideoCapture(0)
PiCam.take_picture
opencv
Try and test the opencv image capturing with your webcam.
Don't worry about testing PiCam.take_picture yet. If you're keen, you'll need to test your branch on a Raspberry Pi with a connected PiCam peripheral.
This feature depends on https://github.com/uvic-aero/onboard-computer/issues/38
Overview
Vision.py will capture images with the piCam in order to algorithmically determine a vector for the vehicle's trajectory.
Instructions:
The logic for image capturing will live within
apps/Vision/Capture.py
.Write a class method called
capture()
which accepts a boolean value,use_picam
, for whether to usePiCam
or the default camera (your webcam).The method should conditionally use
cv2.VideoCapture(0)
orPiCam.take_picture
depending on the value ofuse_picam
.opencv
's image capturing library to read frames from your webcam.PiCam
singleton from https://github.com/uvic-aero/onboard-computer/blob/master/apps/PiCam/piCam.py in order to have access to its methods.Testing
Try and test the opencv image capturing with your webcam.
Don't worry about testing
PiCam.take_picture
yet. If you're keen, you'll need to test your branch on a Raspberry Pi with a connectedPiCam
peripheral.