项目要进行图片的预处理
首先我读取了一张图片
我需要得出可以区分出每一个logo的数组
比如我这张图片是(160,160,3) (width,height,depth)
我希望把它转换为(5,32,32,3)(num, widht,height,depth): 5张logo,每张都是(32,32,3)
要用什么方式比较好呢?:)
项目要进行图片的预处理
首先我读取了一张图片
我需要得出可以区分出每一个logo的数组
比如我这张图片是(160,160,3) (width,height,depth)
我希望把它转换为(5,32,32,3)(num, widht,height,depth): 5张logo,每张都是(32,32,3)
要用什么方式比较好呢?:)
自己回答吧
img_together=[]
for row in range(0,224,32):
for col in range(0,160,32):
img_together.append(img_arr[col:col+32,row:row+32,:])
img_together = np.array(img_together)
2 回答4.9k 阅读✓ 已解决
2 回答1k 阅读✓ 已解决
4 回答837 阅读✓ 已解决
3 回答1k 阅读✓ 已解决
3 回答1.1k 阅读✓ 已解决
1 回答2.5k 阅读✓ 已解决
1 回答1.6k 阅读✓ 已解决
试试reshape