
NumPy
捉不住的鼬鼠
自由光耀世界!
展开
-
使用numpy为图像添加alpha通道;numpy为多维数组添加列
jpg图片读入后不包含alpha通道,为了能够实现透明操作,需要对其添加alpha通道。 import skimage.io import numpy as np image_replace = skimage.io.imread('./McLaren.jpg') width = image_replace.shape[0] height = image_replace.shape[1] ...原创 2018-08-27 10:28:10 · 4293 阅读 · 0 评论 -
numpy选取元素学习,切片
参考https://blog.youkuaiyun.com/LOUISLIAOXH/article/details/50207971的博客学习下numpy选取元素的操作: import numpy as np arr = np.arange(10) # [0 1 2 3 4 5 6 7 8 9] # 完整切片 # 取索引为0(包含)到索引为2(不包含)之间的元素且步长为1 print(arr[0:2...原创 2018-08-24 19:37:00 · 1807 阅读 · 0 评论