常见图像读取方式

常见图像读取方式

代码

## the different methods of reading picture
# 1.opencv
import cv2 

image = '1.jpg'
img = cv2.imread(image)
img = cv2.cvtColor(img, cv2.COLOR_BGR2RGB)

# 2.PIL
from PIL import Image
import numpy as np

image = '1.jpg'
img = Image.open(image)
img = np.array(img)

# 3.scipy
from scipy.misc import imread

image = '1.jpg'
img = imread(image)

# 4.skimage
from skimage import io

image = '1.jpg'
img = io.imread(image)'

猜你喜欢

转载自blog.csdn.net/xw2017/article/details/82596572