def _color_im_callback(self, msg):
        """Callback for handling textures (greyscale images).
        """
        try:
            data = self._bridge.imgmsg_to_cv2(msg)
            if np.max(data) > 255.0:
                data = 255.0 * data / 1200.0 # Experimentally set value for white
            data = np.clip(data, 0., 255.0).astype(np.uint8)
            gsimage = GrayscaleImage(data, frame=self._frame)
            self._cur_color_im = gsimage.to_color()
        except:
            self._cur_color_im = None
def _color_im_callback ( self , msg ) : try : data = self . _bridge . imgmsg_to_cv2 ( msg ) if np . max ( data ) > 255.0 : data = 255.0 * data / 1200.0 data = np . clip ( data , 0. , 255.0 ) . astype ( np . uint8 ) gsimage = GrayscaleImage ( data , frame = self . _frame ) self . _cur_color_im = gsimage . to_color ( ) except : self . _cur_color_im = None
Callback for handling textures (greyscale images).