Commit 6a71e5e5 authored by Ivan Tyagov's avatar Ivan Tyagov

No need to sleep initially.

Add some sane defaults for black belt and normal light (WIP).
parent 5e739a2e
......@@ -38,23 +38,20 @@ async def main():
await myvar.set_writable()
# init camera
cap = cv2.VideoCapture(0)
cap = cv2.VideoCapture(2)
cv2.namedWindow("Trackbars")
cv2.createTrackbar("L-H", "Trackbars", 0, 180, nothing)
cv2.createTrackbar("L-S", "Trackbars", 0, 255, nothing)
cv2.createTrackbar("L-V", "Trackbars", 3, 255, nothing)
cv2.createTrackbar("U-H", "Trackbars", 39, 180, nothing)
cv2.createTrackbar("U-S", "Trackbars", 155, 255, nothing)
cv2.createTrackbar("U-V", "Trackbars", 148, 255, nothing)
cv2.createTrackbar("U-H", "Trackbars", 135, 180, nothing)
cv2.createTrackbar("U-S", "Trackbars", 190, 255, nothing)
cv2.createTrackbar("U-V", "Trackbars", 190, 255, nothing)
font = cv2.FONT_HERSHEY_COMPLEX
_logger.info("Starting server!")
async with server:
while True:
# XXX: find out why we need to sleep (otherwise OPC UA server stops work)
await asyncio.sleep(0.0001)
# read and process camera
_, frame = cap.read()
hsv = cv2.cvtColor(frame, cv2.COLOR_BGR2HSV)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment