def cam_cb(self,rosimg): cvimg = VUtil.rosimg2cv(rosimg) y,x = cvimg.shape[:2] cvimg = cv2.resize(cvimg, (x/2,y/2)) if self.canPublish: out = self.detect(cvimg) self.pub.publish(VUtil.writeCompressed(out))
def cam_cb(self,rosimg): cvimg = VUtil.rosimg2cv(rosimg) y,x = cvimg.shape[:2] cvimg = cv2.resize(cvimg, (x/2,y/2)) if self.canPublish: blank = np.zeros_like(cvimg) out = self.detect(cvimg,self.info.data,blank) self.info.draw(blank) self.pub.publish(VUtil.writeCompressed(out)) self.blank_pub.publish(VUtil.writeCompressed(blank))
def cam_cb(self,rosimg): if 'compressed' in self.parent.analyseTopic: cvimg = VUtil.readCompressed(rosimg) else: cvimg = VUtil.rosimg2cv(rosimg) y,x = cvimg.shape[:2] cvimg = cv2.resize(cvimg, (x/2,y/2)) if self.canPublish: out = self.detect(cvimg) self.pub.publish(VUtil.writeCompressed(out))