理解 pycaffe 中的 load_image() 方法
Understanding load_image() method in pycaffe
来源描述
Load an image converting from grayscale or alpha as needed.
Parameters
----------
filename : string
color : boolean
flag for color format. True (default) loads as RGB while False
loads as intensity (if image is already grayscale).
Returns
-------
image : an image with type np.float32 in range [0, 1]
of size (H x W x 3) in RGB or
of size (H x W x 1) in grayscale.
这是一个如何使用它的例子
input_image = 255 * caffe.io.load_image(IMAGE_FILE)
我的问题是 IMAGE_FILE 是否是每个通道 0-255 值的 RGB 颜色并且 return 值 caffe.io.load_image(IMAGE_FILE)
在 [0,1] 范围内,乘以 255,每个通道的范围仍然是0-255.
那么做这一步有什么意义呢?
来源描述
Load an image converting from grayscale or alpha as needed.
Parameters
----------
filename : string
color : boolean
flag for color format. True (default) loads as RGB while False
loads as intensity (if image is already grayscale).
Returns
-------
image : an image with type np.float32 in range [0, 1]
of size (H x W x 3) in RGB or
of size (H x W x 1) in grayscale.
这是一个如何使用它的例子
input_image = 255 * caffe.io.load_image(IMAGE_FILE)
我的问题是 IMAGE_FILE 是否是每个通道 0-255 值的 RGB 颜色并且 return 值 caffe.io.load_image(IMAGE_FILE)
在 [0,1] 范围内,乘以 255,每个通道的范围仍然是0-255.
那么做这一步有什么意义呢?