Page 258 - Robotics and AI class 10
P. 258

# Display the image using Matplotlib
              plt.imshow(image)
              plt.title('Sample Image')

              plt.axis('off')  # Turn off axis labels and ticks
              plt.show()
              # Print the NumPy array form of the image

              print("Image Array:")
              print(image)
              # Check the datatype and shape of the array

              print("Datatype:", image.dtype)
              print("Shape:", image.shape)
              Output:
                   Sample image


















              Image Array:
              [[[154 147 151]

              [ 109 103 124]
              [ 63 58 102]
              "…

              [127 120 115]
              [120 117 106]

              [125 119 110]]



              [[177 171 171]
              [144 141 143]
              [113 114 124]

              …
              [127 118 112]

              [124 115 108]
              [121 116 105]]


              256     Touchpad Robotics & Artificial Intelligence-X
   253   254   255   256   257   258   259   260   261   262   263