The file has the following structure:
h
w
P1,1_r P1,1_g P1,1_b
P1,2_r P1,2_g P1,2_b
...
P1,w_r P1,w_g P1,w_b
P2,1_r P2,1_g P2,1_b
...
Ph,w_r Ph,w_g Ph,w_b
The first line contains one integer, h, which is the height of the image. The second line contains one integer, w, which is the width of the image. The next h x w lines contain the pixel value as a list of three values corresponding to red, green, and blue color of the pixel. The list of pixels are arranged in the top-to-bottom then left-to-right order.
How can convert this to a np.array using np.genfromtxt?