def get_virtual_display_mask(self, vdisp_name, squeeze=False, dtype=np.bool, fill=1): points = self.get_virtual_display_points(vdisp_name) image = np.zeros((self.height, self.width, 1), dtype=dtype) fp.fill_polygon(points, image, fill) if squeeze: return np.squeeze(image) else: return image
def _update_image(self): self._image = np.zeros( (self.height, self.width, 3), dtype=np.uint8) fill_polygon.fill_polygon( self.linedraw.points, self._image ) if self.show_grid: # draw red horizontal stripes for i in range(0,self.height,100): self._image[i:i+10,:,0] = 255 # draw blue vertical stripes for i in range(0,self.width,100): self._image[:,i:i+10,2] = 255 if hasattr(self,'_pd'): self._pd.set_data("imagedata", self._image) self.send_array() if len(self.linedraw.points) >= 3: self.update_ROS_params()
def _update_image(self): self._image = np.zeros((self.height, self.width, 3), dtype=np.uint8) fill_polygon.fill_polygon(self.linedraw.points, self._image) if self.show_grid: # draw red horizontal stripes for i in range(0, self.height, 100): self._image[i:i + 10, :, 0] = 255 # draw blue vertical stripes for i in range(0, self.width, 100): self._image[:, i:i + 10, 2] = 255 if hasattr(self, '_pd'): self._pd.set_data("imagedata", self._image) self.send_array() if len(self.linedraw.points) >= 3: self.update_ROS_params()