12 img_array = numpy.random.uniform(0., 255., (240, 320)).astype(numpy.float32)
15 yarp_image = yarp.ImageFloat()
16 yarp_image.setExternal(img_array, img_array.shape[1], img_array.shape[0])
22 output_port = yarp.Port()
23 output_port.open(
"/python-image-port")
24 yarp.Network.connect(
"/python-image-port",
"/view01")
25 output_port.write(yarp_image)
33 input_port = yarp.Port()
34 input_port.open(
"/python-image-port")
35 yarp.Network.connect(
"/icubSim/cam",
"/python-image-port")
38 img_array = numpy.zeros((240, 320, 3), dtype=numpy.uint8)
39 yarp_image = yarp.ImageRgb()
40 yarp_image.resize(320, 240)
41 yarp_image.setExternal(img_array, img_array.shape[1], img_array.shape[0])
47 input_port.read(yarp_image)
50 matplotlib.pylab.imshow(img_array)