6 from sensor_msgs.msg
import Image
7 from jsk_topic_tools
import ConnectionBasedTransport
22 '~output/vertical{0:02}/horizontal{1:02}'.format(v, h),
25 self.pubs.append(pubs)
35 img = self.bridge.imgmsg_to_cv2(msg, desired_encoding=
'bgr8')
36 height, width, _ = img.shape
41 split_img = img[
int(v*v_pixels):
int((v+1)*v_pixels),
42 int(h*h_pixels):
int((h+1)*h_pixels)]
43 pub_msg = self.bridge.cv2_to_imgmsg(split_img, encoding=
'bgr8')
44 pub_msg.header = msg.header
45 self.
pubs[v][h].publish(pub_msg)
48 if __name__ ==
'__main__':
49 rospy.init_node(
'split_image')