obstacle detection function complete
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
from multiprocessing import Process
|
||||
from lib.camera.MindVisionCamera import MindVisionCamera
|
||||
from lib.cfg import cfg
|
||||
from lib.cfg.cfg import CameraControl
|
||||
|
||||
|
||||
@@ -12,14 +13,13 @@ class Process2D(Process):
|
||||
self.out_q = out_q
|
||||
self.camera = MindVisionCamera(cfg["sn"])
|
||||
self.status = 0
|
||||
# 仅对轨道摄像头启用 TrackDetector
|
||||
|
||||
def run(self):
|
||||
while True:
|
||||
sig = self.in_q.get()
|
||||
if sig == CameraControl.CAPTURE:
|
||||
img = self.camera.capture()
|
||||
self.out_q.put(img)
|
||||
self.out_q.put({"title": cfg["title"], "img": img})
|
||||
elif sig == CameraControl.DESTORY:
|
||||
for fn in ("destroy", "close", "release"):
|
||||
if hasattr(self.camera, fn):
|
||||
|
Reference in New Issue
Block a user