def handle_return_image_float(self, request): msg = FloatArray() msg.shape = self.shape msg.data = self.data print '*'*80 print msg.data return ReturnImageFloatResponse(self.shape, self.data)
def image_callback(self,data): try: cv_image = self.bridge.imgmsg_to_cv(data, "mono8") np_image = numpy.asarray(cv_image, dtype=numpy.float32) msg = FloatArray() msg.shape = [cv_image.height, cv_image.width] msg.data = [i for i in np_image.reshape(cv_image.height*cv_image.width, 1)] self.float_image_pub.publish(msg) except CvBridgeError, e: print e