Commit 129b9fe6 authored by Barciś, Agata's avatar Barciś, Agata
Browse files

detected mask inverted

parent ec6ca4be
......@@ -186,6 +186,7 @@ class CameraSubscriber(Node, MissionExecutor):
npimg = np.frombuffer(img, dtype=np.uint8)
img = cv2.imdecode(npimg, cv2.IMREAD_COLOR)
mask = detect_red(img)
mask = cv2.bitwise_not(mask)
img = cv2.bitwise_and(img, img, mask=mask)/256
host_id = self.hosts[host]
place = (
......
......@@ -20,7 +20,4 @@ def detect_red(img):
mask = cv2.morphologyEx(mask, cv2.MORPH_OPEN, np.ones((3, 3), np.uint8))
mask = cv2.morphologyEx(mask, cv2.MORPH_DILATE, np.ones((3, 3), np.uint8))
# creating an inverted mask
mask_black = cv2.bitwise_not(mask)
return mask_black
return mask
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