Reshaping of images data

hi all.
it might seem simple to all but its a bit confusing for me. why do we need to reshape the image data. like in the lab if the image is having shape of (400,) we reshape it to (1,400).

Hi @Utsav_Sharma1 ,

Reshaping helps to organise an image in the way that would help to feed the data to the model’s algorithm. An image is represented by pixels, its height and width for size, and number of channels for colour or black/white. For coloured image, there will be 3 channels representing the RGB (red, green, blue) primary colour. Each pixel value is ranged from 0 to 255, the lower value is for lighter shade, and higher value gradually increasing the intensity to darker shade. So by reshaping an image, you can made a 3 dimensional representation into a one dimensional vector, and feed it into the model for calculation.

The shape of (400,) does not tell us whether this is a row vector or column vector, by reshaping it to (1,400) this becomes a 1 dimensional row vector, 1 row and 400 elements.

Hi @Utsav_Sharma1

In addition to what @Kic said
The difference between them in this Thread