Commit 11315a99 authored by Ivan Tyagov's avatar Ivan Tyagov

Make sure that both OPC UA server and CV2 process

can run together.
parent 112f37b8
......@@ -17,6 +17,8 @@ import asyncio
import logging
from asyncua import Server
SLEEP_DURATION = 10e-3 # 10 milliseconds
def nothing(x):
# any operation
pass
......@@ -52,6 +54,10 @@ async def main():
async with server:
while True:
# script runs concurrently OPC UA server and openCV optical shape
# recognition. Thus give (roughly) some CPU time so both can work together.
await asyncio.sleep(SLEEP_DURATION)
# 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