def receive_1_cb(self, msg):
#print 'message received'
#print msg
im = self.br.imgmsg_to_cv2(msg, desired_encoding='passthrough')
for i in range(0, im.shape[0]):
for j in range(0, im.shape[1]):
#if not (im[i, j, 0] == 255 and im[i, j, 1] == 0 and im[i, j, 2] == 0):
if im[i, j, 0] == 255 and im[i, j, 1] == 0 and im[i, j, 2] == 0:
#print 'Detect an intruder!'
msg_sended = Bool()
msg_sended.data = True
send = FunctionUnit.create_send(self, self._send_topic, Bool)
send.send(msg_sended)
virtual_msg = Bool()
virtual_msg.data = False
self._virtual_send.send(virtual_msg)
评论列表
文章目录