Wednesday, December 14, 2016

caffe.io.load_image Quick Facts

Quick facts on the numpy.ndarray object returned by caffe.io.load_image.

  • The array's shape is (height, width, 3)
  • The last shape value of 3 represents three color channels, in RGB order. This is important because OpenCV's imread function gives channels in BGR order.
  • The array has dtype=float32 with values in range 0.0-1.0. Again, this is important because OpenCV's imread function gives an array with dtype=uint8 with values in range 0-255.

I'm publishing this so I don't have to re-learn this "truth" every time I'm dealing with image loading and conversions.